@credal/sdk 0.1.11 → 0.1.12

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 (34) hide show
  1. package/dist/cjs/BaseClient.d.ts +2 -1
  2. package/dist/cjs/BaseClient.js +47 -0
  3. package/dist/cjs/Client.d.ts +16 -16
  4. package/dist/cjs/Client.js +8 -49
  5. package/dist/cjs/api/resources/copilots/client/Client.d.ts +21 -21
  6. package/dist/cjs/api/resources/copilots/client/Client.js +14 -13
  7. package/dist/cjs/api/resources/documentCatalog/client/Client.d.ts +12 -12
  8. package/dist/cjs/api/resources/documentCatalog/client/Client.js +10 -9
  9. package/dist/cjs/api/resources/documentCollections/client/Client.d.ts +18 -18
  10. package/dist/cjs/api/resources/documentCollections/client/Client.js +13 -12
  11. package/dist/cjs/api/resources/search/client/Client.d.ts +6 -6
  12. package/dist/cjs/api/resources/search/client/Client.js +7 -6
  13. package/dist/cjs/api/resources/users/client/Client.d.ts +6 -6
  14. package/dist/cjs/api/resources/users/client/Client.js +7 -6
  15. package/dist/cjs/version.d.ts +1 -1
  16. package/dist/cjs/version.js +1 -1
  17. package/dist/esm/BaseClient.d.mts +2 -1
  18. package/dist/esm/BaseClient.mjs +13 -1
  19. package/dist/esm/Client.d.mts +16 -16
  20. package/dist/esm/Client.mjs +13 -21
  21. package/dist/esm/api/resources/copilots/client/Client.d.mts +21 -21
  22. package/dist/esm/api/resources/copilots/client/Client.mjs +12 -11
  23. package/dist/esm/api/resources/documentCatalog/client/Client.d.mts +12 -12
  24. package/dist/esm/api/resources/documentCatalog/client/Client.mjs +8 -7
  25. package/dist/esm/api/resources/documentCollections/client/Client.d.mts +18 -18
  26. package/dist/esm/api/resources/documentCollections/client/Client.mjs +11 -10
  27. package/dist/esm/api/resources/search/client/Client.d.mts +6 -6
  28. package/dist/esm/api/resources/search/client/Client.mjs +5 -4
  29. package/dist/esm/api/resources/users/client/Client.d.mts +6 -6
  30. package/dist/esm/api/resources/users/client/Client.mjs +5 -4
  31. package/dist/esm/version.d.mts +1 -1
  32. package/dist/esm/version.mjs +1 -1
  33. package/package.json +1 -1
  34. package/reference.md +21 -21
@@ -8,19 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ import { normalizeClientOptions } from "../../../../BaseClient.mjs";
11
12
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
12
13
  import * as core from "../../../../core/index.mjs";
13
14
  import * as environments from "../../../../environments.mjs";
14
15
  import * as errors from "../../../../errors/index.mjs";
