@unofficialbox/box-open-sdk 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +85 -7
  2. package/dist/cjs/index.js +2 -1
  3. package/dist/cjs/managers/search.js +1 -1
  4. package/dist/cjs/managers/transfer.js +1 -1
  5. package/dist/cjs/managers/uploads.js +2 -2
  6. package/dist/esm/index.js +1 -0
  7. package/dist/esm/managers/search.js +1 -1
  8. package/dist/esm/managers/transfer.js +1 -1
  9. package/dist/esm/managers/uploads.js +2 -2
  10. package/dist/types/index.d.ts +1 -0
  11. package/dist/types/managers/search.d.ts +1 -1
  12. package/dist/types/managers/transfer.d.ts +3 -3
  13. package/dist/types/managers/uploads.d.ts +6 -6
  14. package/docs/auth.md +10 -10
  15. package/docs/errors.md +2 -2
  16. package/docs/managers/ai.md +30 -0
  17. package/docs/managers/ai_studio.md +32 -0
  18. package/docs/managers/app_item_associations.md +16 -0
  19. package/docs/managers/archives.md +26 -0
  20. package/docs/managers/authorization.md +24 -0
  21. package/docs/managers/automate_workflows.md +14 -0
  22. package/docs/managers/avatars.md +18 -0
  23. package/docs/managers/chunked_uploads.md +44 -0
  24. package/docs/managers/classifications.md +24 -0
  25. package/docs/managers/collaboration_allowlist_entries.md +26 -0
  26. package/docs/managers/collaboration_allowlist_exempt_targets.md +26 -0
  27. package/docs/managers/collections.md +22 -0
  28. package/docs/managers/comments.md +32 -0
  29. package/docs/managers/device_pinners.md +20 -0
  30. package/docs/managers/docgen.md +28 -0
  31. package/docs/managers/docgen_template.md +42 -0
  32. package/docs/managers/downloads.md +6 -0
  33. package/docs/managers/email_aliases.md +18 -0
  34. package/docs/managers/enterprise_configurations.md +6 -0
  35. package/docs/managers/events.md +12 -0
  36. package/docs/managers/external_users.md +6 -0
  37. package/docs/managers/file_classifications.md +24 -0
  38. package/docs/managers/file_metadata.md +30 -0
  39. package/docs/managers/file_requests.md +24 -0
  40. package/docs/managers/file_version_legal_holds.md +14 -0
  41. package/docs/managers/file_version_retentions.md +14 -0
  42. package/docs/managers/file_versions.md +32 -0
  43. package/docs/managers/file_watermarks.md +18 -0
  44. package/docs/managers/files.md +30 -0
  45. package/docs/managers/folder_classifications.md +24 -0
  46. package/docs/managers/folder_locks.md +18 -0
  47. package/docs/managers/folder_metadata.md +30 -0
  48. package/docs/managers/folder_watermarks.md +18 -0
  49. package/docs/managers/folders.md +38 -0
  50. package/docs/managers/groups.md +32 -0
  51. package/docs/managers/hub_collaborations.md +32 -0
  52. package/docs/managers/hub_document.md +16 -0
  53. package/docs/managers/hub_items.md +14 -0
  54. package/docs/managers/hubs.md +46 -0
  55. package/docs/managers/integration_mappings.md +50 -0
  56. package/docs/managers/invites.md +12 -0
  57. package/docs/managers/legal_hold_policies.md +32 -0
  58. package/docs/managers/legal_hold_policy_assignments.md +42 -0
  59. package/docs/managers/list_collaborations.md +32 -0
  60. package/docs/managers/memberships.md +40 -0
  61. package/docs/managers/metadata_cascade_policies.md +32 -0
  62. package/docs/managers/metadata_taxonomies.md +96 -0
  63. package/docs/managers/metadata_templates.md +54 -0
  64. package/docs/managers/notes.md +6 -0
  65. package/docs/managers/recent_items.md +8 -0
  66. package/docs/managers/retention_policies.md +32 -0
  67. package/docs/managers/retention_policy_assignments.md +42 -0
  68. package/docs/managers/search.md +13 -1
  69. package/docs/managers/session_termination.md +12 -0
  70. package/docs/managers/shared_links_app_items.md +6 -0
  71. package/docs/managers/shared_links_files.md +30 -0
  72. package/docs/managers/shared_links_folders.md +30 -0
  73. package/docs/managers/shared_links_web_links.md +30 -0
  74. package/docs/managers/shield_information_barrier_reports.md +20 -0
  75. package/docs/managers/shield_information_barrier_segment_members.md +26 -0
  76. package/docs/managers/shield_information_barrier_segment_restrictions.md +26 -0
  77. package/docs/managers/shield_information_barrier_segments.md +32 -0
  78. package/docs/managers/shield_information_barriers.md +26 -0
  79. package/docs/managers/shield_lists.md +30 -0
  80. package/docs/managers/sign_requests.md +32 -0
  81. package/docs/managers/sign_templates.md +14 -0
  82. package/docs/managers/skills.md +30 -0
  83. package/docs/managers/storage_policies.md +14 -0
  84. package/docs/managers/storage_policy_assignments.md +32 -0
  85. package/docs/managers/task_assignments.md +30 -0
  86. package/docs/managers/tasks.md +30 -0
  87. package/docs/managers/terms_of_service_user_statuses.md +18 -0
  88. package/docs/managers/terms_of_services.md +24 -0
  89. package/docs/managers/transfer.md +7 -1
  90. package/docs/managers/trashed_files.md +18 -0
  91. package/docs/managers/trashed_folders.md +18 -0
  92. package/docs/managers/trashed_items.md +8 -0
  93. package/docs/managers/trashed_web_links.md +18 -0
  94. package/docs/managers/uploads.md +20 -2
  95. package/docs/managers/user_collaborations.md +24 -0
  96. package/docs/managers/users.md +38 -0
  97. package/docs/managers/web_links.md +24 -0
  98. package/docs/managers/webhooks.md +32 -0
  99. package/docs/managers/workflows.md +14 -0
  100. package/docs/managers/zip_downloads.md +18 -0
  101. package/package.json +3 -2
