@credal/sdk 0.0.11 → 0.0.13

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 (78) hide show
  1. package/api/resources/common/types/ResourceType.d.ts +5 -1
  2. package/api/resources/common/types/ResourceType.js +4 -0
  3. package/api/resources/copilots/client/Client.js +8 -8
  4. package/api/resources/documentCatalog/client/Client.js +2 -2
  5. package/api/resources/documentCollections/client/Client.d.ts +56 -0
  6. package/api/resources/documentCollections/client/Client.js +160 -4
  7. package/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +31 -0
  8. package/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +5 -0
  9. package/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +31 -0
  10. package/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +5 -0
  11. package/api/resources/documentCollections/client/requests/index.d.ts +2 -0
  12. package/api/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +10 -0
  13. package/api/resources/documentCollections/types/MongoCollectionSyncConfig.js +5 -0
  14. package/api/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +8 -0
  15. package/api/resources/documentCollections/types/MongoCollectionSyncResponse.js +5 -0
  16. package/api/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +9 -0
  17. package/api/resources/documentCollections/types/MongoSourceFieldsConfig.js +5 -0
  18. package/api/resources/documentCollections/types/index.d.ts +3 -0
  19. package/api/resources/documentCollections/types/index.js +3 -0
  20. package/api/resources/permissionsService/client/Client.js +3 -3
  21. package/api/resources/search/client/Client.js +1 -1
  22. package/api/resources/users/client/Client.js +1 -1
  23. package/dist/api/resources/common/types/ResourceType.d.ts +5 -1
  24. package/dist/api/resources/common/types/ResourceType.js +4 -0
  25. package/dist/api/resources/copilots/client/Client.js +8 -8
  26. package/dist/api/resources/documentCatalog/client/Client.js +2 -2
  27. package/dist/api/resources/documentCollections/client/Client.d.ts +56 -0
  28. package/dist/api/resources/documentCollections/client/Client.js +160 -4
  29. package/dist/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +31 -0
  30. package/dist/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +5 -0
  31. package/dist/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +31 -0
  32. package/dist/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +5 -0
  33. package/dist/api/resources/documentCollections/client/requests/index.d.ts +2 -0
  34. package/dist/api/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +10 -0
  35. package/dist/api/resources/documentCollections/types/MongoCollectionSyncConfig.js +5 -0
  36. package/dist/api/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +8 -0
  37. package/dist/api/resources/documentCollections/types/MongoCollectionSyncResponse.js +5 -0
  38. package/dist/api/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +9 -0
  39. package/dist/api/resources/documentCollections/types/MongoSourceFieldsConfig.js +5 -0
  40. package/dist/api/resources/documentCollections/types/index.d.ts +3 -0
  41. package/dist/api/resources/documentCollections/types/index.js +3 -0
  42. package/dist/api/resources/permissionsService/client/Client.js +3 -3
  43. package/dist/api/resources/search/client/Client.js +1 -1
  44. package/dist/api/resources/users/client/Client.js +1 -1
  45. package/dist/serialization/resources/common/types/ResourceType.d.ts +1 -1
  46. package/dist/serialization/resources/common/types/ResourceType.js +4 -0
  47. package/dist/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +15 -0
  48. package/dist/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +36 -0
  49. package/dist/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +15 -0
  50. package/dist/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +36 -0
  51. package/dist/serialization/resources/documentCollections/client/requests/index.d.ts +2 -0
  52. package/dist/serialization/resources/documentCollections/client/requests/index.js +5 -1
  53. package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +16 -0
  54. package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +37 -0
  55. package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +14 -0
  56. package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +35 -0
  57. package/dist/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +15 -0
  58. package/dist/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +36 -0
  59. package/dist/serialization/resources/documentCollections/types/index.d.ts +3 -0
  60. package/dist/serialization/resources/documentCollections/types/index.js +3 -0
  61. package/package.json +1 -1
  62. package/reference.md +202 -0
  63. package/serialization/resources/common/types/ResourceType.d.ts +1 -1
  64. package/serialization/resources/common/types/ResourceType.js +4 -0
  65. package/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +15 -0
  66. package/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +36 -0
  67. package/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +15 -0
  68. package/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +36 -0
  69. package/serialization/resources/documentCollections/client/requests/index.d.ts +2 -0
  70. package/serialization/resources/documentCollections/client/requests/index.js +5 -1
  71. package/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +16 -0
  72. package/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +37 -0
  73. package/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +14 -0
  74. package/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +35 -0
  75. package/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +15 -0
  76. package/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +36 -0
  77. package/serialization/resources/documentCollections/types/index.d.ts +3 -0
  78. package/serialization/resources/documentCollections/types/index.js +3 -0
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare type ResourceType = "GOOGLE_DRIVE_ITEM" | "MICROSOFT_DRIVE_ITEM" | "ZENDESK_TICKET" | "ZENDESK_ARTICLE" | "ZENDESK_GROUP" | "ZENDESK_ARTICLE_SECTION" | "CONFLUENCE_PAGE" | "CONFLUENCE_SPACE" | "JIRA_TICKET" | "JIRA_PROJECT" | "SALESFORCE_TASK" | "BOX_FILE" | "BOX_FOLDER" | "NOTION_PAGE" | "UNKNOWN";
4
+ export declare type ResourceType = "GOOGLE_DRIVE_ITEM" | "MICROSOFT_DRIVE_ITEM" | "ZENDESK_TICKET" | "ZENDESK_ARTICLE" | "ZENDESK_GROUP" | "ZENDESK_ARTICLE_SECTION" | "ZENDESK_ARTICLE_CATEGORY" | "CONFLUENCE_PAGE" | "CONFLUENCE_SPACE" | "JIRA_TICKET" | "JIRA_PROJECT" | "SALESFORCE_TASK" | "BOX_FILE" | "BOX_FOLDER" | "NOTION_PAGE" | "NOTION_DATABASE" | "SLACK_CHANNEL" | "MONGO_COLLECTION_SYNC" | "UNKNOWN";
5
5
  export declare const ResourceType: {
6
6
  readonly GoogleDriveItem: "GOOGLE_DRIVE_ITEM";
7
7
  readonly MicrosoftDriveItem: "MICROSOFT_DRIVE_ITEM";
@@ -9,6 +9,7 @@ export declare const ResourceType: {
9
9
  readonly ZendeskArticle: "ZENDESK_ARTICLE";
10
10
  readonly ZendeskGroup: "ZENDESK_GROUP";
11
11
  readonly ZendeskArticleSection: "ZENDESK_ARTICLE_SECTION";
12
+ readonly ZendeskArticleCategory: "ZENDESK_ARTICLE_CATEGORY";
12
13
  readonly ConfluencePage: "CONFLUENCE_PAGE";
13
14
  readonly ConfluenceSpace: "CONFLUENCE_SPACE";
14
15
  readonly JiraTicket: "JIRA_TICKET";
@@ -17,5 +18,8 @@ export declare const ResourceType: {
17
18
  readonly BoxFile: "BOX_FILE";
18
19
  readonly BoxFolder: "BOX_FOLDER";
19
20
  readonly NotionPage: "NOTION_PAGE";
21
+ readonly NotionDatabase: "NOTION_DATABASE";
22
+ readonly SlackChannel: "SLACK_CHANNEL";
23
+ readonly MongoCollectionSync: "MONGO_COLLECTION_SYNC";
20
24
  readonly Unknown: "UNKNOWN";
21
25
  };
@@ -11,6 +11,7 @@ exports.ResourceType = {
11
11
  ZendeskArticle: "ZENDESK_ARTICLE",
12
12
  ZendeskGroup: "ZENDESK_GROUP",
13
13
  ZendeskArticleSection: "ZENDESK_ARTICLE_SECTION",
14
+ ZendeskArticleCategory: "ZENDESK_ARTICLE_CATEGORY",
14
15
  ConfluencePage: "CONFLUENCE_PAGE",
15
16
  ConfluenceSpace: "CONFLUENCE_SPACE",
16
17
  JiraTicket: "JIRA_TICKET",
@@ -19,5 +20,8 @@ exports.ResourceType = {
19
20
  BoxFile: "BOX_FILE",
20
21
  BoxFolder: "BOX_FOLDER",
21
22
  NotionPage: "NOTION_PAGE",
23
+ NotionDatabase: "NOTION_DATABASE",
24
+ SlackChannel: "SLACK_CHANNEL",
25
+ MongoCollectionSync: "MONGO_COLLECTION_SYNC",
22
26
  Unknown: "UNKNOWN",
23
27
  };
@@ -74,7 +74,7 @@ class Copilots {
74
74
  Authorization: yield this._getAuthorizationHeader(),
75
75
  "X-Fern-Language": "JavaScript",
76
76
  "X-Fern-SDK-Name": "@credal/sdk",
77
- "X-Fern-SDK-Version": "0.0.11",
77
+ "X-Fern-SDK-Version": "0.0.13",
78
78
  "X-Fern-Runtime": core.RUNTIME.type,
79
79
  "X-Fern-Runtime-Version": core.RUNTIME.version,
80
80
  },
@@ -135,7 +135,7 @@ class Copilots {
135
135
  Authorization: yield this._getAuthorizationHeader(),
136
136
  "X-Fern-Language": "JavaScript",
137
137
  "X-Fern-SDK-Name": "@credal/sdk",
138
- "X-Fern-SDK-Version": "0.0.11",
138
+ "X-Fern-SDK-Version": "0.0.13",
139
139
  "X-Fern-Runtime": core.RUNTIME.type,
140
140
  "X-Fern-Runtime-Version": core.RUNTIME.version,
141
141
  },
@@ -199,7 +199,7 @@ class Copilots {
199
199
  Authorization: yield this._getAuthorizationHeader(),
200
200
  "X-Fern-Language": "JavaScript",
201
201
  "X-Fern-SDK-Name": "@credal/sdk",
202
- "X-Fern-SDK-Version": "0.0.11",
202
+ "X-Fern-SDK-Version": "0.0.13",
203
203
  "X-Fern-Runtime": core.RUNTIME.type,
204
204
  "X-Fern-Runtime-Version": core.RUNTIME.version,
205
205
  },
@@ -256,7 +256,7 @@ class Copilots {
256
256
  Authorization: yield this._getAuthorizationHeader(),
257
257
  "X-Fern-Language": "JavaScript",
258
258
  "X-Fern-SDK-Name": "@credal/sdk",
259
- "X-Fern-SDK-Version": "0.0.11",
259
+ "X-Fern-SDK-Version": "0.0.13",
260
260
  "X-Fern-Runtime": core.RUNTIME.type,
261
261
  "X-Fern-Runtime-Version": core.RUNTIME.version,
262
262
  },
@@ -317,7 +317,7 @@ class Copilots {
317
317
  Authorization: yield this._getAuthorizationHeader(),
318
318
  "X-Fern-Language": "JavaScript",
319
319
  "X-Fern-SDK-Name": "@credal/sdk",
320
- "X-Fern-SDK-Version": "0.0.11",
320
+ "X-Fern-SDK-Version": "0.0.13",
321
321
  "X-Fern-Runtime": core.RUNTIME.type,
322
322
  "X-Fern-Runtime-Version": core.RUNTIME.version,
323
323
  },
@@ -375,7 +375,7 @@ class Copilots {
375
375
  Authorization: yield this._getAuthorizationHeader(),
376
376
  "X-Fern-Language": "JavaScript",
377
377
  "X-Fern-SDK-Name": "@credal/sdk",
378
- "X-Fern-SDK-Version": "0.0.11",
378
+ "X-Fern-SDK-Version": "0.0.13",
379
379
  "X-Fern-Runtime": core.RUNTIME.type,
380
380
  "X-Fern-Runtime-Version": core.RUNTIME.version,
381
381
  },
@@ -441,7 +441,7 @@ class Copilots {
441
441
  Authorization: yield this._getAuthorizationHeader(),
442
442
  "X-Fern-Language": "JavaScript",
443
443
  "X-Fern-SDK-Name": "@credal/sdk",
444
- "X-Fern-SDK-Version": "0.0.11",
444
+ "X-Fern-SDK-Version": "0.0.13",
445
445
  "X-Fern-Runtime": core.RUNTIME.type,
446
446
  "X-Fern-Runtime-Version": core.RUNTIME.version,
447
447
  },
@@ -496,7 +496,7 @@ class Copilots {
496
496
  Authorization: yield this._getAuthorizationHeader(),
497
497
  "X-Fern-Language": "JavaScript",
498
498
  "X-Fern-SDK-Name": "@credal/sdk",
499
- "X-Fern-SDK-Version": "0.0.11",
499
+ "X-Fern-SDK-Version": "0.0.13",
500
500
  "X-Fern-Runtime": core.RUNTIME.type,
501
501
  "X-Fern-Runtime-Version": core.RUNTIME.version,
502
502
  },
@@ -71,7 +71,7 @@ class DocumentCatalog {
71
71
  Authorization: yield this._getAuthorizationHeader(),
72
72
  "X-Fern-Language": "JavaScript",
73
73
  "X-Fern-SDK-Name": "@credal/sdk",
74
- "X-Fern-SDK-Version": "0.0.11",
74
+ "X-Fern-SDK-Version": "0.0.13",
75
75
  "X-Fern-Runtime": core.RUNTIME.type,
76
76
  "X-Fern-Runtime-Version": core.RUNTIME.version,
77
77
  },
@@ -154,7 +154,7 @@ class DocumentCatalog {
154
154
  Authorization: yield this._getAuthorizationHeader(),
155
155
  "X-Fern-Language": "JavaScript",
156
156
  "X-Fern-SDK-Name": "@credal/sdk",
157
- "X-Fern-SDK-Version": "0.0.11",
157
+ "X-Fern-SDK-Version": "0.0.13",
158
158
  "X-Fern-Runtime": core.RUNTIME.type,
159
159
  "X-Fern-Runtime-Version": core.RUNTIME.version,
160
160
  },
@@ -90,5 +90,61 @@ export declare class DocumentCollections {
90
90
  * })
91
91
  */
92
92
  deleteCollection(request: Credal.DeleteCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<Credal.DeleteCollectionResponse>;
93
+ /**
94
+ * Credal lets you easily sync your MongoDB data for use in Collections and Copilots. Create a new sync from a MongoDB collection to a Credal collection.
95
+ *
96
+ * @param {Credal.CreateMongoCollectionSyncRequest} request
97
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
98
+ *
99
+ * @example
100
+ * await credal.documentCollections.createMongoCollectionSync({
101
+ * mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
102
+ * collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a",
103
+ * config: {
104
+ * syncName: "My sales transcripts",
105
+ * collectionName: "myCollection",
106
+ * filterExpression: {
107
+ * "status": {
108
+ * "$ne": "disabled"
109
+ * }
110
+ * },
111
+ * sourceFields: {
112
+ * body: "body",
113
+ * sourceName: "meetingName",
114
+ * sourceSystemUpdated: "transcriptDatetime",
115
+ * sourceUrl: "link"
116
+ * }
117
+ * }
118
+ * })
119
+ */
120
+ createMongoCollectionSync(request: Credal.CreateMongoCollectionSyncRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<Credal.MongoCollectionSyncResponse>;
121
+ /**
122
+ * Credal lets you easily sync your MongoDB data for use in Collections and Copilots. 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.
123
+ *
124
+ * @param {Credal.UpdateMongoCollectionSyncRequest} request
125
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
126
+ *
127
+ * @example
128
+ * await credal.documentCollections.updateMongoCollectionSync({
129
+ * mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
130
+ * mongoCredentialId: "5988ed76-6ee1-11ef-97dd-1fca54b7c4bc",
131
+ * config: {
132
+ * syncName: "My recent summarized sales transcripts",
133
+ * collectionName: "myCollection",
134
+ * filterExpression: {
135
+ * "transcriptDatetime": {
136
+ * "$gt": "2023-01-01T00:00:00.000Z"
137
+ * }
138
+ * },
139
+ * sourceFields: {
140
+ * body: "transcriptSummary",
141
+ * sourceName: "meetingName",
142
+ * sourceSystemUpdated: "transcriptDatetime",
143
+ * sourceUrl: "link"
144
+ * }
145
+ * }
146
+ * })
147
+ */
148
+ updateMongoCollectionSync(request: Credal.UpdateMongoCollectionSyncRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<Credal.MongoCollectionSyncResponse>;
93
149
  protected _getAuthorizationHeader(): Promise<string>;
94
150
  }
@@ -78,7 +78,7 @@ class DocumentCollections {
78
78
  Authorization: yield this._getAuthorizationHeader(),
79
79
  "X-Fern-Language": "JavaScript",
80
80
  "X-Fern-SDK-Name": "@credal/sdk",
81
- "X-Fern-SDK-Version": "0.0.11",
81
+ "X-Fern-SDK-Version": "0.0.13",
82
82
  "X-Fern-Runtime": core.RUNTIME.type,
83
83
  "X-Fern-Runtime-Version": core.RUNTIME.version,
84
84
  },
@@ -144,7 +144,7 @@ class DocumentCollections {
144
144
  Authorization: yield this._getAuthorizationHeader(),
145
145
  "X-Fern-Language": "JavaScript",
146
146
  "X-Fern-SDK-Name": "@credal/sdk",
147
- "X-Fern-SDK-Version": "0.0.11",
147
+ "X-Fern-SDK-Version": "0.0.13",
148
148
  "X-Fern-Runtime": core.RUNTIME.type,
149
149
  "X-Fern-Runtime-Version": core.RUNTIME.version,
150
150
  },
@@ -206,7 +206,7 @@ class DocumentCollections {
206
206
  Authorization: yield this._getAuthorizationHeader(),
207
207
  "X-Fern-Language": "JavaScript",
208
208
  "X-Fern-SDK-Name": "@credal/sdk",
209
- "X-Fern-SDK-Version": "0.0.11",
209
+ "X-Fern-SDK-Version": "0.0.13",
210
210
  "X-Fern-Runtime": core.RUNTIME.type,
211
211
  "X-Fern-Runtime-Version": core.RUNTIME.version,
212
212
  },
@@ -266,7 +266,7 @@ class DocumentCollections {
266
266
  Authorization: yield this._getAuthorizationHeader(),
267
267
  "X-Fern-Language": "JavaScript",
268
268
  "X-Fern-SDK-Name": "@credal/sdk",
269
- "X-Fern-SDK-Version": "0.0.11",
269
+ "X-Fern-SDK-Version": "0.0.13",
270
270
  "X-Fern-Runtime": core.RUNTIME.type,
271
271
  "X-Fern-Runtime-Version": core.RUNTIME.version,
272
272
  },
@@ -305,6 +305,162 @@ class DocumentCollections {
305
305
  }
306
306
  });
307
307
  }
308
+ /**
309
+ * Credal lets you easily sync your MongoDB data for use in Collections and Copilots. Create a new sync from a MongoDB collection to a Credal collection.
310
+ *
311
+ * @param {Credal.CreateMongoCollectionSyncRequest} request
312
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
313
+ *
314
+ * @example
315
+ * await credal.documentCollections.createMongoCollectionSync({
316
+ * mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
317
+ * collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a",
318
+ * config: {
319
+ * syncName: "My sales transcripts",
320
+ * collectionName: "myCollection",
321
+ * filterExpression: {
322
+ * "status": {
323
+ * "$ne": "disabled"
324
+ * }
325
+ * },
326
+ * sourceFields: {
327
+ * body: "body",
328
+ * sourceName: "meetingName",
329
+ * sourceSystemUpdated: "transcriptDatetime",
330
+ * sourceUrl: "link"
331
+ * }
332
+ * }
333
+ * })
334
+ */
335
+ createMongoCollectionSync(request, requestOptions) {
336
+ var _a, _b;
337
+ return __awaiter(this, void 0, void 0, function* () {
338
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
339
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/documentCollections/mongodb/createMongoSync"),
340
+ method: "POST",
341
+ headers: {
342
+ Authorization: yield this._getAuthorizationHeader(),
343
+ "X-Fern-Language": "JavaScript",
344
+ "X-Fern-SDK-Name": "@credal/sdk",
345
+ "X-Fern-SDK-Version": "0.0.13",
346
+ "X-Fern-Runtime": core.RUNTIME.type,
347
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
348
+ },
349
+ contentType: "application/json",
350
+ body: yield serializers.CreateMongoCollectionSyncRequest.jsonOrThrow(request, {
351
+ unrecognizedObjectKeys: "strip",
352
+ }),
353
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
354
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
355
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
356
+ });
357
+ if (_response.ok) {
358
+ return yield serializers.MongoCollectionSyncResponse.parseOrThrow(_response.body, {
359
+ unrecognizedObjectKeys: "passthrough",
360
+ allowUnrecognizedUnionMembers: true,
361
+ allowUnrecognizedEnumValues: true,
362
+ breadcrumbsPrefix: ["response"],
363
+ });
364
+ }
365
+ if (_response.error.reason === "status-code") {
366
+ throw new errors.CredalError({
367
+ statusCode: _response.error.statusCode,
368
+ body: _response.error.body,
369
+ });
370
+ }
371
+ switch (_response.error.reason) {
372
+ case "non-json":
373
+ throw new errors.CredalError({
374
+ statusCode: _response.error.statusCode,
375
+ body: _response.error.rawBody,
376
+ });
377
+ case "timeout":
378
+ throw new errors.CredalTimeoutError();
379
+ case "unknown":
380
+ throw new errors.CredalError({
381
+ message: _response.error.errorMessage,
382
+ });
383
+ }
384
+ });
385
+ }
386
+ /**
387
+ * Credal lets you easily sync your MongoDB data for use in Collections and Copilots. 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.
388
+ *
389
+ * @param {Credal.UpdateMongoCollectionSyncRequest} request
390
+ * @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
391
+ *
392
+ * @example
393
+ * await credal.documentCollections.updateMongoCollectionSync({
394
+ * mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
395
+ * mongoCredentialId: "5988ed76-6ee1-11ef-97dd-1fca54b7c4bc",
396
+ * config: {
397
+ * syncName: "My recent summarized sales transcripts",
398
+ * collectionName: "myCollection",
399
+ * filterExpression: {
400
+ * "transcriptDatetime": {
401
+ * "$gt": "2023-01-01T00:00:00.000Z"
402
+ * }
403
+ * },
404
+ * sourceFields: {
405
+ * body: "transcriptSummary",
406
+ * sourceName: "meetingName",
407
+ * sourceSystemUpdated: "transcriptDatetime",
408
+ * sourceUrl: "link"
409
+ * }
410
+ * }
411
+ * })
412
+ */
413
+ updateMongoCollectionSync(request, requestOptions) {
414
+ var _a, _b;
415
+ return __awaiter(this, void 0, void 0, function* () {
416
+ const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
417
+ url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/documentCollections/mongodb/updateMongoSync"),
418
+ method: "POST",
419
+ headers: {
420
+ Authorization: yield this._getAuthorizationHeader(),
421
+ "X-Fern-Language": "JavaScript",
422
+ "X-Fern-SDK-Name": "@credal/sdk",
423
+ "X-Fern-SDK-Version": "0.0.13",
424
+ "X-Fern-Runtime": core.RUNTIME.type,
425
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
426
+ },
427
+ contentType: "application/json",
428
+ body: yield serializers.UpdateMongoCollectionSyncRequest.jsonOrThrow(request, {
429
+ unrecognizedObjectKeys: "strip",
430
+ }),
431
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
432
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
433
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
434
+ });
435
+ if (_response.ok) {
436
+ return yield serializers.MongoCollectionSyncResponse.parseOrThrow(_response.body, {
437
+ unrecognizedObjectKeys: "passthrough",
438
+ allowUnrecognizedUnionMembers: true,
439
+ allowUnrecognizedEnumValues: true,
440
+ breadcrumbsPrefix: ["response"],
441
+ });
442
+ }
443
+ if (_response.error.reason === "status-code") {
444
+ throw new errors.CredalError({
445
+ statusCode: _response.error.statusCode,
446
+ body: _response.error.body,
447
+ });
448
+ }
449
+ switch (_response.error.reason) {
450
+ case "non-json":
451
+ throw new errors.CredalError({
452
+ statusCode: _response.error.statusCode,
453
+ body: _response.error.rawBody,
454
+ });
455
+ case "timeout":
456
+ throw new errors.CredalTimeoutError();
457
+ case "unknown":
458
+ throw new errors.CredalError({
459
+ message: _response.error.errorMessage,
460
+ });
461
+ }
462
+ });
463
+ }
308
464
  _getAuthorizationHeader() {
309
465
  var _a;
310
466
  return __awaiter(this, void 0, void 0, function* () {
@@ -0,0 +1,31 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
9
+ * collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a",
10
+ * config: {
11
+ * syncName: "My sales transcripts",
12
+ * collectionName: "myCollection",
13
+ * filterExpression: {
14
+ * "status": {
15
+ * "$ne": "disabled"
16
+ * }
17
+ * },
18
+ * sourceFields: {
19
+ * body: "body",
20
+ * sourceName: "meetingName",
21
+ * sourceSystemUpdated: "transcriptDatetime",
22
+ * sourceUrl: "link"
23
+ * }
24
+ * }
25
+ * }
26
+ */
27
+ export interface CreateMongoCollectionSyncRequest {
28
+ collectionId: string;
29
+ mongoUri: string;
30
+ config: Credal.MongoCollectionSyncConfig;
31
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,31 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../../index";
5
+ /**
6
+ * @example
7
+ * {
8
+ * mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
9
+ * mongoCredentialId: "5988ed76-6ee1-11ef-97dd-1fca54b7c4bc",
10
+ * config: {
11
+ * syncName: "My recent summarized sales transcripts",
12
+ * collectionName: "myCollection",
13
+ * filterExpression: {
14
+ * "transcriptDatetime": {
15
+ * "$gt": "2023-01-01T00:00:00.000Z"
16
+ * }
17
+ * },
18
+ * sourceFields: {
19
+ * body: "transcriptSummary",
20
+ * sourceName: "meetingName",
21
+ * sourceSystemUpdated: "transcriptDatetime",
22
+ * sourceUrl: "link"
23
+ * }
24
+ * }
25
+ * }
26
+ */
27
+ export interface UpdateMongoCollectionSyncRequest {
28
+ mongoCredentialId: string;
29
+ mongoUri: string;
30
+ config: Credal.MongoCollectionSyncConfig;
31
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -2,3 +2,5 @@ export { type AddDocumentsToCollectionRequest } from "./AddDocumentsToCollection
2
2
  export { type RemoveDocumentsFromCollectionRequest } from "./RemoveDocumentsFromCollectionRequest";
3
3
  export { type CreateCollectionRequest } from "./CreateCollectionRequest";
4
4
  export { type DeleteCollectionRequest } from "./DeleteCollectionRequest";
5
+ export { type CreateMongoCollectionSyncRequest } from "./CreateMongoCollectionSyncRequest";
6
+ export { type UpdateMongoCollectionSyncRequest } from "./UpdateMongoCollectionSyncRequest";
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as Credal from "../../../index";
5
+ export interface MongoCollectionSyncConfig {
6
+ syncName: string;
7
+ collectionName: string;
8
+ filterExpression?: unknown;
9
+ sourceFields: Credal.MongoSourceFieldsConfig;
10
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface MongoCollectionSyncResponse {
5
+ mongoCredentialId: string;
6
+ resourceId: string;
7
+ syncLaunched: boolean;
8
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ export interface MongoSourceFieldsConfig {
5
+ body: string;
6
+ sourceName: string;
7
+ sourceSystemUpdated?: string;
8
+ sourceUrl?: string;
9
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated by Fern from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,5 @@
1
1
  export * from "./CreateCollectionResponse";
2
2
  export * from "./DeleteCollectionResponse";
3
+ export * from "./MongoSourceFieldsConfig";
4
+ export * from "./MongoCollectionSyncConfig";
5
+ export * from "./MongoCollectionSyncResponse";
@@ -16,3 +16,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./CreateCollectionResponse"), exports);
18
18
  __exportStar(require("./DeleteCollectionResponse"), exports);
19
+ __exportStar(require("./MongoSourceFieldsConfig"), exports);
20
+ __exportStar(require("./MongoCollectionSyncConfig"), exports);
21
+ __exportStar(require("./MongoCollectionSyncResponse"), exports);
@@ -74,7 +74,7 @@ class PermissionsService {
74
74
  Authorization: yield this._getAuthorizationHeader(),
75
75
  "X-Fern-Language": "JavaScript",
76
76
  "X-Fern-SDK-Name": "@credal/sdk",
77
- "X-Fern-SDK-Version": "0.0.11",
77
+ "X-Fern-SDK-Version": "0.0.13",
78
78
  "X-Fern-Runtime": core.RUNTIME.type,
79
79
  "X-Fern-Runtime-Version": core.RUNTIME.version,
80
80
  },
@@ -144,7 +144,7 @@ class PermissionsService {
144
144
  Authorization: yield this._getAuthorizationHeader(),
145
145
  "X-Fern-Language": "JavaScript",
146
146
  "X-Fern-SDK-Name": "@credal/sdk",
147
- "X-Fern-SDK-Version": "0.0.11",
147
+ "X-Fern-SDK-Version": "0.0.13",
148
148
  "X-Fern-Runtime": core.RUNTIME.type,
149
149
  "X-Fern-Runtime-Version": core.RUNTIME.version,
150
150
  },
@@ -206,7 +206,7 @@ class PermissionsService {
206
206
  Authorization: yield this._getAuthorizationHeader(),
207
207
  "X-Fern-Language": "JavaScript",
208
208
  "X-Fern-SDK-Name": "@credal/sdk",
209
- "X-Fern-SDK-Version": "0.0.11",
209
+ "X-Fern-SDK-Version": "0.0.13",
210
210
  "X-Fern-Runtime": core.RUNTIME.type,
211
211
  "X-Fern-Runtime-Version": core.RUNTIME.version,
212
212
  },
@@ -84,7 +84,7 @@ class Search {
84
84
  Authorization: yield this._getAuthorizationHeader(),
85
85
  "X-Fern-Language": "JavaScript",
86
86
  "X-Fern-SDK-Name": "@credal/sdk",
87
- "X-Fern-SDK-Version": "0.0.11",
87
+ "X-Fern-SDK-Version": "0.0.13",
88
88
  "X-Fern-Runtime": core.RUNTIME.type,
89
89
  "X-Fern-Runtime-Version": core.RUNTIME.version,
90
90
  },
@@ -79,7 +79,7 @@ class Users {
79
79
  Authorization: yield this._getAuthorizationHeader(),
80
80
  "X-Fern-Language": "JavaScript",
81
81
  "X-Fern-SDK-Name": "@credal/sdk",
82
- "X-Fern-SDK-Version": "0.0.11",
82
+ "X-Fern-SDK-Version": "0.0.13",
83
83
  "X-Fern-Runtime": core.RUNTIME.type,
84
84
  "X-Fern-Runtime-Version": core.RUNTIME.version,
85
85
  },
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * This file was auto-generated by Fern from our API Definition.
3
3
  */
4
- export declare type ResourceType = "GOOGLE_DRIVE_ITEM" | "MICROSOFT_DRIVE_ITEM" | "ZENDESK_TICKET" | "ZENDESK_ARTICLE" | "ZENDESK_GROUP" | "ZENDESK_ARTICLE_SECTION" | "CONFLUENCE_PAGE" | "CONFLUENCE_SPACE" | "JIRA_TICKET" | "JIRA_PROJECT" | "SALESFORCE_TASK" | "BOX_FILE" | "BOX_FOLDER" | "NOTION_PAGE" | "UNKNOWN";
4
+ export declare type ResourceType = "GOOGLE_DRIVE_ITEM" | "MICROSOFT_DRIVE_ITEM" | "ZENDESK_TICKET" | "ZENDESK_ARTICLE" | "ZENDESK_GROUP" | "ZENDESK_ARTICLE_SECTION" | "ZENDESK_ARTICLE_CATEGORY" | "CONFLUENCE_PAGE" | "CONFLUENCE_SPACE" | "JIRA_TICKET" | "JIRA_PROJECT" | "SALESFORCE_TASK" | "BOX_FILE" | "BOX_FOLDER" | "NOTION_PAGE" | "NOTION_DATABASE" | "SLACK_CHANNEL" | "MONGO_COLLECTION_SYNC" | "UNKNOWN";
5
5
  export declare const ResourceType: {
6
6
  readonly GoogleDriveItem: "GOOGLE_DRIVE_ITEM";
7
7
  readonly MicrosoftDriveItem: "MICROSOFT_DRIVE_ITEM";
@@ -9,6 +9,7 @@ export declare const ResourceType: {
9
9
  readonly ZendeskArticle: "ZENDESK_ARTICLE";
10
10
  readonly ZendeskGroup: "ZENDESK_GROUP";
11
11
  readonly ZendeskArticleSection: "ZENDESK_ARTICLE_SECTION";
12
+ readonly ZendeskArticleCategory: "ZENDESK_ARTICLE_CATEGORY";
12
13
  readonly ConfluencePage: "CONFLUENCE_PAGE";
13
14
  readonly ConfluenceSpace: "CONFLUENCE_SPACE";
14
15
  readonly JiraTicket: "JIRA_TICKET";
@@ -17,5 +18,8 @@ export declare const ResourceType: {
17
18
  readonly BoxFile: "BOX_FILE";
18
19
  readonly BoxFolder: "BOX_FOLDER";
19
20
  readonly NotionPage: "NOTION_PAGE";
21
+ readonly NotionDatabase: "NOTION_DATABASE";
22
+ readonly SlackChannel: "SLACK_CHANNEL";
23
+ readonly MongoCollectionSync: "MONGO_COLLECTION_SYNC";
20
24
  readonly Unknown: "UNKNOWN";
21
25
  };
@@ -11,6 +11,7 @@ exports.ResourceType = {
11
11
  ZendeskArticle: "ZENDESK_ARTICLE",
12
12
  ZendeskGroup: "ZENDESK_GROUP",
13
13
  ZendeskArticleSection: "ZENDESK_ARTICLE_SECTION",
14
+ ZendeskArticleCategory: "ZENDESK_ARTICLE_CATEGORY",
14
15
  ConfluencePage: "CONFLUENCE_PAGE",
15
16
  ConfluenceSpace: "CONFLUENCE_SPACE",
16
17
  JiraTicket: "JIRA_TICKET",
@@ -19,5 +20,8 @@ exports.ResourceType = {
19
20
  BoxFile: "BOX_FILE",
20
21
  BoxFolder: "BOX_FOLDER",
21
22
  NotionPage: "NOTION_PAGE",
23
+ NotionDatabase: "NOTION_DATABASE",
24
+ SlackChannel: "SLACK_CHANNEL",
25
+ MongoCollectionSync: "MONGO_COLLECTION_SYNC",
22
26
  Unknown: "UNKNOWN",
23
27
  };