Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more exports to client #507

Merged
merged 3 commits into from
Jul 23, 2024
Merged

Conversation

ssanjay1
Copy link
Contributor

No description provided.


export { ActionValidationError } from "./actions/ActionValidationError.js";
export { isOk } from "./ResultOrError.js";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we originally exporting this which I don't think we're actually using anywhere?

export function isOk(result: ResultOrError<any>): result is { type: "ok" } {
changed it to use this:
export function isOk<X>(a: Result<X>): a is OkResult<X> {

export { PalantirApiError } from "@osdk/shared.net.errors";

export type { Client } from "./Client.js";
export { createClient } from "./createClient.js";
export { createPlatformClient } from "./createPlatformClient.js";

export { createAttachmentFromRid } from "./createAttachmentFromRid.js";
export { createAttachmentUpload } from "./object/AttachmentUpload.js";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need this if someone wants to upload a blob to an action. The AttachmentUpload type should also accept the File object from FileApi but we need to provide this helper for now because that doesn't come standard yet

WhereClause,
} from "@osdk/client.api";

export { isOk } from "@osdk/client.api";
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See below on why this got swapped

@@ -27,16 +27,19 @@ export type {
OsdkActionParameters,
OsdkObject,
PageResult,
Result,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If someone uses fetchPageWithError the type is wrapped with Result, so thought it best to expose here

@ssanjay1 ssanjay1 merged commit 8cff4f0 into main Jul 23, 2024
7 checks passed
@ssanjay1 ssanjay1 deleted the ssanjay/exportAttachmentUploadHelper branch July 23, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants