polytomic 1.15.2 → 1.16.1

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 (100) hide show
  1. package/api/resources/bulkSync/client/Client.d.ts +13 -0
  2. package/api/resources/bulkSync/client/Client.js +72 -10
  3. package/api/resources/bulkSync/resources/executions/client/Client.d.ts +14 -0
  4. package/api/resources/bulkSync/resources/executions/client/Client.js +68 -5
  5. package/api/resources/bulkSync/resources/schedules/client/Client.js +5 -5
  6. package/api/resources/bulkSync/resources/schemas/client/Client.d.ts +14 -0
  7. package/api/resources/bulkSync/resources/schemas/client/Client.js +67 -4
  8. package/api/resources/connections/client/Client.d.ts +32 -0
  9. package/api/resources/connections/client/Client.js +142 -10
  10. package/api/resources/connections/client/requests/ApiRequest.d.ts +13 -0
  11. package/api/resources/connections/client/requests/ApiRequest.js +5 -0
  12. package/api/resources/connections/client/requests/GetConnectionTypeParameterValuesRequestSchema.d.ts +15 -0
  13. package/api/resources/connections/client/requests/GetConnectionTypeParameterValuesRequestSchema.js +5 -0
  14. package/api/resources/connections/client/requests/index.d.ts +2 -0
  15. package/api/resources/events/client/Client.js +2 -2
  16. package/api/resources/identity/client/Client.js +1 -1
  17. package/api/resources/jobs/client/Client.js +1 -1
  18. package/api/resources/modelSync/client/Client.js +12 -12
  19. package/api/resources/modelSync/resources/executions/client/Client.js +5 -5
  20. package/api/resources/modelSync/resources/targets/client/Client.js +4 -4
  21. package/api/resources/models/client/Client.js +9 -9
  22. package/api/resources/notifications/client/Client.js +2 -2
  23. package/api/resources/organization/client/Client.js +5 -5
  24. package/api/resources/permissions/resources/policies/client/Client.js +5 -5
  25. package/api/resources/permissions/resources/roles/client/Client.js +5 -5
  26. package/api/resources/queryRunner/client/Client.js +2 -2
  27. package/api/resources/schemas/client/Client.js +8 -8
  28. package/api/resources/users/client/Client.d.ts +5 -20
  29. package/api/resources/users/client/Client.js +21 -26
  30. package/api/resources/users/client/requests/CreateUserRequestSchema.d.ts +1 -0
  31. package/api/resources/users/client/requests/UpdateUserRequestSchema.d.ts +1 -0
  32. package/api/resources/webhooks/client/Client.js +7 -7
  33. package/api/types/BulkBulkSyncSchedule.d.ts +2 -0
  34. package/api/types/BulkScheduleSyncMode.d.ts +10 -0
  35. package/api/types/BulkScheduleSyncMode.js +12 -0
  36. package/api/types/CancelBulkSyncResponse.d.ts +6 -0
  37. package/api/types/CancelBulkSyncResponse.js +5 -0
  38. package/api/types/CancelBulkSyncResponseEnvelope.d.ts +7 -0
  39. package/api/types/CancelBulkSyncResponseEnvelope.js +5 -0
  40. package/api/types/ConnectionResponseSchema.d.ts +2 -0
  41. package/api/types/CreateSharedConnectionResponseSchema.d.ts +6 -0
  42. package/api/types/CreateSharedConnectionResponseSchema.js +5 -0
  43. package/api/types/User.d.ts +1 -0
  44. package/api/types/V2CreateSharedConnectionResponseEnvelope.d.ts +7 -0
  45. package/api/types/V2CreateSharedConnectionResponseEnvelope.js +5 -0
  46. package/api/types/index.d.ts +5 -0
  47. package/api/types/index.js +5 -0
  48. package/dist/api/resources/bulkSync/client/Client.d.ts +13 -0
  49. package/dist/api/resources/bulkSync/client/Client.js +72 -10
  50. package/dist/api/resources/bulkSync/resources/executions/client/Client.d.ts +14 -0
  51. package/dist/api/resources/bulkSync/resources/executions/client/Client.js +68 -5
  52. package/dist/api/resources/bulkSync/resources/schedules/client/Client.js +5 -5
  53. package/dist/api/resources/bulkSync/resources/schemas/client/Client.d.ts +14 -0
  54. package/dist/api/resources/bulkSync/resources/schemas/client/Client.js +67 -4
  55. package/dist/api/resources/connections/client/Client.d.ts +32 -0
  56. package/dist/api/resources/connections/client/Client.js +142 -10
  57. package/dist/api/resources/connections/client/requests/ApiRequest.d.ts +13 -0
  58. package/dist/api/resources/connections/client/requests/ApiRequest.js +5 -0
  59. package/dist/api/resources/connections/client/requests/GetConnectionTypeParameterValuesRequestSchema.d.ts +15 -0
  60. package/dist/api/resources/connections/client/requests/GetConnectionTypeParameterValuesRequestSchema.js +5 -0
  61. package/dist/api/resources/connections/client/requests/index.d.ts +2 -0
  62. package/dist/api/resources/events/client/Client.js +2 -2
  63. package/dist/api/resources/identity/client/Client.js +1 -1
  64. package/dist/api/resources/jobs/client/Client.js +1 -1
  65. package/dist/api/resources/modelSync/client/Client.js +12 -12
  66. package/dist/api/resources/modelSync/resources/executions/client/Client.js +5 -5
  67. package/dist/api/resources/modelSync/resources/targets/client/Client.js +4 -4
  68. package/dist/api/resources/models/client/Client.js +9 -9
  69. package/dist/api/resources/notifications/client/Client.js +2 -2
  70. package/dist/api/resources/organization/client/Client.js +5 -5
  71. package/dist/api/resources/permissions/resources/policies/client/Client.js +5 -5
  72. package/dist/api/resources/permissions/resources/roles/client/Client.js +5 -5
  73. package/dist/api/resources/queryRunner/client/Client.js +2 -2
  74. package/dist/api/resources/schemas/client/Client.js +8 -8
  75. package/dist/api/resources/users/client/Client.d.ts +5 -20
  76. package/dist/api/resources/users/client/Client.js +21 -26
  77. package/dist/api/resources/users/client/requests/CreateUserRequestSchema.d.ts +1 -0
  78. package/dist/api/resources/users/client/requests/UpdateUserRequestSchema.d.ts +1 -0
  79. package/dist/api/resources/webhooks/client/Client.js +7 -7
  80. package/dist/api/types/BulkBulkSyncSchedule.d.ts +2 -0
  81. package/dist/api/types/BulkScheduleSyncMode.d.ts +10 -0
  82. package/dist/api/types/BulkScheduleSyncMode.js +12 -0
  83. package/dist/api/types/CancelBulkSyncResponse.d.ts +6 -0
  84. package/dist/api/types/CancelBulkSyncResponse.js +5 -0
  85. package/dist/api/types/CancelBulkSyncResponseEnvelope.d.ts +7 -0
  86. package/dist/api/types/CancelBulkSyncResponseEnvelope.js +5 -0
  87. package/dist/api/types/ConnectionResponseSchema.d.ts +2 -0
  88. package/dist/api/types/CreateSharedConnectionResponseSchema.d.ts +6 -0
  89. package/dist/api/types/CreateSharedConnectionResponseSchema.js +5 -0
  90. package/dist/api/types/User.d.ts +1 -0
  91. package/dist/api/types/V2CreateSharedConnectionResponseEnvelope.d.ts +7 -0
  92. package/dist/api/types/V2CreateSharedConnectionResponseEnvelope.js +5 -0
  93. package/dist/api/types/index.d.ts +5 -0
  94. package/dist/api/types/index.js +5 -0
  95. package/dist/version.d.ts +1 -1
  96. package/dist/version.js +1 -1
  97. package/package.json +1 -1
  98. package/reference.md +276 -85
  99. package/version.d.ts +1 -1
  100. package/version.js +1 -1
@@ -72,6 +72,20 @@ export declare class Executions {
72
72
  * await client.bulkSync.executions.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
73
73
  */
74
74
  get(id: string, execId: string, requestOptions?: Executions.RequestOptions): Promise<Polytomic.BulkSyncExecutionEnvelope>;
75
+ /**
76
+ * @param {string} id - The bulk sync ID.
77
+ * @param {string} execId - The execution ID to cancel.
78
+ * @param {Executions.RequestOptions} requestOptions - Request-specific configuration.
79
+ *
80
+ * @throws {@link Polytomic.UnauthorizedError}
81
+ * @throws {@link Polytomic.ForbiddenError}
82
+ * @throws {@link Polytomic.NotFoundError}
83
+ * @throws {@link Polytomic.InternalServerError}
84
+ *
85
+ * @example
86
+ * await client.bulkSync.executions.cancel("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
87
+ */
88
+ cancel(id: string, execId: string, requestOptions?: Executions.RequestOptions): Promise<Polytomic.CancelBulkSyncResponseEnvelope>;
75
89
  /**
76
90
  * @param {string} syncId
77
91
  * @param {string} executionId
@@ -95,7 +95,7 @@ class Executions {
95
95
  method: "GET",
96
96
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
97
97
  ? yield core.Supplier.get(this._options.version)
98
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
98
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
99
99
  contentType: "application/json",
100
100
  queryParameters: _queryParams,
101
101
  requestType: "json",
@@ -172,7 +172,7 @@ class Executions {
172
172
  method: "GET",
173
173
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
174
174
  ? yield core.Supplier.get(this._options.version)
175
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
175
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
176
176
  contentType: "application/json",
177
177
  queryParameters: _queryParams,
178
178
  requestType: "json",
@@ -230,7 +230,7 @@ class Executions {
230
230
  method: "GET",
231
231
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
232
232
  ? yield core.Supplier.get(this._options.version)
233
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
233
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
234
234
  contentType: "application/json",
235
235
  requestType: "json",
236
236
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -268,6 +268,69 @@ class Executions {
268
268
  }
269
269
  });
270
270
  }
271
+ /**
272
+ * @param {string} id - The bulk sync ID.
273
+ * @param {string} execId - The execution ID to cancel.
274
+ * @param {Executions.RequestOptions} requestOptions - Request-specific configuration.
275
+ *
276
+ * @throws {@link Polytomic.UnauthorizedError}
277
+ * @throws {@link Polytomic.ForbiddenError}
278
+ * @throws {@link Polytomic.NotFoundError}
279
+ * @throws {@link Polytomic.InternalServerError}
280
+ *
281
+ * @example
282
+ * await client.bulkSync.executions.cancel("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
283
+ */
284
+ cancel(id, execId, requestOptions) {
285
+ return __awaiter(this, void 0, void 0, function* () {
286
+ var _a, _b;
287
+ const _response = yield core.fetcher({
288
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/bulk/syncs/${encodeURIComponent(id)}/executions/${encodeURIComponent(execId)}/cancel`),
289
+ method: "POST",
290
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
291
+ ? yield core.Supplier.get(this._options.version)
292
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
293
+ contentType: "application/json",
294
+ requestType: "json",
295
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
296
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
297
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
298
+ });
299
+ if (_response.ok) {
300
+ return _response.body;
301
+ }
302
+ if (_response.error.reason === "status-code") {
303
+ switch (_response.error.statusCode) {
304
+ case 401:
305
+ throw new Polytomic.UnauthorizedError(_response.error.body);
306
+ case 403:
307
+ throw new Polytomic.ForbiddenError(_response.error.body);
308
+ case 404:
309
+ throw new Polytomic.NotFoundError(_response.error.body);
310
+ case 500:
311
+ throw new Polytomic.InternalServerError(_response.error.body);
312
+ default:
313
+ throw new errors.PolytomicError({
314
+ statusCode: _response.error.statusCode,
315
+ body: _response.error.body,
316
+ });
317
+ }
318
+ }
319
+ switch (_response.error.reason) {
320
+ case "non-json":
321
+ throw new errors.PolytomicError({
322
+ statusCode: _response.error.statusCode,
323
+ body: _response.error.rawBody,
324
+ });
325
+ case "timeout":
326
+ throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/bulk/syncs/{id}/executions/{exec_id}/cancel.");
327
+ case "unknown":
328
+ throw new errors.PolytomicError({
329
+ message: _response.error.errorMessage,
330
+ });
331
+ }
332
+ });
333
+ }
271
334
  /**
272
335
  * @param {string} syncId
273
336
  * @param {string} executionId
@@ -287,7 +350,7 @@ class Executions {
287
350
  method: "GET",
288
351
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
289
352
  ? yield core.Supplier.get(this._options.version)
290
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
353
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
291
354
  contentType: "application/json",
292
355
  requestType: "json",
293
356
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -352,7 +415,7 @@ class Executions {
352
415
  method: "POST",
353
416
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
354
417
  ? yield core.Supplier.get(this._options.version)
355
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
418
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
356
419
  contentType: "application/json",
357
420
  queryParameters: _queryParams,
358
421
  requestType: "json",
@@ -78,7 +78,7 @@ class Schedules {
78
78
  method: "GET",
79
79
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
80
80
  ? yield core.Supplier.get(this._options.version)
81
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
81
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
82
82
  contentType: "application/json",
83
83
  requestType: "json",
84
84
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -146,7 +146,7 @@ class Schedules {
146
146
  method: "POST",
147
147
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
148
148
  ? yield core.Supplier.get(this._options.version)
149
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
149
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
150
150
  contentType: "application/json",
151
151
  requestType: "json",
152
152
  body: request,
@@ -212,7 +212,7 @@ class Schedules {
212
212
  method: "GET",
213
213
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
214
214
  ? yield core.Supplier.get(this._options.version)
215
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
215
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
216
216
  contentType: "application/json",
217
217
  requestType: "json",
218
218
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -281,7 +281,7 @@ class Schedules {
281
281
  method: "PUT",
282
282
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
283
283
  ? yield core.Supplier.get(this._options.version)
284
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
284
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
285
285
  contentType: "application/json",
286
286
  requestType: "json",
287
287
  body: request,
@@ -347,7 +347,7 @@ class Schedules {
347
347
  method: "DELETE",
348
348
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
349
349
  ? yield core.Supplier.get(this._options.version)
350
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
350
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
351
351
  contentType: "application/json",
352
352
  requestType: "json",
353
353
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -83,5 +83,19 @@ export declare class Schemas {
83
83
  * await client.bulkSync.schemas.update("248df4b7-aa70-47b8-a036-33ac447e668d", "contact")
84
84
  */
85
85
  update(id: string, schemaId: string, request?: Polytomic.bulkSync.UpdateBulkSchema, requestOptions?: Schemas.RequestOptions): Promise<Polytomic.BulkSchemaEnvelope>;
86
+ /**
87
+ * @param {string} id - The bulk sync ID.
88
+ * @param {string} schemaId - The schema ID to cancel for the bulk sync.
89
+ * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration.
90
+ *
91
+ * @throws {@link Polytomic.UnauthorizedError}
92
+ * @throws {@link Polytomic.ForbiddenError}
93
+ * @throws {@link Polytomic.NotFoundError}
94
+ * @throws {@link Polytomic.InternalServerError}
95
+ *
96
+ * @example
97
+ * await client.bulkSync.schemas.cancel("248df4b7-aa70-47b8-a036-33ac447e668d", "schema_id")
98
+ */
99
+ cancel(id: string, schemaId: string, requestOptions?: Schemas.RequestOptions): Promise<Polytomic.CancelBulkSyncResponseEnvelope>;
86
100
  protected _getAuthorizationHeader(): Promise<string>;
87
101
  }
@@ -83,7 +83,7 @@ class Schemas {
83
83
  method: "GET",
84
84
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
85
85
  ? yield core.Supplier.get(this._options.version)
86
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
86
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
87
87
  contentType: "application/json",
88
88
  queryParameters: _queryParams,
89
89
  requestType: "json",
@@ -144,7 +144,7 @@ class Schemas {
144
144
  method: "PATCH",
145
145
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
146
146
  ? yield core.Supplier.get(this._options.version)
147
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
147
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
148
148
  contentType: "application/json",
149
149
  requestType: "json",
150
150
  body: request,
@@ -208,7 +208,7 @@ class Schemas {
208
208
  method: "GET",
209
209
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
210
210
  ? yield core.Supplier.get(this._options.version)
211
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
211
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
212
212
  contentType: "application/json",
213
213
  requestType: "json",
214
214
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -268,7 +268,7 @@ class Schemas {
268
268
  method: "PUT",
269
269
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
270
270
  ? yield core.Supplier.get(this._options.version)
271
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
271
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
272
272
  contentType: "application/json",
273
273
  requestType: "json",
274
274
  body: request,
@@ -311,6 +311,69 @@ class Schemas {
311
311
  }
312
312
  });
313
313
  }
314
+ /**
315
+ * @param {string} id - The bulk sync ID.
316
+ * @param {string} schemaId - The schema ID to cancel for the bulk sync.
317
+ * @param {Schemas.RequestOptions} requestOptions - Request-specific configuration.
318
+ *
319
+ * @throws {@link Polytomic.UnauthorizedError}
320
+ * @throws {@link Polytomic.ForbiddenError}
321
+ * @throws {@link Polytomic.NotFoundError}
322
+ * @throws {@link Polytomic.InternalServerError}
323
+ *
324
+ * @example
325
+ * await client.bulkSync.schemas.cancel("248df4b7-aa70-47b8-a036-33ac447e668d", "schema_id")
326
+ */
327
+ cancel(id, schemaId, requestOptions) {
328
+ return __awaiter(this, void 0, void 0, function* () {
329
+ var _a, _b;
330
+ const _response = yield core.fetcher({
331
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/bulk/syncs/${encodeURIComponent(id)}/schemas/${encodeURIComponent(schemaId)}/cancel`),
332
+ method: "POST",
333
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
334
+ ? yield core.Supplier.get(this._options.version)
335
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
336
+ contentType: "application/json",
337
+ requestType: "json",
338
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
339
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
340
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
341
+ });
342
+ if (_response.ok) {
343
+ return _response.body;
344
+ }
345
+ if (_response.error.reason === "status-code") {
346
+ switch (_response.error.statusCode) {
347
+ case 401:
348
+ throw new Polytomic.UnauthorizedError(_response.error.body);
349
+ case 403:
350
+ throw new Polytomic.ForbiddenError(_response.error.body);
351
+ case 404:
352
+ throw new Polytomic.NotFoundError(_response.error.body);
353
+ case 500:
354
+ throw new Polytomic.InternalServerError(_response.error.body);
355
+ default:
356
+ throw new errors.PolytomicError({
357
+ statusCode: _response.error.statusCode,
358
+ body: _response.error.body,
359
+ });
360
+ }
361
+ }
362
+ switch (_response.error.reason) {
363
+ case "non-json":
364
+ throw new errors.PolytomicError({
365
+ statusCode: _response.error.statusCode,
366
+ body: _response.error.rawBody,
367
+ });
368
+ case "timeout":
369
+ throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/bulk/syncs/{id}/schemas/{schema_id}/cancel.");
370
+ case "unknown":
371
+ throw new errors.PolytomicError({
372
+ message: _response.error.errorMessage,
373
+ });
374
+ }
375
+ });
376
+ }
314
377
  _getAuthorizationHeader() {
315
378
  return __awaiter(this, void 0, void 0, function* () {
316
379
  return `Bearer ${yield core.Supplier.get(this._options.token)}`;
@@ -51,6 +51,22 @@ export declare class Connections {
51
51
  * await client.connections.getConnectionTypeSchema("postgresql")
52
52
  */
53
53
  getConnectionTypeSchema(id: string, requestOptions?: Connections.RequestOptions): Promise<Polytomic.JsonschemaSchema>;
54
+ /**
55
+ * @param {string} type_
56
+ * @param {Polytomic.GetConnectionTypeParameterValuesRequestSchema} request
57
+ * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
58
+ *
59
+ * @throws {@link Polytomic.BadRequestError}
60
+ * @throws {@link Polytomic.UnauthorizedError}
61
+ * @throws {@link Polytomic.NotFoundError}
62
+ * @throws {@link Polytomic.InternalServerError}
63
+ *
64
+ * @example
65
+ * await client.connections.getTypeParameterValues("type", {
66
+ * field: "field"
67
+ * })
68
+ */
69
+ getTypeParameterValues(type_: string, request: Polytomic.GetConnectionTypeParameterValuesRequestSchema, requestOptions?: Connections.RequestOptions): Promise<Polytomic.ConnectionParameterValuesResponseEnvelope>;
54
70
  /**
55
71
  * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
56
72
  *
@@ -201,5 +217,21 @@ export declare class Connections {
201
217
  * await client.connections.getParameterValues("248df4b7-aa70-47b8-a036-33ac447e668d")
202
218
  */
203
219
  getParameterValues(id: string, requestOptions?: Connections.RequestOptions): Promise<Polytomic.ConnectionParameterValuesResponseEnvelope>;
220
+ /**
221
+ * @param {string} id
222
+ * @param {Polytomic.ApiRequest} request
223
+ * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
224
+ *
225
+ * @throws {@link Polytomic.UnauthorizedError}
226
+ * @throws {@link Polytomic.ForbiddenError}
227
+ * @throws {@link Polytomic.NotFoundError}
228
+ * @throws {@link Polytomic.InternalServerError}
229
+ *
230
+ * @example
231
+ * await client.connections.apiV2CreateSharedConnection("248df4b7-aa70-47b8-a036-33ac447e668d", {
232
+ * organization_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
233
+ * })
234
+ */
235
+ apiV2CreateSharedConnection(id: string, request: Polytomic.ApiRequest, requestOptions?: Connections.RequestOptions): Promise<Polytomic.V2CreateSharedConnectionResponseEnvelope>;
204
236
  protected _getAuthorizationHeader(): Promise<string>;
205
237
  }
@@ -75,7 +75,7 @@ class Connections {
75
75
  method: "GET",
76
76
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
77
77
  ? yield core.Supplier.get(this._options.version)
78
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
78
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
79
79
  contentType: "application/json",
80
80
  requestType: "json",
81
81
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -132,7 +132,7 @@ class Connections {
132
132
  method: "GET",
133
133
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
134
134
  ? yield core.Supplier.get(this._options.version)
135
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
135
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
136
136
  contentType: "application/json",
137
137
  requestType: "json",
138
138
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -172,6 +172,72 @@ class Connections {
172
172
  }
173
173
  });
174
174
  }
175
+ /**
176
+ * @param {string} type_
177
+ * @param {Polytomic.GetConnectionTypeParameterValuesRequestSchema} request
178
+ * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
179
+ *
180
+ * @throws {@link Polytomic.BadRequestError}
181
+ * @throws {@link Polytomic.UnauthorizedError}
182
+ * @throws {@link Polytomic.NotFoundError}
183
+ * @throws {@link Polytomic.InternalServerError}
184
+ *
185
+ * @example
186
+ * await client.connections.getTypeParameterValues("type", {
187
+ * field: "field"
188
+ * })
189
+ */
190
+ getTypeParameterValues(type_, request, requestOptions) {
191
+ return __awaiter(this, void 0, void 0, function* () {
192
+ var _a, _b;
193
+ const _response = yield core.fetcher({
194
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connection_types/${encodeURIComponent(type_)}/parameter_values`),
195
+ method: "POST",
196
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
197
+ ? yield core.Supplier.get(this._options.version)
198
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
199
+ contentType: "application/json",
200
+ requestType: "json",
201
+ body: request,
202
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
203
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
204
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
205
+ });
206
+ if (_response.ok) {
207
+ return _response.body;
208
+ }
209
+ if (_response.error.reason === "status-code") {
210
+ switch (_response.error.statusCode) {
211
+ case 400:
212
+ throw new Polytomic.BadRequestError(_response.error.body);
213
+ case 401:
214
+ throw new Polytomic.UnauthorizedError(_response.error.body);
215
+ case 404:
216
+ throw new Polytomic.NotFoundError(_response.error.body);
217
+ case 500:
218
+ throw new Polytomic.InternalServerError(_response.error.body);
219
+ default:
220
+ throw new errors.PolytomicError({
221
+ statusCode: _response.error.statusCode,
222
+ body: _response.error.body,
223
+ });
224
+ }
225
+ }
226
+ switch (_response.error.reason) {
227
+ case "non-json":
228
+ throw new errors.PolytomicError({
229
+ statusCode: _response.error.statusCode,
230
+ body: _response.error.rawBody,
231
+ });
232
+ case "timeout":
233
+ throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/connection_types/{type}/parameter_values.");
234
+ case "unknown":
235
+ throw new errors.PolytomicError({
236
+ message: _response.error.errorMessage,
237
+ });
238
+ }
239
+ });
240
+ }
175
241
  /**
176
242
  * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
177
243
  *
@@ -189,7 +255,7 @@ class Connections {
189
255
  method: "GET",
190
256
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
191
257
  ? yield core.Supplier.get(this._options.version)
192
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
258
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
193
259
  contentType: "application/json",
194
260
  requestType: "json",
195
261
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -258,7 +324,7 @@ class Connections {
258
324
  method: "POST",
259
325
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
260
326
  ? yield core.Supplier.get(this._options.version)
261
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
327
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
262
328
  contentType: "application/json",
263
329
  requestType: "json",
264
330
  body: request,
@@ -336,7 +402,7 @@ class Connections {
336
402
  method: "POST",
337
403
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
338
404
  ? yield core.Supplier.get(this._options.version)
339
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
405
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
340
406
  contentType: "application/json",
341
407
  requestType: "json",
342
408
  body: request,
@@ -410,7 +476,7 @@ class Connections {
410
476
  method: "POST",
411
477
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
412
478
  ? yield core.Supplier.get(this._options.version)
413
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
479
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
414
480
  contentType: "application/json",
415
481
  requestType: "json",
416
482
  body: request,
@@ -472,7 +538,7 @@ class Connections {
472
538
  method: "GET",
473
539
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
474
540
  ? yield core.Supplier.get(this._options.version)
475
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
541
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
476
542
  contentType: "application/json",
477
543
  requestType: "json",
478
544
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -544,7 +610,7 @@ class Connections {
544
610
  method: "PUT",
545
611
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
546
612
  ? yield core.Supplier.get(this._options.version)
547
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
613
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
548
614
  contentType: "application/json",
549
615
  requestType: "json",
550
616
  body: request,
@@ -620,7 +686,7 @@ class Connections {
620
686
  method: "DELETE",
621
687
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
622
688
  ? yield core.Supplier.get(this._options.version)
623
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
689
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
624
690
  contentType: "application/json",
625
691
  queryParameters: _queryParams,
626
692
  requestType: "json",
@@ -684,7 +750,7 @@ class Connections {
684
750
  method: "GET",
685
751
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
686
752
  ? yield core.Supplier.get(this._options.version)
687
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.15.2", "User-Agent": "polytomic/1.15.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
753
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
688
754
  contentType: "application/json",
689
755
  requestType: "json",
690
756
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -724,6 +790,72 @@ class Connections {
724
790
  }
725
791
  });
726
792
  }
793
+ /**
794
+ * @param {string} id
795
+ * @param {Polytomic.ApiRequest} request
796
+ * @param {Connections.RequestOptions} requestOptions - Request-specific configuration.
797
+ *
798
+ * @throws {@link Polytomic.UnauthorizedError}
799
+ * @throws {@link Polytomic.ForbiddenError}
800
+ * @throws {@link Polytomic.NotFoundError}
801
+ * @throws {@link Polytomic.InternalServerError}
802
+ *
803
+ * @example
804
+ * await client.connections.apiV2CreateSharedConnection("248df4b7-aa70-47b8-a036-33ac447e668d", {
805
+ * organization_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
806
+ * })
807
+ */
808
+ apiV2CreateSharedConnection(id, request, requestOptions) {
809
+ return __awaiter(this, void 0, void 0, function* () {
810
+ var _a, _b;
811
+ const _response = yield core.fetcher({
812
+ url: (0, url_join_1.default)((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.PolytomicEnvironment.Default, `api/connections/${encodeURIComponent(id)}/share`),
813
+ method: "POST",
814
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
815
+ ? yield core.Supplier.get(this._options.version)
816
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.1", "User-Agent": "polytomic/1.16.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
817
+ contentType: "application/json",
818
+ requestType: "json",
819
+ body: request,
820
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
821
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
822
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
823
+ });
824
+ if (_response.ok) {
825
+ return _response.body;
826
+ }
827
+ if (_response.error.reason === "status-code") {
828
+ switch (_response.error.statusCode) {
829
+ case 401:
830
+ throw new Polytomic.UnauthorizedError(_response.error.body);
831
+ case 403:
832
+ throw new Polytomic.ForbiddenError(_response.error.body);
833
+ case 404:
834
+ throw new Polytomic.NotFoundError(_response.error.body);
835
+ case 500:
836
+ throw new Polytomic.InternalServerError(_response.error.body);
837
+ default:
838
+ throw new errors.PolytomicError({
839
+ statusCode: _response.error.statusCode,
840
+ body: _response.error.body,
841
+ });
842
+ }
843
+ }
844
+ switch (_response.error.reason) {
845
+ case "non-json":
846
+ throw new errors.PolytomicError({
847
+ statusCode: _response.error.statusCode,
848
+ body: _response.error.rawBody,
849
+ });
850
+ case "timeout":
851
+ throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/connections/{id}/share.");
852
+ case "unknown":
853
+ throw new errors.PolytomicError({
854
+ message: _response.error.errorMessage,
855
+ });
856
+ }
857
+ });
858
+ }
727
859
  _getAuthorizationHeader() {
728
860
  return __awaiter(this, void 0, void 0, function* () {
729
861
  return `Bearer ${yield core.Supplier.get(this._options.token)}`;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ /**
5
+ * @example
6
+ * {
7
+ * organization_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
8
+ * }
9
+ */
10
+ export interface ApiRequest {
11
+ name?: string;
12
+ organization_id: string;
13
+ }