polytomic 1.14.4 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/Client.d.ts +3 -0
  2. package/Client.js +13 -8
  3. package/api/resources/bulkSync/client/Client.d.ts +13 -0
  4. package/api/resources/bulkSync/client/Client.js +72 -10
  5. package/api/resources/bulkSync/resources/executions/client/Client.d.ts +14 -0
  6. package/api/resources/bulkSync/resources/executions/client/Client.js +68 -5
  7. package/api/resources/bulkSync/resources/schedules/client/Client.js +5 -5
  8. package/api/resources/bulkSync/resources/schemas/client/Client.d.ts +14 -0
  9. package/api/resources/bulkSync/resources/schemas/client/Client.js +67 -4
  10. package/api/resources/connections/client/Client.js +10 -10
  11. package/api/resources/events/client/Client.js +2 -2
  12. package/api/resources/identity/client/Client.js +1 -1
  13. package/api/resources/index.d.ts +2 -0
  14. package/api/resources/index.js +3 -1
  15. package/api/resources/jobs/client/Client.js +1 -1
  16. package/api/resources/modelSync/client/Client.js +12 -12
  17. package/api/resources/modelSync/resources/executions/client/Client.js +5 -5
  18. package/api/resources/modelSync/resources/targets/client/Client.js +4 -4
  19. package/api/resources/models/client/Client.js +9 -9
  20. package/api/resources/notifications/client/Client.d.ts +55 -0
  21. package/api/resources/notifications/client/Client.js +182 -0
  22. package/api/resources/notifications/client/index.d.ts +1 -0
  23. package/api/resources/notifications/client/index.js +17 -0
  24. package/api/resources/notifications/client/requests/V4GlobalErrorSubscribersRequest.d.ts +10 -0
  25. package/api/resources/notifications/client/requests/V4GlobalErrorSubscribersRequest.js +5 -0
  26. package/api/resources/notifications/client/requests/index.d.ts +1 -0
  27. package/api/resources/notifications/client/requests/index.js +2 -0
  28. package/api/resources/notifications/index.d.ts +1 -0
  29. package/api/resources/notifications/index.js +17 -0
  30. package/api/resources/organization/client/Client.js +5 -5
  31. package/api/resources/permissions/resources/policies/client/Client.js +5 -5
  32. package/api/resources/permissions/resources/roles/client/Client.js +5 -5
  33. package/api/resources/queryRunner/client/Client.js +2 -2
  34. package/api/resources/schemas/client/Client.js +8 -8
  35. package/api/resources/users/client/Client.d.ts +5 -20
  36. package/api/resources/users/client/Client.js +21 -26
  37. package/api/resources/webhooks/client/Client.js +7 -7
  38. package/api/types/BackendConnectionCapabilities.d.ts +4 -4
  39. package/api/types/BulkBulkSyncSchedule.d.ts +2 -0
  40. package/api/types/BulkScheduleSyncMode.d.ts +10 -0
  41. package/api/types/BulkScheduleSyncMode.js +12 -0
  42. package/api/types/CancelBulkSyncResponse.d.ts +6 -0
  43. package/api/types/CancelBulkSyncResponse.js +5 -0
  44. package/api/types/CancelBulkSyncResponseEnvelope.d.ts +7 -0
  45. package/api/types/CancelBulkSyncResponseEnvelope.js +5 -0
  46. package/api/types/ConnectionType.d.ts +1 -1
  47. package/api/types/V4GlobalErrorSubscribersResponse.d.ts +6 -0
  48. package/api/types/V4GlobalErrorSubscribersResponse.js +5 -0
  49. package/api/types/index.d.ts +4 -0
  50. package/api/types/index.js +4 -0
  51. package/dist/Client.d.ts +3 -0
  52. package/dist/Client.js +13 -8
  53. package/dist/api/resources/bulkSync/client/Client.d.ts +13 -0
  54. package/dist/api/resources/bulkSync/client/Client.js +72 -10
  55. package/dist/api/resources/bulkSync/resources/executions/client/Client.d.ts +14 -0
  56. package/dist/api/resources/bulkSync/resources/executions/client/Client.js +68 -5
  57. package/dist/api/resources/bulkSync/resources/schedules/client/Client.js +5 -5
  58. package/dist/api/resources/bulkSync/resources/schemas/client/Client.d.ts +14 -0
  59. package/dist/api/resources/bulkSync/resources/schemas/client/Client.js +67 -4
  60. package/dist/api/resources/connections/client/Client.js +10 -10
  61. package/dist/api/resources/events/client/Client.js +2 -2
  62. package/dist/api/resources/identity/client/Client.js +1 -1
  63. package/dist/api/resources/index.d.ts +2 -0
  64. package/dist/api/resources/index.js +3 -1
  65. package/dist/api/resources/jobs/client/Client.js +1 -1
  66. package/dist/api/resources/modelSync/client/Client.js +12 -12
  67. package/dist/api/resources/modelSync/resources/executions/client/Client.js +5 -5
  68. package/dist/api/resources/modelSync/resources/targets/client/Client.js +4 -4
  69. package/dist/api/resources/models/client/Client.js +9 -9
  70. package/dist/api/resources/notifications/client/Client.d.ts +55 -0
  71. package/dist/api/resources/notifications/client/Client.js +182 -0
  72. package/dist/api/resources/notifications/client/index.d.ts +1 -0
  73. package/dist/api/resources/notifications/client/index.js +17 -0
  74. package/dist/api/resources/notifications/client/requests/V4GlobalErrorSubscribersRequest.d.ts +10 -0
  75. package/dist/api/resources/notifications/client/requests/V4GlobalErrorSubscribersRequest.js +5 -0
  76. package/dist/api/resources/notifications/client/requests/index.d.ts +1 -0
  77. package/dist/api/resources/notifications/client/requests/index.js +2 -0
  78. package/dist/api/resources/notifications/index.d.ts +1 -0
  79. package/dist/api/resources/notifications/index.js +17 -0
  80. package/dist/api/resources/organization/client/Client.js +5 -5
  81. package/dist/api/resources/permissions/resources/policies/client/Client.js +5 -5
  82. package/dist/api/resources/permissions/resources/roles/client/Client.js +5 -5
  83. package/dist/api/resources/queryRunner/client/Client.js +2 -2
  84. package/dist/api/resources/schemas/client/Client.js +8 -8
  85. package/dist/api/resources/users/client/Client.d.ts +5 -20
  86. package/dist/api/resources/users/client/Client.js +21 -26
  87. package/dist/api/resources/webhooks/client/Client.js +7 -7
  88. package/dist/api/types/BackendConnectionCapabilities.d.ts +4 -4
  89. package/dist/api/types/BulkBulkSyncSchedule.d.ts +2 -0
  90. package/dist/api/types/BulkScheduleSyncMode.d.ts +10 -0
  91. package/dist/api/types/BulkScheduleSyncMode.js +12 -0
  92. package/dist/api/types/CancelBulkSyncResponse.d.ts +6 -0
  93. package/dist/api/types/CancelBulkSyncResponse.js +5 -0
  94. package/dist/api/types/CancelBulkSyncResponseEnvelope.d.ts +7 -0
  95. package/dist/api/types/CancelBulkSyncResponseEnvelope.js +5 -0
  96. package/dist/api/types/ConnectionType.d.ts +1 -1
  97. package/dist/api/types/V4GlobalErrorSubscribersResponse.d.ts +6 -0
  98. package/dist/api/types/V4GlobalErrorSubscribersResponse.js +5 -0
  99. package/dist/api/types/index.d.ts +4 -0
  100. package/dist/api/types/index.js +4 -0
  101. package/dist/version.d.ts +1 -1
  102. package/dist/version.js +1 -1
  103. package/package.json +1 -1
  104. package/reference.md +250 -85
  105. package/version.d.ts +1 -1
  106. package/version.js +1 -1