package/README.md CHANGED
@@ -1,13 +1,91 @@
1
- <!-- Generated by box-gantry. DO NOT EDIT. -->
2
- # Box SDK
1
+ <!-- Generated by box-gantry. DO NOT EDIT — regenerate from the specs instead. -->
2
+ ![Box Open SDK for TypeScript](assets/banner.svg)
3
3
 
4
- A generated TypeScript SDK for the Box API — a dual ESM/CJS package with
5
- shipped type declarations.
4
+ # @unofficialbox/box-open-sdk
5
+
6
+ [![npm](https://img.shields.io/npm/v/@unofficialbox/box-open-sdk.svg)](https://www.npmjs.com/package/@unofficialbox/box-open-sdk)
7
+
8
+ A **community, unofficial** Box API client for TypeScript — fully typed models
9
+ for the whole Box surface, one manager per API area behind a single `Client`,
10
+ and a `fetch`-based runtime with retry, backoff, and token refresh. Ships as a
11
+ **dual ESM/CJS** package with bundled `.d.ts` declarations; no runtime
12
+ dependencies.
13
+
14
+ > **Not affiliated with, authorized, or endorsed by Box, Inc.** "Box" is a
15
+ > trademark of Box, Inc. This is an independent, generated client.
16
+
17
+ ## Install
18
+
19
+ ```sh
20
+ npm install @unofficialbox/box-open-sdk
21
+ ```
22
+
23
+ ## Quickstart
24
+
25
+ Authenticate, look up the current user, create a folder, upload a file, extract
26
+ its fields with Box AI, tag it with metadata, and query for it — end to end:
6
27
 
7
28
  ```ts
8
- import { Client, runtime } from '@unofficialbox/box-open-sdk';
9
- const client = new Client(runtime.developerToken('DEVELOPER_TOKEN'));
29
+ import { Client, auth } from '@unofficialbox/box-open-sdk';
30
+
31
+ // Client Credentials Grant (server-to-server); developer token, OAuth, and JWT
32
+ // also live in the `auth` namespace.
33
+ const client = new Client(auth.clientCredentials({
34
+ clientId: 'CLIENT_ID',
35
+ clientSecret: 'CLIENT_SECRET',
36
+ enterpriseId: 'ENTERPRISE_ID',
37
+ }));
38
+
39
+ // The current user.
40
+ const me = await client.users.getMe();
41
+ console.log(`authenticated as ${me.id}`);
42
+
43
+ // Create a folder at the account root ("0").
44
+ const folder = await client.folders.create({
45
+ name: 'Invoices',
46
+ parent: { id: '0' },
47
+ });
48
+
49
+ // Upload a file into it.
50
+ const uploaded = await client.uploads.uploadFile({
51
+ attributes: { name: 'invoice.pdf', parent: { id: folder.id } },
52
+ file: new Blob(['<file bytes>']),
53
+ });
54
+ const fileId = uploaded.entries![0].id;
55
+
56
+ // Extract fields from the file with Box AI.
57
+ const answer = await client.ai.extract({
58
+ prompt: 'Extract the invoice number and total amount.',
59
+ items: [{ id: fileId, type: 'file' }],
60
+ });
61
+ console.log(answer);
62
+
63
+ // Attach that metadata to the file (an enterprise template).
64
+ await client.fileMetadata.createFileMetadata(fileId, 'enterprise', 'invoiceData', {
65
+ invoiceNumber: 'INV-0042',
66
+ total: 1250,
67
+ });
68
+
69
+ // Query for files carrying that metadata.
70
+ const results = await client.search.queryByMetadata({
71
+ from: 'enterprise_0.invoiceData',
72
+ ancestor_folder_id: folder.id,
73
+ });
74
+ console.log(results);
10
75
  ```
11
76
 
12
- See [`docs/`](./docs/README.md) for the manager reference and the
77
+ ## Authentication
78
+
79
+ The runtime implements Box's four auth flows — **developer token**, **client
80
+ credentials (CCG)**, **OAuth 2.0** (with a pluggable refresh-token store), and
81
+ **JWT** (server auth, exposed as the Node-only `./jwt` subpath). See
82
+ [`docs/auth.md`](./docs/auth.md).
83
+
84
+ ## Documentation
85
+
86
+ The [`docs/`](./docs/README.md) tree carries the per-manager reference and the
13
87
  authentication, pagination, and errors guides.
88
+
89
+ ## License
90
+
91
+ MIT. Generated by [box-gantry](https://github.com/unofficialbox/box-gantry).
package/dist/cjs/index.js CHANGED
@@ -34,10 +34,11 @@ var __importStar = (this && this.__importStar) || (function () {
34
34
  };
35
35
  })();
36
36
  Object.defineProperty(exports, "__esModule", { value: true });
37
- exports.buildinfo = exports.runtime = exports.managers = exports.models = exports.Client = void 0;
37
+ exports.buildinfo = exports.auth = exports.runtime = exports.managers = exports.models = exports.Client = void 0;
38
38
  var client_js_1 = require("./client.js");
39
39
  Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return client_js_1.Client; } });
