From 413a1e02629c73abf45dd47e0ed2367abd3e3b5d Mon Sep 17 00:00:00 2001 From: box-sdk-build Date: Mon, 12 Aug 2024 04:56:36 -0700 Subject: [PATCH] feat: add parameters to box ai ask and text gen (box/box-openapi#445) --- .codegen.json | 2 +- docs/ai.md | 21 +- docs/authorization.md | 12 - docs/avatars.md | 15 - docs/chunkedUploads.md | 250 ++++-- docs/classifications.md | 18 - docs/collaborationAllowlistEntries.md | 20 - docs/collaborationAllowlistExemptTargets.md | 20 - docs/collections.md | 10 - docs/comments.md | 25 - docs/devicePinners.md | 9 - docs/emailAliases.md | 15 - docs/events.md | 10 - docs/fileClassifications.md | 20 - docs/fileMetadata.md | 25 - docs/fileRequests.md | 20 - docs/fileVersionLegalHolds.md | 10 - docs/fileVersionRetentions.md | 10 - docs/fileVersions.md | 23 - docs/fileWatermarks.md | 15 - docs/files.md | 25 - docs/folderClassifications.md | 20 - docs/folderLocks.md | 15 - docs/folderMetadata.md | 25 - docs/folderWatermarks.md | 15 - docs/folders.md | 30 - docs/groups.md | 25 - docs/integrationMappings.md | 16 - docs/invites.md | 10 - docs/legalHoldPolicies.md | 25 - docs/legalHoldPolicyAssignments.md | 25 - docs/listCollaborations.md | 20 - docs/memberships.md | 30 - docs/metadataCascadePolicies.md | 25 - docs/metadataTemplates.md | 40 - docs/recentItems.md | 5 - docs/retentionPolicies.md | 25 - docs/retentionPolicyAssignments.md | 25 - docs/search.md | 10 - docs/sessionTermination.md | 10 - docs/sharedLinksFiles.md | 23 - docs/sharedLinksFolders.md | 23 - docs/sharedLinksWebLinks.md | 23 - docs/shieldInformationBarrierReports.md | 15 - .../shieldInformationBarrierSegmentMembers.md | 20 - ...ldInformationBarrierSegmentRestrictions.md | 20 - docs/shieldInformationBarrierSegments.md | 25 - docs/shieldInformationBarriers.md | 20 - docs/signRequests.md | 23 - docs/signTemplates.md | 10 - docs/skills.md | 23 - docs/storagePolicies.md | 10 - docs/storagePolicyAssignments.md | 25 - docs/taskAssignments.md | 25 - docs/tasks.md | 25 - docs/termsOfServiceUserStatuses.md | 15 - docs/termsOfServices.md | 18 - docs/transfer.md | 5 - docs/trashedFiles.md | 15 - docs/trashedFolders.md | 15 - docs/trashedItems.md | 5 - docs/trashedWebLinks.md | 15 - docs/userCollaborations.md | 20 - docs/users.md | 30 - docs/webLinks.md | 20 - docs/webhooks.md | 25 - docs/workflows.md | 10 - docs/zipDownloads.md | 15 - package-lock.json | 158 ++-- src/managers/ai.generated.ts | 15 +- src/managers/chunkedUploads.generated.ts | 712 +++++++++++++++++- src/schemas/aiAgentAsk.generated.ts | 93 ++- src/schemas/aiAgentTextGen.generated.ts | 58 +- src/schemas/aiAsk.generated.ts | 46 ++ src/schemas/aiAskResponse.generated.ts | 99 +++ src/schemas/aiCitation.generated.ts | 77 ++ src/schemas/aiDialogueHistory.generated.ts | 65 ++ src/schemas/aiTextGen.generated.ts | 75 +- src/test/ai.generated.test.ts | 23 +- src/test/chunkedUploads.generated.test.ts | 335 +++++++- 80 files changed, 1756 insertions(+), 1489 deletions(-) create mode 100644 src/schemas/aiAskResponse.generated.ts create mode 100644 src/schemas/aiCitation.generated.ts create mode 100644 src/schemas/aiDialogueHistory.generated.ts diff --git a/.codegen.json b/.codegen.json index 17d6bdcd..628c2845 100644 --- a/.codegen.json +++ b/.codegen.json @@ -1 +1 @@ -{ "engineHash": "525674e", "specHash": "e50af18", "version": "1.3.0" } +{ "engineHash": "8243188", "specHash": "871a814", "version": "1.3.0" } diff --git a/docs/ai.md b/docs/ai.md index 2c6ae571..0faecdca 100644 --- a/docs/ai.md +++ b/docs/ai.md @@ -10,11 +10,6 @@ Sends an AI request to supported LLMs and returns an answer specifically focused This operation is performed by calling function `createAiAsk`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-ai-ask/). - - - ```ts await client.ai.createAiAsk({ mode: 'multiple_item_qa' as AiAskModeField, @@ -43,7 +38,7 @@ await client.ai.createAiAsk({ ### Returns -This function returns a value of type `AiResponse`. +This function returns a value of type `AiAskResponse`. A successful response including the answer from the LLM. @@ -53,11 +48,6 @@ Sends an AI request to supported LLMs and returns an answer specifically focused This operation is performed by calling function `createAiTextGen`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-ai-text-gen/). - - - ```ts await client.ai.createAiTextGen({ prompt: 'Parapharse the document.s', @@ -74,12 +64,12 @@ await client.ai.createAiTextGen({ prompt: 'What does the earth go around?', answer: 'The sun', createdAt: dateTimeFromString('2021-01-01T00:00:00Z'), - } satisfies AiTextGenDialogueHistoryField, + } satisfies AiDialogueHistory, { prompt: 'On Earth, where does the sun rise?', answer: 'East', createdAt: dateTimeFromString('2021-01-01T00:00:00Z'), - } satisfies AiTextGenDialogueHistoryField, + } satisfies AiDialogueHistory, ], } satisfies AiTextGen); ``` @@ -103,11 +93,6 @@ Get the AI agent default config This operation is performed by calling function `getAiAgentDefaultConfig`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-ai-agent-default/). - - - ```ts await client.ai.getAiAgentDefaultConfig({ mode: 'text_gen' as GetAiAgentDefaultConfigQueryParamsModeField, diff --git a/docs/authorization.md b/docs/authorization.md index f41f439a..0e85b17d 100644 --- a/docs/authorization.md +++ b/docs/authorization.md @@ -17,9 +17,6 @@ format. This operation is performed by calling function `authorizeUser`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-authorize/). - _Currently we don't have an example for calling `authorizeUser` in integration tests_ ### Arguments @@ -52,9 +49,6 @@ Box API calls. This operation is performed by calling function `requestAccessToken`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-oauth-2-token/). - _Currently we don't have an example for calling `requestAccessToken` in integration tests_ ### Arguments @@ -78,9 +72,6 @@ Refresh an Access Token using its client ID, secret, and refresh token. This operation is performed by calling function `refreshAccessToken`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-oauth-2-token-refresh/). - _Currently we don't have an example for calling `refreshAccessToken` in integration tests_ ### Arguments @@ -105,9 +96,6 @@ that has been previously authenticated. This operation is performed by calling function `revokeAccessToken`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-oauth-2-revoke/). - _Currently we don't have an example for calling `revokeAccessToken` in integration tests_ ### Arguments diff --git a/docs/avatars.md b/docs/avatars.md index c86c102a..30294cd1 100644 --- a/docs/avatars.md +++ b/docs/avatars.md @@ -10,11 +10,6 @@ Retrieves an image of a the user's avatar. This operation is performed by calling function `getUserAvatar`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-users-id-avatar/). - - - ```ts await client.avatars.getUserAvatar(user.id); ``` @@ -40,11 +35,6 @@ Adds or updates a user avatar. This operation is performed by calling function `createUserAvatar`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-users-id-avatar/). - - - ```ts await client.avatars.createUserAvatar(user.id, { pic: decodeBase64ByteStream( @@ -79,11 +69,6 @@ You cannot reverse this operation. This operation is performed by calling function `deleteUserAvatar`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-users-id-avatar/). - - - ```ts await client.avatars.deleteUserAvatar(user.id); ``` diff --git a/docs/chunkedUploads.md b/docs/chunkedUploads.md index 19a49cfb..e54b686e 100644 --- a/docs/chunkedUploads.md +++ b/docs/chunkedUploads.md @@ -4,10 +4,15 @@ This is a manager for chunked uploads (allowed for files at least 20MB). - [Create upload session](#create-upload-session) - [Create upload session for existing file](#create-upload-session-for-existing-file) +- [Get upload session by URL](#get-upload-session-by-url) - [Get upload session](#get-upload-session) +- [Upload part of file by URL](#upload-part-of-file-by-url) - [Upload part of file](#upload-part-of-file) +- [Remove upload session by URL](#remove-upload-session-by-url) - [Remove upload session](#remove-upload-session) +- [List parts by URL](#list-parts-by-url) - [List parts](#list-parts) +- [Commit upload session by URL](#commit-upload-session-by-url) - [Commit upload session](#commit-upload-session) - [Upload big file](#upload-big-file) @@ -17,23 +22,12 @@ Creates an upload session for a new file. This operation is performed by calling function `createFileUploadSession`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-files-upload-sessions/). - - - ```ts -await this.createFileUploadSession( - { - fileName: fileName, - fileSize: fileSize, - folderId: parentFolderId, - } satisfies CreateFileUploadSessionRequestBody, - { - headers: new CreateFileUploadSessionHeaders({}), - cancellationToken: cancellationToken, - } satisfies CreateFileUploadSessionOptionalsInput -); +await client.chunkedUploads.createFileUploadSession({ + fileName: fileName, + fileSize: fileSize, + folderId: parentFolderId, +} satisfies CreateFileUploadSessionRequestBody); ``` ### Arguments @@ -55,9 +49,6 @@ Creates an upload session for an existing file. This operation is performed by calling function `createFileUploadSessionForExistingFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-files-id-upload-sessions/). - _Currently we don't have an example for calling `createFileUploadSessionForExistingFile` in integration tests_ ### Arguments @@ -75,16 +66,42 @@ This function returns a value of type `UploadSession`. Returns a new upload session. +## Get upload session by URL + +Return information about an upload session. + +The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) endpoint. + +This operation is performed by calling function `getFileUploadSessionByUrl`. + +```ts +await client.chunkedUploads.getFileUploadSessionByUrl(statusUrl); +``` + +### Arguments + +- url `string` + - URL of getFileUploadSessionById method +- optionalsInput `GetFileUploadSessionByUrlOptionalsInput` + - + +### Returns + +This function returns a value of type `UploadSession`. + +Returns an upload session object. + ## Get upload session Return information about an upload session. -This operation is performed by calling function `getFileUploadSessionById`. +The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) endpoint. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-upload-sessions-id/). +This operation is performed by calling function `getFileUploadSessionById`. -_Currently we don't have an example for calling `getFileUploadSessionById` in integration tests_ +```ts +await client.chunkedUploads.getFileUploadSessionById(uploadSessionId); +``` ### Arguments @@ -99,19 +116,54 @@ This function returns a value of type `UploadSession`. Returns an upload session object. -## Upload part of file +## Upload part of file by URL -Updates a chunk of an upload session for a file. +Uploads a chunk of a file for an upload session. -This operation is performed by calling function `uploadFilePart`. +The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) +and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-files-upload-sessions-id/). +This operation is performed by calling function `uploadFilePartByUrl`. - +```ts +await client.chunkedUploads.uploadFilePartByUrl( + acc.uploadPartUrl, + generateByteStreamFromBuffer(chunkBuffer), + { + digest: digest, + contentRange: contentRange, + } satisfies UploadFilePartByUrlHeadersInput +); +``` + +### Arguments + +- url `string` + - URL of uploadFilePart method +- requestBody `ByteStream` + - Request body of uploadFilePart method +- headersInput `UploadFilePartByUrlHeadersInput` + - Headers of uploadFilePart method +- optionalsInput `UploadFilePartByUrlOptionalsInput` + - + +### Returns + +This function returns a value of type `UploadedPart`. + +Chunk has been uploaded successfully. + +## Upload part of file + +Uploads a chunk of a file for an upload session. + +The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) +and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. + +This operation is performed by calling function `uploadFilePart`. ```ts -await this.uploadFilePart( +await client.chunkedUploads.uploadFilePart( acc.uploadSessionId, generateByteStreamFromBuffer(chunkBuffer), { @@ -138,18 +190,49 @@ This function returns a value of type `UploadedPart`. Chunk has been uploaded successfully. +## Remove upload session by URL + +Abort an upload session and discard all data uploaded. + +This cannot be reversed. + +The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) +and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. + +This operation is performed by calling function `deleteFileUploadSessionByUrl`. + +```ts +await client.chunkedUploads.deleteFileUploadSessionByUrl(abortUrl); +``` + +### Arguments + +- url `string` + - URL of deleteFileUploadSessionById method +- optionalsInput `DeleteFileUploadSessionByUrlOptionalsInput` + - + +### Returns + +This function returns a value of type `undefined`. + +A blank response is returned if the session was +successfully aborted. + ## Remove upload session Abort an upload session and discard all data uploaded. This cannot be reversed. -This operation is performed by calling function `deleteFileUploadSessionById`. +The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) +and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-files-upload-sessions-id/). +This operation is performed by calling function `deleteFileUploadSessionById`. -_Currently we don't have an example for calling `deleteFileUploadSessionById` in integration tests_ +```ts +await client.chunkedUploads.deleteFileUploadSessionById(uploadSessionId); +``` ### Arguments @@ -165,24 +248,43 @@ This function returns a value of type `undefined`. A blank response is returned if the session was successfully aborted. -## List parts +## List parts by URL -Return a list of the chunks uploaded to the upload -session so far. +Return a list of the chunks uploaded to the upload session so far. -This operation is performed by calling function `getFileUploadSessionParts`. +The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) +and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. + +This operation is performed by calling function `getFileUploadSessionPartsByUrl`. + +```ts +await client.chunkedUploads.getFileUploadSessionPartsByUrl(listPartsUrl); +``` + +### Arguments + +- url `string` + - URL of getFileUploadSessionParts method +- optionalsInput `GetFileUploadSessionPartsByUrlOptionalsInput` + - + +### Returns + +This function returns a value of type `UploadParts`. + +Returns a list of parts that have been uploaded. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-upload-sessions-id-parts/). +## List parts + +Return a list of the chunks uploaded to the upload session so far. - +The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) +and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. + +This operation is performed by calling function `getFileUploadSessionParts`. ```ts -await this.getFileUploadSessionParts(uploadSessionId, { - queryParams: {} satisfies GetFileUploadSessionPartsQueryParams, - headers: new GetFileUploadSessionPartsHeaders({}), - cancellationToken: cancellationToken, -} satisfies GetFileUploadSessionPartsOptionalsInput); +await client.chunkedUploads.getFileUploadSessionParts(uploadSessionId); ``` ### Arguments @@ -198,26 +300,58 @@ This function returns a value of type `UploadParts`. Returns a list of parts that have been uploaded. -## Commit upload session +## Commit upload session by URL -Close an upload session and create a file from the -uploaded chunks. +Close an upload session and create a file from the uploaded chunks. -This operation is performed by calling function `createFileUploadSessionCommit`. +The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) +and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. + +This operation is performed by calling function `createFileUploadSessionCommitByUrl`. + +```ts +await client.chunkedUploads.createFileUploadSessionCommitByUrl( + commitUrl, + { parts: parts } satisfies CreateFileUploadSessionCommitByUrlRequestBody, + { digest: digest } satisfies CreateFileUploadSessionCommitByUrlHeadersInput +); +``` + +### Arguments + +- url `string` + - URL of createFileUploadSessionCommit method +- requestBody `CreateFileUploadSessionCommitByUrlRequestBody` + - Request body of createFileUploadSessionCommit method +- headersInput `CreateFileUploadSessionCommitByUrlHeadersInput` + - Headers of createFileUploadSessionCommit method +- optionalsInput `CreateFileUploadSessionCommitByUrlOptionalsInput` + - + +### Returns + +This function returns a value of type `Files`. + +Returns the file object in a list.Returns when all chunks have been uploaded but not yet processed. + +Inspect the upload session to get more information about the +progress of processing the chunks, then retry committing the file +when all chunks have processed. + +## Commit upload session + +Close an upload session and create a file from the uploaded chunks. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-files-upload-sessions-id-commit/). +The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) +and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. - +This operation is performed by calling function `createFileUploadSessionCommit`. ```ts -await this.createFileUploadSessionCommit( +await client.chunkedUploads.createFileUploadSessionCommit( uploadSessionId, { parts: parts } satisfies CreateFileUploadSessionCommitRequestBody, - { digest: digest } satisfies CreateFileUploadSessionCommitHeadersInput, - { - cancellationToken: cancellationToken, - } satisfies CreateFileUploadSessionCommitOptionalsInput + { digest: digest } satisfies CreateFileUploadSessionCommitHeadersInput ); ``` diff --git a/docs/classifications.md b/docs/classifications.md index 5eec328e..eb59bffe 100644 --- a/docs/classifications.md +++ b/docs/classifications.md @@ -16,11 +16,6 @@ URL explicitly, for example This operation is performed by calling function `getClassificationTemplate`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-metadata-templates-enterprise-security-classification-6-vm-vochw-u-wo-schema/). - - - ```ts await client.classifications.getClassificationTemplate(); ``` @@ -51,11 +46,6 @@ URL explicitly, for example This operation is performed by calling function `addClassification`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-metadata-templates-enterprise-security-classification-6-vm-vochw-u-wo-schema-add/). - - - ```ts await client.classifications.addClassification([ new AddClassificationRequestBody({ @@ -98,11 +88,6 @@ URL explicitly, for example This operation is performed by calling function `updateClassification`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-metadata-templates-enterprise-security-classification-6-vm-vochw-u-wo-schema-update/). - - - ```ts await client.classifications.updateClassification([ new UpdateClassificationRequestBody({ @@ -147,9 +132,6 @@ classifications. This operation is performed by calling function `createClassificationTemplate`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-metadata-templates-schema-classifications/). - _Currently we don't have an example for calling `createClassificationTemplate` in integration tests_ ### Arguments diff --git a/docs/collaborationAllowlistEntries.md b/docs/collaborationAllowlistEntries.md index 865134fa..d2360c7e 100644 --- a/docs/collaborationAllowlistEntries.md +++ b/docs/collaborationAllowlistEntries.md @@ -12,11 +12,6 @@ for within the current enterprise. This operation is performed by calling function `getCollaborationWhitelistEntries`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-collaboration-whitelist-entries/). - - - ```ts await client.collaborationAllowlistEntries.getCollaborationWhitelistEntries(); ``` @@ -43,11 +38,6 @@ collaboration for. This operation is performed by calling function `createCollaborationWhitelistEntry`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-collaboration-whitelist-entries/). - - - ```ts await client.collaborationAllowlistEntries.createCollaborationWhitelistEntry({ direction: @@ -76,11 +66,6 @@ for within the current enterprise. This operation is performed by calling function `getCollaborationWhitelistEntryById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-collaboration-whitelist-entries-id/). - - - ```ts await client.collaborationAllowlistEntries.getCollaborationWhitelistEntryById( entry.id! @@ -107,11 +92,6 @@ collaborations for within the current enterprise. This operation is performed by calling function `deleteCollaborationWhitelistEntryById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-collaboration-whitelist-entries-id/). - - - ```ts await client.collaborationAllowlistEntries.deleteCollaborationWhitelistEntryById( entry.id! diff --git a/docs/collaborationAllowlistExemptTargets.md b/docs/collaborationAllowlistExemptTargets.md index 4440eff0..370a3a41 100644 --- a/docs/collaborationAllowlistExemptTargets.md +++ b/docs/collaborationAllowlistExemptTargets.md @@ -12,11 +12,6 @@ domain restrictions. This operation is performed by calling function `getCollaborationWhitelistExemptTargets`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-collaboration-whitelist-exempt-targets/). - - - ```ts await client.collaborationAllowlistExemptTargets.getCollaborationWhitelistExemptTargets(); ``` @@ -43,11 +38,6 @@ for collaborations. This operation is performed by calling function `createCollaborationWhitelistExemptTarget`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-collaboration-whitelist-exempt-targets/). - - - ```ts await client.collaborationAllowlistExemptTargets.createCollaborationWhitelistExemptTarget( { @@ -78,11 +68,6 @@ domain restrictions. This operation is performed by calling function `getCollaborationWhitelistExemptTargetById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-collaboration-whitelist-exempt-targets-id/). - - - ```ts await client.collaborationAllowlistExemptTargets.getCollaborationWhitelistExemptTargetById( exemptTarget.id! @@ -109,11 +94,6 @@ of domains for collaborations. This operation is performed by calling function `deleteCollaborationWhitelistExemptTargetById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-collaboration-whitelist-exempt-targets-id/). - - - ```ts await client.collaborationAllowlistExemptTargets.deleteCollaborationWhitelistExemptTargetById( exemptTarget.id! diff --git a/docs/collections.md b/docs/collections.md index 845fbccd..f38b2b25 100644 --- a/docs/collections.md +++ b/docs/collections.md @@ -12,11 +12,6 @@ is supported. This operation is performed by calling function `getCollections`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-collections/). - - - ```ts await client.collections.getCollections(); ``` @@ -43,11 +38,6 @@ this collection. This operation is performed by calling function `getCollectionItems`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-collections-id-items/). - - - ```ts await client.collections.getCollectionItems(favouriteCollection.id!); ``` diff --git a/docs/comments.md b/docs/comments.md index fe4f305a..f5912776 100644 --- a/docs/comments.md +++ b/docs/comments.md @@ -12,11 +12,6 @@ Retrieves a list of comments for a file. This operation is performed by calling function `getFileComments`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-comments/). - - - ```ts await client.comments.getFileComments(fileId); ``` @@ -42,11 +37,6 @@ as information on the user who created the comment. This operation is performed by calling function `getCommentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-comments-id/). - - - ```ts await client.comments.getCommentById(newComment.id!); ``` @@ -70,11 +60,6 @@ Update the message of a comment. This operation is performed by calling function `updateCommentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-comments-id/). - - - ```ts await client.comments.updateCommentById(newReplyComment.id!, { requestBody: { message: newMessage } satisfies UpdateCommentByIdRequestBody, @@ -100,11 +85,6 @@ Permanently deletes a comment. This operation is performed by calling function `deleteCommentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-comments-id/). - - - ```ts await client.comments.deleteCommentById(newComment.id!); ``` @@ -129,11 +109,6 @@ as a reply to an other comment. This operation is performed by calling function `createComment`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-comments/). - - - ```ts await client.comments.createComment({ message: message, diff --git a/docs/devicePinners.md b/docs/devicePinners.md index b4965817..c4dc568f 100644 --- a/docs/devicePinners.md +++ b/docs/devicePinners.md @@ -10,9 +10,6 @@ Retrieves information about an individual device pin. This operation is performed by calling function `getDevicePinnerById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-device-pinners-id/). - _Currently we don't have an example for calling `getDevicePinnerById` in integration tests_ ### Arguments @@ -34,9 +31,6 @@ Deletes an individual device pin. This operation is performed by calling function `deleteDevicePinnerById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-device-pinners-id/). - _Currently we don't have an example for calling `deleteDevicePinnerById` in integration tests_ ### Arguments @@ -61,9 +55,6 @@ needs the "manage enterprise" scope to make this call. This operation is performed by calling function `getEnterpriseDevicePinners`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-enterprises-id-device-pinners/). - _Currently we don't have an example for calling `getEnterpriseDevicePinners` in integration tests_ ### Arguments diff --git a/docs/emailAliases.md b/docs/emailAliases.md index 7f425ba5..dcd231ff 100644 --- a/docs/emailAliases.md +++ b/docs/emailAliases.md @@ -11,11 +11,6 @@ does not include the primary login for the user. This operation is performed by calling function `getUserEmailAliases`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-users-id-email-aliases/). - - - ```ts await client.emailAliases.getUserEmailAliases(newUser.id); ``` @@ -39,11 +34,6 @@ Adds a new email alias to a user account.. This operation is performed by calling function `createUserEmailAlias`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-users-id-email-aliases/). - - - ```ts await client.emailAliases.createUserEmailAlias(newUser.id, { email: newAliasEmail, @@ -71,11 +61,6 @@ Removes an email alias from a user. This operation is performed by calling function `deleteUserEmailAliasById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-users-id-email-aliases-id/). - - - ```ts await client.emailAliases.deleteUserEmailAliasById(newUser.id, newAlias.id!); ``` diff --git a/docs/events.md b/docs/events.md index 5babff8b..0cf0a267 100644 --- a/docs/events.md +++ b/docs/events.md @@ -17,11 +17,6 @@ scope `manage enterprise properties` checked. This operation is performed by calling function `getEvents`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-events/). - - - ```ts await client.events.getEvents({ streamType: 'admin_logs' as GetEventsQueryParamsStreamTypeField, @@ -90,11 +85,6 @@ first. This operation is performed by calling function `getEventsWithLongPolling`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/options-events/). - - - ```ts await client.events.getEventsWithLongPolling(); ``` diff --git a/docs/fileClassifications.md b/docs/fileClassifications.md index 3d86a3e0..bacda33a 100644 --- a/docs/fileClassifications.md +++ b/docs/fileClassifications.md @@ -16,11 +16,6 @@ URL explicitly, for example This operation is performed by calling function `getClassificationOnFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-metadata-enterprise-security-classification-6-vm-vochw-u-wo/). - - - ```ts await client.fileClassifications.getClassificationOnFile(file.id); ``` @@ -52,11 +47,6 @@ URL explicitly, for example This operation is performed by calling function `addClassificationToFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-files-id-metadata-enterprise-security-classification-6-vm-vochw-u-wo/). - - - ```ts await client.fileClassifications.addClassificationToFile(file.id, { requestBody: { @@ -89,11 +79,6 @@ defined for the enterprise will be accepted. This operation is performed by calling function `updateClassificationOnFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-files-id-metadata-enterprise-security-classification-6-vm-vochw-u-wo/). - - - ```ts await client.fileClassifications.updateClassificationOnFile(file.id, [ new UpdateClassificationOnFileRequestBody({ @@ -127,11 +112,6 @@ URL explicitly, for example This operation is performed by calling function `deleteClassificationFromFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-files-id-metadata-enterprise-security-classification-6-vm-vochw-u-wo/). - - - ```ts await client.fileClassifications.deleteClassificationFromFile(file.id); ``` diff --git a/docs/fileMetadata.md b/docs/fileMetadata.md index 943f6584..888c97ab 100644 --- a/docs/fileMetadata.md +++ b/docs/fileMetadata.md @@ -12,11 +12,6 @@ Retrieves all metadata for a given file. This operation is performed by calling function `getFileMetadata`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-metadata/). - - - ```ts await client.fileMetadata.getFileMetadata(file.id); ``` @@ -44,11 +39,6 @@ file. This operation is performed by calling function `getFileMetadataById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-metadata-id-id/). - - - ```ts await client.fileMetadata.getFileMetadataById( file.id, @@ -86,11 +76,6 @@ any key-value pair. This operation is performed by calling function `createFileMetadataById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-files-id-metadata-id-id/). - - - ```ts await client.fileMetadata.createFileMetadataById( file.id, @@ -139,11 +124,6 @@ application of the operations, the metadata instance will not be changed. This operation is performed by calling function `updateFileMetadataById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-files-id-metadata-id-id/). - - - ```ts await client.fileMetadata.updateFileMetadataById( file.id, @@ -185,11 +165,6 @@ Deletes a piece of file metadata. This operation is performed by calling function `deleteFileMetadataById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-files-id-metadata-id-id/). - - - ```ts await client.fileMetadata.deleteFileMetadataById( file.id, diff --git a/docs/fileRequests.md b/docs/fileRequests.md index 1857f5e4..783db17c 100644 --- a/docs/fileRequests.md +++ b/docs/fileRequests.md @@ -11,11 +11,6 @@ Retrieves the information about a file request. This operation is performed by calling function `getFileRequestById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-file-requests-id/). - - - ```ts await client.fileRequests.getFileRequestById(updatedFileRequest.id); ``` @@ -40,11 +35,6 @@ deactivate a file request. This operation is performed by calling function `updateFileRequestById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-file-requests-id/). - - - ```ts await client.fileRequests.updateFileRequestById(copiedFileRequest.id, { title: 'updated title', @@ -73,11 +63,6 @@ Deletes a file request permanently. This operation is performed by calling function `deleteFileRequestById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-file-requests-id/). - - - ```ts await client.fileRequests.deleteFileRequestById(updatedFileRequest.id); ``` @@ -103,11 +88,6 @@ and applies it to another folder. This operation is performed by calling function `createFileRequestCopy`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-file-requests-id-copy/). - - - ```ts await client.fileRequests.createFileRequestCopy(fileRequestId, { folder: { diff --git a/docs/fileVersionLegalHolds.md b/docs/fileVersionLegalHolds.md index fab20dd6..16920580 100644 --- a/docs/fileVersionLegalHolds.md +++ b/docs/fileVersionLegalHolds.md @@ -10,11 +10,6 @@ assigned to a file version. This operation is performed by calling function `getFileVersionLegalHoldById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-file-version-legal-holds-id/). - - - ```ts await client.fileVersionLegalHolds.getFileVersionLegalHoldById( fileVersionLegalHoldId @@ -59,11 +54,6 @@ Once the re-architecture is completed this API will be deprecated. This operation is performed by calling function `getFileVersionLegalHolds`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-file-version-legal-holds/). - - - ```ts await client.fileVersionLegalHolds.getFileVersionLegalHolds({ policyId: policyId, diff --git a/docs/fileVersionRetentions.md b/docs/fileVersionRetentions.md index f6dd134b..c6792aac 100644 --- a/docs/fileVersionRetentions.md +++ b/docs/fileVersionRetentions.md @@ -14,11 +14,6 @@ see [files under retention](e://get-retention-policy-assignments-id-files-under- This operation is performed by calling function `getFileVersionRetentions`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-file-version-retentions/). - - - ```ts await client.fileVersionRetentions.getFileVersionRetentions(); ``` @@ -49,11 +44,6 @@ see [files under retention](e://get-retention-policy-assignments-id-files-under- This operation is performed by calling function `getFileVersionRetentionById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-file-version-retentions-id/). - - - ```ts await client.fileVersionRetentions.getFileVersionRetentionById( fileVersionRetention.id! diff --git a/docs/fileVersions.md b/docs/fileVersions.md index 2ed29c51..aa2996f5 100644 --- a/docs/fileVersions.md +++ b/docs/fileVersions.md @@ -15,11 +15,6 @@ of the current version of a file, use the `GET /file/:id` API. This operation is performed by calling function `getFileVersions`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-versions/). - - - ```ts await client.fileVersions.getFileVersions(file.id); ``` @@ -45,11 +40,6 @@ Versions are only tracked for Box users with premium accounts. This operation is performed by calling function `getFileVersionById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-versions-id/). - - - ```ts await client.fileVersions.getFileVersionById( file.id, @@ -85,9 +75,6 @@ PPTX or similar. This operation is performed by calling function `updateFileVersionById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-files-id-versions-id/). - _Currently we don't have an example for calling `updateFileVersionById` in integration tests_ ### Arguments @@ -113,11 +100,6 @@ Versions are only tracked for Box users with premium accounts. This operation is performed by calling function `deleteFileVersionById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-files-id-versions-id/). - - - ```ts await client.fileVersions.deleteFileVersionById(file.id, fileVersion.id); ``` @@ -159,11 +141,6 @@ PPTX or similar. This operation is performed by calling function `promoteFileVersion`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-files-id-versions-current/). - - - ```ts await client.fileVersions.promoteFileVersion(file.id, { requestBody: { diff --git a/docs/fileWatermarks.md b/docs/fileWatermarks.md index f88c9c6d..bf5b732d 100644 --- a/docs/fileWatermarks.md +++ b/docs/fileWatermarks.md @@ -10,11 +10,6 @@ Retrieve the watermark for a file. This operation is performed by calling function `getFileWatermark`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-watermark/). - - - ```ts await client.fileWatermarks.getFileWatermark(file.id); ``` @@ -39,11 +34,6 @@ Applies or update a watermark on a file. This operation is performed by calling function `updateFileWatermark`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-files-id-watermark/). - - - ```ts await client.fileWatermarks.updateFileWatermark(file.id, { watermark: new UpdateFileWatermarkRequestBodyWatermarkField({ @@ -75,11 +65,6 @@ Removes the watermark from a file. This operation is performed by calling function `deleteFileWatermark`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-files-id-watermark/). - - - ```ts await client.fileWatermarks.deleteFileWatermark(file.id); ``` diff --git a/docs/files.md b/docs/files.md index 5071795d..bfdf3224 100644 --- a/docs/files.md +++ b/docs/files.md @@ -12,11 +12,6 @@ Retrieves the details about a file. This operation is performed by calling function `getFileById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id/). - - - ```ts await client.files.getFileById(file.id); ``` @@ -45,11 +40,6 @@ create a shared link, or lock a file. This operation is performed by calling function `updateFileById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-files-id/). - - - ```ts await downscopedClient.files.updateFileById(file.id, { requestBody: { name: getUuid() } satisfies UpdateFileByIdRequestBody, @@ -83,11 +73,6 @@ be permanently deleted from Box or moved to the trash. This operation is performed by calling function `deleteFileById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-files-id/). - - - ```ts await parentClient.files.deleteFileById(file.id); ``` @@ -112,11 +97,6 @@ Creates a copy of a file. This operation is performed by calling function `copyFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-files-id-copy/). - - - ```ts await client.files.copyFile(fileOrigin.id, { parent: { id: '0' } satisfies CopyFileRequestBodyParentField, @@ -158,11 +138,6 @@ Thumbnails can be generated for the image and video file formats listed This operation is performed by calling function `getFileThumbnailById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-thumbnail-id/). - - - ```ts await client.files.getFileThumbnailById( thumbnailFile.id, diff --git a/docs/folderClassifications.md b/docs/folderClassifications.md index 66cb4cdd..73de69da 100644 --- a/docs/folderClassifications.md +++ b/docs/folderClassifications.md @@ -16,11 +16,6 @@ URL explicitly, for example This operation is performed by calling function `getClassificationOnFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folders-id-metadata-enterprise-security-classification-6-vm-vochw-u-wo/). - - - ```ts await client.folderClassifications.getClassificationOnFolder(folder.id); ``` @@ -52,11 +47,6 @@ URL explicitly, for example This operation is performed by calling function `addClassificationToFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-folders-id-metadata-enterprise-security-classification-6-vm-vochw-u-wo/). - - - ```ts await client.folderClassifications.addClassificationToFolder(folder.id, { requestBody: { @@ -89,11 +79,6 @@ defined for the enterprise will be accepted. This operation is performed by calling function `updateClassificationOnFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-folders-id-metadata-enterprise-security-classification-6-vm-vochw-u-wo/). - - - ```ts await client.folderClassifications.updateClassificationOnFolder(folder.id, [ new UpdateClassificationOnFolderRequestBody({ @@ -127,11 +112,6 @@ URL explicitly, for example This operation is performed by calling function `deleteClassificationFromFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-folders-id-metadata-enterprise-security-classification-6-vm-vochw-u-wo/). - - - ```ts await client.folderClassifications.deleteClassificationFromFolder(folder.id); ``` diff --git a/docs/folderLocks.md b/docs/folderLocks.md index 952bc52b..d1343340 100644 --- a/docs/folderLocks.md +++ b/docs/folderLocks.md @@ -13,11 +13,6 @@ use this endpoint. This operation is performed by calling function `getFolderLocks`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folder-locks/). - - - ```ts await client.folderLocks.getFolderLocks({ folderId: folder.id, @@ -48,11 +43,6 @@ use this endpoint. This operation is performed by calling function `createFolderLock`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-folder-locks/). - - - ```ts await client.folderLocks.createFolderLock({ folder: { @@ -89,11 +79,6 @@ use this endpoint. This operation is performed by calling function `deleteFolderLockById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-folder-locks-id/). - - - ```ts await client.folderLocks.deleteFolderLockById(folderLock.id!); ``` diff --git a/docs/folderMetadata.md b/docs/folderMetadata.md index 4fc3f25f..82aa65cf 100644 --- a/docs/folderMetadata.md +++ b/docs/folderMetadata.md @@ -13,11 +13,6 @@ folder with ID `0`. This operation is performed by calling function `getFolderMetadata`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folders-id-metadata/). - - - ```ts await client.folderMetadata.getFolderMetadata(folder.id); ``` @@ -45,11 +40,6 @@ folder. This can not be used on the root folder with ID `0`. This operation is performed by calling function `getFolderMetadataById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folders-id-metadata-id-id/). - - - ```ts await client.folderMetadata.getFolderMetadataById( folder.id, @@ -91,11 +81,6 @@ admin console. This operation is performed by calling function `createFolderMetadataById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-folders-id-metadata-id-id/). - - - ```ts await client.folderMetadata.createFolderMetadataById( folder.id, @@ -144,11 +129,6 @@ application of the operations, the metadata instance will not be changed. This operation is performed by calling function `updateFolderMetadataById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-folders-id-metadata-id-id/). - - - ```ts await client.folderMetadata.updateFolderMetadataById( folder.id, @@ -190,11 +170,6 @@ Deletes a piece of folder metadata. This operation is performed by calling function `deleteFolderMetadataById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-folders-id-metadata-id-id/). - - - ```ts await client.folderMetadata.deleteFolderMetadataById( folder.id, diff --git a/docs/folderWatermarks.md b/docs/folderWatermarks.md index b0387a50..cfad741f 100644 --- a/docs/folderWatermarks.md +++ b/docs/folderWatermarks.md @@ -10,11 +10,6 @@ Retrieve the watermark for a folder. This operation is performed by calling function `getFolderWatermark`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folders-id-watermark/). - - - ```ts await client.folderWatermarks.getFolderWatermark(folder.id); ``` @@ -39,11 +34,6 @@ Applies or update a watermark on a folder. This operation is performed by calling function `updateFolderWatermark`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-folders-id-watermark/). - - - ```ts await client.folderWatermarks.updateFolderWatermark(folder.id, { watermark: new UpdateFolderWatermarkRequestBodyWatermarkField({ @@ -75,11 +65,6 @@ Removes the watermark from a folder. This operation is performed by calling function `deleteFolderWatermark`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-folders-id-watermark/). - - - ```ts await client.folderWatermarks.deleteFolderWatermark(folder.id); ``` diff --git a/docs/folders.md b/docs/folders.md index 8663bd09..5c14904a 100644 --- a/docs/folders.md +++ b/docs/folders.md @@ -22,11 +22,6 @@ To fetch more items within the folder, use the This operation is performed by calling function `getFolderById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folders-id/). - - - ```ts await client.folders.getFolderById(newFolder.id); ``` @@ -61,11 +56,6 @@ create shared links, update collaborations, and more. This operation is performed by calling function `updateFolderById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-folders-id/). - - - ```ts await downscopedClient.folders.updateFolderById(folder.id, { requestBody: { name: getUuid() } satisfies UpdateFolderByIdRequestBody, @@ -101,11 +91,6 @@ the trash. This operation is performed by calling function `deleteFolderById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-folders-id/). - - - ```ts await parentClient.folders.deleteFolderById(folder.id); ``` @@ -134,11 +119,6 @@ use the [Get a folder](#get-folders-id) endpoint instead. This operation is performed by calling function `getFolderItems`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folders-id-items/). - - - ```ts await client.folders.getFolderItems(folderOrigin.id); ``` @@ -162,11 +142,6 @@ Creates a new empty folder within the specified parent folder. This operation is performed by calling function `createFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-folders/). - - - ```ts await parentClient.folders.createFolder({ name: getUuid(), @@ -199,11 +174,6 @@ The original folder will not be changed. This operation is performed by calling function `copyFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-folders-id-copy/). - - - ```ts await client.folders.copyFolder(folderOrigin.id, { parent: { id: '0' } satisfies CopyFolderRequestBodyParentField, diff --git a/docs/groups.md b/docs/groups.md index 926b3422..421f7e05 100644 --- a/docs/groups.md +++ b/docs/groups.md @@ -13,11 +13,6 @@ must have admin permissions to inspect enterprise's groups. This operation is performed by calling function `getGroups`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-groups/). - - - ```ts await client.groups.getGroups(); ``` @@ -45,11 +40,6 @@ permissions can create new groups. This operation is performed by calling function `createGroup`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-groups/). - - - ```ts await client.groups.createGroup({ name: groupName, @@ -78,11 +68,6 @@ use this API. This operation is performed by calling function `getGroupById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-groups-id/). - - - ```ts await client.groups.getGroupById(group.id); ``` @@ -108,11 +93,6 @@ use this API. This operation is performed by calling function `updateGroupById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-groups-id/). - - - ```ts await client.groups.updateGroupById(group.id, { requestBody: { name: updatedGroupName } satisfies UpdateGroupByIdRequestBody, @@ -139,11 +119,6 @@ admin-level permissions will be able to use this API. This operation is performed by calling function `deleteGroupById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-groups-id/). - - - ```ts await client.groups.deleteGroupById(group.id); ``` diff --git a/docs/integrationMappings.md b/docs/integrationMappings.md index f6b4931a..1612c363 100644 --- a/docs/integrationMappings.md +++ b/docs/integrationMappings.md @@ -14,11 +14,6 @@ use this endpoint. This operation is performed by calling function `getSlackIntegrationMapping`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-integration-mappings-slack/). - - - ```ts await userClient.integrationMappings.getSlackIntegrationMapping(); ``` @@ -48,11 +43,6 @@ use this endpoint. This operation is performed by calling function `createSlackIntegrationMapping`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-integration-mappings-slack/). - - - ```ts await userClient.integrationMappings.createSlackIntegrationMapping({ partnerItem: new IntegrationMappingPartnerItemSlack({ @@ -86,9 +76,6 @@ use this endpoint. This operation is performed by calling function `updateSlackIntegrationMappingById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-integration-mappings-slack-id/). - _Currently we don't have an example for calling `updateSlackIntegrationMappingById` in integration tests_ ### Arguments @@ -113,9 +100,6 @@ use this endpoint. This operation is performed by calling function `deleteSlackIntegrationMappingById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-integration-mappings-slack-id/). - _Currently we don't have an example for calling `deleteSlackIntegrationMappingById` in integration tests_ ### Arguments diff --git a/docs/invites.md b/docs/invites.md index 6947c4ba..db720185 100644 --- a/docs/invites.md +++ b/docs/invites.md @@ -17,11 +17,6 @@ the application, which can be enabled within the developer console. This operation is performed by calling function `createInvite`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-invites/). - - - ```ts await client.invites.createInvite({ enterprise: { @@ -52,11 +47,6 @@ Returns the status of a user invite. This operation is performed by calling function `getInviteById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-invites-id/). - - - ```ts await client.invites.getInviteById(invitation.id); ``` diff --git a/docs/legalHoldPolicies.md b/docs/legalHoldPolicies.md index 1e494e3c..4a60908b 100644 --- a/docs/legalHoldPolicies.md +++ b/docs/legalHoldPolicies.md @@ -13,11 +13,6 @@ an enterprise. This operation is performed by calling function `getLegalHoldPolicies`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-legal-hold-policies/). - - - ```ts await client.legalHoldPolicies.getLegalHoldPolicies(); ``` @@ -43,11 +38,6 @@ Create a new legal hold policy. This operation is performed by calling function `createLegalHoldPolicy`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-legal-hold-policies/). - - - ```ts await client.legalHoldPolicies.createLegalHoldPolicy({ policyName: legalHoldPolicyName, @@ -77,11 +67,6 @@ Retrieve a legal hold policy. This operation is performed by calling function `getLegalHoldPolicyById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-legal-hold-policies-id/). - - - ```ts await client.legalHoldPolicies.getLegalHoldPolicyById(legalHoldPolicyId); ``` @@ -105,11 +90,6 @@ Update legal hold policy. This operation is performed by calling function `updateLegalHoldPolicyById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-legal-hold-policies-id/). - - - ```ts await client.legalHoldPolicies.updateLegalHoldPolicyById(legalHoldPolicyId, { requestBody: { @@ -140,11 +120,6 @@ fully deleted yet when the response returns. This operation is performed by calling function `deleteLegalHoldPolicyById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-legal-hold-policies-id/). - - - ```ts await client.legalHoldPolicies.deleteLegalHoldPolicyById(legalHoldPolicy.id); ``` diff --git a/docs/legalHoldPolicyAssignments.md b/docs/legalHoldPolicyAssignments.md index b1a64267..f898c71a 100644 --- a/docs/legalHoldPolicyAssignments.md +++ b/docs/legalHoldPolicyAssignments.md @@ -12,11 +12,6 @@ Retrieves a list of items a legal hold policy has been assigned to. This operation is performed by calling function `getLegalHoldPolicyAssignments`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-legal-hold-policy-assignments/). - - - ```ts await client.legalHoldPolicyAssignments.getLegalHoldPolicyAssignments({ policyId: legalHoldPolicyId, @@ -42,11 +37,6 @@ Assign a legal hold to a file, file version, folder, or user. This operation is performed by calling function `createLegalHoldPolicyAssignment`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-legal-hold-policy-assignments/). - - - ```ts await client.legalHoldPolicyAssignments.createLegalHoldPolicyAssignment({ policyId: legalHoldPolicyId, @@ -76,11 +66,6 @@ Retrieve a legal hold policy assignment. This operation is performed by calling function `getLegalHoldPolicyAssignmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-legal-hold-policy-assignments-id/). - - - ```ts await client.legalHoldPolicyAssignments.getLegalHoldPolicyAssignmentById( legalHoldPolicyAssignmentId @@ -109,11 +94,6 @@ fully removed yet when the response returns. This operation is performed by calling function `deleteLegalHoldPolicyAssignmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-legal-hold-policy-assignments-id/). - - - ```ts await client.legalHoldPolicyAssignments.deleteLegalHoldPolicyAssignmentById( legalHoldPolicyAssignmentId @@ -158,11 +138,6 @@ find a list of policy assignments for a given policy ID. This operation is performed by calling function `getLegalHoldPolicyAssignmentFileOnHold`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-legal-hold-policy-assignments-id-files-on-hold/). - - - ```ts await client.legalHoldPolicyAssignments.getLegalHoldPolicyAssignmentFileOnHold( legalHoldPolicyAssignmentId diff --git a/docs/listCollaborations.md b/docs/listCollaborations.md index cf12bde8..8a94f82c 100644 --- a/docs/listCollaborations.md +++ b/docs/listCollaborations.md @@ -13,11 +13,6 @@ or have been invited to the file. This operation is performed by calling function `getFileCollaborations`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-collaborations/). - - - ```ts await client.listCollaborations.getFileCollaborations(file.id); ``` @@ -48,11 +43,6 @@ or have been invited to the folder. This operation is performed by calling function `getFolderCollaborations`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folders-id-collaborations/). - - - ```ts await client.listCollaborations.getFolderCollaborations(folder.id); ``` @@ -81,11 +71,6 @@ Retrieves all pending collaboration invites for this user. This operation is performed by calling function `getCollaborations`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-collaborations/). - - - ```ts await client.listCollaborations.getCollaborations({ status: 'pending' as GetCollaborationsQueryParamsStatusField, @@ -118,11 +103,6 @@ folders the group has access to and with what role. This operation is performed by calling function `getGroupCollaborations`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-groups-id-collaborations/). - - - ```ts await client.listCollaborations.getGroupCollaborations(group.id); ``` diff --git a/docs/memberships.md b/docs/memberships.md index 697a9243..e084f3fa 100644 --- a/docs/memberships.md +++ b/docs/memberships.md @@ -15,11 +15,6 @@ use this API. This operation is performed by calling function `getUserMemberships`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-users-id-memberships/). - - - ```ts await client.memberships.getUserMemberships(user.id); ``` @@ -46,11 +41,6 @@ use this API. This operation is performed by calling function `getGroupMemberships`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-groups-id-memberships/). - - - ```ts await client.memberships.getGroupMemberships(group.id); ``` @@ -76,11 +66,6 @@ admin-level permissions will be able to use this API. This operation is performed by calling function `createGroupMembership`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-group-memberships/). - - - ```ts await client.memberships.createGroupMembership({ user: { id: user.id } satisfies CreateGroupMembershipRequestBodyUserField, @@ -109,11 +94,6 @@ use this API. This operation is performed by calling function `getGroupMembershipById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-group-memberships-id/). - - - ```ts await client.memberships.getGroupMembershipById(groupMembership.id!); ``` @@ -139,11 +119,6 @@ use this API. This operation is performed by calling function `updateGroupMembershipById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-group-memberships-id/). - - - ```ts await client.memberships.updateGroupMembershipById(groupMembership.id!, { requestBody: { @@ -173,11 +148,6 @@ use this API. This operation is performed by calling function `deleteGroupMembershipById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-group-memberships-id/). - - - ```ts await client.memberships.deleteGroupMembershipById(groupMembership.id!); ``` diff --git a/docs/metadataCascadePolicies.md b/docs/metadataCascadePolicies.md index f426ec0f..443c72b0 100644 --- a/docs/metadataCascadePolicies.md +++ b/docs/metadataCascadePolicies.md @@ -14,11 +14,6 @@ folder with ID `0`. This operation is performed by calling function `getMetadataCascadePolicies`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-metadata-cascade-policies/). - - - ```ts await client.metadataCascadePolicies.getMetadataCascadePolicies({ folderId: folder.id, @@ -49,11 +44,6 @@ be applied to the folder the policy is to be applied to. This operation is performed by calling function `createMetadataCascadePolicy`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-metadata-cascade-policies/). - - - ```ts await client.metadataCascadePolicies.createMetadataCascadePolicy({ folderId: folder.id, @@ -81,11 +71,6 @@ Retrieve a specific metadata cascade policy assigned to a folder. This operation is performed by calling function `getMetadataCascadePolicyById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-metadata-cascade-policies-id/). - - - ```ts await client.metadataCascadePolicies.getMetadataCascadePolicyById( cascadePolicyId @@ -111,11 +96,6 @@ Deletes a metadata cascade policy. This operation is performed by calling function `deleteMetadataCascadePolicyById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-metadata-cascade-policies-id/). - - - ```ts await client.metadataCascadePolicies.deleteMetadataCascadePolicyById( cascadePolicyId @@ -145,11 +125,6 @@ folder. This operation is performed by calling function `applyMetadataCascadePolicy`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-metadata-cascade-policies-id-apply/). - - - ```ts await client.metadataCascadePolicies.applyMetadataCascadePolicy( cascadePolicyId, diff --git a/docs/metadataTemplates.md b/docs/metadataTemplates.md index 42eaf8d3..0f3bc810 100644 --- a/docs/metadataTemplates.md +++ b/docs/metadataTemplates.md @@ -16,11 +16,6 @@ template. This operation is performed by calling function `getMetadataTemplatesByInstanceId`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-metadata-templates/). - - - ```ts await client.metadataTemplates.getMetadataTemplatesByInstanceId({ metadataInstanceId: createdMetadataInstance.id!, @@ -50,11 +45,6 @@ an enterprise or globally, or list all templates applied to a file or folder. This operation is performed by calling function `getMetadataTemplate`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-metadata-templates-id-id-schema/). - - - ```ts await client.metadataTemplates.getMetadataTemplate( 'enterprise' as GetMetadataTemplateScope, @@ -90,11 +80,6 @@ application of the operations, the metadata template will not be changed. This operation is performed by calling function `updateMetadataTemplate`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-metadata-templates-id-id-schema/). - - - ```ts await client.metadataTemplates.updateMetadataTemplate( 'enterprise' as UpdateMetadataTemplateScope, @@ -134,11 +119,6 @@ This deletion is permanent and can not be reversed. This operation is performed by calling function `deleteMetadataTemplate`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-metadata-templates-id-id-schema/). - - - ```ts await client.metadataTemplates.deleteMetadataTemplate( 'enterprise' as DeleteMetadataTemplateScope, @@ -168,11 +148,6 @@ Retrieves a metadata template by its ID. This operation is performed by calling function `getMetadataTemplateById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-metadata-templates-id/). - - - ```ts await client.metadataTemplates.getMetadataTemplateById(template.id); ``` @@ -197,11 +172,6 @@ enterprises using Box. This operation is performed by calling function `getGlobalMetadataTemplates`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-metadata-templates-global/). - - - ```ts await client.metadataTemplates.getGlobalMetadataTemplates(); ``` @@ -229,11 +199,6 @@ the user's enterprise This operation is performed by calling function `getEnterpriseMetadataTemplates`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-metadata-templates-enterprise/). - - - ```ts await client.metadataTemplates.getEnterpriseMetadataTemplates(); ``` @@ -261,11 +226,6 @@ files and folders. This operation is performed by calling function `createMetadataTemplate`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-metadata-templates-schema/). - - - ```ts await client.metadataTemplates.createMetadataTemplate({ scope: 'enterprise', diff --git a/docs/recentItems.md b/docs/recentItems.md index 1233c9de..51fcebed 100644 --- a/docs/recentItems.md +++ b/docs/recentItems.md @@ -10,11 +10,6 @@ by a user, either in the last 90 days or up to the last This operation is performed by calling function `getRecentItems`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-recent-items/). - - - ```ts await client.recentItems.getRecentItems(); ``` diff --git a/docs/retentionPolicies.md b/docs/retentionPolicies.md index 7adf4479..7f14a208 100644 --- a/docs/retentionPolicies.md +++ b/docs/retentionPolicies.md @@ -12,11 +12,6 @@ Retrieves all of the retention policies for an enterprise. This operation is performed by calling function `getRetentionPolicies`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-retention-policies/). - - - ```ts await client.retentionPolicies.getRetentionPolicies(); ``` @@ -42,11 +37,6 @@ Creates a retention policy. This operation is performed by calling function `createRetentionPolicy`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-retention-policies/). - - - ```ts await client.retentionPolicies.createRetentionPolicy({ policyName: getUuid(), @@ -80,11 +70,6 @@ Retrieves a retention policy. This operation is performed by calling function `getRetentionPolicyById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-retention-policies-id/). - - - ```ts await client.retentionPolicies.getRetentionPolicyById(retentionPolicy.id); ``` @@ -108,11 +93,6 @@ Updates a retention policy. This operation is performed by calling function `updateRetentionPolicyById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-retention-policies-id/). - - - ```ts await client.retentionPolicies.updateRetentionPolicyById(retentionPolicy.id, { requestBody: { @@ -140,11 +120,6 @@ Permanently deletes a retention policy. This operation is performed by calling function `deleteRetentionPolicyById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-retention-policies-id/). - - - ```ts await client.retentionPolicies.deleteRetentionPolicyById(retentionPolicy.id); ``` diff --git a/docs/retentionPolicyAssignments.md b/docs/retentionPolicyAssignments.md index be7a9d36..aa0981b1 100644 --- a/docs/retentionPolicyAssignments.md +++ b/docs/retentionPolicyAssignments.md @@ -13,11 +13,6 @@ retention policy. This operation is performed by calling function `getRetentionPolicyAssignments`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-retention-policies-id-assignments/). - - - ```ts await client.retentionPolicyAssignments.getRetentionPolicyAssignments( retentionPolicy.id @@ -44,11 +39,6 @@ Assigns a retention policy to an item. This operation is performed by calling function `createRetentionPolicyAssignment`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-retention-policy-assignments/). - - - ```ts await client.retentionPolicyAssignments.createRetentionPolicyAssignment({ policyId: retentionPolicy.id, @@ -78,11 +68,6 @@ Retrieves a retention policy assignment This operation is performed by calling function `getRetentionPolicyAssignmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-retention-policy-assignments-id/). - - - ```ts await client.retentionPolicyAssignments.getRetentionPolicyAssignmentById( retentionPolicyAssignment.id @@ -109,11 +94,6 @@ applied to content. This operation is performed by calling function `deleteRetentionPolicyAssignmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-retention-policy-assignments-id/). - - - ```ts await client.retentionPolicyAssignments.deleteRetentionPolicyAssignmentById( retentionPolicyAssignment.id @@ -140,11 +120,6 @@ Returns a list of files under retention for a retention policy assignment. This operation is performed by calling function `getFilesUnderRetentionPolicyAssignment`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-retention-policy-assignments-id-files-under-retention/). - - - ```ts await client.retentionPolicyAssignments.getFilesUnderRetentionPolicyAssignment( retentionPolicyAssignment.id diff --git a/docs/search.md b/docs/search.md index c2902b7e..67955759 100644 --- a/docs/search.md +++ b/docs/search.md @@ -14,11 +14,6 @@ of the metadata, use the `fields` attribute in the query. This operation is performed by calling function `searchByMetadataQuery`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-metadata-queries-execute-read/). - - - ```ts await client.search.searchByMetadataQuery({ ancestorFolderId: '0', @@ -48,11 +43,6 @@ users content or across the entire enterprise. This operation is performed by calling function `searchForContent`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-search/). - - - ```ts await client.search.searchForContent({ ancestorFolderIds: ['0' as string], diff --git a/docs/sessionTermination.md b/docs/sessionTermination.md index 2dc550ce..d74372db 100644 --- a/docs/sessionTermination.md +++ b/docs/sessionTermination.md @@ -12,11 +12,6 @@ Returns the status for the POST request. This operation is performed by calling function `terminateUsersSessions`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-users-terminate-sessions/). - - - ```ts await client.sessionTermination.terminateUsersSessions({ userIds: [getEnvVar('USER_ID')], @@ -46,11 +41,6 @@ Returns the status for the POST request. This operation is performed by calling function `terminateGroupsSessions`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-groups-terminate-sessions/). - - - ```ts await client.sessionTermination.terminateGroupsSessions({ groupIds: [group.id], diff --git a/docs/sharedLinksFiles.md b/docs/sharedLinksFiles.md index ddf5fe9b..b6df575f 100644 --- a/docs/sharedLinksFiles.md +++ b/docs/sharedLinksFiles.md @@ -21,11 +21,6 @@ by requesting it in the `fields` query parameter. This operation is performed by calling function `findFileForSharedLink`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shared-items/). - - - ```ts await userClient.sharedLinksFiles.findFileForSharedLink( {} satisfies FindFileForSharedLinkQueryParams, @@ -61,11 +56,6 @@ Gets the information for a shared link on a file. This operation is performed by calling function `getSharedLinkForFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-get-shared-link/). - - - ```ts await client.sharedLinksFiles.getSharedLinkForFile(fileId, { fields: 'shared_link', @@ -94,11 +84,6 @@ Adds a shared link to a file. This operation is performed by calling function `addShareLinkToFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-files-id-add-shared-link/). - - - ```ts await client.sharedLinksFiles.addShareLinkToFile( fileId, @@ -136,11 +121,6 @@ Updates a shared link on a file. This operation is performed by calling function `updateSharedLinkOnFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-files-id-update-shared-link/). - - - ```ts await client.sharedLinksFiles.updateSharedLinkOnFile( fileId, @@ -178,9 +158,6 @@ Removes a shared link from a file. This operation is performed by calling function `removeSharedLinkFromFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-files-id-remove-shared-link/). - _Currently we don't have an example for calling `removeSharedLinkFromFile` in integration tests_ ### Arguments diff --git a/docs/sharedLinksFolders.md b/docs/sharedLinksFolders.md index 10f1989c..520b7b31 100644 --- a/docs/sharedLinksFolders.md +++ b/docs/sharedLinksFolders.md @@ -18,11 +18,6 @@ shared folder when only given a shared link. This operation is performed by calling function `findFolderForSharedLink`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shared-items-folders/). - - - ```ts await userClient.sharedLinksFolders.findFolderForSharedLink( {} satisfies FindFolderForSharedLinkQueryParams, @@ -58,11 +53,6 @@ Gets the information for a shared link on a folder. This operation is performed by calling function `getSharedLinkForFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folders-id-get-shared-link/). - - - ```ts await client.sharedLinksFolders.getSharedLinkForFolder(folder.id, { fields: 'shared_link', @@ -91,11 +81,6 @@ Adds a shared link to a folder. This operation is performed by calling function `addShareLinkToFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-folders-id-add-shared-link/). - - - ```ts await client.sharedLinksFolders.addShareLinkToFolder( folder.id, @@ -133,11 +118,6 @@ Updates a shared link on a folder. This operation is performed by calling function `updateSharedLinkOnFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-folders-id-update-shared-link/). - - - ```ts await client.sharedLinksFolders.updateSharedLinkOnFolder( folder.id, @@ -175,9 +155,6 @@ Removes a shared link from a folder. This operation is performed by calling function `removeSharedLinkFromFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-folders-id-remove-shared-link/). - _Currently we don't have an example for calling `removeSharedLinkFromFolder` in integration tests_ ### Arguments diff --git a/docs/sharedLinksWebLinks.md b/docs/sharedLinksWebLinks.md index 4729a3dc..30756ca8 100644 --- a/docs/sharedLinksWebLinks.md +++ b/docs/sharedLinksWebLinks.md @@ -18,11 +18,6 @@ shared web link when only given a shared link. This operation is performed by calling function `findWebLinkForSharedLink`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shared-items-web-links/). - - - ```ts await userClient.sharedLinksWebLinks.findWebLinkForSharedLink( {} satisfies FindWebLinkForSharedLinkQueryParams, @@ -58,11 +53,6 @@ Gets the information for a shared link on a web link. This operation is performed by calling function `getSharedLinkForWebLink`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-web-links-id-get-shared-link/). - - - ```ts await client.sharedLinksWebLinks.getSharedLinkForWebLink(webLinkId, { fields: 'shared_link', @@ -91,11 +81,6 @@ Adds a shared link to a web link. This operation is performed by calling function `addShareLinkToWebLink`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-web-links-id-add-shared-link/). - - - ```ts await client.sharedLinksWebLinks.addShareLinkToWebLink( webLinkId, @@ -133,11 +118,6 @@ Updates a shared link on a web link. This operation is performed by calling function `updateSharedLinkOnWebLink`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-web-links-id-update-shared-link/). - - - ```ts await client.sharedLinksWebLinks.updateSharedLinkOnWebLink( webLinkId, @@ -175,9 +155,6 @@ Removes a shared link from a web link. This operation is performed by calling function `removeSharedLinkFromWebLink`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-web-links-id-remove-shared-link/). - _Currently we don't have an example for calling `removeSharedLinkFromWebLink` in integration tests_ ### Arguments diff --git a/docs/shieldInformationBarrierReports.md b/docs/shieldInformationBarrierReports.md index 0cbb528a..7ff89097 100644 --- a/docs/shieldInformationBarrierReports.md +++ b/docs/shieldInformationBarrierReports.md @@ -10,11 +10,6 @@ Lists shield information barrier reports. This operation is performed by calling function `getShieldInformationBarrierReports`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shield-information-barrier-reports/). - - - ```ts await client.shieldInformationBarrierReports.getShieldInformationBarrierReports( { @@ -42,11 +37,6 @@ Creates a shield information barrier report for a given barrier. This operation is performed by calling function `createShieldInformationBarrierReport`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-shield-information-barrier-reports/). - - - ```ts await client.shieldInformationBarrierReports.createShieldInformationBarrierReport( { @@ -77,11 +67,6 @@ Retrieves a shield information barrier report by its ID. This operation is performed by calling function `getShieldInformationBarrierReportById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shield-information-barrier-reports-id/). - - - ```ts await client.shieldInformationBarrierReports.getShieldInformationBarrierReportById( createdReport.id! diff --git a/docs/shieldInformationBarrierSegmentMembers.md b/docs/shieldInformationBarrierSegmentMembers.md index d260bf3e..0698b052 100644 --- a/docs/shieldInformationBarrierSegmentMembers.md +++ b/docs/shieldInformationBarrierSegmentMembers.md @@ -12,11 +12,6 @@ segment member by its ID. This operation is performed by calling function `getShieldInformationBarrierSegmentMemberById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shield-information-barrier-segment-members-id/). - - - ```ts await client.shieldInformationBarrierSegmentMembers.getShieldInformationBarrierSegmentMemberById( segmentMember.id! @@ -43,11 +38,6 @@ segment member based on provided ID. This operation is performed by calling function `deleteShieldInformationBarrierSegmentMemberById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-shield-information-barrier-segment-members-id/). - - - ```ts await client.shieldInformationBarrierSegmentMembers.deleteShieldInformationBarrierSegmentMemberById( segmentMember.id! @@ -75,11 +65,6 @@ based on provided segment IDs. This operation is performed by calling function `getShieldInformationBarrierSegmentMembers`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shield-information-barrier-segment-members/). - - - ```ts await client.shieldInformationBarrierSegmentMembers.getShieldInformationBarrierSegmentMembers( { @@ -108,11 +93,6 @@ Creates a new shield information barrier segment member. This operation is performed by calling function `createShieldInformationBarrierSegmentMember`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-shield-information-barrier-segment-members/). - - - ```ts await client.shieldInformationBarrierSegmentMembers.createShieldInformationBarrierSegmentMember( { diff --git a/docs/shieldInformationBarrierSegmentRestrictions.md b/docs/shieldInformationBarrierSegmentRestrictions.md index 625bd0f3..bbd5c136 100644 --- a/docs/shieldInformationBarrierSegmentRestrictions.md +++ b/docs/shieldInformationBarrierSegmentRestrictions.md @@ -12,11 +12,6 @@ restriction based on provided ID. This operation is performed by calling function `getShieldInformationBarrierSegmentRestrictionById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shield-information-barrier-segment-restrictions-id/). - - - ```ts await client.shieldInformationBarrierSegmentRestrictions.getShieldInformationBarrierSegmentRestrictionById( segmentRestrictionId @@ -44,11 +39,6 @@ based on provided ID. This operation is performed by calling function `deleteShieldInformationBarrierSegmentRestrictionById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-shield-information-barrier-segment-restrictions-id/). - - - ```ts await client.shieldInformationBarrierSegmentRestrictions.deleteShieldInformationBarrierSegmentRestrictionById( segmentRestrictionId @@ -75,11 +65,6 @@ based on provided segment ID. This operation is performed by calling function `getShieldInformationBarrierSegmentRestrictions`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shield-information-barrier-segment-restrictions/). - - - ```ts await client.shieldInformationBarrierSegmentRestrictions.getShieldInformationBarrierSegmentRestrictions( { @@ -109,11 +94,6 @@ segment restriction object. This operation is performed by calling function `createShieldInformationBarrierSegmentRestriction`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-shield-information-barrier-segment-restrictions/). - - - ```ts await client.shieldInformationBarrierSegmentRestrictions.createShieldInformationBarrierSegmentRestriction( { diff --git a/docs/shieldInformationBarrierSegments.md b/docs/shieldInformationBarrierSegments.md index 23dadc7b..83e89afa 100644 --- a/docs/shieldInformationBarrierSegments.md +++ b/docs/shieldInformationBarrierSegments.md @@ -12,11 +12,6 @@ Retrieves shield information barrier segment based on provided ID.. This operation is performed by calling function `getShieldInformationBarrierSegmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shield-information-barrier-segments-id/). - - - ```ts await client.shieldInformationBarrierSegments.getShieldInformationBarrierSegmentById( segmentId @@ -42,11 +37,6 @@ Updates the shield information barrier segment based on provided ID.. This operation is performed by calling function `updateShieldInformationBarrierSegmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-shield-information-barrier-segments-id/). - - - ```ts await client.shieldInformationBarrierSegments.updateShieldInformationBarrierSegmentById( segmentId, @@ -78,11 +68,6 @@ based on provided ID. This operation is performed by calling function `deleteShieldInformationBarrierSegmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-shield-information-barrier-segments-id/). - - - ```ts await client.shieldInformationBarrierSegments.deleteShieldInformationBarrierSegmentById( segment.id! @@ -109,11 +94,6 @@ for the specified Information Barrier ID. This operation is performed by calling function `getShieldInformationBarrierSegments`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shield-information-barrier-segments/). - - - ```ts await client.shieldInformationBarrierSegments.getShieldInformationBarrierSegments( { @@ -141,11 +121,6 @@ Creates a shield information barrier segment. This operation is performed by calling function `createShieldInformationBarrierSegment`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-shield-information-barrier-segments/). - - - ```ts await client.shieldInformationBarrierSegments.createShieldInformationBarrierSegment( { diff --git a/docs/shieldInformationBarriers.md b/docs/shieldInformationBarriers.md index 5d20b88e..496df121 100644 --- a/docs/shieldInformationBarriers.md +++ b/docs/shieldInformationBarriers.md @@ -11,11 +11,6 @@ Get shield information barrier based on provided ID. This operation is performed by calling function `getShieldInformationBarrierById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shield-information-barriers-id/). - - - ```ts await client.shieldInformationBarriers.getShieldInformationBarrierById( barrierId @@ -41,11 +36,6 @@ Change status of shield information barrier with the specified ID. This operation is performed by calling function `updateShieldInformationBarrierStatus`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-shield-information-barriers-change-status/). - - - ```ts await client.shieldInformationBarriers.updateShieldInformationBarrierStatus({ id: barrierId, @@ -74,11 +64,6 @@ for the enterprise of JWT. This operation is performed by calling function `getShieldInformationBarriers`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-shield-information-barriers/). - - - ```ts await client.shieldInformationBarriers.getShieldInformationBarriers(); ``` @@ -108,11 +93,6 @@ firm and prevents confidential information passing between them. This operation is performed by calling function `createShieldInformationBarrier`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-shield-information-barriers/). - - - ```ts await client.shieldInformationBarriers.createShieldInformationBarrier({ enterprise: { id: enterpriseId } satisfies EnterpriseBase, diff --git a/docs/signRequests.md b/docs/signRequests.md index c0edc1e9..a9a80f6c 100644 --- a/docs/signRequests.md +++ b/docs/signRequests.md @@ -12,11 +12,6 @@ Cancels a sign request. This operation is performed by calling function `cancelSignRequest`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-sign-requests-id-cancel/). - - - ```ts await client.signRequests.cancelSignRequest(createdSignRequest.id!); ``` @@ -40,9 +35,6 @@ Resends a signature request email to all outstanding signers. This operation is performed by calling function `resendSignRequest`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-sign-requests-id-resend/). - _Currently we don't have an example for calling `resendSignRequest` in integration tests_ ### Arguments @@ -65,11 +57,6 @@ Gets a sign request by ID. This operation is performed by calling function `getSignRequestById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-sign-requests-id/). - - - ```ts await client.signRequests.getSignRequestById(createdSignRequest.id!); ``` @@ -94,11 +81,6 @@ Gets signature requests created by a user. If the `sign_files` and/or This operation is performed by calling function `getSignRequests`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-sign-requests/). - - - ```ts await client.signRequests.getSignRequests(); ``` @@ -125,11 +107,6 @@ sending the signature request to signers. This operation is performed by calling function `createSignRequest`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-sign-requests/). - - - ```ts await client.signRequests.createSignRequest({ signers: [ diff --git a/docs/signTemplates.md b/docs/signTemplates.md index 543b5f44..e1a4f72c 100644 --- a/docs/signTemplates.md +++ b/docs/signTemplates.md @@ -9,11 +9,6 @@ Gets Box Sign templates created by a user. This operation is performed by calling function `getSignTemplates`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-sign-templates/). - - - ```ts await client.signTemplates.getSignTemplates({ limit: 2, @@ -41,11 +36,6 @@ Fetches details of a specific Box Sign template. This operation is performed by calling function `getSignTemplateById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-sign-templates-id/). - - - ```ts await client.signTemplates.getSignTemplateById(signTemplates.entries![0].id!); ``` diff --git a/docs/skills.md b/docs/skills.md index b94b855a..2ef4b1c5 100644 --- a/docs/skills.md +++ b/docs/skills.md @@ -12,11 +12,6 @@ List the Box Skills metadata cards that are attached to a file. This operation is performed by calling function `getBoxSkillCardsOnFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-metadata-global-box-skills-cards/). - - - ```ts await client.skills.getBoxSkillCardsOnFile(file.id); ``` @@ -43,11 +38,6 @@ Applies one or more Box Skills metadata cards to a file. This operation is performed by calling function `createBoxSkillCardsOnFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-files-id-metadata-global-box-skills-cards/). - - - ```ts await client.skills.createBoxSkillCardsOnFile(file.id, { cards: [ @@ -85,11 +75,6 @@ Updates one or more Box Skills metadata cards to a file. This operation is performed by calling function `updateBoxSkillCardsOnFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-files-id-metadata-global-box-skills-cards/). - - - ```ts await client.skills.updateBoxSkillCardsOnFile(file.id, [ { @@ -138,11 +123,6 @@ Removes any Box Skills cards metadata from a file. This operation is performed by calling function `deleteBoxSkillCardsFromFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-files-id-metadata-global-box-skills-cards/). - - - ```ts await client.skills.deleteBoxSkillCardsFromFile(file.id); ``` @@ -168,9 +148,6 @@ metadata cards on a file. This operation is performed by calling function `updateAllSkillCardsOnFile`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-skill-invocations-id/). - _Currently we don't have an example for calling `updateAllSkillCardsOnFile` in integration tests_ ### Arguments diff --git a/docs/storagePolicies.md b/docs/storagePolicies.md index 1ac30443..09b9b618 100644 --- a/docs/storagePolicies.md +++ b/docs/storagePolicies.md @@ -9,11 +9,6 @@ Fetches all the storage policies in the enterprise. This operation is performed by calling function `getStoragePolicies`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-storage-policies/). - - - ```ts await client.storagePolicies.getStoragePolicies(); ``` @@ -39,11 +34,6 @@ Fetches a specific storage policy. This operation is performed by calling function `getStoragePolicyById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-storage-policies-id/). - - - ```ts await client.storagePolicies.getStoragePolicyById(storagePolicy.id); ``` diff --git a/docs/storagePolicyAssignments.md b/docs/storagePolicyAssignments.md index 4be77fed..54b931c2 100644 --- a/docs/storagePolicyAssignments.md +++ b/docs/storagePolicyAssignments.md @@ -12,11 +12,6 @@ Fetches all the storage policy assignment for an enterprise or user. This operation is performed by calling function `getStoragePolicyAssignments`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-storage-policy-assignments/). - - - ```ts await client.storagePolicyAssignments.getStoragePolicyAssignments({ resolvedForType: @@ -45,11 +40,6 @@ Creates a storage policy assignment for an enterprise or user. This operation is performed by calling function `createStoragePolicyAssignment`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-storage-policy-assignments/). - - - ```ts await client.storagePolicyAssignments.createStoragePolicyAssignment({ storagePolicy: new CreateStoragePolicyAssignmentRequestBodyStoragePolicyField( @@ -81,11 +71,6 @@ Fetches a specific storage policy assignment. This operation is performed by calling function `getStoragePolicyAssignmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-storage-policy-assignments-id/). - - - ```ts await client.storagePolicyAssignments.getStoragePolicyAssignmentById( storagePolicyAssignment.id @@ -111,11 +96,6 @@ Updates a specific storage policy assignment. This operation is performed by calling function `updateStoragePolicyAssignmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-storage-policy-assignments-id/). - - - ```ts await client.storagePolicyAssignments.updateStoragePolicyAssignmentById( storagePolicyAssignment.id, @@ -156,11 +136,6 @@ twice per user in a 24 hour time frame. This operation is performed by calling function `deleteStoragePolicyAssignmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-storage-policy-assignments-id/). - - - ```ts await client.storagePolicyAssignments.deleteStoragePolicyAssignmentById( storagePolicyAssignment.id diff --git a/docs/taskAssignments.md b/docs/taskAssignments.md index 920367e2..b60b3466 100644 --- a/docs/taskAssignments.md +++ b/docs/taskAssignments.md @@ -12,11 +12,6 @@ Lists all of the assignments for a given task. This operation is performed by calling function `getTaskAssignments`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-tasks-id-assignments/). - - - ```ts await client.taskAssignments.getTaskAssignments(task.id!); ``` @@ -44,11 +39,6 @@ assignments. This operation is performed by calling function `createTaskAssignment`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-task-assignments/). - - - ```ts await client.taskAssignments.createTaskAssignment({ task: new CreateTaskAssignmentRequestBodyTaskField({ @@ -80,11 +70,6 @@ Retrieves information about a task assignment. This operation is performed by calling function `getTaskAssignmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-task-assignments-id/). - - - ```ts await client.taskAssignments.getTaskAssignmentById(taskAssignment.id!); ``` @@ -110,11 +95,6 @@ used to update the state of a task assigned to a user. This operation is performed by calling function `updateTaskAssignmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-task-assignments-id/). - - - ```ts await client.taskAssignments.updateTaskAssignmentById(taskAssignment.id!, { requestBody: { @@ -144,11 +124,6 @@ Deletes a specific task assignment. This operation is performed by calling function `deleteTaskAssignmentById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-task-assignments-id/). - - - ```ts await client.taskAssignments.deleteTaskAssignmentById(taskAssignment.id!); ``` diff --git a/docs/tasks.md b/docs/tasks.md index 64d6a8d1..db14afd4 100644 --- a/docs/tasks.md +++ b/docs/tasks.md @@ -13,11 +13,6 @@ endpoint does not support pagination. This operation is performed by calling function `getFileTasks`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-tasks/). - - - ```ts await client.tasks.getFileTasks(file.id); ``` @@ -45,11 +40,6 @@ will need to be assigned separately. This operation is performed by calling function `createTask`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-tasks/). - - - ```ts await client.tasks.createTask({ item: { @@ -82,11 +72,6 @@ Retrieves information about a specific task. This operation is performed by calling function `getTaskById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-tasks-id/). - - - ```ts await client.tasks.getTaskById(task.id!); ``` @@ -111,11 +96,6 @@ update its completion state. This operation is performed by calling function `updateTaskById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-tasks-id/). - - - ```ts await client.tasks.updateTaskById(task.id!, { requestBody: { @@ -143,11 +123,6 @@ Removes a task from a file. This operation is performed by calling function `deleteTaskById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-tasks-id/). - - - ```ts await client.tasks.deleteTaskById(task.id!); ``` diff --git a/docs/termsOfServiceUserStatuses.md b/docs/termsOfServiceUserStatuses.md index 7846cf57..712b4ce6 100644 --- a/docs/termsOfServiceUserStatuses.md +++ b/docs/termsOfServiceUserStatuses.md @@ -12,11 +12,6 @@ the terms and when. This operation is performed by calling function `getTermsOfServiceUserStatuses`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-terms-of-service-user-statuses/). - - - ```ts await client.termsOfServiceUserStatuses.getTermsOfServiceUserStatuses({ tosId: tos.id, @@ -43,11 +38,6 @@ Sets the status for a terms of service for a user. This operation is performed by calling function `createTermsOfServiceStatusForUser`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-terms-of-service-user-statuses/). - - - ```ts await client.termsOfServiceUserStatuses.createTermsOfServiceStatusForUser({ tos: new CreateTermsOfServiceStatusForUserRequestBodyTosField({ id: tos.id }), @@ -77,11 +67,6 @@ Updates the status for a terms of service for a user. This operation is performed by calling function `updateTermsOfServiceStatusForUserById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-terms-of-service-user-statuses-id/). - - - ```ts await client.termsOfServiceUserStatuses.updateTermsOfServiceStatusForUserById( createdTosUserStatus.id, diff --git a/docs/termsOfServices.md b/docs/termsOfServices.md index ef427495..89091aa6 100644 --- a/docs/termsOfServices.md +++ b/docs/termsOfServices.md @@ -12,11 +12,6 @@ for the enterprise. This operation is performed by calling function `getTermsOfService`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-terms-of-services/). - - - ```ts await client.termsOfServices.getTermsOfService(); ``` @@ -44,11 +39,6 @@ and type of user. This operation is performed by calling function `createTermsOfService`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-terms-of-services/). - - - ```ts await client.termsOfServices.createTermsOfService({ status: 'disabled' as CreateTermsOfServiceRequestBodyStatusField, @@ -76,9 +66,6 @@ Fetches a specific terms of service. This operation is performed by calling function `getTermsOfServiceById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-terms-of-services-id/). - _Currently we don't have an example for calling `getTermsOfServiceById` in integration tests_ ### Arguments @@ -100,11 +87,6 @@ Updates a specific terms of service. This operation is performed by calling function `updateTermsOfServiceById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-terms-of-services-id/). - - - ```ts await client.termsOfServices.updateTermsOfServiceById(tos.id, { status: 'disabled' as UpdateTermsOfServiceByIdRequestBodyStatusField, diff --git a/docs/transfer.md b/docs/transfer.md index 09b39e9a..2dc257d1 100644 --- a/docs/transfer.md +++ b/docs/transfer.md @@ -40,11 +40,6 @@ Admins will receive an email when the operation is completed. This operation is performed by calling function `transferOwnedFolder`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-users-id-folders-0/). - - - ```ts await client.transfer.transferOwnedFolder( newUser.id, diff --git a/docs/trashedFiles.md b/docs/trashedFiles.md index dedb83ba..bb8d713d 100644 --- a/docs/trashedFiles.md +++ b/docs/trashedFiles.md @@ -13,11 +13,6 @@ original folder has been deleted. This operation is performed by calling function `restoreFileFromTrash`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-files-id/). - - - ```ts await client.trashedFiles.restoreFileFromTrash(file.id); ``` @@ -51,11 +46,6 @@ API. This operation is performed by calling function `getTrashedFileById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-files-id-trash/). - - - ```ts await client.trashedFiles.getTrashedFileById(uploadedFile.id); ``` @@ -82,11 +72,6 @@ This action cannot be undone. This operation is performed by calling function `deleteTrashedFileById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-files-id-trash/). - - - ```ts await client.trashedFiles.deleteTrashedFileById(file.id); ``` diff --git a/docs/trashedFolders.md b/docs/trashedFolders.md index c06dc27e..cb09e97f 100644 --- a/docs/trashedFolders.md +++ b/docs/trashedFolders.md @@ -20,11 +20,6 @@ operation can performed on any of the locked folders. This operation is performed by calling function `restoreFolderFromTrash`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-folders-id/). - - - ```ts await client.trashedFolders.restoreFolderFromTrash(folder.id); ``` @@ -58,11 +53,6 @@ API. This operation is performed by calling function `getTrashedFolderById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folders-id-trash/). - - - ```ts await client.trashedFolders.getTrashedFolderById(folder.id); ``` @@ -89,11 +79,6 @@ This action cannot be undone. This operation is performed by calling function `deleteTrashedFolderById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-folders-id-trash/). - - - ```ts await client.trashedFolders.deleteTrashedFolderById(folder.id); ``` diff --git a/docs/trashedItems.md b/docs/trashedItems.md index 7bc4c0dd..0c572e0b 100644 --- a/docs/trashedItems.md +++ b/docs/trashedItems.md @@ -16,11 +16,6 @@ marker-based pagination using the `marker` parameter. This operation is performed by calling function `getTrashedItems`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-folders-trash-items/). - - - ```ts await client.trashedItems.getTrashedItems(); ``` diff --git a/docs/trashedWebLinks.md b/docs/trashedWebLinks.md index a5886972..0318231c 100644 --- a/docs/trashedWebLinks.md +++ b/docs/trashedWebLinks.md @@ -13,11 +13,6 @@ the original folder has been deleted. This operation is performed by calling function `restoreWeblinkFromTrash`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-web-links-id/). - - - ```ts await client.trashedWebLinks.restoreWeblinkFromTrash(weblink.id); ``` @@ -41,11 +36,6 @@ Retrieves a web link that has been moved to the trash. This operation is performed by calling function `getTrashedWebLinkById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-web-links-id-trash/). - - - ```ts await client.trashedWebLinks.getTrashedWebLinkById(weblink.id); ``` @@ -72,11 +62,6 @@ This action cannot be undone. This operation is performed by calling function `deleteTrashedWebLinkById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-web-links-id-trash/). - - - ```ts await client.trashedWebLinks.deleteTrashedWebLinkById(weblink.id); ``` diff --git a/docs/userCollaborations.md b/docs/userCollaborations.md index c0cf5d2f..bd8e867e 100644 --- a/docs/userCollaborations.md +++ b/docs/userCollaborations.md @@ -11,11 +11,6 @@ Retrieves a single collaboration. This operation is performed by calling function `getCollaborationById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-collaborations-id/). - - - ```ts await client.userCollaborations.getCollaborationById(collaborationId); ``` @@ -41,11 +36,6 @@ accept collaboration invites. This operation is performed by calling function `updateCollaborationById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-collaborations-id/). - - - ```ts await client.userCollaborations.updateCollaborationById(collaborationId, { role: 'viewer' as UpdateCollaborationByIdRequestBodyRoleField, @@ -75,11 +65,6 @@ Deletes a single collaboration. This operation is performed by calling function `deleteCollaborationById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-collaborations-id/). - - - ```ts await client.userCollaborations.deleteCollaborationById(groupCollaboration.id); ``` @@ -118,11 +103,6 @@ are redacted: This operation is performed by calling function `createCollaboration`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-collaborations/). - - - ```ts await client.userCollaborations.createCollaboration({ item: { diff --git a/docs/users.md b/docs/users.md index 4f2b273a..45cebdd5 100644 --- a/docs/users.md +++ b/docs/users.md @@ -18,11 +18,6 @@ enterprise. This operation is performed by calling function `getUsers`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-users/). - - - ```ts await client.users.getUsers(); ``` @@ -50,11 +45,6 @@ admin permissions. This operation is performed by calling function `createUser`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-users/). - - - ```ts await client.users.createUser({ name: userName, @@ -90,11 +80,6 @@ Use the `As-User` header to change who this API call is made on behalf of. This operation is performed by calling function `getUserMe`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-users-me/). - - - ```ts await client.users.getUserMe(); ``` @@ -130,11 +115,6 @@ null instead. This operation is performed by calling function `getUserById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-users-id/). - - - ```ts await client.users.getUserById(user.id); ``` @@ -165,11 +145,6 @@ admin permissions. This operation is performed by calling function `updateUserById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-users-id/). - - - ```ts await client.users.updateUserById(user.id, { requestBody: { name: updatedUserName } satisfies UpdateUserByIdRequestBody, @@ -198,11 +173,6 @@ the user and their files. This operation is performed by calling function `deleteUserById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-users-id/). - - - ```ts await client.users.deleteUserById(createdUser.id); ``` diff --git a/docs/webLinks.md b/docs/webLinks.md index 24b80355..075a8126 100644 --- a/docs/webLinks.md +++ b/docs/webLinks.md @@ -11,11 +11,6 @@ Creates a web link object within a folder. This operation is performed by calling function `createWebLink`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-web-links/). - - - ```ts await client.webLinks.createWebLink({ url: 'https://www.box.com', @@ -44,11 +39,6 @@ Retrieve information about a web link. This operation is performed by calling function `getWebLinkById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-web-links-id/). - - - ```ts await client.webLinks.getWebLinkById(weblink.id); ``` @@ -72,11 +62,6 @@ Updates a web link object. This operation is performed by calling function `updateWebLinkById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-web-links-id/). - - - ```ts await client.webLinks.updateWebLinkById(weblink.id, { requestBody: { @@ -108,11 +93,6 @@ Deletes a web link. This operation is performed by calling function `deleteWebLinkById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-web-links-id/). - - - ```ts await client.webLinks.deleteWebLinkById(webLinkId); ``` diff --git a/docs/webhooks.md b/docs/webhooks.md index 1031487c..9b056194 100644 --- a/docs/webhooks.md +++ b/docs/webhooks.md @@ -17,11 +17,6 @@ vice versa. This operation is performed by calling function `getWebhooks`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-webhooks/). - - - ```ts await client.webhooks.getWebhooks(); ``` @@ -47,11 +42,6 @@ Creates a webhook. This operation is performed by calling function `createWebhook`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-webhooks/). - - - ```ts await client.webhooks.createWebhook({ target: { @@ -82,11 +72,6 @@ Retrieves a specific webhook This operation is performed by calling function `getWebhookById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-webhooks-id/). - - - ```ts await client.webhooks.getWebhookById(webhook.id!); ``` @@ -110,11 +95,6 @@ Updates a webhook. This operation is performed by calling function `updateWebhookById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/put-webhooks-id/). - - - ```ts await client.webhooks.updateWebhookById(webhook.id!, { requestBody: { @@ -142,11 +122,6 @@ Deletes a webhook. This operation is performed by calling function `deleteWebhookById`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/delete-webhooks-id/). - - - ```ts await client.webhooks.deleteWebhookById(webhook.id!); ``` diff --git a/docs/workflows.md b/docs/workflows.md index b36b7340..02307252 100644 --- a/docs/workflows.md +++ b/docs/workflows.md @@ -13,11 +13,6 @@ scope within the developer console in to use this endpoint. This operation is performed by calling function `getWorkflows`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-workflows/). - - - ```ts await adminClient.workflows.getWorkflows({ folderId: workflowFolderId, @@ -46,11 +41,6 @@ scope within the developer console. This operation is performed by calling function `startWorkflow`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-workflows-id-start/). - - - ```ts await adminClient.workflows.startWorkflow(workflowToRun.id!, { type: 'workflow_parameters' as StartWorkflowRequestBodyTypeField, diff --git a/docs/zipDownloads.md b/docs/zipDownloads.md index 9fe1dfa5..8e9b1ee2 100644 --- a/docs/zipDownloads.md +++ b/docs/zipDownloads.md @@ -26,11 +26,6 @@ total size does not exceed 25GB. This operation is performed by calling function `createZipDownload`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/post-zip-downloads/). - - - ```ts await client.zipDownloads.createZipDownload({ items: [ @@ -84,11 +79,6 @@ this endpoint. This operation is performed by calling function `getZipDownloadContent`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-zip-downloads-id-content/). - - - ```ts await client.zipDownloads.getZipDownloadContent(zipDownload.downloadUrl!); ``` @@ -124,11 +114,6 @@ this endpoint. This operation is performed by calling function `getZipDownloadStatus`. -See the endpoint docs at -[API Reference](https://developer.box.com/reference/get-zip-downloads-id-status/). - - - ```ts await client.zipDownloads.getZipDownloadStatus(zipDownload.statusUrl!); ``` diff --git a/package-lock.json b/package-lock.json index f187b482..b64709ec 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1067,9 +1067,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.19.2.tgz", - "integrity": "sha512-OHflWINKtoCFSpm/WmuQaWW4jeX+3Qt3XQDepkkiFTsoxFc5BpF3Z5aDxFZgBqRjO6ATP5+b1iilp4kGIZVWlA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.20.0.tgz", + "integrity": "sha512-TSpWzflCc4VGAUJZlPpgAJE1+V60MePDQnBd7PPkpuEmOy8i87aL6tinFGKBFKuEDikYpig72QzdT3QPYIi+oA==", "cpu": [ "arm" ], @@ -1080,9 +1080,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.19.2.tgz", - "integrity": "sha512-k0OC/b14rNzMLDOE6QMBCjDRm3fQOHAL8Ldc9bxEWvMo4Ty9RY6rWmGetNTWhPo+/+FNd1lsQYRd0/1OSix36A==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.20.0.tgz", + "integrity": "sha512-u00Ro/nok7oGzVuh/FMYfNoGqxU5CPWz1mxV85S2w9LxHR8OoMQBuSk+3BKVIDYgkpeOET5yXkx90OYFc+ytpQ==", "cpu": [ "arm64" ], @@ -1093,9 +1093,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.19.2.tgz", - "integrity": "sha512-IIARRgWCNWMTeQH+kr/gFTHJccKzwEaI0YSvtqkEBPj7AshElFq89TyreKNFAGh5frLfDCbodnq+Ye3dqGKPBw==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.20.0.tgz", + "integrity": "sha512-uFVfvzvsdGtlSLuL0ZlvPJvl6ZmrH4CBwLGEFPe7hUmf7htGAN+aXo43R/V6LATyxlKVC/m6UsLb7jbG+LG39Q==", "cpu": [ "arm64" ], @@ -1106,9 +1106,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.19.2.tgz", - "integrity": "sha512-52udDMFDv54BTAdnw+KXNF45QCvcJOcYGl3vQkp4vARyrcdI/cXH8VXTEv/8QWfd6Fru8QQuw1b2uNersXOL0g==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.20.0.tgz", + "integrity": "sha512-xbrMDdlev53vNXexEa6l0LffojxhqDTBeL+VUxuuIXys4x6xyvbKq5XqTXBCEUA8ty8iEJblHvFaWRJTk/icAQ==", "cpu": [ "x64" ], @@ -1119,9 +1119,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.19.2.tgz", - "integrity": "sha512-r+SI2t8srMPYZeoa1w0o/AfoVt9akI1ihgazGYPQGRilVAkuzMGiTtexNZkrPkQsyFrvqq/ni8f3zOnHw4hUbA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.20.0.tgz", + "integrity": "sha512-jMYvxZwGmoHFBTbr12Xc6wOdc2xA5tF5F2q6t7Rcfab68TT0n+r7dgawD4qhPEvasDsVpQi+MgDzj2faOLsZjA==", "cpu": [ "arm" ], @@ -1132,9 +1132,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.19.2.tgz", - "integrity": "sha512-+tYiL4QVjtI3KliKBGtUU7yhw0GMcJJuB9mLTCEauHEsqfk49gtUBXGtGP3h1LW8MbaTY6rSFIQV1XOBps1gBA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.20.0.tgz", + "integrity": "sha512-1asSTl4HKuIHIB1GcdFHNNZhxAYEdqML/MW4QmPS4G0ivbEcBr1JKlFLKsIRqjSwOBkdItn3/ZDlyvZ/N6KPlw==", "cpu": [ "arm" ], @@ -1145,9 +1145,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.19.2.tgz", - "integrity": "sha512-OR5DcvZiYN75mXDNQQxlQPTv4D+uNCUsmSCSY2FolLf9W5I4DSoJyg7z9Ea3TjKfhPSGgMJiey1aWvlWuBzMtg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.20.0.tgz", + "integrity": "sha512-COBb8Bkx56KldOYJfMf6wKeYJrtJ9vEgBRAOkfw6Ens0tnmzPqvlpjZiLgkhg6cA3DGzCmLmmd319pmHvKWWlQ==", "cpu": [ "arm64" ], @@ -1158,9 +1158,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.19.2.tgz", - "integrity": "sha512-Hw3jSfWdUSauEYFBSFIte6I8m6jOj+3vifLg8EU3lreWulAUpch4JBjDMtlKosrBzkr0kwKgL9iCfjA8L3geoA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.20.0.tgz", + "integrity": "sha512-+it+mBSyMslVQa8wSPvBx53fYuZK/oLTu5RJoXogjk6x7Q7sz1GNRsXWjn6SwyJm8E/oMjNVwPhmNdIjwP135Q==", "cpu": [ "arm64" ], @@ -1171,9 +1171,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.19.2.tgz", - "integrity": "sha512-rhjvoPBhBwVnJRq/+hi2Q3EMiVF538/o9dBuj9TVLclo9DuONqt5xfWSaE6MYiFKpo/lFPJ/iSI72rYWw5Hc7w==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.20.0.tgz", + "integrity": "sha512-yAMvqhPfGKsAxHN8I4+jE0CpLWD8cv4z7CK7BMmhjDuz606Q2tFKkWRY8bHR9JQXYcoLfopo5TTqzxgPUjUMfw==", "cpu": [ "ppc64" ], @@ -1184,9 +1184,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.19.2.tgz", - "integrity": "sha512-EAz6vjPwHHs2qOCnpQkw4xs14XJq84I81sDRGPEjKPFVPBw7fwvtwhVjcZR6SLydCv8zNK8YGFblKWd/vRmP8g==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.20.0.tgz", + "integrity": "sha512-qmuxFpfmi/2SUkAw95TtNq/w/I7Gpjurx609OOOV7U4vhvUhBcftcmXwl3rqAek+ADBwSjIC4IVNLiszoj3dPA==", "cpu": [ "riscv64" ], @@ -1197,9 +1197,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.19.2.tgz", - "integrity": "sha512-IJSUX1xb8k/zN9j2I7B5Re6B0NNJDJ1+soezjNojhT8DEVeDNptq2jgycCOpRhyGj0+xBn7Cq+PK7Q+nd2hxLA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.20.0.tgz", + "integrity": "sha512-I0BtGXddHSHjV1mqTNkgUZLnS3WtsqebAXv11D5BZE/gfw5KoyXSAXVqyJximQXNvNzUo4GKlCK/dIwXlz+jlg==", "cpu": [ "s390x" ], @@ -1210,9 +1210,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.19.2.tgz", - "integrity": "sha512-OgaToJ8jSxTpgGkZSkwKE+JQGihdcaqnyHEFOSAU45utQ+yLruE1dkonB2SDI8t375wOKgNn8pQvaWY9kPzxDQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.20.0.tgz", + "integrity": "sha512-y+eoL2I3iphUg9tN9GB6ku1FA8kOfmF4oUEWhztDJ4KXJy1agk/9+pejOuZkNFhRwHAOxMsBPLbXPd6mJiCwew==", "cpu": [ "x64" ], @@ -1223,9 +1223,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.19.2.tgz", - "integrity": "sha512-5V3mPpWkB066XZZBgSd1lwozBk7tmOkKtquyCJ6T4LN3mzKENXyBwWNQn8d0Ci81hvlBw5RoFgleVpL6aScLYg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.20.0.tgz", + "integrity": "sha512-hM3nhW40kBNYUkZb/r9k2FKK+/MnKglX7UYd4ZUy5DJs8/sMsIbqWK2piZtVGE3kcXVNj3B2IrUYROJMMCikNg==", "cpu": [ "x64" ], @@ -1236,9 +1236,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.19.2.tgz", - "integrity": "sha512-ayVstadfLeeXI9zUPiKRVT8qF55hm7hKa+0N1V6Vj+OTNFfKSoUxyZvzVvgtBxqSb5URQ8sK6fhwxr9/MLmxdA==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.20.0.tgz", + "integrity": "sha512-psegMvP+Ik/Bg7QRJbv8w8PAytPA7Uo8fpFjXyCRHWm6Nt42L+JtoqH8eDQ5hRP7/XW2UiIriy1Z46jf0Oa1kA==", "cpu": [ "arm64" ], @@ -1249,9 +1249,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.19.2.tgz", - "integrity": "sha512-Mda7iG4fOLHNsPqjWSjANvNZYoW034yxgrndof0DwCy0D3FvTjeNo+HGE6oGWgvcLZNLlcp0hLEFcRs+UGsMLg==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.20.0.tgz", + "integrity": "sha512-GabekH3w4lgAJpVxkk7hUzUf2hICSQO0a/BLFA11/RMxQT92MabKAqyubzDZmMOC/hcJNlc+rrypzNzYl4Dx7A==", "cpu": [ "ia32" ], @@ -1262,9 +1262,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.19.2.tgz", - "integrity": "sha512-DPi0ubYhSow/00YqmG1jWm3qt1F8aXziHc/UNy8bo9cpCacqhuWu+iSq/fp2SyEQK7iYTZ60fBU9cat3MXTjIQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.20.0.tgz", + "integrity": "sha512-aJ1EJSuTdGnM6qbVC4B5DSmozPTqIag9fSzXRNNo+humQLG89XpPgdt16Ia56ORD7s+H8Pmyx44uczDQ0yDzpg==", "cpu": [ "x64" ], @@ -1394,9 +1394,9 @@ } }, "node_modules/@types/node": { - "version": "22.1.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", - "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", + "version": "22.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.2.0.tgz", + "integrity": "sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ==", "dev": true, "dependencies": { "undici-types": "~6.13.0" @@ -1445,9 +1445,9 @@ "dev": true }, "node_modules/@types/yargs": { - "version": "17.0.32", - "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.32.tgz", - "integrity": "sha512-xQ67Yc/laOG5uMfX/093MRlGGCIBzZMarVa+gfNKJxWAIgykYpVGkBdbqEzGDDfCrVUj6Hiff4mTZ5BA6TmAog==", + "version": "17.0.33", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", + "integrity": "sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==", "dev": true, "dependencies": { "@types/yargs-parser": "*" @@ -1827,9 +1827,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001646", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001646.tgz", - "integrity": "sha512-dRg00gudiBDDTmUhClSdv3hqRfpbOnU28IpI1T6PBTLWa+kOj0681C8uML3PifYfREuBrVjDGhL3adYpBT6spw==", + "version": "1.0.30001651", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz", + "integrity": "sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==", "dev": true, "funding": [ { @@ -2106,9 +2106,9 @@ } }, "node_modules/electron-to-chromium": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.4.tgz", - "integrity": "sha512-orzA81VqLyIGUEA77YkVA1D+N+nNfl2isJVjjmOyrlxuooZ19ynb+dOlaDTqd/idKRS9lDCSBmtzM+kyCsMnkA==", + "version": "1.5.6", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.6.tgz", + "integrity": "sha512-jwXWsM5RPf6j9dPYzaorcBSUg6AiqocPEyMpkchkvntaH9HGfOOMZwxMJjDY/XEs3T5dM7uyH1VhRMkqUU9qVw==", "dev": true }, "node_modules/emittery": { @@ -4106,9 +4106,9 @@ } }, "node_modules/rollup": { - "version": "4.19.2", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.19.2.tgz", - "integrity": "sha512-6/jgnN1svF9PjNYJ4ya3l+cqutg49vOZ4rVgsDKxdl+5gpGPnByFXWGyfH9YGx9i3nfBwSu1Iyu6vGwFFA0BdQ==", + "version": "4.20.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.20.0.tgz", + "integrity": "sha512-6rbWBChcnSGzIlXeIdNIZTopKYad8ZG8ajhl78lGRLsI2rX8IkaotQhVas2Ma+GPxJav19wrSzvRvuiv0YKzWw==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -4121,22 +4121,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.19.2", - "@rollup/rollup-android-arm64": "4.19.2", - "@rollup/rollup-darwin-arm64": "4.19.2", - "@rollup/rollup-darwin-x64": "4.19.2", - "@rollup/rollup-linux-arm-gnueabihf": "4.19.2", - "@rollup/rollup-linux-arm-musleabihf": "4.19.2", - "@rollup/rollup-linux-arm64-gnu": "4.19.2", - "@rollup/rollup-linux-arm64-musl": "4.19.2", - "@rollup/rollup-linux-powerpc64le-gnu": "4.19.2", - "@rollup/rollup-linux-riscv64-gnu": "4.19.2", - "@rollup/rollup-linux-s390x-gnu": "4.19.2", - "@rollup/rollup-linux-x64-gnu": "4.19.2", - "@rollup/rollup-linux-x64-musl": "4.19.2", - "@rollup/rollup-win32-arm64-msvc": "4.19.2", - "@rollup/rollup-win32-ia32-msvc": "4.19.2", - "@rollup/rollup-win32-x64-msvc": "4.19.2", + "@rollup/rollup-android-arm-eabi": "4.20.0", + "@rollup/rollup-android-arm64": "4.20.0", + "@rollup/rollup-darwin-arm64": "4.20.0", + "@rollup/rollup-darwin-x64": "4.20.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.20.0", + "@rollup/rollup-linux-arm-musleabihf": "4.20.0", + "@rollup/rollup-linux-arm64-gnu": "4.20.0", + "@rollup/rollup-linux-arm64-musl": "4.20.0", + "@rollup/rollup-linux-powerpc64le-gnu": "4.20.0", + "@rollup/rollup-linux-riscv64-gnu": "4.20.0", + "@rollup/rollup-linux-s390x-gnu": "4.20.0", + "@rollup/rollup-linux-x64-gnu": "4.20.0", + "@rollup/rollup-linux-x64-musl": "4.20.0", + "@rollup/rollup-win32-arm64-msvc": "4.20.0", + "@rollup/rollup-win32-ia32-msvc": "4.20.0", + "@rollup/rollup-win32-x64-msvc": "4.20.0", "fsevents": "~2.3.2" } }, diff --git a/src/managers/ai.generated.ts b/src/managers/ai.generated.ts index eb378879..4da5d78b 100644 --- a/src/managers/ai.generated.ts +++ b/src/managers/ai.generated.ts @@ -1,16 +1,19 @@ -import { serializeAiResponse } from '../schemas/aiResponse.generated.js'; -import { deserializeAiResponse } from '../schemas/aiResponse.generated.js'; +import { serializeAiAskResponse } from '../schemas/aiAskResponse.generated.js'; +import { deserializeAiAskResponse } from '../schemas/aiAskResponse.generated.js'; import { serializeClientError } from '../schemas/clientError.generated.js'; import { deserializeClientError } from '../schemas/clientError.generated.js'; import { serializeAiAsk } from '../schemas/aiAsk.generated.js'; import { deserializeAiAsk } from '../schemas/aiAsk.generated.js'; +import { serializeAiResponse } from '../schemas/aiResponse.generated.js'; +import { deserializeAiResponse } from '../schemas/aiResponse.generated.js'; import { serializeAiTextGen } from '../schemas/aiTextGen.generated.js'; import { deserializeAiTextGen } from '../schemas/aiTextGen.generated.js'; import { serializeAiAgentAskOrAiAgentTextGen } from '../schemas/aiAgentAskOrAiAgentTextGen.generated.js'; import { deserializeAiAgentAskOrAiAgentTextGen } from '../schemas/aiAgentAskOrAiAgentTextGen.generated.js'; -import { AiResponse } from '../schemas/aiResponse.generated.js'; +import { AiAskResponse } from '../schemas/aiAskResponse.generated.js'; import { ClientError } from '../schemas/clientError.generated.js'; import { AiAsk } from '../schemas/aiAsk.generated.js'; +import { AiResponse } from '../schemas/aiResponse.generated.js'; import { AiTextGen } from '../schemas/aiTextGen.generated.js'; import { AiAgentAskOrAiAgentTextGen } from '../schemas/aiAgentAskOrAiAgentTextGen.generated.js'; import { Authentication } from '../networking/auth.generated.js'; @@ -203,12 +206,12 @@ export class AiManager { * Sends an AI request to supported LLMs and returns an answer specifically focused on the user's question given the provided context. * @param {AiAsk} requestBody Request body of createAiAsk method * @param {CreateAiAskOptionalsInput} optionalsInput - * @returns {Promise} + * @returns {Promise} */ async createAiAsk( requestBody: AiAsk, optionalsInput: CreateAiAskOptionalsInput = {} - ): Promise { + ): Promise { const optionals: CreateAiAskOptionals = new CreateAiAskOptionals({ headers: optionalsInput.headers, cancellationToken: optionalsInput.cancellationToken, @@ -231,7 +234,7 @@ export class AiManager { cancellationToken: cancellationToken, } satisfies FetchOptions )) as FetchResponse; - return deserializeAiResponse(response.data); + return deserializeAiAskResponse(response.data); } /** * Sends an AI request to supported LLMs and returns an answer specifically focused on the creation of new text. diff --git a/src/managers/chunkedUploads.generated.ts b/src/managers/chunkedUploads.generated.ts index 63a34851..dd04d012 100644 --- a/src/managers/chunkedUploads.generated.ts +++ b/src/managers/chunkedUploads.generated.ts @@ -100,6 +100,34 @@ export interface CreateFileUploadSessionForExistingFileOptionalsInput { readonly headers?: CreateFileUploadSessionForExistingFileHeaders; readonly cancellationToken?: undefined | CancellationToken; } +export class GetFileUploadSessionByUrlOptionals { + readonly headers: GetFileUploadSessionByUrlHeaders = + new GetFileUploadSessionByUrlHeaders({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetFileUploadSessionByUrlOptionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetFileUploadSessionByUrlOptionals, + 'headers' | 'cancellationToken' + > + > + ) { + if (fields.headers) { + this.headers = fields.headers; + } + if (fields.cancellationToken) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetFileUploadSessionByUrlOptionalsInput { + readonly headers?: GetFileUploadSessionByUrlHeaders; + readonly cancellationToken?: undefined | CancellationToken; +} export class GetFileUploadSessionByIdOptionals { readonly headers: GetFileUploadSessionByIdHeaders = new GetFileUploadSessionByIdHeaders({}); @@ -125,6 +153,20 @@ export interface GetFileUploadSessionByIdOptionalsInput { readonly headers?: GetFileUploadSessionByIdHeaders; readonly cancellationToken?: undefined | CancellationToken; } +export class UploadFilePartByUrlOptionals { + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit & + Partial> + ) { + if (fields.cancellationToken) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface UploadFilePartByUrlOptionalsInput { + readonly cancellationToken?: undefined | CancellationToken; +} export class UploadFilePartOptionals { readonly cancellationToken?: CancellationToken = void 0; constructor( @@ -139,6 +181,34 @@ export class UploadFilePartOptionals { export interface UploadFilePartOptionalsInput { readonly cancellationToken?: undefined | CancellationToken; } +export class DeleteFileUploadSessionByUrlOptionals { + readonly headers: DeleteFileUploadSessionByUrlHeaders = + new DeleteFileUploadSessionByUrlHeaders({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + DeleteFileUploadSessionByUrlOptionals, + 'headers' | 'cancellationToken' + > & + Partial< + Pick< + DeleteFileUploadSessionByUrlOptionals, + 'headers' | 'cancellationToken' + > + > + ) { + if (fields.headers) { + this.headers = fields.headers; + } + if (fields.cancellationToken) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface DeleteFileUploadSessionByUrlOptionalsInput { + readonly headers?: DeleteFileUploadSessionByUrlHeaders; + readonly cancellationToken?: undefined | CancellationToken; +} export class DeleteFileUploadSessionByIdOptionals { readonly headers: DeleteFileUploadSessionByIdHeaders = new DeleteFileUploadSessionByIdHeaders({}); @@ -167,6 +237,40 @@ export interface DeleteFileUploadSessionByIdOptionalsInput { readonly headers?: DeleteFileUploadSessionByIdHeaders; readonly cancellationToken?: undefined | CancellationToken; } +export class GetFileUploadSessionPartsByUrlOptionals { + readonly queryParams: GetFileUploadSessionPartsByUrlQueryParams = + {} satisfies GetFileUploadSessionPartsByUrlQueryParams; + readonly headers: GetFileUploadSessionPartsByUrlHeaders = + new GetFileUploadSessionPartsByUrlHeaders({}); + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + GetFileUploadSessionPartsByUrlOptionals, + 'queryParams' | 'headers' | 'cancellationToken' + > & + Partial< + Pick< + GetFileUploadSessionPartsByUrlOptionals, + 'queryParams' | 'headers' | 'cancellationToken' + > + > + ) { + if (fields.queryParams) { + this.queryParams = fields.queryParams; + } + if (fields.headers) { + this.headers = fields.headers; + } + if (fields.cancellationToken) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface GetFileUploadSessionPartsByUrlOptionalsInput { + readonly queryParams?: GetFileUploadSessionPartsByUrlQueryParams; + readonly headers?: GetFileUploadSessionPartsByUrlHeaders; + readonly cancellationToken?: undefined | CancellationToken; +} export class GetFileUploadSessionPartsOptionals { readonly queryParams: GetFileUploadSessionPartsQueryParams = {} satisfies GetFileUploadSessionPartsQueryParams; @@ -201,6 +305,25 @@ export interface GetFileUploadSessionPartsOptionalsInput { readonly headers?: GetFileUploadSessionPartsHeaders; readonly cancellationToken?: undefined | CancellationToken; } +export class CreateFileUploadSessionCommitByUrlOptionals { + readonly cancellationToken?: CancellationToken = void 0; + constructor( + fields: Omit< + CreateFileUploadSessionCommitByUrlOptionals, + 'cancellationToken' + > & + Partial< + Pick + > + ) { + if (fields.cancellationToken) { + this.cancellationToken = fields.cancellationToken; + } + } +} +export interface CreateFileUploadSessionCommitByUrlOptionalsInput { + readonly cancellationToken?: undefined | CancellationToken; +} export class CreateFileUploadSessionCommitOptionals { readonly cancellationToken?: CancellationToken = void 0; constructor( @@ -219,7 +342,7 @@ interface PartAccumulator { readonly lastIndex: number; readonly parts: readonly UploadPart[]; readonly fileSize: number; - readonly uploadSessionId: string; + readonly uploadPartUrl: string; readonly fileHash: Hash; } export interface CreateFileUploadSessionRequestBody { @@ -294,6 +417,30 @@ export interface CreateFileUploadSessionForExistingFileHeadersInput { readonly [key: string]: undefined | string; }; } +export class GetFileUploadSessionByUrlHeaders { + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit & + Partial> + ) { + if (fields.extraHeaders) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetFileUploadSessionByUrlHeadersInput { + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: + | undefined + | { + readonly [key: string]: undefined | string; + }; +} export class GetFileUploadSessionByIdHeaders { /** * Extra headers that will be included in the HTTP request. */ @@ -318,6 +465,92 @@ export interface GetFileUploadSessionByIdHeadersInput { readonly [key: string]: undefined | string; }; } +export class UploadFilePartByUrlHeaders { + /** + * The [RFC3230][1] message digest of the chunk uploaded. + * + * Only SHA1 is supported. The SHA1 digest must be base64 + * encoded. The format of this header is as + * `sha=BASE64_ENCODED_DIGEST`. + * + * To get the value for the `SHA` digest, use the + * openSSL command to encode the file part: + * `openssl sha1 -binary | base64` + * + * [1]: https://tools.ietf.org/html/rfc3230 */ + readonly digest!: string; + /** + * The byte range of the chunk. + * + * Must not overlap with the range of a part already + * uploaded this session. Each part’s size must be + * exactly equal in size to the part size specified + * in the upload session that you created. + * One exception is the last part of the file, as this can be smaller. + * + * When providing the value for `content-range`, remember that: + * + * * The lower bound of each part's byte range + * must be a multiple of the part size. + * * The higher bound must be a multiple of the part size - 1. */ + readonly contentRange!: string; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit & + Partial> + ) { + if (fields.digest) { + this.digest = fields.digest; + } + if (fields.contentRange) { + this.contentRange = fields.contentRange; + } + if (fields.extraHeaders) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface UploadFilePartByUrlHeadersInput { + /** + * The [RFC3230][1] message digest of the chunk uploaded. + * + * Only SHA1 is supported. The SHA1 digest must be base64 + * encoded. The format of this header is as + * `sha=BASE64_ENCODED_DIGEST`. + * + * To get the value for the `SHA` digest, use the + * openSSL command to encode the file part: + * `openssl sha1 -binary | base64` + * + * [1]: https://tools.ietf.org/html/rfc3230 */ + readonly digest: string; + /** + * The byte range of the chunk. + * + * Must not overlap with the range of a part already + * uploaded this session. Each part’s size must be + * exactly equal in size to the part size specified + * in the upload session that you created. + * One exception is the last part of the file, as this can be smaller. + * + * When providing the value for `content-range`, remember that: + * + * * The lower bound of each part's byte range + * must be a multiple of the part size. + * * The higher bound must be a multiple of the part size - 1. */ + readonly contentRange: string; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: + | undefined + | { + readonly [key: string]: undefined | string; + }; +} export class UploadFilePartHeaders { /** * The [RFC3230][1] message digest of the chunk uploaded. @@ -404,6 +637,30 @@ export interface UploadFilePartHeadersInput { readonly [key: string]: undefined | string; }; } +export class DeleteFileUploadSessionByUrlHeaders { + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit & + Partial> + ) { + if (fields.extraHeaders) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface DeleteFileUploadSessionByUrlHeadersInput { + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: + | undefined + | { + readonly [key: string]: undefined | string; + }; +} export class DeleteFileUploadSessionByIdHeaders { /** * Extra headers that will be included in the HTTP request. */ @@ -428,6 +685,42 @@ export interface DeleteFileUploadSessionByIdHeadersInput { readonly [key: string]: undefined | string; }; } +export interface GetFileUploadSessionPartsByUrlQueryParams { + /** + * The offset of the item at which to begin the response. + * + * Queries with offset parameter value + * exceeding 10000 will be rejected + * with a 400 response. */ + readonly offset?: number; + /** + * The maximum number of items to return per page. */ + readonly limit?: number; +} +export class GetFileUploadSessionPartsByUrlHeaders { + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit & + Partial> + ) { + if (fields.extraHeaders) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface GetFileUploadSessionPartsByUrlHeadersInput { + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: + | undefined + | { + readonly [key: string]: undefined | string; + }; +} export interface GetFileUploadSessionPartsQueryParams { /** * The offset of the item at which to begin the response. @@ -464,6 +757,96 @@ export interface GetFileUploadSessionPartsHeadersInput { readonly [key: string]: undefined | string; }; } +export interface CreateFileUploadSessionCommitByUrlRequestBody { + /** + * The list details for the uploaded parts */ + readonly parts: readonly UploadPart[]; +} +export class CreateFileUploadSessionCommitByUrlHeaders { + /** + * The [RFC3230][1] message digest of the whole file. + * + * Only SHA1 is supported. The SHA1 digest must be Base64 + * encoded. The format of this header is as + * `sha=BASE64_ENCODED_DIGEST`. + * + * [1]: https://tools.ietf.org/html/rfc3230 */ + readonly digest!: string; + /** + * Ensures this item hasn't recently changed before + * making changes. + * + * Pass in the item's last observed `etag` value + * into this header and the endpoint will fail + * with a `412 Precondition Failed` if it + * has changed since. */ + readonly ifMatch?: string; + /** + * Ensures an item is only returned if it has changed. + * + * Pass in the item's last observed `etag` value + * into this header and the endpoint will fail + * with a `304 Not Modified` if the item has not + * changed since. */ + readonly ifNoneMatch?: string; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: { + readonly [key: string]: undefined | string; + } = {}; + constructor( + fields: Omit & + Partial> + ) { + if (fields.digest) { + this.digest = fields.digest; + } + if (fields.ifMatch) { + this.ifMatch = fields.ifMatch; + } + if (fields.ifNoneMatch) { + this.ifNoneMatch = fields.ifNoneMatch; + } + if (fields.extraHeaders) { + this.extraHeaders = fields.extraHeaders; + } + } +} +export interface CreateFileUploadSessionCommitByUrlHeadersInput { + /** + * The [RFC3230][1] message digest of the whole file. + * + * Only SHA1 is supported. The SHA1 digest must be Base64 + * encoded. The format of this header is as + * `sha=BASE64_ENCODED_DIGEST`. + * + * [1]: https://tools.ietf.org/html/rfc3230 */ + readonly digest: string; + /** + * Ensures this item hasn't recently changed before + * making changes. + * + * Pass in the item's last observed `etag` value + * into this header and the endpoint will fail + * with a `412 Precondition Failed` if it + * has changed since. */ + readonly ifMatch?: string; + /** + * Ensures an item is only returned if it has changed. + * + * Pass in the item's last observed `etag` value + * into this header and the endpoint will fail + * with a `304 Not Modified` if the item has not + * changed since. */ + readonly ifNoneMatch?: string; + /** + * Extra headers that will be included in the HTTP request. */ + readonly extraHeaders?: + | undefined + | { + readonly [key: string]: undefined | string; + }; +} export interface CreateFileUploadSessionCommitRequestBody { /** * The list details for the uploaded parts */ @@ -563,10 +946,15 @@ export class ChunkedUploadsManager { | 'networkSession' | 'createFileUploadSession' | 'createFileUploadSessionForExistingFile' + | 'getFileUploadSessionByUrl' | 'getFileUploadSessionById' + | 'uploadFilePartByUrl' | 'uploadFilePart' + | 'deleteFileUploadSessionByUrl' | 'deleteFileUploadSessionById' + | 'getFileUploadSessionPartsByUrl' | 'getFileUploadSessionParts' + | 'createFileUploadSessionCommitByUrl' | 'createFileUploadSessionCommit' | 'reducer' | 'uploadBigFile' @@ -669,8 +1057,44 @@ export class ChunkedUploadsManager { )) as FetchResponse; return deserializeUploadSession(response.data); } + /** + * Using this method with urls provided in response when creating a new upload session is preferred to use over GetFileUploadSessionById method. + * This allows to always upload your content to the closest Box data center and can significantly improve upload speed. + * Return information about an upload session. + * + * The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) endpoint. + * @param {string} url URL of getFileUploadSessionById method + * @param {GetFileUploadSessionByUrlOptionalsInput} optionalsInput + * @returns {Promise} + */ + async getFileUploadSessionByUrl( + url: string, + optionalsInput: GetFileUploadSessionByUrlOptionalsInput = {} + ): Promise { + const optionals: GetFileUploadSessionByUrlOptionals = + new GetFileUploadSessionByUrlOptionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = (await fetch(url, { + method: 'GET', + headers: headersMap, + responseFormat: 'json', + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + } satisfies FetchOptions)) as FetchResponse; + return deserializeUploadSession(response.data); + } /** * Return information about an upload session. + * + * The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) endpoint. * @param {string} uploadSessionId The ID of the upload session. Example: "D5E3F7A" * @param {GetFileUploadSessionByIdOptionalsInput} optionalsInput @@ -708,7 +1132,60 @@ export class ChunkedUploadsManager { return deserializeUploadSession(response.data); } /** - * Updates a chunk of an upload session for a file. + * Using this method with urls provided in response when creating a new upload session is preferred to use over UploadFilePart method. + * This allows to always upload your content to the closest Box data center and can significantly improve upload speed. + * Uploads a chunk of a file for an upload session. + * + * The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) + * and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. + * @param {string} url URL of uploadFilePart method + * @param {ByteStream} requestBody Request body of uploadFilePart method + * @param {UploadFilePartByUrlHeadersInput} headersInput Headers of uploadFilePart method + * @param {UploadFilePartByUrlOptionalsInput} optionalsInput + * @returns {Promise} + */ + async uploadFilePartByUrl( + url: string, + requestBody: ByteStream, + headersInput: UploadFilePartByUrlHeadersInput, + optionalsInput: UploadFilePartByUrlOptionalsInput = {} + ): Promise { + const headers: UploadFilePartByUrlHeaders = new UploadFilePartByUrlHeaders({ + digest: headersInput.digest, + contentRange: headersInput.contentRange, + extraHeaders: headersInput.extraHeaders, + }); + const optionals: UploadFilePartByUrlOptionals = + new UploadFilePartByUrlOptionals({ + cancellationToken: optionalsInput.cancellationToken, + }); + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ + ['digest']: toString(headers.digest) as string, + ['content-range']: toString(headers.contentRange) as string, + }, + ...headers.extraHeaders, + }); + const response: FetchResponse = (await fetch(url, { + method: 'PUT', + headers: headersMap, + fileStream: requestBody, + contentType: 'application/octet-stream', + responseFormat: 'json', + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + } satisfies FetchOptions)) as FetchResponse; + return deserializeUploadedPart(response.data); + } + /** + * Uploads a chunk of a file for an upload session. + * + * The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) + * and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. * @param {string} uploadSessionId The ID of the upload session. Example: "D5E3F7A" * @param {ByteStream} requestBody Request body of uploadFilePart method @@ -759,10 +1236,50 @@ export class ChunkedUploadsManager { )) as FetchResponse; return deserializeUploadedPart(response.data); } + /** + * Using this method with urls provided in response when creating a new upload session is preferred to use over DeleteFileUploadSessionById method. + * This allows to always upload your content to the closest Box data center and can significantly improve upload speed. + * Abort an upload session and discard all data uploaded. + * + * This cannot be reversed. + * + * The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) + * and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. + * @param {string} url URL of deleteFileUploadSessionById method + * @param {DeleteFileUploadSessionByUrlOptionalsInput} optionalsInput + * @returns {Promise} + */ + async deleteFileUploadSessionByUrl( + url: string, + optionalsInput: DeleteFileUploadSessionByUrlOptionalsInput = {} + ): Promise { + const optionals: DeleteFileUploadSessionByUrlOptionals = + new DeleteFileUploadSessionByUrlOptionals({ + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = (await fetch(url, { + method: 'DELETE', + headers: headersMap, + responseFormat: void 0, + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + } satisfies FetchOptions)) as FetchResponse; + return void 0; + } /** * Abort an upload session and discard all data uploaded. * * This cannot be reversed. + * + * The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) + * and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. * @param {string} uploadSessionId The ID of the upload session. Example: "D5E3F7A" * @param {DeleteFileUploadSessionByIdOptionalsInput} optionalsInput @@ -800,8 +1317,54 @@ export class ChunkedUploadsManager { return void 0; } /** - * Return a list of the chunks uploaded to the upload - * session so far. + * Using this method with urls provided in response when creating a new upload session is preferred to use over GetFileUploadSessionParts method. + * This allows to always upload your content to the closest Box data center and can significantly improve upload speed. + * Return a list of the chunks uploaded to the upload session so far. + * + * The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) + * and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. + * @param {string} url URL of getFileUploadSessionParts method + * @param {GetFileUploadSessionPartsByUrlOptionalsInput} optionalsInput + * @returns {Promise} + */ + async getFileUploadSessionPartsByUrl( + url: string, + optionalsInput: GetFileUploadSessionPartsByUrlOptionalsInput = {} + ): Promise { + const optionals: GetFileUploadSessionPartsByUrlOptionals = + new GetFileUploadSessionPartsByUrlOptionals({ + queryParams: optionalsInput.queryParams, + headers: optionalsInput.headers, + cancellationToken: optionalsInput.cancellationToken, + }); + const queryParams: any = optionals.queryParams; + const headers: any = optionals.headers; + const cancellationToken: any = optionals.cancellationToken; + const queryParamsMap: { + readonly [key: string]: string; + } = prepareParams({ + ['offset']: toString(queryParams.offset) as string, + ['limit']: toString(queryParams.limit) as string, + }); + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ ...{}, ...headers.extraHeaders }); + const response: FetchResponse = (await fetch(url, { + method: 'GET', + params: queryParamsMap, + headers: headersMap, + responseFormat: 'json', + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + } satisfies FetchOptions)) as FetchResponse; + return deserializeUploadParts(response.data); + } + /** + * Return a list of the chunks uploaded to the upload session so far. + * + * The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) + * and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. * @param {string} uploadSessionId The ID of the upload session. Example: "D5E3F7A" * @param {GetFileUploadSessionPartsOptionalsInput} optionalsInput @@ -849,8 +1412,63 @@ export class ChunkedUploadsManager { return deserializeUploadParts(response.data); } /** - * Close an upload session and create a file from the - * uploaded chunks. + * Using this method with urls provided in response when creating a new upload session is preferred to use over CreateFileUploadSessionCommit method. + * This allows to always upload your content to the closest Box data center and can significantly improve upload speed. + * Close an upload session and create a file from the uploaded chunks. + * + * The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) + * and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. + * @param {string} url URL of createFileUploadSessionCommit method + * @param {CreateFileUploadSessionCommitByUrlRequestBody} requestBody Request body of createFileUploadSessionCommit method + * @param {CreateFileUploadSessionCommitByUrlHeadersInput} headersInput Headers of createFileUploadSessionCommit method + * @param {CreateFileUploadSessionCommitByUrlOptionalsInput} optionalsInput + * @returns {Promise} + */ + async createFileUploadSessionCommitByUrl( + url: string, + requestBody: CreateFileUploadSessionCommitByUrlRequestBody, + headersInput: CreateFileUploadSessionCommitByUrlHeadersInput, + optionalsInput: CreateFileUploadSessionCommitByUrlOptionalsInput = {} + ): Promise { + const headers: CreateFileUploadSessionCommitByUrlHeaders = + new CreateFileUploadSessionCommitByUrlHeaders({ + digest: headersInput.digest, + ifMatch: headersInput.ifMatch, + ifNoneMatch: headersInput.ifNoneMatch, + extraHeaders: headersInput.extraHeaders, + }); + const optionals: CreateFileUploadSessionCommitByUrlOptionals = + new CreateFileUploadSessionCommitByUrlOptionals({ + cancellationToken: optionalsInput.cancellationToken, + }); + const cancellationToken: any = optionals.cancellationToken; + const headersMap: { + readonly [key: string]: string; + } = prepareParams({ + ...{ + ['digest']: toString(headers.digest) as string, + ['if-match']: toString(headers.ifMatch) as string, + ['if-none-match']: toString(headers.ifNoneMatch) as string, + }, + ...headers.extraHeaders, + }); + const response: FetchResponse = (await fetch(url, { + method: 'POST', + headers: headersMap, + data: serializeCreateFileUploadSessionCommitRequestBody(requestBody), + contentType: 'application/json', + responseFormat: 'json', + auth: this.auth, + networkSession: this.networkSession, + cancellationToken: cancellationToken, + } satisfies FetchOptions)) as FetchResponse; + return deserializeFiles(response.data); + } + /** + * Close an upload session and create a file from the uploaded chunks. + * + * The actual endpoint URL is returned by the [`Create upload session`](e://post-files-upload-sessions) + * and [`Get upload session`](e://get-files-upload-sessions-id) endpoints. * @param {string} uploadSessionId The ID of the upload session. Example: "D5E3F7A" * @param {CreateFileUploadSessionCommitRequestBody} requestBody Request body of createFileUploadSessionCommit method @@ -933,13 +1551,13 @@ export class ChunkedUploadsManager { '/', (toString(acc.fileSize) as string)! ) as string; - const uploadedPart: UploadedPart = await this.uploadFilePart( - acc.uploadSessionId, + const uploadedPart: UploadedPart = await this.uploadFilePartByUrl( + acc.uploadPartUrl, generateByteStreamFromBuffer(chunkBuffer), { digest: digest, contentRange: contentRange, - } satisfies UploadFilePartHeadersInput + } satisfies UploadFilePartByUrlHeadersInput ); const part: UploadPart = uploadedPart.part!; const partSha1: string = hexToBase64(part.sha1!); @@ -957,7 +1575,7 @@ export class ChunkedUploadsManager { lastIndex: bytesEnd, parts: parts.concat([part]), fileSize: acc.fileSize, - uploadSessionId: acc.uploadSessionId, + uploadPartUrl: acc.uploadPartUrl, fileHash: acc.fileHash, } satisfies PartAccumulator; } @@ -988,7 +1606,9 @@ export class ChunkedUploadsManager { cancellationToken: cancellationToken, } satisfies CreateFileUploadSessionOptionalsInput ); - const uploadSessionId: string = uploadSession.id!; + const uploadPartUrl: string = uploadSession.sessionEndpoints!.uploadPart!; + const commitUrl: string = uploadSession.sessionEndpoints!.commit!; + const listPartsUrl: string = uploadSession.sessionEndpoints!.listParts!; const partSize: number = uploadSession.partSize!; const totalParts: number = uploadSession.totalParts!; if (!(partSize * totalParts >= fileSize)) { @@ -1006,30 +1626,35 @@ export class ChunkedUploadsManager { lastIndex: -1, parts: [], fileSize: fileSize, - uploadSessionId: uploadSessionId, + uploadPartUrl: uploadPartUrl, fileHash: fileHash, } satisfies PartAccumulator ); const parts: readonly UploadPart[] = results.parts; const processedSessionParts: UploadParts = - await this.getFileUploadSessionParts(uploadSessionId, { - queryParams: {} satisfies GetFileUploadSessionPartsQueryParams, - headers: new GetFileUploadSessionPartsHeaders({}), + await this.getFileUploadSessionPartsByUrl(listPartsUrl, { + queryParams: {} satisfies GetFileUploadSessionPartsByUrlQueryParams, + headers: new GetFileUploadSessionPartsByUrlHeaders({}), cancellationToken: cancellationToken, - } satisfies GetFileUploadSessionPartsOptionalsInput); + } satisfies GetFileUploadSessionPartsByUrlOptionalsInput); if (!(processedSessionParts.totalCount! == totalParts)) { throw new Error('Assertion failed'); } const sha1: string = await fileHash.digestHash('base64'); const digest: string = ''.concat('sha=', sha1) as string; - const committedSession: Files = await this.createFileUploadSessionCommit( - uploadSessionId, - { parts: parts } satisfies CreateFileUploadSessionCommitRequestBody, - { digest: digest } satisfies CreateFileUploadSessionCommitHeadersInput, - { - cancellationToken: cancellationToken, - } satisfies CreateFileUploadSessionCommitOptionalsInput - ); + const committedSession: Files = + await this.createFileUploadSessionCommitByUrl( + commitUrl, + { + parts: parts, + } satisfies CreateFileUploadSessionCommitByUrlRequestBody, + { + digest: digest, + } satisfies CreateFileUploadSessionCommitByUrlHeadersInput, + { + cancellationToken: cancellationToken, + } satisfies CreateFileUploadSessionCommitByUrlOptionalsInput + ); return committedSession.entries![0]; } } @@ -1142,6 +1767,45 @@ export function deserializeCreateFileUploadSessionForExistingFileRequestBody( fileName: fileName, } satisfies CreateFileUploadSessionForExistingFileRequestBody; } +export function serializeCreateFileUploadSessionCommitByUrlRequestBody( + val: CreateFileUploadSessionCommitByUrlRequestBody +): SerializedData { + return { + ['parts']: val.parts.map(function (item: UploadPart): SerializedData { + return serializeUploadPart(item); + }) as readonly any[], + }; +} +export function deserializeCreateFileUploadSessionCommitByUrlRequestBody( + val: SerializedData +): CreateFileUploadSessionCommitByUrlRequestBody { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: + 'Expecting a map for "CreateFileUploadSessionCommitByUrlRequestBody"', + }); + } + if (val.parts == void 0) { + throw new BoxSdkError({ + message: + 'Expecting "parts" of type "CreateFileUploadSessionCommitByUrlRequestBody" to be defined', + }); + } + if (!sdIsList(val.parts)) { + throw new BoxSdkError({ + message: + 'Expecting array for "parts" of type "CreateFileUploadSessionCommitByUrlRequestBody"', + }); + } + const parts: readonly UploadPart[] = sdIsList(val.parts) + ? (val.parts.map(function (itm: SerializedData): UploadPart { + return deserializeUploadPart(itm); + }) as readonly any[]) + : []; + return { + parts: parts, + } satisfies CreateFileUploadSessionCommitByUrlRequestBody; +} export function serializeCreateFileUploadSessionCommitRequestBody( val: CreateFileUploadSessionCommitRequestBody ): SerializedData { diff --git a/src/schemas/aiAgentAsk.generated.ts b/src/schemas/aiAgentAsk.generated.ts index 9974cdfd..46a95d70 100644 --- a/src/schemas/aiAgentAsk.generated.ts +++ b/src/schemas/aiAgentAsk.generated.ts @@ -13,7 +13,35 @@ import { sdIsString } from '../serialization/json.js'; import { sdIsList } from '../serialization/json.js'; import { sdIsMap } from '../serialization/json.js'; export type AiAgentAskTypeField = 'ai_agent_ask'; -export interface AiAgentAsk { +export class AiAgentAsk { + /** + * The type of AI agent used to handle queries. */ + readonly type: AiAgentAskTypeField = 'ai_agent_ask' as AiAgentAskTypeField; + readonly longText?: AiAgentLongTextTool; + readonly basicText?: AiAgentBasicTextToolAsk; + readonly longTextMulti?: AiAgentLongTextTool; + readonly basicTextMulti?: AiAgentBasicTextToolAsk; + constructor( + fields: Omit & Partial> + ) { + if (fields.type) { + this.type = fields.type; + } + if (fields.longText) { + this.longText = fields.longText; + } + if (fields.basicText) { + this.basicText = fields.basicText; + } + if (fields.longTextMulti) { + this.longTextMulti = fields.longTextMulti; + } + if (fields.basicTextMulti) { + this.basicTextMulti = fields.basicTextMulti; + } + } +} +export interface AiAgentAskInput { /** * The type of AI agent used to handle queries. */ readonly type?: AiAgentAskTypeField; @@ -37,8 +65,7 @@ export function deserializeAiAgentAskTypeField( } export function serializeAiAgentAsk(val: AiAgentAsk): SerializedData { return { - ['type']: - val.type == void 0 ? void 0 : serializeAiAgentAskTypeField(val.type), + ['type']: serializeAiAgentAskTypeField(val.type), ['long_text']: val.longText == void 0 ? void 0 @@ -61,6 +88,64 @@ export function deserializeAiAgentAsk(val: SerializedData): AiAgentAsk { if (!sdIsMap(val)) { throw new BoxSdkError({ message: 'Expecting a map for "AiAgentAsk"' }); } + if (val.type == void 0) { + throw new BoxSdkError({ + message: 'Expecting "type" of type "AiAgentAsk" to be defined', + }); + } + const type: AiAgentAskTypeField = deserializeAiAgentAskTypeField(val.type); + const longText: undefined | AiAgentLongTextTool = + val.long_text == void 0 + ? void 0 + : deserializeAiAgentLongTextTool(val.long_text); + const basicText: undefined | AiAgentBasicTextToolAsk = + val.basic_text == void 0 + ? void 0 + : deserializeAiAgentBasicTextToolAsk(val.basic_text); + const longTextMulti: undefined | AiAgentLongTextTool = + val.long_text_multi == void 0 + ? void 0 + : deserializeAiAgentLongTextTool(val.long_text_multi); + const basicTextMulti: undefined | AiAgentBasicTextToolAsk = + val.basic_text_multi == void 0 + ? void 0 + : deserializeAiAgentBasicTextToolAsk(val.basic_text_multi); + return { + type: type, + longText: longText, + basicText: basicText, + longTextMulti: longTextMulti, + basicTextMulti: basicTextMulti, + } satisfies AiAgentAsk; +} +export function serializeAiAgentAskInput(val: AiAgentAskInput): SerializedData { + return { + ['type']: + val.type == void 0 ? void 0 : serializeAiAgentAskTypeField(val.type), + ['long_text']: + val.longText == void 0 + ? void 0 + : serializeAiAgentLongTextTool(val.longText), + ['basic_text']: + val.basicText == void 0 + ? void 0 + : serializeAiAgentBasicTextToolAsk(val.basicText), + ['long_text_multi']: + val.longTextMulti == void 0 + ? void 0 + : serializeAiAgentLongTextTool(val.longTextMulti), + ['basic_text_multi']: + val.basicTextMulti == void 0 + ? void 0 + : serializeAiAgentBasicTextToolAsk(val.basicTextMulti), + }; +} +export function deserializeAiAgentAskInput( + val: SerializedData +): AiAgentAskInput { + if (!sdIsMap(val)) { + throw new BoxSdkError({ message: 'Expecting a map for "AiAgentAskInput"' }); + } const type: undefined | AiAgentAskTypeField = val.type == void 0 ? void 0 : deserializeAiAgentAskTypeField(val.type); const longText: undefined | AiAgentLongTextTool = @@ -85,5 +170,5 @@ export function deserializeAiAgentAsk(val: SerializedData): AiAgentAsk { basicText: basicText, longTextMulti: longTextMulti, basicTextMulti: basicTextMulti, - } satisfies AiAgentAsk; + } satisfies AiAgentAskInput; } diff --git a/src/schemas/aiAgentTextGen.generated.ts b/src/schemas/aiAgentTextGen.generated.ts index 0c4df5f0..8e568017 100644 --- a/src/schemas/aiAgentTextGen.generated.ts +++ b/src/schemas/aiAgentTextGen.generated.ts @@ -10,7 +10,24 @@ import { sdIsString } from '../serialization/json.js'; import { sdIsList } from '../serialization/json.js'; import { sdIsMap } from '../serialization/json.js'; export type AiAgentTextGenTypeField = 'ai_agent_text_gen'; -export interface AiAgentTextGen { +export class AiAgentTextGen { + /** + * The type of AI agent used for generating text. */ + readonly type: AiAgentTextGenTypeField = + 'ai_agent_text_gen' as AiAgentTextGenTypeField; + readonly basicGen?: AiAgentBasicGenTool; + constructor( + fields: Omit & Partial> + ) { + if (fields.type) { + this.type = fields.type; + } + if (fields.basicGen) { + this.basicGen = fields.basicGen; + } + } +} +export interface AiAgentTextGenInput { /** * The type of AI agent used for generating text. */ readonly type?: AiAgentTextGenTypeField; @@ -33,8 +50,7 @@ export function deserializeAiAgentTextGenTypeField( } export function serializeAiAgentTextGen(val: AiAgentTextGen): SerializedData { return { - ['type']: - val.type == void 0 ? void 0 : serializeAiAgentTextGenTypeField(val.type), + ['type']: serializeAiAgentTextGenTypeField(val.type), ['basic_gen']: val.basicGen == void 0 ? void 0 @@ -45,11 +61,45 @@ export function deserializeAiAgentTextGen(val: SerializedData): AiAgentTextGen { if (!sdIsMap(val)) { throw new BoxSdkError({ message: 'Expecting a map for "AiAgentTextGen"' }); } + if (val.type == void 0) { + throw new BoxSdkError({ + message: 'Expecting "type" of type "AiAgentTextGen" to be defined', + }); + } + const type: AiAgentTextGenTypeField = deserializeAiAgentTextGenTypeField( + val.type + ); + const basicGen: undefined | AiAgentBasicGenTool = + val.basic_gen == void 0 + ? void 0 + : deserializeAiAgentBasicGenTool(val.basic_gen); + return { type: type, basicGen: basicGen } satisfies AiAgentTextGen; +} +export function serializeAiAgentTextGenInput( + val: AiAgentTextGenInput +): SerializedData { + return { + ['type']: + val.type == void 0 ? void 0 : serializeAiAgentTextGenTypeField(val.type), + ['basic_gen']: + val.basicGen == void 0 + ? void 0 + : serializeAiAgentBasicGenTool(val.basicGen), + }; +} +export function deserializeAiAgentTextGenInput( + val: SerializedData +): AiAgentTextGenInput { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "AiAgentTextGenInput"', + }); + } const type: undefined | AiAgentTextGenTypeField = val.type == void 0 ? void 0 : deserializeAiAgentTextGenTypeField(val.type); const basicGen: undefined | AiAgentBasicGenTool = val.basic_gen == void 0 ? void 0 : deserializeAiAgentBasicGenTool(val.basic_gen); - return { type: type, basicGen: basicGen } satisfies AiAgentTextGen; + return { type: type, basicGen: basicGen } satisfies AiAgentTextGenInput; } diff --git a/src/schemas/aiAsk.generated.ts b/src/schemas/aiAsk.generated.ts index 0cd60b9a..5ced877e 100644 --- a/src/schemas/aiAsk.generated.ts +++ b/src/schemas/aiAsk.generated.ts @@ -1,5 +1,8 @@ +import { serializeAiDialogueHistory } from './aiDialogueHistory.generated.js'; +import { deserializeAiDialogueHistory } from './aiDialogueHistory.generated.js'; import { serializeAiAgentAsk } from './aiAgentAsk.generated.js'; import { deserializeAiAgentAsk } from './aiAgentAsk.generated.js'; +import { AiDialogueHistory } from './aiDialogueHistory.generated.js'; import { AiAgentAsk } from './aiAgentAsk.generated.js'; import { BoxSdkError } from '../box/errors.js'; import { SerializedData } from '../serialization/json.js'; @@ -61,6 +64,12 @@ export interface AiAsk { * If the file size exceeds 1MB, the first 1MB of text representation will be processed. * If you set `mode` parameter to `single_item_qa`, the `items` array can have one element only. */ readonly items: readonly AiAskItemsField[]; + /** + * The history of prompts and answers previously passed to the LLM. This provides additional context to the LLM in generating the response. */ + readonly dialogueHistory?: readonly AiDialogueHistory[]; + /** + * A flag to indicate whether citations should be returned. */ + readonly includeCitations?: boolean; readonly aiAgent?: AiAgentAsk; } export function serializeAiAskModeField(val: AiAskModeField): SerializedData { @@ -178,6 +187,16 @@ export function serializeAiAsk(val: AiAsk): SerializedData { ['items']: val.items.map(function (item: AiAskItemsField): SerializedData { return serializeAiAskItemsField(item); }) as readonly any[], + ['dialogue_history']: + val.dialogueHistory == void 0 + ? void 0 + : (val.dialogueHistory.map(function ( + item: AiDialogueHistory + ): SerializedData { + return serializeAiDialogueHistory(item); + }) as readonly any[]), + ['include_citations']: + val.includeCitations == void 0 ? void 0 : val.includeCitations, ['ai_agent']: val.aiAgent == void 0 ? void 0 : serializeAiAgentAsk(val.aiAgent), }; @@ -218,12 +237,39 @@ export function deserializeAiAsk(val: SerializedData): AiAsk { return deserializeAiAskItemsField(itm); }) as readonly any[]) : []; + if (!(val.dialogue_history == void 0) && !sdIsList(val.dialogue_history)) { + throw new BoxSdkError({ + message: 'Expecting array for "dialogue_history" of type "AiAsk"', + }); + } + const dialogueHistory: undefined | readonly AiDialogueHistory[] = + val.dialogue_history == void 0 + ? void 0 + : sdIsList(val.dialogue_history) + ? (val.dialogue_history.map(function ( + itm: SerializedData + ): AiDialogueHistory { + return deserializeAiDialogueHistory(itm); + }) as readonly any[]) + : []; + if ( + !(val.include_citations == void 0) && + !sdIsBoolean(val.include_citations) + ) { + throw new BoxSdkError({ + message: 'Expecting boolean for "include_citations" of type "AiAsk"', + }); + } + const includeCitations: undefined | boolean = + val.include_citations == void 0 ? void 0 : val.include_citations; const aiAgent: undefined | AiAgentAsk = val.ai_agent == void 0 ? void 0 : deserializeAiAgentAsk(val.ai_agent); return { mode: mode, prompt: prompt, items: items, + dialogueHistory: dialogueHistory, + includeCitations: includeCitations, aiAgent: aiAgent, } satisfies AiAsk; } diff --git a/src/schemas/aiAskResponse.generated.ts b/src/schemas/aiAskResponse.generated.ts new file mode 100644 index 00000000..485649e1 --- /dev/null +++ b/src/schemas/aiAskResponse.generated.ts @@ -0,0 +1,99 @@ +import { serializeAiCitation } from './aiCitation.generated.js'; +import { deserializeAiCitation } from './aiCitation.generated.js'; +import { serializeDateTime } from '../internal/utils.js'; +import { deserializeDateTime } from '../internal/utils.js'; +import { AiCitation } from './aiCitation.generated.js'; +import { DateTime } from '../internal/utils.js'; +import { BoxSdkError } from '../box/errors.js'; +import { SerializedData } from '../serialization/json.js'; +import { sdIsEmpty } from '../serialization/json.js'; +import { sdIsBoolean } from '../serialization/json.js'; +import { sdIsNumber } from '../serialization/json.js'; +import { sdIsString } from '../serialization/json.js'; +import { sdIsList } from '../serialization/json.js'; +import { sdIsMap } from '../serialization/json.js'; +export interface AiAskResponse { + /** + * The answer provided by the LLM. */ + readonly answer: string; + /** + * The ISO date formatted timestamp of when the answer to the prompt was created. */ + readonly createdAt: DateTime; + /** + * The reason the response finishes. */ + readonly completionReason?: string; + /** + * The citations of the LLM's answer reference. */ + readonly citations?: readonly AiCitation[]; +} +export function serializeAiAskResponse(val: AiAskResponse): SerializedData { + return { + ['answer']: val.answer, + ['created_at']: serializeDateTime(val.createdAt), + ['completion_reason']: + val.completionReason == void 0 ? void 0 : val.completionReason, + ['citations']: + val.citations == void 0 + ? void 0 + : (val.citations.map(function (item: AiCitation): SerializedData { + return serializeAiCitation(item); + }) as readonly any[]), + }; +} +export function deserializeAiAskResponse(val: SerializedData): AiAskResponse { + if (!sdIsMap(val)) { + throw new BoxSdkError({ message: 'Expecting a map for "AiAskResponse"' }); + } + if (val.answer == void 0) { + throw new BoxSdkError({ + message: 'Expecting "answer" of type "AiAskResponse" to be defined', + }); + } + if (!sdIsString(val.answer)) { + throw new BoxSdkError({ + message: 'Expecting string for "answer" of type "AiAskResponse"', + }); + } + const answer: string = val.answer; + if (val.created_at == void 0) { + throw new BoxSdkError({ + message: 'Expecting "created_at" of type "AiAskResponse" to be defined', + }); + } + if (!sdIsString(val.created_at)) { + throw new BoxSdkError({ + message: 'Expecting string for "created_at" of type "AiAskResponse"', + }); + } + const createdAt: DateTime = deserializeDateTime(val.created_at); + if ( + !(val.completion_reason == void 0) && + !sdIsString(val.completion_reason) + ) { + throw new BoxSdkError({ + message: + 'Expecting string for "completion_reason" of type "AiAskResponse"', + }); + } + const completionReason: undefined | string = + val.completion_reason == void 0 ? void 0 : val.completion_reason; + if (!(val.citations == void 0) && !sdIsList(val.citations)) { + throw new BoxSdkError({ + message: 'Expecting array for "citations" of type "AiAskResponse"', + }); + } + const citations: undefined | readonly AiCitation[] = + val.citations == void 0 + ? void 0 + : sdIsList(val.citations) + ? (val.citations.map(function (itm: SerializedData): AiCitation { + return deserializeAiCitation(itm); + }) as readonly any[]) + : []; + return { + answer: answer, + createdAt: createdAt, + completionReason: completionReason, + citations: citations, + } satisfies AiAskResponse; +} diff --git a/src/schemas/aiCitation.generated.ts b/src/schemas/aiCitation.generated.ts new file mode 100644 index 00000000..edc2e254 --- /dev/null +++ b/src/schemas/aiCitation.generated.ts @@ -0,0 +1,77 @@ +import { BoxSdkError } from '../box/errors.js'; +import { SerializedData } from '../serialization/json.js'; +import { sdIsEmpty } from '../serialization/json.js'; +import { sdIsBoolean } from '../serialization/json.js'; +import { sdIsNumber } from '../serialization/json.js'; +import { sdIsString } from '../serialization/json.js'; +import { sdIsList } from '../serialization/json.js'; +import { sdIsMap } from '../serialization/json.js'; +export type AiCitationTypeField = 'file'; +export interface AiCitation { + /** + * The specific content from where the answer was referenced. */ + readonly content?: string; + /** + * The id of the item. */ + readonly id?: string; + /** + * The type of the item. */ + readonly type?: AiCitationTypeField; + /** + * The name of the item. */ + readonly name?: string; +} +export function serializeAiCitationTypeField( + val: AiCitationTypeField +): SerializedData { + return val; +} +export function deserializeAiCitationTypeField( + val: SerializedData +): AiCitationTypeField { + if (val == 'file') { + return val; + } + throw new BoxSdkError({ message: "Can't deserialize AiCitationTypeField" }); +} +export function serializeAiCitation(val: AiCitation): SerializedData { + return { + ['content']: val.content == void 0 ? void 0 : val.content, + ['id']: val.id == void 0 ? void 0 : val.id, + ['type']: + val.type == void 0 ? void 0 : serializeAiCitationTypeField(val.type), + ['name']: val.name == void 0 ? void 0 : val.name, + }; +} +export function deserializeAiCitation(val: SerializedData): AiCitation { + if (!sdIsMap(val)) { + throw new BoxSdkError({ message: 'Expecting a map for "AiCitation"' }); + } + if (!(val.content == void 0) && !sdIsString(val.content)) { + throw new BoxSdkError({ + message: 'Expecting string for "content" of type "AiCitation"', + }); + } + const content: undefined | string = + val.content == void 0 ? void 0 : val.content; + if (!(val.id == void 0) && !sdIsString(val.id)) { + throw new BoxSdkError({ + message: 'Expecting string for "id" of type "AiCitation"', + }); + } + const id: undefined | string = val.id == void 0 ? void 0 : val.id; + const type: undefined | AiCitationTypeField = + val.type == void 0 ? void 0 : deserializeAiCitationTypeField(val.type); + if (!(val.name == void 0) && !sdIsString(val.name)) { + throw new BoxSdkError({ + message: 'Expecting string for "name" of type "AiCitation"', + }); + } + const name: undefined | string = val.name == void 0 ? void 0 : val.name; + return { + content: content, + id: id, + type: type, + name: name, + } satisfies AiCitation; +} diff --git a/src/schemas/aiDialogueHistory.generated.ts b/src/schemas/aiDialogueHistory.generated.ts new file mode 100644 index 00000000..442eb841 --- /dev/null +++ b/src/schemas/aiDialogueHistory.generated.ts @@ -0,0 +1,65 @@ +import { serializeDateTime } from '../internal/utils.js'; +import { deserializeDateTime } from '../internal/utils.js'; +import { DateTime } from '../internal/utils.js'; +import { BoxSdkError } from '../box/errors.js'; +import { SerializedData } from '../serialization/json.js'; +import { sdIsEmpty } from '../serialization/json.js'; +import { sdIsBoolean } from '../serialization/json.js'; +import { sdIsNumber } from '../serialization/json.js'; +import { sdIsString } from '../serialization/json.js'; +import { sdIsList } from '../serialization/json.js'; +import { sdIsMap } from '../serialization/json.js'; +export interface AiDialogueHistory { + /** + * The prompt previously provided by the client and answered by the LLM. */ + readonly prompt?: string; + /** + * The answer previously provided by the LLM. */ + readonly answer?: string; + /** + * The ISO date formatted timestamp of when the previous answer to the prompt was created. */ + readonly createdAt?: DateTime; +} +export function serializeAiDialogueHistory( + val: AiDialogueHistory +): SerializedData { + return { + ['prompt']: val.prompt == void 0 ? void 0 : val.prompt, + ['answer']: val.answer == void 0 ? void 0 : val.answer, + ['created_at']: + val.createdAt == void 0 ? void 0 : serializeDateTime(val.createdAt), + }; +} +export function deserializeAiDialogueHistory( + val: SerializedData +): AiDialogueHistory { + if (!sdIsMap(val)) { + throw new BoxSdkError({ + message: 'Expecting a map for "AiDialogueHistory"', + }); + } + if (!(val.prompt == void 0) && !sdIsString(val.prompt)) { + throw new BoxSdkError({ + message: 'Expecting string for "prompt" of type "AiDialogueHistory"', + }); + } + const prompt: undefined | string = val.prompt == void 0 ? void 0 : val.prompt; + if (!(val.answer == void 0) && !sdIsString(val.answer)) { + throw new BoxSdkError({ + message: 'Expecting string for "answer" of type "AiDialogueHistory"', + }); + } + const answer: undefined | string = val.answer == void 0 ? void 0 : val.answer; + if (!(val.created_at == void 0) && !sdIsString(val.created_at)) { + throw new BoxSdkError({ + message: 'Expecting string for "created_at" of type "AiDialogueHistory"', + }); + } + const createdAt: undefined | DateTime = + val.created_at == void 0 ? void 0 : deserializeDateTime(val.created_at); + return { + prompt: prompt, + answer: answer, + createdAt: createdAt, + } satisfies AiDialogueHistory; +} diff --git a/src/schemas/aiTextGen.generated.ts b/src/schemas/aiTextGen.generated.ts index 4def7e0f..8b451f5f 100644 --- a/src/schemas/aiTextGen.generated.ts +++ b/src/schemas/aiTextGen.generated.ts @@ -1,9 +1,9 @@ +import { serializeAiDialogueHistory } from './aiDialogueHistory.generated.js'; +import { deserializeAiDialogueHistory } from './aiDialogueHistory.generated.js'; import { serializeAiAgentTextGen } from './aiAgentTextGen.generated.js'; import { deserializeAiAgentTextGen } from './aiAgentTextGen.generated.js'; -import { serializeDateTime } from '../internal/utils.js'; -import { deserializeDateTime } from '../internal/utils.js'; +import { AiDialogueHistory } from './aiDialogueHistory.generated.js'; import { AiAgentTextGen } from './aiAgentTextGen.generated.js'; -import { DateTime } from '../internal/utils.js'; import { BoxSdkError } from '../box/errors.js'; import { SerializedData } from '../serialization/json.js'; import { sdIsEmpty } from '../serialization/json.js'; @@ -24,17 +24,6 @@ export interface AiTextGenItemsField { * The content to use as context for generating new text or editing existing text. */ readonly content?: string; } -export interface AiTextGenDialogueHistoryField { - /** - * The prompt previously provided by the client and answered by the LLM. */ - readonly prompt?: string; - /** - * The answer previously provided by the LLM. */ - readonly answer?: string; - /** - * The ISO date formatted timestamp of when the previous answer to the prompt was created. */ - readonly createdAt?: DateTime; -} export interface AiTextGen { /** * The prompt provided by the client to be answered by the LLM. The prompt's length is limited to 10000 characters. */ @@ -48,7 +37,7 @@ export interface AiTextGen { readonly items: readonly AiTextGenItemsField[]; /** * The history of prompts and answers previously passed to the LLM. This provides additional context to the LLM in generating the response. */ - readonly dialogueHistory?: readonly AiTextGenDialogueHistoryField[]; + readonly dialogueHistory?: readonly AiDialogueHistory[]; readonly aiAgent?: AiAgentTextGen; } export function serializeAiTextGenItemsTypeField( @@ -101,52 +90,6 @@ export function deserializeAiTextGenItemsField( val.content == void 0 ? void 0 : val.content; return { id: id, type: type, content: content } satisfies AiTextGenItemsField; } -export function serializeAiTextGenDialogueHistoryField( - val: AiTextGenDialogueHistoryField -): SerializedData { - return { - ['prompt']: val.prompt == void 0 ? void 0 : val.prompt, - ['answer']: val.answer == void 0 ? void 0 : val.answer, - ['created_at']: - val.createdAt == void 0 ? void 0 : serializeDateTime(val.createdAt), - }; -} -export function deserializeAiTextGenDialogueHistoryField( - val: SerializedData -): AiTextGenDialogueHistoryField { - if (!sdIsMap(val)) { - throw new BoxSdkError({ - message: 'Expecting a map for "AiTextGenDialogueHistoryField"', - }); - } - if (!(val.prompt == void 0) && !sdIsString(val.prompt)) { - throw new BoxSdkError({ - message: - 'Expecting string for "prompt" of type "AiTextGenDialogueHistoryField"', - }); - } - const prompt: undefined | string = val.prompt == void 0 ? void 0 : val.prompt; - if (!(val.answer == void 0) && !sdIsString(val.answer)) { - throw new BoxSdkError({ - message: - 'Expecting string for "answer" of type "AiTextGenDialogueHistoryField"', - }); - } - const answer: undefined | string = val.answer == void 0 ? void 0 : val.answer; - if (!(val.created_at == void 0) && !sdIsString(val.created_at)) { - throw new BoxSdkError({ - message: - 'Expecting string for "created_at" of type "AiTextGenDialogueHistoryField"', - }); - } - const createdAt: undefined | DateTime = - val.created_at == void 0 ? void 0 : deserializeDateTime(val.created_at); - return { - prompt: prompt, - answer: answer, - createdAt: createdAt, - } satisfies AiTextGenDialogueHistoryField; -} export function serializeAiTextGen(val: AiTextGen): SerializedData { return { ['prompt']: val.prompt, @@ -159,9 +102,9 @@ export function serializeAiTextGen(val: AiTextGen): SerializedData { val.dialogueHistory == void 0 ? void 0 : (val.dialogueHistory.map(function ( - item: AiTextGenDialogueHistoryField + item: AiDialogueHistory ): SerializedData { - return serializeAiTextGenDialogueHistoryField(item); + return serializeAiDialogueHistory(item); }) as readonly any[]), ['ai_agent']: val.aiAgent == void 0 ? void 0 : serializeAiAgentTextGen(val.aiAgent), @@ -202,14 +145,14 @@ export function deserializeAiTextGen(val: SerializedData): AiTextGen { message: 'Expecting array for "dialogue_history" of type "AiTextGen"', }); } - const dialogueHistory: undefined | readonly AiTextGenDialogueHistoryField[] = + const dialogueHistory: undefined | readonly AiDialogueHistory[] = val.dialogue_history == void 0 ? void 0 : sdIsList(val.dialogue_history) ? (val.dialogue_history.map(function ( itm: SerializedData - ): AiTextGenDialogueHistoryField { - return deserializeAiTextGenDialogueHistoryField(itm); + ): AiDialogueHistory { + return deserializeAiDialogueHistory(itm); }) as readonly any[]) : []; const aiAgent: undefined | AiAgentTextGen = diff --git a/src/test/ai.generated.test.ts b/src/test/ai.generated.test.ts index 838e8e87..4b307467 100644 --- a/src/test/ai.generated.test.ts +++ b/src/test/ai.generated.test.ts @@ -1,7 +1,7 @@ import { serializeFileFull } from '../schemas/fileFull.generated.js'; import { deserializeFileFull } from '../schemas/fileFull.generated.js'; -import { serializeAiResponse } from '../schemas/aiResponse.generated.js'; -import { deserializeAiResponse } from '../schemas/aiResponse.generated.js'; +import { serializeAiAskResponse } from '../schemas/aiAskResponse.generated.js'; +import { deserializeAiAskResponse } from '../schemas/aiAskResponse.generated.js'; import { serializeAiAsk } from '../schemas/aiAsk.generated.js'; import { deserializeAiAsk } from '../schemas/aiAsk.generated.js'; import { serializeAiAskModeField } from '../schemas/aiAsk.generated.js'; @@ -10,14 +10,16 @@ import { serializeAiAskItemsField } from '../schemas/aiAsk.generated.js'; import { deserializeAiAskItemsField } from '../schemas/aiAsk.generated.js'; import { serializeAiAskItemsTypeField } from '../schemas/aiAsk.generated.js'; import { deserializeAiAskItemsTypeField } from '../schemas/aiAsk.generated.js'; +import { serializeAiResponse } from '../schemas/aiResponse.generated.js'; +import { deserializeAiResponse } from '../schemas/aiResponse.generated.js'; import { serializeAiTextGen } from '../schemas/aiTextGen.generated.js'; import { deserializeAiTextGen } from '../schemas/aiTextGen.generated.js'; import { serializeAiTextGenItemsField } from '../schemas/aiTextGen.generated.js'; import { deserializeAiTextGenItemsField } from '../schemas/aiTextGen.generated.js'; import { serializeAiTextGenItemsTypeField } from '../schemas/aiTextGen.generated.js'; import { deserializeAiTextGenItemsTypeField } from '../schemas/aiTextGen.generated.js'; -import { serializeAiTextGenDialogueHistoryField } from '../schemas/aiTextGen.generated.js'; -import { deserializeAiTextGenDialogueHistoryField } from '../schemas/aiTextGen.generated.js'; +import { serializeAiDialogueHistory } from '../schemas/aiDialogueHistory.generated.js'; +import { deserializeAiDialogueHistory } from '../schemas/aiDialogueHistory.generated.js'; import { serializeAiAgentAskOrAiAgentTextGen } from '../schemas/aiAgentAskOrAiAgentTextGen.generated.js'; import { deserializeAiAgentAskOrAiAgentTextGen } from '../schemas/aiAgentAskOrAiAgentTextGen.generated.js'; import { serializeGetAiAgentDefaultConfigQueryParamsModeField } from '../managers/ai.generated.js'; @@ -28,15 +30,16 @@ import { serializeAiAgentTextGen } from '../schemas/aiAgentTextGen.generated.js' import { deserializeAiAgentTextGen } from '../schemas/aiAgentTextGen.generated.js'; import { BoxClient } from '../client.generated.js'; import { FileFull } from '../schemas/fileFull.generated.js'; -import { AiResponse } from '../schemas/aiResponse.generated.js'; +import { AiAskResponse } from '../schemas/aiAskResponse.generated.js'; import { AiAsk } from '../schemas/aiAsk.generated.js'; import { AiAskModeField } from '../schemas/aiAsk.generated.js'; import { AiAskItemsField } from '../schemas/aiAsk.generated.js'; import { AiAskItemsTypeField } from '../schemas/aiAsk.generated.js'; +import { AiResponse } from '../schemas/aiResponse.generated.js'; import { AiTextGen } from '../schemas/aiTextGen.generated.js'; import { AiTextGenItemsField } from '../schemas/aiTextGen.generated.js'; import { AiTextGenItemsTypeField } from '../schemas/aiTextGen.generated.js'; -import { AiTextGenDialogueHistoryField } from '../schemas/aiTextGen.generated.js'; +import { AiDialogueHistory } from '../schemas/aiDialogueHistory.generated.js'; import { AiAgentAskOrAiAgentTextGen } from '../schemas/aiAgentAskOrAiAgentTextGen.generated.js'; import { GetAiAgentDefaultConfigQueryParams } from '../managers/ai.generated.js'; import { GetAiAgentDefaultConfigQueryParamsModeField } from '../managers/ai.generated.js'; @@ -58,7 +61,7 @@ import { sdIsMap } from '../serialization/json.js'; export const client: BoxClient = getDefaultClient(); test('testAskAISingleItem', async function testAskAISingleItem(): Promise { const fileToAsk: FileFull = await uploadNewFile(); - const response: AiResponse = await client.ai.createAiAsk({ + const response: AiAskResponse = await client.ai.createAiAsk({ mode: 'single_item_qa' as AiAskModeField, prompt: 'which direction sun rises', items: [ @@ -80,7 +83,7 @@ test('testAskAISingleItem', async function testAskAISingleItem(): Promise { test('testAskAIMultipleItems', async function testAskAIMultipleItems(): Promise { const fileToAsk1: FileFull = await uploadNewFile(); const fileToAsk2: FileFull = await uploadNewFile(); - const response: AiResponse = await client.ai.createAiAsk({ + const response: AiAskResponse = await client.ai.createAiAsk({ mode: 'multiple_item_qa' as AiAskModeField, prompt: 'Which direction sun rises?', items: [ @@ -122,12 +125,12 @@ test('testAITextGenWithDialogueHistory', async function testAITextGenWithDialogu prompt: 'What does the earth go around?', answer: 'The sun', createdAt: dateTimeFromString('2021-01-01T00:00:00Z'), - } satisfies AiTextGenDialogueHistoryField, + } satisfies AiDialogueHistory, { prompt: 'On Earth, where does the sun rise?', answer: 'East', createdAt: dateTimeFromString('2021-01-01T00:00:00Z'), - } satisfies AiTextGenDialogueHistoryField, + } satisfies AiDialogueHistory, ], } satisfies AiTextGen); if (!(response.answer.includes('sun') as boolean)) { diff --git a/src/test/chunkedUploads.generated.test.ts b/src/test/chunkedUploads.generated.test.ts index 7776fe1a..ada81265 100644 --- a/src/test/chunkedUploads.generated.test.ts +++ b/src/test/chunkedUploads.generated.test.ts @@ -1,11 +1,55 @@ +import { serializeCreateFileUploadSessionRequestBody } from '../managers/chunkedUploads.generated.js'; +import { deserializeCreateFileUploadSessionRequestBody } from '../managers/chunkedUploads.generated.js'; +import { serializeCreateFileUploadSessionCommitRequestBody } from '../managers/chunkedUploads.generated.js'; +import { deserializeCreateFileUploadSessionCommitRequestBody } from '../managers/chunkedUploads.generated.js'; +import { serializeCreateFileUploadSessionCommitByUrlRequestBody } from '../managers/chunkedUploads.generated.js'; +import { deserializeCreateFileUploadSessionCommitByUrlRequestBody } from '../managers/chunkedUploads.generated.js'; import { serializeFile } from '../schemas/file.generated.js'; import { deserializeFile } from '../schemas/file.generated.js'; -import { BoxClient } from '../client.generated.js'; -import { ByteStream } from '../internal/utils.js'; +import { serializeUploadSession } from '../schemas/uploadSession.generated.js'; +import { deserializeUploadSession } from '../schemas/uploadSession.generated.js'; +import { serializeUploadPart } from '../schemas/uploadPart.generated.js'; +import { deserializeUploadPart } from '../schemas/uploadPart.generated.js'; +import { serializeUploadParts } from '../schemas/uploadParts.generated.js'; +import { deserializeUploadParts } from '../schemas/uploadParts.generated.js'; +import { serializeUploadedPart } from '../schemas/uploadedPart.generated.js'; +import { deserializeUploadedPart } from '../schemas/uploadedPart.generated.js'; +import { serializeFiles } from '../schemas/files.generated.js'; +import { deserializeFiles } from '../schemas/files.generated.js'; +import { UploadFilePartHeadersInput } from '../managers/chunkedUploads.generated.js'; +import { CreateFileUploadSessionCommitHeadersInput } from '../managers/chunkedUploads.generated.js'; +import { UploadFilePartByUrlHeadersInput } from '../managers/chunkedUploads.generated.js'; +import { CreateFileUploadSessionCommitByUrlHeadersInput } from '../managers/chunkedUploads.generated.js'; +import { Buffer } from '../internal/utils.js'; +import { HashName } from '../internal/utils.js'; +import { UploadFilePartHeaders } from '../managers/chunkedUploads.generated.js'; +import { CreateFileUploadSessionRequestBody } from '../managers/chunkedUploads.generated.js'; +import { Iterator } from '../internal/utils.js'; +import { CreateFileUploadSessionCommitRequestBody } from '../managers/chunkedUploads.generated.js'; +import { CreateFileUploadSessionCommitHeaders } from '../managers/chunkedUploads.generated.js'; +import { UploadFilePartByUrlHeaders } from '../managers/chunkedUploads.generated.js'; +import { CreateFileUploadSessionCommitByUrlRequestBody } from '../managers/chunkedUploads.generated.js'; +import { CreateFileUploadSessionCommitByUrlHeaders } from '../managers/chunkedUploads.generated.js'; +import { generateByteStreamFromBuffer } from '../internal/utils.js'; +import { hexToBase64 } from '../internal/utils.js'; +import { iterateChunks } from '../internal/utils.js'; +import { readByteStream } from '../internal/utils.js'; +import { reduceIterator } from '../internal/utils.js'; +import { Hash } from '../internal/utils.js'; +import { bufferLength } from '../internal/utils.js'; import { getUuid } from '../internal/utils.js'; import { generateByteStream } from '../internal/utils.js'; +import { ByteStream } from '../internal/utils.js'; import { getDefaultClient } from './commons.generated.js'; import { File } from '../schemas/file.generated.js'; +import { UploadSession } from '../schemas/uploadSession.generated.js'; +import { UploadPart } from '../schemas/uploadPart.generated.js'; +import { UploadParts } from '../schemas/uploadParts.generated.js'; +import { UploadedPart } from '../schemas/uploadedPart.generated.js'; +import { Files } from '../schemas/files.generated.js'; +import { BoxClient } from '../client.generated.js'; +import { toString } from '../internal/utils.js'; +import { sdToJson } from '../serialization/json.js'; import { SerializedData } from '../serialization/json.js'; import { sdIsEmpty } from '../serialization/json.js'; import { sdIsBoolean } from '../serialization/json.js'; @@ -14,7 +58,292 @@ import { sdIsString } from '../serialization/json.js'; import { sdIsList } from '../serialization/json.js'; import { sdIsMap } from '../serialization/json.js'; export const client: BoxClient = getDefaultClient(); -test('testChunkedUpload', async function testChunkedUpload(): Promise { +export class TestPartAccumulator { + readonly lastIndex!: number; + readonly parts!: readonly UploadPart[]; + readonly fileSize!: number; + readonly uploadPartUrl: string = ''; + readonly uploadSessionId: string = ''; + readonly fileHash!: Hash; + constructor( + fields: Omit & + Partial> + ) { + if (fields.lastIndex) { + this.lastIndex = fields.lastIndex; + } + if (fields.parts) { + this.parts = fields.parts; + } + if (fields.fileSize) { + this.fileSize = fields.fileSize; + } + if (fields.uploadPartUrl) { + this.uploadPartUrl = fields.uploadPartUrl; + } + if (fields.uploadSessionId) { + this.uploadSessionId = fields.uploadSessionId; + } + if (fields.fileHash) { + this.fileHash = fields.fileHash; + } + } +} +export interface TestPartAccumulatorInput { + readonly lastIndex: number; + readonly parts: readonly UploadPart[]; + readonly fileSize: number; + readonly uploadPartUrl?: string; + readonly uploadSessionId?: string; + readonly fileHash: Hash; +} +async function reducerById( + accInput: TestPartAccumulatorInput, + chunk: ByteStream +): Promise { + const acc: TestPartAccumulator = new TestPartAccumulator({ + lastIndex: accInput.lastIndex, + parts: accInput.parts, + fileSize: accInput.fileSize, + uploadPartUrl: accInput.uploadPartUrl, + uploadSessionId: accInput.uploadSessionId, + fileHash: accInput.fileHash, + }); + const lastIndex: number = acc.lastIndex; + const parts: readonly UploadPart[] = acc.parts; + const chunkBuffer: Buffer = await readByteStream(chunk); + const hash: Hash = new Hash({ algorithm: 'sha1' as HashName }); + hash.updateHash(chunkBuffer); + const sha1: string = await hash.digestHash('base64'); + const digest: string = ''.concat('sha=', sha1) as string; + const chunkSize: number = bufferLength(chunkBuffer); + const bytesStart: number = lastIndex + 1; + const bytesEnd: number = lastIndex + chunkSize; + const contentRange: string = ''.concat( + 'bytes ', + (toString(bytesStart) as string)!, + '-', + (toString(bytesEnd) as string)!, + '/', + (toString(acc.fileSize) as string)! + ) as string; + const uploadedPart: UploadedPart = await client.chunkedUploads.uploadFilePart( + acc.uploadSessionId, + generateByteStreamFromBuffer(chunkBuffer), + { + digest: digest, + contentRange: contentRange, + } satisfies UploadFilePartHeadersInput + ); + const part: UploadPart = uploadedPart.part!; + const partSha1: string = hexToBase64(part.sha1!); + if (!(partSha1 == sha1)) { + throw new Error('Assertion failed'); + } + if (!(part.size! == chunkSize)) { + throw new Error('Assertion failed'); + } + if (!(part.offset! == bytesStart)) { + throw new Error('Assertion failed'); + } + acc.fileHash.updateHash(chunkBuffer); + return new TestPartAccumulator({ + lastIndex: bytesEnd, + parts: parts.concat([part]), + fileSize: acc.fileSize, + uploadSessionId: acc.uploadSessionId, + fileHash: acc.fileHash, + }); +} +async function reducerByUrl( + accInput: TestPartAccumulatorInput, + chunk: ByteStream +): Promise { + const acc: TestPartAccumulator = new TestPartAccumulator({ + lastIndex: accInput.lastIndex, + parts: accInput.parts, + fileSize: accInput.fileSize, + uploadPartUrl: accInput.uploadPartUrl, + uploadSessionId: accInput.uploadSessionId, + fileHash: accInput.fileHash, + }); + const lastIndex: number = acc.lastIndex; + const parts: readonly UploadPart[] = acc.parts; + const chunkBuffer: Buffer = await readByteStream(chunk); + const hash: Hash = new Hash({ algorithm: 'sha1' as HashName }); + hash.updateHash(chunkBuffer); + const sha1: string = await hash.digestHash('base64'); + const digest: string = ''.concat('sha=', sha1) as string; + const chunkSize: number = bufferLength(chunkBuffer); + const bytesStart: number = lastIndex + 1; + const bytesEnd: number = lastIndex + chunkSize; + const contentRange: string = ''.concat( + 'bytes ', + (toString(bytesStart) as string)!, + '-', + (toString(bytesEnd) as string)!, + '/', + (toString(acc.fileSize) as string)! + ) as string; + const uploadedPart: UploadedPart = + await client.chunkedUploads.uploadFilePartByUrl( + acc.uploadPartUrl, + generateByteStreamFromBuffer(chunkBuffer), + { + digest: digest, + contentRange: contentRange, + } satisfies UploadFilePartByUrlHeadersInput + ); + const part: UploadPart = uploadedPart.part!; + const partSha1: string = hexToBase64(part.sha1!); + if (!(partSha1 == sha1)) { + throw new Error('Assertion failed'); + } + if (!(part.size! == chunkSize)) { + throw new Error('Assertion failed'); + } + if (!(part.offset! == bytesStart)) { + throw new Error('Assertion failed'); + } + acc.fileHash.updateHash(chunkBuffer); + return new TestPartAccumulator({ + lastIndex: bytesEnd, + parts: parts.concat([part]), + fileSize: acc.fileSize, + uploadPartUrl: acc.uploadPartUrl, + fileHash: acc.fileHash, + }); +} +test('testChunkedManualProcessById', async function testChunkedManualProcessById(): Promise { + const fileSize: number = 20 * 1024 * 1024; + const fileByteStream: ByteStream = generateByteStream(fileSize); + const fileName: string = getUuid(); + const parentFolderId: string = '0'; + const uploadSession: UploadSession = + await client.chunkedUploads.createFileUploadSession({ + fileName: fileName, + fileSize: fileSize, + folderId: parentFolderId, + } satisfies CreateFileUploadSessionRequestBody); + const uploadSessionId: string = uploadSession.id!; + const partSize: number = uploadSession.partSize!; + const totalParts: number = uploadSession.totalParts!; + if (!(partSize * totalParts >= fileSize)) { + throw new Error('Assertion failed'); + } + if (!(uploadSession.numPartsProcessed == 0)) { + throw new Error('Assertion failed'); + } + const fileHash: Hash = new Hash({ algorithm: 'sha1' as HashName }); + const chunksIterator: Iterator = iterateChunks( + fileByteStream, + partSize, + fileSize + ); + const results: TestPartAccumulator = await reduceIterator( + chunksIterator, + reducerById, + new TestPartAccumulator({ + lastIndex: -1, + parts: [], + fileSize: fileSize, + uploadSessionId: uploadSessionId, + fileHash: fileHash, + }) + ); + const parts: readonly UploadPart[] = results.parts; + const processedSessionParts: UploadParts = + await client.chunkedUploads.getFileUploadSessionParts(uploadSessionId); + if (!(processedSessionParts.totalCount! == totalParts)) { + throw new Error('Assertion failed'); + } + const processedSession: UploadSession = + await client.chunkedUploads.getFileUploadSessionById(uploadSessionId); + if (!(processedSession.id! == uploadSessionId)) { + throw new Error('Assertion failed'); + } + const sha1: string = await fileHash.digestHash('base64'); + const digest: string = ''.concat('sha=', sha1) as string; + const committedSession: Files = + await client.chunkedUploads.createFileUploadSessionCommit( + uploadSessionId, + { parts: parts } satisfies CreateFileUploadSessionCommitRequestBody, + { digest: digest } satisfies CreateFileUploadSessionCommitHeadersInput + ); + if (!(committedSession.entries![0].name! == fileName)) { + throw new Error('Assertion failed'); + } + await client.chunkedUploads.deleteFileUploadSessionById(uploadSessionId); +}); +test('testChunkedManualProcessByUrl', async function testChunkedManualProcessByUrl(): Promise { + const fileSize: number = 20 * 1024 * 1024; + const fileByteStream: ByteStream = generateByteStream(fileSize); + const fileName: string = getUuid(); + const parentFolderId: string = '0'; + const uploadSession: UploadSession = + await client.chunkedUploads.createFileUploadSession({ + fileName: fileName, + fileSize: fileSize, + folderId: parentFolderId, + } satisfies CreateFileUploadSessionRequestBody); + const uploadPartUrl: string = uploadSession.sessionEndpoints!.uploadPart!; + const commitUrl: string = uploadSession.sessionEndpoints!.commit!; + const listPartsUrl: string = uploadSession.sessionEndpoints!.listParts!; + const statusUrl: string = uploadSession.sessionEndpoints!.status!; + const abortUrl: string = uploadSession.sessionEndpoints!.abort!; + const uploadSessionId: string = uploadSession.id!; + const partSize: number = uploadSession.partSize!; + const totalParts: number = uploadSession.totalParts!; + if (!(partSize * totalParts >= fileSize)) { + throw new Error('Assertion failed'); + } + if (!(uploadSession.numPartsProcessed == 0)) { + throw new Error('Assertion failed'); + } + const fileHash: Hash = new Hash({ algorithm: 'sha1' as HashName }); + const chunksIterator: Iterator = iterateChunks( + fileByteStream, + partSize, + fileSize + ); + const results: TestPartAccumulator = await reduceIterator( + chunksIterator, + reducerByUrl, + new TestPartAccumulator({ + lastIndex: -1, + parts: [], + fileSize: fileSize, + uploadPartUrl: uploadPartUrl, + fileHash: fileHash, + }) + ); + const parts: readonly UploadPart[] = results.parts; + const processedSessionParts: UploadParts = + await client.chunkedUploads.getFileUploadSessionPartsByUrl(listPartsUrl); + if (!(processedSessionParts.totalCount! == totalParts)) { + throw new Error('Assertion failed'); + } + const processedSession: UploadSession = + await client.chunkedUploads.getFileUploadSessionByUrl(statusUrl); + if (!(processedSession.id! == uploadSessionId)) { + throw new Error('Assertion failed'); + } + const sha1: string = await fileHash.digestHash('base64'); + const digest: string = ''.concat('sha=', sha1) as string; + const committedSession: Files = + await client.chunkedUploads.createFileUploadSessionCommitByUrl( + commitUrl, + { parts: parts } satisfies CreateFileUploadSessionCommitByUrlRequestBody, + { + digest: digest, + } satisfies CreateFileUploadSessionCommitByUrlHeadersInput + ); + if (!(committedSession.entries![0].name! == fileName)) { + throw new Error('Assertion failed'); + } + await client.chunkedUploads.deleteFileUploadSessionByUrl(abortUrl); +}); +test('testChunkedUploadConvenienceMethod', async function testChunkedUploadConvenienceMethod(): Promise { const fileSize: number = 20 * 1024 * 1024; const fileByteStream: ByteStream = generateByteStream(fileSize); const fileName: string = getUuid();