package/Client.d.ts CHANGED
@@ -12,6 +12,7 @@ import { ModelSync } from "./api/resources/modelSync/client/Client";
12
12
  import { Events } from "./api/resources/events/client/Client";
13
13
  import { Jobs } from "./api/resources/jobs/client/Client";
14
14
  import { Identity } from "./api/resources/identity/client/Client";
15
+ import { Notifications } from "./api/resources/notifications/client/Client";
15
16
  import { Organization } from "./api/resources/organization/client/Client";
16
17
  import { Users } from "./api/resources/users/client/Client";
17
18
  import { Webhooks } from "./api/resources/webhooks/client/Client";
@@ -49,6 +50,7 @@ export declare class PolytomicClient {
49
50
  protected _events: Events | undefined;
50
51
  protected _jobs: Jobs | undefined;
51
52
  protected _identity: Identity | undefined;
53
+ protected _notifications: Notifications | undefined;
52
54
  protected _organization: Organization | undefined;
53
55
  protected _users: Users | undefined;
54
56
  protected _webhooks: Webhooks | undefined;
@@ -63,6 +65,7 @@ export declare class PolytomicClient {
63
65
  get events(): Events;
64
66
  get jobs(): Jobs;
65
67
  get identity(): Identity;
68
+ get notifications(): Notifications;
66
69
  get organization(): Organization;
67
70
  get users(): Users;
68
71
  get webhooks(): Webhooks;
package/Client.js CHANGED
@@ -13,10 +13,11 @@ const Client_6 = require("./api/resources/modelSync/client/Client");
13
13
  const Client_7 = require("./api/resources/events/client/Client");
14
14
  const Client_8 = require("./api/resources/jobs/client/Client");
15
15
  const Client_9 = require("./api/resources/identity/client/Client");
16
- const Client_10 = require("./api/resources/organization/client/Client");
17
- const Client_11 = require("./api/resources/users/client/Client");
18
- const Client_12 = require("./api/resources/webhooks/client/Client");
19
- const Client_13 = require("./api/resources/permissions/client/Client");
16
+ const Client_10 = require("./api/resources/notifications/client/Client");
17
+ const Client_11 = require("./api/resources/organization/client/Client");
18
+ const Client_12 = require("./api/resources/users/client/Client");
19
+ const Client_13 = require("./api/resources/webhooks/client/Client");
20
+ const Client_14 = require("./api/resources/permissions/client/Client");
20
21
  class PolytomicClient {
21
22
  constructor(_options) {
22
23
  this._options = _options;
@@ -57,21 +58,25 @@ class PolytomicClient {
57
58
  var _a;
58
59
  return ((_a = this._identity) !== null && _a !== void 0 ? _a : (this._identity = new Client_9.Identity(this._options)));
59
60
  }
61
+ get notifications() {
62
+ var _a;
63
+ return ((_a = this._notifications) !== null && _a !== void 0 ? _a : (this._notifications = new Client_10.Notifications(this._options)));
64
+ }
60
65
  get organization() {
61
66
  var _a;
62
- return ((_a = this._organization) !== null && _a !== void 0 ? _a : (this._organization = new Client_10.Organization(this._options)));
67
+ return ((_a = this._organization) !== null && _a !== void 0 ? _a : (this._organization = new Client_11.Organization(this._options)));
63
68
  }
64
69
  get users() {
65
70
  var _a;
66
- return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_11.Users(this._options)));
71
+ return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new Client_12.Users(this._options)));
67
72
  }
68
73
  get webhooks() {
69
74
  var _a;
70
- return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_12.Webhooks(this._options)));
75
+ return ((_a = this._webhooks) !== null && _a !== void 0 ? _a : (this._webhooks = new Client_13.Webhooks(this._options)));
71
76
  }
72
77
  get permissions() {
73
78
  var _a;
74
- return ((_a = this._permissions) !== null && _a !== void 0 ? _a : (this._permissions = new Client_13.Permissions(this._options)));
79
+ return ((_a = this._permissions) !== null && _a !== void 0 ? _a : (this._permissions = new Client_14.Permissions(this._options)));
75
80
  }
76
81
  }
77
82
  exports.PolytomicClient = PolytomicClient;
@@ -177,6 +177,19 @@ export declare class BulkSync {
177
177
  * })
178
178
  */
179
179
  activate(id: string, request: Polytomic.ActivateSyncInput, requestOptions?: BulkSync.RequestOptions): Promise<Polytomic.ActivateSyncEnvelope>;
180
+ /**
181
+ * @param {string} id - The active execution of this bulk sync ID will be cancelled.
182
+ * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration.
183
+ *
184
+ * @throws {@link Polytomic.UnauthorizedError}
185
+ * @throws {@link Polytomic.ForbiddenError}
186
+ * @throws {@link Polytomic.NotFoundError}
187
+ * @throws {@link Polytomic.InternalServerError}
188
+ *
189
+ * @example
190
+ * await client.bulkSync.cancel("248df4b7-aa70-47b8-a036-33ac447e668d")
191
+ */
192
+ cancel(id: string, requestOptions?: BulkSync.RequestOptions): Promise<Polytomic.CancelBulkSyncResponseEnvelope>;
180
193
  /**
181
194
  * @param {string} id
182
195
  * @param {Polytomic.StartBulkSyncRequest} request
@@ -98,7 +98,7 @@ class BulkSync {
98
98
  method: "GET",
99
99
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
100
100
  ? yield core.Supplier.get(this._options.version)
101
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
101
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
102
102
  contentType: "application/json",
103
103
  queryParameters: _queryParams,
104
104
  requestType: "json",
@@ -195,7 +195,7 @@ class BulkSync {
195
195
  method: "POST",
196
196
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
197
197
  ? yield core.Supplier.get(this._options.version)
198
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
198
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
199
199
  contentType: "application/json",
200
200
  requestType: "json",
201
201
  body: request,
@@ -266,7 +266,7 @@ class BulkSync {
266
266
  method: "GET",
267
267
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
268
268
  ? yield core.Supplier.get(this._options.version)
269
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
269
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
270
270
  contentType: "application/json",
271
271
  queryParameters: _queryParams,
272
272
  requestType: "json",
@@ -341,7 +341,7 @@ class BulkSync {
341
341
  method: "PUT",
342
342
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
343
343
  ? yield core.Supplier.get(this._options.version)
344
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
344
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
345
345
  contentType: "application/json",
346
346
  requestType: "json",
347
347
  body: request,
@@ -414,7 +414,7 @@ class BulkSync {
414
414
  method: "DELETE",
415
415
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
416
416
  ? yield core.Supplier.get(this._options.version)
417
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
417
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
418
418
  contentType: "application/json",
419
419
  queryParameters: _queryParams,
420
420
  requestType: "json",
@@ -480,7 +480,7 @@ class BulkSync {
480
480
  method: "POST",
481
481
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
482
482
  ? yield core.Supplier.get(this._options.version)
483
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
483
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
484
484
  contentType: "application/json",
485
485
  requestType: "json",
486
486
  body: request,
@@ -523,6 +523,68 @@ class BulkSync {
523
523
  }
524
524
  });
525
525
  }
526
+ /**
527
+ * @param {string} id - The active execution of this bulk sync ID will be cancelled.
528
+ * @param {BulkSync.RequestOptions} requestOptions - Request-specific configuration.
529
+ *
530
+ * @throws {@link Polytomic.UnauthorizedError}
531
+ * @throws {@link Polytomic.ForbiddenError}
532
+ * @throws {@link Polytomic.NotFoundError}
533
+ * @throws {@link Polytomic.InternalServerError}
534
+ *
535
+ * @example
536
+ * await client.bulkSync.cancel("248df4b7-aa70-47b8-a036-33ac447e668d")
537
+ */
538
+ cancel(id, requestOptions) {
539
+ return __awaiter(this, void 0, void 0, function* () {
540
+ var _a, _b;
541
+ const _response = yield core.fetcher({
542
+ 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)}/cancel`),
543
+ method: "POST",
544
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
545
+ ? yield core.Supplier.get(this._options.version)
546
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
547
+ contentType: "application/json",
548
+ requestType: "json",
549
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
550
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
551
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
552
+ });
553
+ if (_response.ok) {
554
+ return _response.body;
555
+ }
556
+ if (_response.error.reason === "status-code") {
557
+ switch (_response.error.statusCode) {
558
+ case 401:
559
+ throw new Polytomic.UnauthorizedError(_response.error.body);
560
+ case 403:
561
+ throw new Polytomic.ForbiddenError(_response.error.body);
562
+ case 404:
563
+ throw new Polytomic.NotFoundError(_response.error.body);
564
+ case 500:
565
+ throw new Polytomic.InternalServerError(_response.error.body);
566
+ default:
567
+ throw new errors.PolytomicError({
568
+ statusCode: _response.error.statusCode,
569
+ body: _response.error.body,
570
+ });
571
+ }
572
+ }
573
+ switch (_response.error.reason) {
574
+ case "non-json":
575
+ throw new errors.PolytomicError({
576
+ statusCode: _response.error.statusCode,
577
+ body: _response.error.rawBody,
578
+ });
579
+ case "timeout":
580
+ throw new errors.PolytomicTimeoutError("Timeout exceeded when calling POST /api/bulk/syncs/{id}/cancel.");
581
+ case "unknown":
582
+ throw new errors.PolytomicError({
583
+ message: _response.error.errorMessage,
584
+ });
585
+ }
586
+ });
587
+ }
526
588
  /**
527
589
  * @param {string} id
528
590
  * @param {Polytomic.StartBulkSyncRequest} request
@@ -543,7 +605,7 @@ class BulkSync {
543
605
  method: "POST",
544
606
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
545
607
  ? yield core.Supplier.get(this._options.version)
546
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
608
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
547
609
  contentType: "application/json",
548
610
  requestType: "json",
549
611
  body: request,
@@ -603,7 +665,7 @@ class BulkSync {
603
665
  method: "GET",
604
666
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
605
667
  ? yield core.Supplier.get(this._options.version)
606
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
668
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
607
669
  contentType: "application/json",
608
670
  requestType: "json",
609
671
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -671,7 +733,7 @@ class BulkSync {
671
733
  method: "GET",
672
734
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
673
735
  ? yield core.Supplier.get(this._options.version)
674
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
736
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
675
737
  contentType: "application/json",
676
738
  queryParameters: _queryParams,
677
739
  requestType: "json",
@@ -734,7 +796,7 @@ class BulkSync {
734
796
  method: "GET",
735
797
  headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Polytomic-Version": (yield core.Supplier.get(this._options.version)) != null
736
798
  ? yield core.Supplier.get(this._options.version)
737
- : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.14.4", "User-Agent": "polytomic/1.14.4", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
799
+ : undefined, "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "polytomic", "X-Fern-SDK-Version": "1.16.0", "User-Agent": "polytomic/1.16.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
738
800
  contentType: "application/json",
739
801
  requestType: "json",
740
802
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.14.4", "User-Agent": "polytomic/1.14.4", "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.0", "User-Agent": "polytomic/1.16.0", "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.0", "User-Agent": "polytomic/1.16.0", "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)}`;