15
- export class Copilots {
16
- constructor(_options = {}) {
17
- this._options = _options;
16
+ export class CopilotsClient {
17
+ constructor(options = {}) {
18
+ this._options = normalizeClientOptions(options);
18
19
  }
19
20
  /**
20
21
  * Create a new agent. The API key used will be added to the agent for future Requests
21
22
  *
22
23
  * @param {Credal.CreateCopilotRequest} request
23
- * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
24
+ * @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
24
25
  *
25
26
  * @example
26
27
  * await client.copilots.createCopilot({
@@ -84,7 +85,7 @@ export class Copilots {
84
85
  * OPTIONAL. Create a new conversation with the Agent. The conversation ID can be used in the `sendMessage` endpoint. The `sendMessage` endpoint automatically creates new conversations upon first request, but calling this endpoint can simplify certain use cases where it is helpful for the application to have the conversation ID before the first message is sent.
85
86
  *
86
87
  * @param {Credal.CreateConversationRequest} request
87
- * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
88
+ * @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
88
89
  *
89
90
  * @example
90
91
  * await client.copilots.createConversation({
@@ -142,7 +143,7 @@ export class Copilots {
142
143
  }
143
144
  /**
144
145
  * @param {Credal.ProvideMessageFeedbackRequest} request
145
- * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
146
+ * @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
146
147
  *
147
148
  * @example
148
149
  * await client.copilots.provideMessageFeedback({
@@ -206,7 +207,7 @@ export class Copilots {
206
207
  }
207
208
  /**
208
209
  * @param {Credal.SendMessageRequest} request
209
- * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
210
+ * @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
210
211
  *
211
212
  * @example
212
213
  * await client.copilots.sendMessage({
@@ -337,7 +338,7 @@ export class Copilots {
337
338
  * Link a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
338
339
  *
339
340
  * @param {Credal.AddCollectionToCopilotRequest} request
340
- * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
341
+ * @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
341
342
  *
342
343
  * @example
343
344
  * await client.copilots.addCollectionToCopilot({
@@ -397,7 +398,7 @@ export class Copilots {
397
398
  * Unlink a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
398
399
  *
399
400
  * @param {Credal.RemoveCollectionFromCopilotRequest} request
400
- * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
401
+ * @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
401
402
  *
402
403
  * @example
403
404
  * await client.copilots.removeCollectionFromCopilot({
@@ -457,7 +458,7 @@ export class Copilots {
457
458
  * Update the configuration for a agent
458
459
  *
459
460
  * @param {Credal.UpdateConfigurationRequest} request
460
- * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
461
+ * @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
461
462
  *
462
463
  * @example
463
464
  * await client.copilots.updateConfiguration({
@@ -523,7 +524,7 @@ export class Copilots {
523
524
  }
524
525
  /**
525
526
  * @param {Credal.DeleteCopilotRequest} request
526
- * @param {Copilots.RequestOptions} requestOptions - Request-specific configuration.
527
+ * @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
527
528
  *
528
529
  * @example
529
530
  * await client.copilots.deleteCopilot({
@@ -1,18 +1,18 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
2
  import * as core from "../../../../core/index.mjs";
3
3
  import type * as Credal from "../../../index.mjs";
4
- export declare namespace DocumentCatalog {
4
+ export declare namespace DocumentCatalogClient {
5
5
  interface Options extends BaseClientOptions {
6
6
  }
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class DocumentCatalog {
11
- protected readonly _options: DocumentCatalog.Options;
12
- constructor(_options?: DocumentCatalog.Options);
10
+ export declare class DocumentCatalogClient {
11
+ protected readonly _options: DocumentCatalogClient.Options;
12
+ constructor(options?: DocumentCatalogClient.Options);
13
13
  /**
14
14
  * @param {Credal.UploadDocumentContentsRequest} request
15
- * @param {DocumentCatalog.RequestOptions} requestOptions - Request-specific configuration.
15
+ * @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
16
16
  *
17
17
  * @example
18
18
  * await client.documentCatalog.uploadDocumentContents({
@@ -23,21 +23,21 @@ export declare class DocumentCatalog {
23
23
  * uploadAsUserEmail: "jack@credal.ai"
24
24
  * })
25
25
  */
26
- uploadDocumentContents(request: Credal.UploadDocumentContentsRequest, requestOptions?: DocumentCatalog.RequestOptions): core.HttpResponsePromise<Credal.UploadDocumentResponse>;
26
+ uploadDocumentContents(request: Credal.UploadDocumentContentsRequest, requestOptions?: DocumentCatalogClient.RequestOptions): core.HttpResponsePromise<Credal.UploadDocumentResponse>;
27
27
  private __uploadDocumentContents;
28
28
  /**
29
29
  * Upload a file (PDF, Word, Excel, CSV, PowerPoint) to Credal. Unlike uploadDocumentContents which requires pre-parsed text, this endpoint accepts actual file uploads and automatically parses them using Credal's parsing service.
30
30
  *
31
31
  * @param {Credal.UploadFileRequest} request
32
- * @param {DocumentCatalog.RequestOptions} requestOptions - Request-specific configuration.
32
+ * @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
33
33
  */
34
- uploadFile(request: Credal.UploadFileRequest, requestOptions?: DocumentCatalog.RequestOptions): core.HttpResponsePromise<Credal.UploadDocumentResponse>;
34
+ uploadFile(request: Credal.UploadFileRequest, requestOptions?: DocumentCatalogClient.RequestOptions): core.HttpResponsePromise<Credal.UploadDocumentResponse>;
35
35
  private __uploadFile;
36
36
  /**
37
37
  * Sync a document from a source URL. Does not support recursive web search. Reach out to a Credal representative for access.
38
38
  *
39
39
  * @param {Credal.SyncSourceByUrlRequest} request
40
- * @param {DocumentCatalog.RequestOptions} requestOptions - Request-specific configuration.
40
+ * @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
41
41
  *
42
42
  * @example
43
43
  * await client.documentCatalog.syncSourceByUrl({
@@ -45,13 +45,13 @@ export declare class DocumentCatalog {
45
45
  * uploadAsUserEmail: "ria@credal.ai"
46
46
  * })
47
47
  */
48
- syncSourceByUrl(request: Credal.SyncSourceByUrlRequest, requestOptions?: DocumentCatalog.RequestOptions): core.HttpResponsePromise<Credal.SyncSourceByUrlResponse>;
48
+ syncSourceByUrl(request: Credal.SyncSourceByUrlRequest, requestOptions?: DocumentCatalogClient.RequestOptions): core.HttpResponsePromise<Credal.SyncSourceByUrlResponse>;
49
49
  private __syncSourceByUrl;
50
50
  /**
51
51
  * Bulk patch metadata for documents, synced natively by Credal or manual API uploads
52
52
  *
53
53
  * @param {Credal.DocumentMetadataPatchRequest} request
54
- * @param {DocumentCatalog.RequestOptions} requestOptions - Request-specific configuration.
54
+ * @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
55
55
  *
56
56
  * @example
57
57
  * await client.documentCatalog.metadata({
@@ -79,7 +79,7 @@ export declare class DocumentCatalog {
79
79
  * uploadAsUserEmail: "ben@credal.ai"
80
80
  * })
81
81
  */
82
- metadata(request: Credal.DocumentMetadataPatchRequest, requestOptions?: DocumentCatalog.RequestOptions): core.HttpResponsePromise<void>;
82
+ metadata(request: Credal.DocumentMetadataPatchRequest, requestOptions?: DocumentCatalogClient.RequestOptions): core.HttpResponsePromise<void>;
83
83
  private __metadata;
84
84
  protected _getAuthorizationHeader(): Promise<string>;
85
85
  }
@@ -8,17 +8,18 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ import { normalizeClientOptions } from "../../../../BaseClient.mjs";
11
12
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
12
13
  import * as core from "../../../../core/index.mjs";
13
14
  import * as environments from "../../../../environments.mjs";
14
15
  import * as errors from "../../../../errors/index.mjs";
15
- export class DocumentCatalog {
16
- constructor(_options = {}) {
17
- this._options = _options;
16
+ export class DocumentCatalogClient {
17
+ constructor(options = {}) {
18
+ this._options = normalizeClientOptions(options);
18
19
  }
19
20
  /**
20
21
  * @param {Credal.UploadDocumentContentsRequest} request
21
- * @param {DocumentCatalog.RequestOptions} requestOptions - Request-specific configuration.
22
+ * @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
22
23
  *
23
24
  * @example
24
25
  * await client.documentCatalog.uploadDocumentContents({
@@ -81,7 +82,7 @@ export class DocumentCatalog {
81
82
  * Upload a file (PDF, Word, Excel, CSV, PowerPoint) to Credal. Unlike uploadDocumentContents which requires pre-parsed text, this endpoint accepts actual file uploads and automatically parses them using Credal's parsing service.
82
83
  *
83
84
  * @param {Credal.UploadFileRequest} request
84
- * @param {DocumentCatalog.RequestOptions} requestOptions - Request-specific configuration.
85
+ * @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
85
86
  */
86
87
  uploadFile(request, requestOptions) {
87
88
  return core.HttpResponsePromise.fromPromise(this.__uploadFile(request, requestOptions));
@@ -167,7 +168,7 @@ export class DocumentCatalog {
167
168
  * Sync a document from a source URL. Does not support recursive web search. Reach out to a Credal representative for access.
168
169
  *
169
170
  * @param {Credal.SyncSourceByUrlRequest} request
170
- * @param {DocumentCatalog.RequestOptions} requestOptions - Request-specific configuration.
171
+ * @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
171
172
  *
172
173
  * @example
173
174
  * await client.documentCatalog.syncSourceByUrl({
@@ -227,7 +228,7 @@ export class DocumentCatalog {
227
228
  * Bulk patch metadata for documents, synced natively by Credal or manual API uploads
228
229
  *
229
230
  * @param {Credal.DocumentMetadataPatchRequest} request
230
- * @param {DocumentCatalog.RequestOptions} requestOptions - Request-specific configuration.
231
+ * @param {DocumentCatalogClient.RequestOptions} requestOptions - Request-specific configuration.
231
232
  *
232
233
  * @example
233
234
  * await client.documentCatalog.metadata({
@@ -1,20 +1,20 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
2
  import * as core from "../../../../core/index.mjs";
3
3
  import type * as Credal from "../../../index.mjs";
4
- export declare namespace DocumentCollections {
4
+ export declare namespace DocumentCollectionsClient {
5
5
  interface Options extends BaseClientOptions {
6
6
  }
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class DocumentCollections {
11
- protected readonly _options: DocumentCollections.Options;
12
- constructor(_options?: DocumentCollections.Options);
10
+ export declare class DocumentCollectionsClient {
11
+ protected readonly _options: DocumentCollectionsClient.Options;
12
+ constructor(options?: DocumentCollectionsClient.Options);
13
13
  /**
14
14
  * Add documents to a document collection. Note that the documents must already exist in the document catalog to use this endpoint. If you want to upload a new document to a collection, use the `uploadDocumentContents` endpoint.
15
15
  *
16
16
  * @param {Credal.AddDocumentsToCollectionRequest} request
17
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
17
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
18
18
  *
19
19
  * @example
20
20
  * await client.documentCollections.addDocumentsToCollection({
@@ -30,13 +30,13 @@ export declare class DocumentCollections {
30
30
  * }]
31
31
  * })
32
32
  */
33
- addDocumentsToCollection(request: Credal.AddDocumentsToCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): core.HttpResponsePromise<void>;
33
+ addDocumentsToCollection(request: Credal.AddDocumentsToCollectionRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<void>;
34
34
  private __addDocumentsToCollection;
35
35
  /**
36
36
  * Remove documents from a collection
37
37
  *
38
38
  * @param {Credal.RemoveDocumentsFromCollectionRequest} request
39
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
39
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
40
40
  *
41
41
  * @example
42
42
  * await client.documentCollections.removeDocumentsFromCollection({
@@ -52,26 +52,26 @@ export declare class DocumentCollections {
52
52
  * }]
53
53
  * })
54
54
  */
55
- removeDocumentsFromCollection(request: Credal.RemoveDocumentsFromCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): core.HttpResponsePromise<void>;
55
+ removeDocumentsFromCollection(request: Credal.RemoveDocumentsFromCollectionRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<void>;
56
56
  private __removeDocumentsFromCollection;
57
57
  /**
58
58
  * List documents in a collection
59
59
  *
60
60
  * @param {Credal.ListDocumentsInCollectionRequest} request
61
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
61
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
62
62
  *
63
63
  * @example
64
64
  * await client.documentCollections.listDocumentsInCollection({
65
65
  * collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24"
66
66
  * })
67
67
  */
68
- listDocumentsInCollection(request: Credal.ListDocumentsInCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): core.HttpResponsePromise<Credal.ListDocumentsInCollectionResponse>;
68
+ listDocumentsInCollection(request: Credal.ListDocumentsInCollectionRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<Credal.ListDocumentsInCollectionResponse>;
69
69
  private __listDocumentsInCollection;
70
70
  /**
71
71
  * Create a new collection. The API key used will be added to the collection for future Requests
72
72
  *
73
73
  * @param {Credal.CreateCollectionRequest} request
74
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
74
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
75
75
  *
76
76
  * @example
77
77
  * await client.documentCollections.createCollection({
@@ -83,26 +83,26 @@ export declare class DocumentCollections {
83
83
  * }]
84
84
  * })
85
85
  */
86
- createCollection(request: Credal.CreateCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): core.HttpResponsePromise<Credal.CreateCollectionResponse>;
86
+ createCollection(request: Credal.CreateCollectionRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<Credal.CreateCollectionResponse>;
87
87
  private __createCollection;
88
88
  /**
89
89
  * Delete the collection.
90
90
  *
91
91
  * @param {Credal.DeleteCollectionRequest} request
92
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
92
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
93
93
  *
94
94
  * @example
95
95
  * await client.documentCollections.deleteCollection({
96
96
  * collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
97
97
  * })
98
98
  */
99
- deleteCollection(request: Credal.DeleteCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): core.HttpResponsePromise<Credal.DeleteCollectionResponse>;
99
+ deleteCollection(request: Credal.DeleteCollectionRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<Credal.DeleteCollectionResponse>;
100
100
  private __deleteCollection;
101
101
  /**
102
102
  * Credal lets you easily sync your MongoDB data for use in Collections and Agents. Create a new sync from a MongoDB collection to a Credal collection.
103
103
  *
104
104
  * @param {Credal.CreateMongoCollectionSyncRequest} request
105
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
105
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
106
106
  *
107
107
  * @example
108
108
  * await client.documentCollections.createMongoCollectionSync({
@@ -125,13 +125,13 @@ export declare class DocumentCollections {
125
125
  * }
126
126
  * })
127
127
  */
128
- createMongoCollectionSync(request: Credal.CreateMongoCollectionSyncRequest, requestOptions?: DocumentCollections.RequestOptions): core.HttpResponsePromise<Credal.MongoCollectionSyncResponse>;
128
+ createMongoCollectionSync(request: Credal.CreateMongoCollectionSyncRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<Credal.MongoCollectionSyncResponse>;
129
129
  private __createMongoCollectionSync;
130
130
  /**
131
131
  * Credal lets you easily sync your MongoDB data for use in Collections and Agents. Update an existing sync from a MongoDB collection to a Credal collection via the `mongoCredentialId`, to disambiguate between multiple potential syncs to a given collection.
132
132
  *
133
133
  * @param {Credal.UpdateMongoCollectionSyncRequest} request
134
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
134
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
135
135
  *
136
136
  * @example
137
137
  * await client.documentCollections.updateMongoCollectionSync({
@@ -154,7 +154,7 @@ export declare class DocumentCollections {
154
154
  * }
155
155
  * })
156
156
  */
157
- updateMongoCollectionSync(request: Credal.UpdateMongoCollectionSyncRequest, requestOptions?: DocumentCollections.RequestOptions): core.HttpResponsePromise<Credal.MongoCollectionSyncResponse>;
157
+ updateMongoCollectionSync(request: Credal.UpdateMongoCollectionSyncRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<Credal.MongoCollectionSyncResponse>;
158
158
  private __updateMongoCollectionSync;
159
159
  protected _getAuthorizationHeader(): Promise<string>;
160
160
  }
@@ -8,19 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ import { normalizeClientOptions } from "../../../../BaseClient.mjs";
11
12
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
12
13
  import * as core from "../../../../core/index.mjs";
13
14
  import * as environments from "../../../../environments.mjs";
14
15
  import * as errors from "../../../../errors/index.mjs";
15
- export class DocumentCollections {
16
- constructor(_options = {}) {
17
- this._options = _options;
16
+ export class DocumentCollectionsClient {
17
+ constructor(options = {}) {
18
+ this._options = normalizeClientOptions(options);
18
19
  }
19
20
  /**
20
21
  * Add documents to a document collection. Note that the documents must already exist in the document catalog to use this endpoint. If you want to upload a new document to a collection, use the `uploadDocumentContents` endpoint.
21
22
  *
22
23
  * @param {Credal.AddDocumentsToCollectionRequest} request
23
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
24
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
24
25
  *
25
26
  * @example
26
27
  * await client.documentCollections.addDocumentsToCollection({
@@ -88,7 +89,7 @@ export class DocumentCollections {
88
89
  * Remove documents from a collection
89
90
  *
90
91
  * @param {Credal.RemoveDocumentsFromCollectionRequest} request
91
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
92
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
92
93
  *
93
94
  * @example
94
95
  * await client.documentCollections.removeDocumentsFromCollection({
@@ -156,7 +157,7 @@ export class DocumentCollections {
156
157
  * List documents in a collection
157
158
  *
158
159
  * @param {Credal.ListDocumentsInCollectionRequest} request
159
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
160
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
160
161
  *
161
162
  * @example
162
163
  * await client.documentCollections.listDocumentsInCollection({
@@ -218,7 +219,7 @@ export class DocumentCollections {
218
219
  * Create a new collection. The API key used will be added to the collection for future Requests
219
220
  *
220
221
  * @param {Credal.CreateCollectionRequest} request
221
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
222
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
222
223
  *
223
224
  * @example
224
225
  * await client.documentCollections.createCollection({
@@ -282,7 +283,7 @@ export class DocumentCollections {
282
283
  * Delete the collection.
283
284
  *
284
285
  * @param {Credal.DeleteCollectionRequest} request
285
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
286
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
286
287
  *
287
288
  * @example
288
289
  * await client.documentCollections.deleteCollection({
@@ -341,7 +342,7 @@ export class DocumentCollections {
341
342
  * Credal lets you easily sync your MongoDB data for use in Collections and Agents. Create a new sync from a MongoDB collection to a Credal collection.
342
343
  *
343
344
  * @param {Credal.CreateMongoCollectionSyncRequest} request
344
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
345
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
345
346
  *
346
347
  * @example
347
348
  * await client.documentCollections.createMongoCollectionSync({
@@ -416,7 +417,7 @@ export class DocumentCollections {
416
417
  * Credal lets you easily sync your MongoDB data for use in Collections and Agents. Update an existing sync from a MongoDB collection to a Credal collection via the `mongoCredentialId`, to disambiguate between multiple potential syncs to a given collection.
417
418
  *
418
419
  * @param {Credal.UpdateMongoCollectionSyncRequest} request
419
- * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
420
+ * @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
420
421
  *
421
422
  * @example
422
423
  * await client.documentCollections.updateMongoCollectionSync({
@@ -1,20 +1,20 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
2
  import * as core from "../../../../core/index.mjs";
3
3
  import type * as Credal from "../../../index.mjs";
4
- export declare namespace Search {
4
+ export declare namespace SearchClient {
5
5
  interface Options extends BaseClientOptions {
6
6
  }
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class Search {
11
- protected readonly _options: Search.Options;
12
- constructor(_options?: Search.Options);
10
+ export declare class SearchClient {
11
+ protected readonly _options: SearchClient.Options;
12
+ constructor(options?: SearchClient.Options);
13
13
  /**
14
14
  * Search across all documents in a document collection using the document metadata and contents.
15
15
  *
16
16
  * @param {Credal.SearchDocumentCollectionRequest} request
17
- * @param {Search.RequestOptions} requestOptions - Request-specific configuration.
17
+ * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
18
18
  *
19
19
  * @example
20
20
  * await client.search.searchDocumentCollection({
@@ -36,7 +36,7 @@ export declare class Search {
36
36
  * }
37
37
  * })
38
38
  */
39
- searchDocumentCollection(request: Credal.SearchDocumentCollectionRequest, requestOptions?: Search.RequestOptions): core.HttpResponsePromise<Credal.SearchDocumentCollectionResponse>;
39
+ searchDocumentCollection(request: Credal.SearchDocumentCollectionRequest, requestOptions?: SearchClient.RequestOptions): core.HttpResponsePromise<Credal.SearchDocumentCollectionResponse>;
40
40
  private __searchDocumentCollection;
41
41
  protected _getAuthorizationHeader(): Promise<string>;
42
42
  }
@@ -8,19 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ import { normalizeClientOptions } from "../../../../BaseClient.mjs";
11
12
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
12
13
  import * as core from "../../../../core/index.mjs";
13
14
  import * as environments from "../../../../environments.mjs";
14
15
  import * as errors from "../../../../errors/index.mjs";
15
- export class Search {
16
- constructor(_options = {}) {
17
- this._options = _options;
16
+ export class SearchClient {
17
+ constructor(options = {}) {
18
+ this._options = normalizeClientOptions(options);
18
19
  }
19
20
  /**
20
21
  * Search across all documents in a document collection using the document metadata and contents.
21
22
  *
22
23
  * @param {Credal.SearchDocumentCollectionRequest} request
23
- * @param {Search.RequestOptions} requestOptions - Request-specific configuration.
24
+ * @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
24
25
  *
25
26
  * @example
26
27
  * await client.search.searchDocumentCollection({
@@ -1,20 +1,20 @@
1
1
  import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
2
2
  import * as core from "../../../../core/index.mjs";
3
3
  import type * as Credal from "../../../index.mjs";
4
- export declare namespace Users {
4
+ export declare namespace UsersClient {
5
5
  interface Options extends BaseClientOptions {
6
6
  }
7
7
  interface RequestOptions extends BaseRequestOptions {
8
8
  }
9
9
  }
10
- export declare class Users {
11
- protected readonly _options: Users.Options;
12
- constructor(_options?: Users.Options);
10
+ export declare class UsersClient {
11
+ protected readonly _options: UsersClient.Options;
12
+ constructor(options?: UsersClient.Options);
13
13
  /**
14
14
  * Bulk patch metadata for users
15
15
  *
16
16
  * @param {Credal.UserMetadataPatch[]} request
17
- * @param {Users.RequestOptions} requestOptions - Request-specific configuration.
17
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
18
18
  *
19
19
  * @example
20
20
  * await client.users.metadata([{
@@ -31,7 +31,7 @@ export declare class Users {
31
31
  * userEmail: "jack@credal.ai"
32
32
  * }])
33
33
  */
34
- metadata(request: Credal.UserMetadataPatch[], requestOptions?: Users.RequestOptions): core.HttpResponsePromise<void>;
34
+ metadata(request: Credal.UserMetadataPatch[], requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<void>;
35
35
  private __metadata;
36
36
  protected _getAuthorizationHeader(): Promise<string>;
37
37
  }
@@ -8,19 +8,20 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  step((generator = generator.apply(thisArg, _arguments || [])).next());
9
9
  });
10
10
  };
11
+ import { normalizeClientOptions } from "../../../../BaseClient.mjs";
11
12
  import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.mjs";
12
13
  import * as core from "../../../../core/index.mjs";
13
14
  import * as environments from "../../../../environments.mjs";
14
15
  import * as errors from "../../../../errors/index.mjs";
15
- export class Users {
16
- constructor(_options = {}) {
17
- this._options = _options;
16
+ export class UsersClient {
17
+ constructor(options = {}) {
18
+ this._options = normalizeClientOptions(options);
18
19
  }
19
20
  /**
20
21
  * Bulk patch metadata for users
21
22
  *
22
23
  * @param {Credal.UserMetadataPatch[]} request
23
- * @param {Users.RequestOptions} requestOptions - Request-specific configuration.
24
+ * @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
24
25
  *
25
26
  * @example
26
27
  * await client.users.metadata([{
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "0.1.11";
1
+ export declare const SDK_VERSION = "0.1.12";
@@ -1 +1 @@
1
- export const SDK_VERSION = "0.1.11";
1
+ export const SDK_VERSION = "0.1.12";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@credal/sdk",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "private": false,
5
5
  "repository": "github:credal-ai/credal-typescript-sdk",
6
6
  "type": "commonjs",