40
40
  exports.models = __importStar(require("./models/index.js"));
41
41
  exports.managers = __importStar(require("./managers/index.js"));
42
42
  exports.runtime = __importStar(require("./runtime.js"));
43
+ exports.auth = __importStar(require("./auth.js"));
43
44
  exports.buildinfo = __importStar(require("./buildinfo.js"));
@@ -43,7 +43,7 @@ class SearchManager {
43
43
  constructor(session) {
44
44
  this.session = session;
45
45
  }
46
- async createMetadataQueryExecuteRead(body) {
46
+ async queryByMetadata(body) {
47
47
  let url = this.session.baseUrl("api");
48
48
  url += "/metadata_queries";
49
49
  url += "/execute_read";
@@ -43,7 +43,7 @@ class TransferManager {
43
43
  constructor(session) {
44
44
  this.session = session;
45
45
  }
46
- async updateUserFolder0(userId, body, opts) {
46
+ async transferFolders(userId, body, opts) {
47
47
  let url = this.session.baseUrl("api");
48
48
  url += "/users";
49
49
  url += '/' + (0, internal_js_1.pathEscape)(userId);
@@ -43,7 +43,7 @@ class UploadsManager {
43
43
  constructor(session) {
44
44
  this.session = session;
45
45
  }
46
- async createFileContent(fileId, body, opts) {
46
+ async uploadFileVersion(fileId, body, opts) {
47
47
  let url = this.session.baseUrl("upload");
48
48
  url += "/files";
49
49
  url += '/' + (0, internal_js_1.pathEscape)(fileId);
@@ -65,7 +65,7 @@ class UploadsManager {
65
65
  const data = runtime.responseBytes(resp);
66
66
  return JSON.parse(new TextDecoder().decode(data));
67
67
  }
68
- async createFileContent2(body, opts) {
68
+ async uploadFile(body, opts) {
69
69
  let url = this.session.baseUrl("upload");
70
70
  url += "/files";
71
71
  url += "/content";
package/dist/esm/index.js CHANGED
@@ -3,4 +3,5 @@ export { Client } from './client.js';
3
3
  export * as models from './models/index.js';
4
4
  export * as managers from './managers/index.js';
5
5
  export * as runtime from './runtime.js';
6
+ export * as auth from './auth.js';
6
7
  export * as buildinfo from './buildinfo.js';
@@ -7,7 +7,7 @@ export class SearchManager {
7
7
  constructor(session) {
8
8
  this.session = session;
9
9
  }
10
- async createMetadataQueryExecuteRead(body) {
10
+ async queryByMetadata(body) {
11
11
  let url = this.session.baseUrl("api");
12
12
  url += "/metadata_queries";
13
13
  url += "/execute_read";
@@ -7,7 +7,7 @@ export class TransferManager {
7
7
  constructor(session) {
8
8
  this.session = session;
9
9
  }
10
- async updateUserFolder0(userId, body, opts) {
10
+ async transferFolders(userId, body, opts) {
11
11
  let url = this.session.baseUrl("api");
12
12
  url += "/users";
13
13
  url += '/' + pathEscape(userId);
@@ -7,7 +7,7 @@ export class UploadsManager {
7
7
  constructor(session) {
8
8
  this.session = session;
9
9
  }
10
- async createFileContent(fileId, body, opts) {
10
+ async uploadFileVersion(fileId, body, opts) {
11
11
  let url = this.session.baseUrl("upload");
12
12
  url += "/files";
13
13
  url += '/' + pathEscape(fileId);
@@ -29,7 +29,7 @@ export class UploadsManager {
29
29
  const data = runtime.responseBytes(resp);
30
30
  return JSON.parse(new TextDecoder().decode(data));
31
31
  }
32
- async createFileContent2(body, opts) {
32
+ async uploadFile(body, opts) {
33
33
  let url = this.session.baseUrl("upload");
34
34
  url += "/files";
35
35
  url += "/content";
@@ -2,4 +2,5 @@ export { Client } from './client.js';
2
2
  export * as models from './models/index.js';
3
3
  export * as managers from './managers/index.js';
4
4
  export * as runtime from './runtime.js';
5
+ export * as auth from './auth.js';
5
6
  export * as buildinfo from './buildinfo.js';
@@ -28,6 +28,6 @@ export interface SearchManagerGetOptions {
28
28
  export declare class SearchManager {
29
29
  private readonly session;
30
30
  constructor(session: runtime.Client);
31
- createMetadataQueryExecuteRead(body: models.schemas.MetadataQuery): Promise<models.schemas.MetadataQueryResults>;
31
+ queryByMetadata(body: models.schemas.MetadataQuery): Promise<models.schemas.MetadataQueryResults>;
32
32
  get(opts?: SearchManagerGetOptions): Promise<models.schemas.SearchResultsResponse>;
33
33
  }
@@ -1,7 +1,7 @@
1
1
  import * as runtime from '../runtime.js';
2
2
  import type * as models from '../models/index.js';
3
- /** Optional parameters for TransferManager.updateUserFolder0. */
4
- export interface TransferManagerUpdateUserFolder0Options {
3
+ /** Optional parameters for TransferManager.transferFolders. */
4
+ export interface TransferManagerTransferFoldersOptions {
5
5
  fields?: Array<string>;
6
6
  notify?: boolean;
7
7
  }
@@ -9,5 +9,5 @@ export interface TransferManagerUpdateUserFolder0Options {
9
9
  export declare class TransferManager {
10
10
  private readonly session;
11
11
  constructor(session: runtime.Client);
12
- updateUserFolder0(userId: string, body: models.schemas.UserFolder0UpdateRequest, opts?: TransferManagerUpdateUserFolder0Options): Promise<models.schemas.FolderFull>;
12
+ transferFolders(userId: string, body: models.schemas.UserFolder0UpdateRequest, opts?: TransferManagerTransferFoldersOptions): Promise<models.schemas.FolderFull>;
13
13
  }
@@ -1,13 +1,13 @@
1
1
  import * as runtime from '../runtime.js';
2
2
  import type * as models from '../models/index.js';
3
- /** Optional parameters for UploadsManager.createFileContent. */
4
- export interface UploadsManagerCreateFileContentOptions {
3
+ /** Optional parameters for UploadsManager.uploadFileVersion. */
4
+ export interface UploadsManagerUploadFileVersionOptions {
5
5
  "if-match"?: string;
6
6
  fields?: Array<string>;
7
7
  "content-md5"?: string;
8
8
  }
9
- /** Optional parameters for UploadsManager.createFileContent2. */
10
- export interface UploadsManagerCreateFileContent2Options {
9
+ /** Optional parameters for UploadsManager.uploadFile. */
10
+ export interface UploadsManagerUploadFileOptions {
11
11
  fields?: Array<string>;
12
12
  "content-md5"?: string;
13
13
  }
@@ -15,7 +15,7 @@ export interface UploadsManagerCreateFileContent2Options {
15
15
  export declare class UploadsManager {
16
16
  private readonly session;
17
17
  constructor(session: runtime.Client);
18
- createFileContent(fileId: string, body: models.schemas.FileIdContentCreateRequest, opts?: UploadsManagerCreateFileContentOptions): Promise<models.schemas.Files>;
19
- createFileContent2(body: models.schemas.FileContentCreateRequest, opts?: UploadsManagerCreateFileContent2Options): Promise<models.schemas.Files>;
18
+ uploadFileVersion(fileId: string, body: models.schemas.FileIdContentCreateRequest, opts?: UploadsManagerUploadFileVersionOptions): Promise<models.schemas.Files>;
19
+ uploadFile(body: models.schemas.FileContentCreateRequest, opts?: UploadsManagerUploadFileOptions): Promise<models.schemas.Files>;
20
20
  optionFileContent(body: models.schemas.OptionFileContentRequest): Promise<models.schemas.UploadUrl>;
21
21
  }
package/docs/auth.md CHANGED
@@ -3,16 +3,16 @@
3
3
 
4
4
  Build a `Client` from one of the four Box auth flows. Each flow is an `Auth`
5
5
  the runtime uses to fetch a bearer token; the network layer refreshes on a
6
- `401` and retries once. The flow builders live in the runtime package and are
7
- passed straight to `new Client(...)`.
6
+ `401` and retries once. The flow builders live in the `auth` namespace (JWT on
7
+ the Node-only `./jwt` subpath) and are passed straight to `new Client(...)`.
8
8
 
9
9
  ## Developer Token
10
10
 
11
11
  A fixed token from the Developer Console, for quick local testing:
12
12
 
13
13
  ```ts
14
- import { developerToken } from 'box-gantry-runtime';
15
- const client = new Client(developerToken('DEVELOPER_TOKEN'));
14
+ import { auth } from '@unofficialbox/box-open-sdk';
15
+ const client = new Client(auth.developerToken('DEVELOPER_TOKEN'));
16
16
  ```
17
17
 
18
18
  ## Client Credentials Grant (server auth, no key)
@@ -21,8 +21,8 @@ Set exactly one subject — `enterpriseId` for the service account, or `userId`
21
21
  to act as a managed user:
22
22
 
23
23
  ```ts
24
- import { clientCredentials } from 'box-gantry-runtime';
25
- const client = new Client(clientCredentials({
24
+ import { auth } from '@unofficialbox/box-open-sdk';
25
+ const client = new Client(auth.clientCredentials({
26
26
  clientId: 'CLIENT_ID',
27
27
  clientSecret: 'CLIENT_SECRET',
28
28
  enterpriseId: 'ENTERPRISE_ID',
@@ -36,7 +36,7 @@ loudly at construction. It reaches `node:crypto`, so it is a Node-only leaf
36
36
  imported from the runtime's `./jwt` entry point and returns a promise:
37
37
 
38
38
  ```ts
39
- import { jwtAuth } from 'box-gantry-runtime/jwt';
39
+ import { jwtAuth } from '@unofficialbox/box-open-sdk/jwt';
40
40
  const auth = await jwtAuth({
41
41
  clientId: 'CLIENT_ID',
42
42
  clientSecret: 'CLIENT_SECRET',
@@ -53,8 +53,8 @@ Redirect the user to the authorize URL, exchange the returned code, then reuse
53
53
  the rotated refresh token on later runs (persist it via `onRefresh`):
54
54
 
55
55
  ```ts
56
- import { oauth } from 'box-gantry-runtime';
56
+ import { auth } from '@unofficialbox/box-open-sdk';
57
57
  // later runs: resume from the stored refresh token.
58
- const auth = oauth({ clientId: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET' }, storedRefreshToken);
59
- const client = new Client(auth);
58
+ const source = auth.oauth({ clientId: 'CLIENT_ID', clientSecret: 'CLIENT_SECRET' }, storedRefreshToken);
59
+ const client = new Client(source);
60
60
  ```
package/docs/errors.md CHANGED
@@ -9,11 +9,11 @@ when the failure came with a response, and the underlying `cause` for
9
9
  transport or decode failures:
10
10
 
11
11
  ```ts
12
- import { BoxApiError } from 'box-gantry-runtime';
12
+ import { runtime } from '@unofficialbox/box-open-sdk';
13
13
  try {
14
14
  await client.files.getFileById(fileId);
15
15
  } catch (err) {
16
- if (err instanceof BoxApiError) {
16
+ if (err instanceof runtime.BoxApiError) {
17
17
  // err.status (number | undefined), err.cause
18
18
  }
19
19
  }
@@ -11,6 +11,12 @@ Reach these methods through the `ai` field on `Client`.
11
11
 
12
12
  **Returns:** `AiResponseFull`
13
13
 
14
+ **Example**
15
+
16
+ ```ts
17
+ const result = await client.ai.ask({ /* … */ });
18
+ ```
19
+
14
20
  ## createTextGen
15
21
 
16
22
  `POST /ai/text_gen`
@@ -19,6 +25,12 @@ Reach these methods through the `ai` field on `Client`.
19
25
 
20
26
  **Returns:** `AiResponse`
21
27
 
28
+ **Example**
29
+
30
+ ```ts
31
+ const result = await client.ai.createTextGen({ /* … */ });
32
+ ```
33
+
22
34
  ## getAgentDefault
23
35
 
24
36
  `GET /ai_agent_default`
@@ -31,6 +43,12 @@ Reach these methods through the `ai` field on `Client`.
31
43
 
32
44
  **Returns:** `AiAgent`
33
45
 
46
+ **Example**
47
+
48
+ ```ts
49
+ const result = await client.ai.getAgentDefault("...");
50
+ ```
51
+
34
52
  ## extract
35
53
 
36
54
  `POST /ai/extract`
@@ -39,6 +57,12 @@ Reach these methods through the `ai` field on `Client`.
39
57
 
40
58
  **Returns:** `AiResponse`
41
59
 
60
+ **Example**
61
+
62
+ ```ts
63
+ const result = await client.ai.extract({ /* … */ });
64
+ ```
65
+
42
66
  ## createExtractStructured
43
67
 
44
68
  `POST /ai/extract_structured`
@@ -47,3 +71,9 @@ Reach these methods through the `ai` field on `Client`.
47
71
 
48
72
  **Returns:** `AiExtractStructuredResponse`
49
73
 
74
+ **Example**
75
+
76
+ ```ts
77
+ const result = await client.ai.createExtractStructured({ /* … */ });
78
+ ```
79
+
@@ -18,6 +18,14 @@ Reach these methods through the `aiStudio` field on `Client`.
18
18
 
19
19
  **Returns:** `AiMultipleAgentResponse`
20
20
 
21
+ **Example**
22
+
23
+ ```ts
24
+ for await (const item of client.aiStudio.listAiAgents()) {
25
+ // use item
26
+ }
27
+ ```
28
+
21
29
  Paginated — `listAiAgents(...)` is an async iterable that yields each entry across pages (`for await (const item of ...)`), threading the cursor for you. See the [pagination guide](../pagination.md).
22
30
 
23
31
  ## createAiAgents
@@ -28,6 +36,12 @@ Paginated — `listAiAgents(...)` is an async iterable that yields each entry ac
28
36
 
29
37
  **Returns:** `AiSingleAgentResponseFull`
30
38
 
39
+ **Example**
40
+
41
+ ```ts
42
+ const result = await client.aiStudio.createAiAgents({ /* … */ });
43
+ ```
44
+
31
45
  ## getAiAgent
32
46
 
33
47
  `GET /ai_agents/{agent_id}`
@@ -39,6 +53,12 @@ Paginated — `listAiAgents(...)` is an async iterable that yields each entry ac
39
53
 
40
54
  **Returns:** `AiSingleAgentResponseFull`
41
55
 
56
+ **Example**
57
+
58
+ ```ts
59
+ const result = await client.aiStudio.getAiAgent("AGENT_ID");
60
+ ```
61
+
42
62
  ## updateAiAgent
43
63
 
44
64
  `PUT /ai_agents/{agent_id}`
@@ -51,6 +71,12 @@ Paginated — `listAiAgents(...)` is an async iterable that yields each entry ac
51
71
 
52
72
  **Returns:** `AiSingleAgentResponseFull`
53
73
 
74
+ **Example**
75
+
76
+ ```ts
77
+ const result = await client.aiStudio.updateAiAgent("AGENT_ID", { /* … */ });
78
+ ```
79
+
54
80
  ## deleteAiAgent
55
81
 
56
82
  `DELETE /ai_agents/{agent_id}`
@@ -61,3 +87,9 @@ Paginated — `listAiAgents(...)` is an async iterable that yields each entry ac
61
87
 
62
88
  **Returns:** `void`
63
89
 
90
+ **Example**
91
+
92
+ ```ts
93
+ await client.aiStudio.deleteAiAgent("AGENT_ID");
94
+ ```
95
+
@@ -16,6 +16,14 @@ Reach these methods through the `appItemAssociations` field on `Client`.
16
16
 
17
17
  **Returns:** `AppItemAssociations`
18
18
 
19
+ **Example**
20
+
21
+ ```ts
22
+ for await (const item of client.appItemAssociations.listFile("FILE_ID")) {
23
+ // use item
24
+ }
25
+ ```
26
+
19
27
  Paginated — `listFile(...)` is an async iterable that yields each entry across pages (`for await (const item of ...)`), threading the cursor for you. See the [pagination guide](../pagination.md).
20
28
 
21
29
  ## listFolder
@@ -31,5 +39,13 @@ Paginated — `listFile(...)` is an async iterable that yields each entry across
31
39
 
32
40
  **Returns:** `AppItemAssociations`
33
41
 
42
+ **Example**
43
+
44
+ ```ts
45
+ for await (const item of client.appItemAssociations.listFolder("FOLDER_ID")) {
46
+ // use item
47
+ }
48
+ ```
49
+
34
50
  Paginated — `listFolder(...)` is an async iterable that yields each entry across pages (`for await (const item of ...)`), threading the cursor for you. See the [pagination guide](../pagination.md).
35
51
 
@@ -14,6 +14,14 @@ Reach these methods through the `archives` field on `Client`.
14
14
 
15
15
  **Returns:** `Archives`
16
16
 
17
+ **Example**
18
+
19
+ ```ts
20
+ for await (const item of client.archives.list()) {
21
+ // use item
22
+ }
23
+ ```
24
+
17
25
  Paginated — `list(...)` is an async iterable that yields each entry across pages (`for await (const item of ...)`), threading the cursor for you. See the [pagination guide](../pagination.md).
18
26
 
19
27
  ## create
@@ -24,6 +32,12 @@ Paginated — `list(...)` is an async iterable that yields each entry across pag
24
32
 
25
33
  **Returns:** `Archive`
26
34
 
35
+ **Example**
36
+
37
+ ```ts
38
+ const result = await client.archives.create({ /* … */ });
39
+ ```
40
+
27
41
  ## update
28
42
 
29
43
  `PUT /archives/{archive_id}`
@@ -36,6 +50,12 @@ Paginated — `list(...)` is an async iterable that yields each entry across pag
36
50
 
37
51
  **Returns:** `Archive`
38
52
 
53
+ **Example**
54
+
55
+ ```ts
56
+ const result = await client.archives.update("ARCHIVE_ID", { /* … */ });
57
+ ```
58
+
39
59
  ## delete_
40
60
 
41
61
  `DELETE /archives/{archive_id}`
@@ -46,3 +66,9 @@ Paginated — `list(...)` is an async iterable that yields each entry across pag
46
66
 
47
67
  **Returns:** `void`
48
68
 
69
+ **Example**
70
+
71
+ ```ts
72
+ await client.archives.delete_("ARCHIVE_ID");
73
+ ```
74
+
@@ -17,6 +17,12 @@ Reach these methods through the `authorization` field on `Client`.
17
17
 
18
18
  **Returns:** text (`string`)
19
19
 
20
+ **Example**
21
+
22
+ ```ts
23
+ const result = await client.authorization.authorize("...", "CLIENT_ID");
24
+ ```
25
+
20
26
  ## createOauth2Token
21
27
 
22
28
  `POST /oauth2/token`
@@ -25,6 +31,12 @@ Reach these methods through the `authorization` field on `Client`.
25
31
 
26
32
  **Returns:** `AccessToken`
27
33
 
34
+ **Example**
35
+
36
+ ```ts
37
+ const result = await client.authorization.createOauth2Token({ /* … */ });
38
+ ```
39
+
28
40
  ## createOauth2TokenRefresh
29
41
 
30
42
  `POST /oauth2/token`
@@ -33,6 +45,12 @@ Reach these methods through the `authorization` field on `Client`.
33
45
 
34
46
  **Returns:** `AccessToken`
35
47
 
48
+ **Example**
49
+
50
+ ```ts
51
+ const result = await client.authorization.createOauth2TokenRefresh({ /* … */ });
52
+ ```
53
+
36
54
  ## revokeOauth2
37
55
 
38
56
  `POST /oauth2/revoke`
@@ -41,3 +59,9 @@ Reach these methods through the `authorization` field on `Client`.
41
59
 
42
60
  **Returns:** `void`
43
61
 
62
+ **Example**
63
+
64
+ ```ts
65
+ await client.authorization.revokeOauth2({ /* … */ });
66
+ ```
67
+
@@ -15,6 +15,14 @@ Reach these methods through the `automateWorkflows` field on `Client`.
15
15
 
16
16
  **Returns:** `AutomateWorkflows`
17
17
 
18
+ **Example**
19
+
20
+ ```ts
21
+ for await (const item of client.automateWorkflows.list("FOLDER_ID")) {
22
+ // use item
23
+ }
24
+ ```
25
+
18
26
  Paginated — `list(...)` is an async iterable that yields each entry across pages (`for await (const item of ...)`), threading the cursor for you. See the [pagination guide](../pagination.md).
19
27
 
20
28
  ## start
@@ -29,3 +37,9 @@ Paginated — `list(...)` is an async iterable that yields each entry across pag
29
37
 
30
38
  **Returns:** `void`
31
39
 
40
+ **Example**
41
+
42
+ ```ts
43
+ await client.automateWorkflows.start("WORKFLOW_ID", { /* … */ });
44
+ ```
45
+
@@ -13,6 +13,12 @@ Reach these methods through the `avatars` field on `Client`.
13
13
 
14
14
  **Returns:** a binary stream (`runtime.Stream`)
15
15
 
16
+ **Example**
17
+
18
+ ```ts
19
+ const result = await client.avatars.getUserAvatar("USER_ID");
20
+ ```
21
+
16
22
  ## createUserAvatar
17
23
 
18
24
  `POST /users/{user_id}/avatar`
@@ -25,6 +31,12 @@ Reach these methods through the `avatars` field on `Client`.
25
31
 
26
32
  **Returns:** `UserAvatar`
27
33
 
34
+ **Example**
35
+
36
+ ```ts
37
+ const result = await client.avatars.createUserAvatar("USER_ID", { /* … */ });
38
+ ```
39
+
28
40
  ## deleteUserAvatar
29
41
 
30
42
  `DELETE /users/{user_id}/avatar`
@@ -35,3 +47,9 @@ Reach these methods through the `avatars` field on `Client`.
35
47
 
36
48
  **Returns:** `void`
37
49
 
50
+ **Example**
51
+
52
+ ```ts
53
+ await client.avatars.deleteUserAvatar("USER_ID");
54
+ ```
55
+