polytomic 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/Client.d.ts +8 -6
  2. package/Client.js +27 -22
  3. package/api/errors/BadRequestError.d.ts +8 -0
  4. package/api/errors/BadRequestError.js +41 -0
  5. package/api/errors/ForbiddenError.d.ts +8 -0
  6. package/api/errors/ForbiddenError.js +41 -0
  7. package/api/errors/InternalServerError.d.ts +8 -0
  8. package/api/errors/InternalServerError.js +41 -0
  9. package/api/errors/NotFoundError.d.ts +8 -0
  10. package/api/errors/NotFoundError.js +41 -0
  11. package/api/errors/UnprocessableEntityError.d.ts +8 -0
  12. package/api/errors/UnprocessableEntityError.js +41 -0
  13. package/api/errors/index.d.ts +5 -0
  14. package/api/errors/index.js +5 -0
  15. package/api/resources/bulkSync/client/Client.d.ts +78 -47
  16. package/api/resources/bulkSync/client/Client.js +188 -183
  17. package/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +0 -1
  18. package/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +8 -2
  19. package/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +8 -2
  20. package/api/resources/bulkSync/client/requests/index.d.ts +3 -2
  21. package/api/resources/bulkSync/resources/executions/client/Client.d.ts +5 -14
  22. package/api/resources/bulkSync/resources/executions/client/Client.js +12 -74
  23. package/api/resources/bulkSync/resources/executions/client/index.d.ts +1 -1
  24. package/api/resources/bulkSync/resources/executions/client/index.js +0 -15
  25. package/api/resources/bulkSync/resources/index.d.ts +0 -1
  26. package/api/resources/bulkSync/resources/index.js +0 -1
  27. package/api/resources/bulkSync/resources/schemas/client/Client.d.ts +23 -9
  28. package/api/resources/bulkSync/resources/schemas/client/Client.js +93 -24
  29. package/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +11 -0
  30. package/api/resources/bulkSync/resources/schemas/client/requests/index.d.ts +1 -0
  31. package/api/resources/connections/client/Client.d.ts +43 -45
  32. package/api/resources/connections/client/Client.js +116 -294
  33. package/api/resources/connections/client/requests/ConnectCardRequest.d.ts +20 -0
  34. package/api/resources/connections/client/requests/CreateConnectionRequestSchema.d.ts +2 -2
  35. package/api/resources/connections/client/requests/UpdateConnectionRequestSchema.d.ts +2 -2
  36. package/api/resources/connections/client/requests/index.d.ts +2 -4
  37. package/api/resources/events/client/Client.d.ts +9 -8
  38. package/api/resources/events/client/Client.js +16 -18
  39. package/{dist/api/resources/events/client/requests/EventsApiV2GetEventsRequest.d.ts → api/resources/events/client/requests/EventsListRequest.d.ts} +1 -1
  40. package/api/resources/events/client/requests/index.d.ts +1 -1
  41. package/api/resources/identity/client/Client.d.ts +29 -0
  42. package/api/resources/identity/client/Client.js +114 -0
  43. package/api/resources/identity/client/index.d.ts +1 -0
  44. package/api/resources/identity/index.d.ts +1 -0
  45. package/api/resources/identity/index.js +17 -0
  46. package/api/resources/index.d.ts +3 -2
  47. package/api/resources/index.js +4 -3
  48. package/api/resources/jobs/client/Client.d.ts +6 -4
  49. package/api/resources/jobs/client/Client.js +13 -10
  50. package/api/resources/modelSync/client/Client.d.ts +82 -11
  51. package/api/resources/modelSync/client/Client.js +421 -79
  52. package/api/resources/{connections/client/requests/ModelFieldsRequest.d.ts → modelSync/client/requests/ModelSyncGetSourceRequest.d.ts} +2 -2
  53. package/{dist/api/resources/connections/client/requests/TargetRequest.d.ts → api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.d.ts} +4 -4
  54. package/{dist/api/resources/connections/client/requests/ConnectionsGetTargetRequest.d.ts → api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.d.ts} +2 -5
  55. package/api/resources/modelSync/client/requests/index.d.ts +3 -0
  56. package/api/resources/modelSync/resources/executions/client/Client.d.ts +16 -64
  57. package/api/resources/modelSync/resources/executions/client/Client.js +43 -476
  58. package/api/resources/models/client/Client.d.ts +22 -11
  59. package/api/resources/models/client/Client.js +68 -46
  60. package/api/resources/organization/client/Client.d.ts +21 -14
  61. package/api/resources/organization/client/Client.js +52 -42
  62. package/api/resources/permissions/client/Client.d.ts +2 -3
  63. package/api/resources/permissions/client/Client.js +1 -1
  64. package/api/resources/permissions/resources/policies/client/Client.d.ts +24 -11
  65. package/api/resources/permissions/resources/policies/client/Client.js +69 -41
  66. package/api/resources/permissions/resources/roles/client/Client.d.ts +22 -10
  67. package/api/resources/permissions/resources/roles/client/Client.js +62 -37
  68. package/api/resources/schemas/client/Client.d.ts +39 -6
  69. package/api/resources/schemas/client/Client.js +208 -13
  70. package/api/resources/users/client/Client.d.ts +21 -11
  71. package/api/resources/users/client/Client.js +57 -40
  72. package/api/resources/webhooks/client/Client.d.ts +18 -11
  73. package/api/resources/webhooks/client/Client.js +53 -43
  74. package/api/types/ApiError.d.ts +8 -0
  75. package/api/types/GetModelSyncSourceMetaEnvelope.d.ts +7 -0
  76. package/api/types/ModelSyncSourceMetaResponse.d.ts +9 -0
  77. package/api/types/SourceMeta.d.ts +8 -0
  78. package/api/types/SourceMeta.js +5 -0
  79. package/api/types/index.d.ts +4 -0
  80. package/api/types/index.js +4 -0
  81. package/dist/Client.d.ts +8 -6
  82. package/dist/Client.js +27 -22
  83. package/dist/api/errors/BadRequestError.d.ts +8 -0
  84. package/dist/api/errors/BadRequestError.js +41 -0
  85. package/dist/api/errors/ForbiddenError.d.ts +8 -0
  86. package/dist/api/errors/ForbiddenError.js +41 -0
  87. package/dist/api/errors/InternalServerError.d.ts +8 -0
  88. package/dist/api/errors/InternalServerError.js +41 -0
  89. package/dist/api/errors/NotFoundError.d.ts +8 -0
  90. package/dist/api/errors/NotFoundError.js +41 -0
  91. package/dist/api/errors/UnprocessableEntityError.d.ts +8 -0
  92. package/dist/api/errors/UnprocessableEntityError.js +41 -0
  93. package/dist/api/errors/index.d.ts +5 -0
  94. package/dist/api/errors/index.js +5 -0
  95. package/dist/api/resources/bulkSync/client/Client.d.ts +78 -47
  96. package/dist/api/resources/bulkSync/client/Client.js +188 -183
  97. package/dist/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +0 -1
  98. package/dist/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +8 -2
  99. package/dist/api/resources/bulkSync/client/requests/StartBulkSyncRequest.js +5 -0
  100. package/dist/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +8 -2
  101. package/dist/api/resources/bulkSync/client/requests/index.d.ts +3 -2
  102. package/dist/api/resources/bulkSync/resources/executions/client/Client.d.ts +5 -14
  103. package/dist/api/resources/bulkSync/resources/executions/client/Client.js +12 -74
  104. package/dist/api/resources/bulkSync/resources/executions/client/index.d.ts +1 -1
  105. package/dist/api/resources/bulkSync/resources/executions/client/index.js +0 -15
  106. package/dist/api/resources/bulkSync/resources/index.d.ts +0 -1
  107. package/dist/api/resources/bulkSync/resources/index.js +0 -1
  108. package/dist/api/resources/bulkSync/resources/schemas/client/Client.d.ts +23 -9
  109. package/dist/api/resources/bulkSync/resources/schemas/client/Client.js +93 -24
  110. package/dist/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +11 -0
  111. package/dist/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.js +5 -0
  112. package/dist/api/resources/bulkSync/resources/schemas/client/requests/index.d.ts +1 -0
  113. package/dist/api/resources/connections/client/Client.d.ts +43 -45
  114. package/dist/api/resources/connections/client/Client.js +116 -294
  115. package/dist/api/resources/connections/client/requests/ConnectCardRequest.d.ts +20 -0
  116. package/dist/api/resources/connections/client/requests/ConnectCardRequest.js +5 -0
  117. package/dist/api/resources/connections/client/requests/CreateConnectionRequestSchema.d.ts +2 -2
  118. package/dist/api/resources/connections/client/requests/UpdateConnectionRequestSchema.d.ts +2 -2
  119. package/dist/api/resources/connections/client/requests/index.d.ts +2 -4
  120. package/dist/api/resources/events/client/Client.d.ts +9 -8
  121. package/dist/api/resources/events/client/Client.js +16 -18
  122. package/{api/resources/events/client/requests/EventsApiV2GetEventsRequest.d.ts → dist/api/resources/events/client/requests/EventsListRequest.d.ts} +1 -1
  123. package/dist/api/resources/events/client/requests/EventsListRequest.js +5 -0
  124. package/dist/api/resources/events/client/requests/index.d.ts +1 -1
  125. package/dist/api/resources/identity/client/Client.d.ts +29 -0
  126. package/dist/api/resources/identity/client/Client.js +114 -0
  127. package/dist/api/resources/identity/client/index.d.ts +1 -0
  128. package/dist/api/resources/identity/index.d.ts +1 -0
  129. package/dist/api/resources/identity/index.js +17 -0
  130. package/dist/api/resources/index.d.ts +3 -2
  131. package/dist/api/resources/index.js +4 -3
  132. package/dist/api/resources/jobs/client/Client.d.ts +6 -4
  133. package/dist/api/resources/jobs/client/Client.js +13 -10
  134. package/dist/api/resources/modelSync/client/Client.d.ts +82 -11
  135. package/dist/api/resources/modelSync/client/Client.js +421 -79
  136. package/dist/api/resources/{connections/client/requests/ModelFieldsRequest.d.ts → modelSync/client/requests/ModelSyncGetSourceRequest.d.ts} +2 -2
  137. package/dist/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.js +5 -0
  138. package/{api/resources/connections/client/requests/TargetRequest.d.ts → dist/api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.d.ts} +4 -4
  139. package/dist/api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.js +5 -0
  140. package/{api/resources/connections/client/requests/ConnectionsGetTargetRequest.d.ts → dist/api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.d.ts} +2 -5
  141. package/dist/api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.js +5 -0
  142. package/dist/api/resources/modelSync/client/requests/index.d.ts +3 -0
  143. package/dist/api/resources/modelSync/resources/executions/client/Client.d.ts +16 -64
  144. package/dist/api/resources/modelSync/resources/executions/client/Client.js +43 -476
  145. package/dist/api/resources/models/client/Client.d.ts +22 -11
  146. package/dist/api/resources/models/client/Client.js +68 -46
  147. package/dist/api/resources/organization/client/Client.d.ts +21 -14
  148. package/dist/api/resources/organization/client/Client.js +52 -42
  149. package/dist/api/resources/permissions/client/Client.d.ts +2 -3
  150. package/dist/api/resources/permissions/client/Client.js +1 -1
  151. package/dist/api/resources/permissions/resources/policies/client/Client.d.ts +24 -11
  152. package/dist/api/resources/permissions/resources/policies/client/Client.js +69 -41
  153. package/dist/api/resources/permissions/resources/roles/client/Client.d.ts +22 -10
  154. package/dist/api/resources/permissions/resources/roles/client/Client.js +62 -37
  155. package/dist/api/resources/schemas/client/Client.d.ts +39 -6
  156. package/dist/api/resources/schemas/client/Client.js +208 -13
  157. package/dist/api/resources/users/client/Client.d.ts +21 -11
  158. package/dist/api/resources/users/client/Client.js +57 -40
  159. package/dist/api/resources/webhooks/client/Client.d.ts +18 -11
  160. package/dist/api/resources/webhooks/client/Client.js +53 -43
  161. package/dist/api/types/ApiError.d.ts +8 -0
  162. package/dist/api/types/ApiError.js +5 -0
  163. package/dist/api/types/GetModelSyncSourceMetaEnvelope.d.ts +7 -0
  164. package/dist/api/types/GetModelSyncSourceMetaEnvelope.js +5 -0
  165. package/dist/api/types/ModelSyncSourceMetaResponse.d.ts +9 -0
  166. package/dist/api/types/ModelSyncSourceMetaResponse.js +5 -0
  167. package/dist/api/types/SourceMeta.d.ts +8 -0
  168. package/dist/api/types/SourceMeta.js +5 -0
  169. package/dist/api/types/index.d.ts +4 -0
  170. package/dist/api/types/index.js +4 -0
  171. package/package.json +1 -1
  172. package/api/resources/bulkSync/resources/executions/client/requests/index.d.ts +0 -1
  173. package/dist/api/resources/bulkSync/resources/executions/client/requests/index.d.ts +0 -1
  174. /package/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.d.ts +0 -0
  175. /package/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.js +0 -0
  176. /package/api/resources/{connections/client/requests/ConnectionsGetTargetRequest.js → bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.js} +0 -0
  177. /package/api/resources/connections/client/requests/{ModelFieldsRequest.js → ConnectCardRequest.js} +0 -0
  178. /package/api/resources/{connections/client/requests/TargetRequest.js → events/client/requests/EventsListRequest.js} +0 -0
  179. /package/api/resources/{bulkSync/resources/executions/client/requests → identity/client}/index.js +0 -0
  180. /package/api/resources/{events/client/requests/EventsApiV2GetEventsRequest.js → modelSync/client/requests/ModelSyncGetSourceRequest.js} +0 -0
  181. /package/{dist/api/resources/bulkSync/resources/executions/client/requests/StartBulkSyncRequest.js → api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.js} +0 -0
  182. /package/{dist/api/resources/connections/client/requests/ConnectionsGetTargetRequest.js → api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.js} +0 -0
  183. /package/{dist/api/resources/connections/client/requests/ModelFieldsRequest.js → api/types/ApiError.js} +0 -0
  184. /package/{dist/api/resources/connections/client/requests/TargetRequest.js → api/types/GetModelSyncSourceMetaEnvelope.js} +0 -0
  185. /package/{dist/api/resources/events/client/requests/EventsApiV2GetEventsRequest.js → api/types/ModelSyncSourceMetaResponse.js} +0 -0
  186. /package/dist/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.d.ts +0 -0
  187. /package/dist/api/resources/{bulkSync/resources/executions/client/requests → identity/client}/index.js +0 -0
@@ -8,6 +8,5 @@
8
8
  * }
9
9
  */
10
10
  export interface BulkSyncGetSourceRequest {
11
- refresh_schemas?: boolean;
12
11
  include_fields?: boolean;
13
12
  }
@@ -6,9 +6,15 @@ import * as Polytomic from "../../../..";
6
6
  * @example
7
7
  * {
8
8
  * destination_connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
9
- * name: "name",
9
+ * mode: "replicate",
10
+ * name: "My Bulk Sync",
10
11
  * schedule: {
11
- * frequency: Polytomic.ScheduleFrequency.Manual
12
+ * day_of_month: "1",
13
+ * day_of_week: "monday",
14
+ * frequency: Polytomic.ScheduleFrequency.Manual,
15
+ * hour: "0",
16
+ * minute: "0",
17
+ * month: "1"
12
18
  * },
13
19
  * source_connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
14
20
  * }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,9 +6,15 @@ import * as Polytomic from "../../../..";
6
6
  * @example
7
7
  * {
8
8
  * destination_connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
9
- * name: "name",
9
+ * mode: "replicate",
10
+ * name: "My Bulk Sync",
10
11
  * schedule: {
11
- * frequency: Polytomic.ScheduleFrequency.Manual
12
+ * day_of_month: "1",
13
+ * day_of_week: "monday",
14
+ * frequency: Polytomic.ScheduleFrequency.Manual,
15
+ * hour: "0",
16
+ * minute: "0",
17
+ * month: "1"
12
18
  * },
13
19
  * source_connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d"
14
20
  * }
@@ -1,5 +1,6 @@
1
- export { BulkSyncGetSourceRequest } from "./BulkSyncGetSourceRequest";
2
1
  export { CreateBulkSyncRequest } from "./CreateBulkSyncRequest";
3
2
  export { BulkSyncGetRequest } from "./BulkSyncGetRequest";
4
- export { BulkSyncRemoveRequest } from "./BulkSyncRemoveRequest";
5
3
  export { UpdateBulkSyncRequest } from "./UpdateBulkSyncRequest";
4
+ export { BulkSyncRemoveRequest } from "./BulkSyncRemoveRequest";
5
+ export { StartBulkSyncRequest } from "./StartBulkSyncRequest";
6
+ export { BulkSyncGetSourceRequest } from "./BulkSyncGetSourceRequest";
@@ -7,8 +7,7 @@ import * as Polytomic from "../../../../..";
7
7
  export declare namespace Executions {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.PolytomicEnvironment | string>;
10
- token?: core.Supplier<core.BearerToken | undefined>;
11
- xPolytomicVersion?: core.Supplier<"2023-04-25" | undefined>;
10
+ token: core.Supplier<core.BearerToken>;
12
11
  }
13
12
  interface RequestOptions {
14
13
  timeoutInSeconds?: number;
@@ -17,9 +16,10 @@ export declare namespace Executions {
17
16
  }
18
17
  export declare class Executions {
19
18
  protected readonly _options: Executions.Options;
20
- constructor(_options?: Executions.Options);
19
+ constructor(_options: Executions.Options);
21
20
  /**
22
21
  * @throws {@link Polytomic.UnauthorizedError}
22
+ * @throws {@link Polytomic.NotFoundError}
23
23
  *
24
24
  * @example
25
25
  * await polytomic.bulkSync.executions.list("248df4b7-aa70-47b8-a036-33ac447e668d")
@@ -27,20 +27,11 @@ export declare class Executions {
27
27
  list(id: string, requestOptions?: Executions.RequestOptions): Promise<Polytomic.ListBulkSyncExecutionsEnvelope>;
28
28
  /**
29
29
  * @throws {@link Polytomic.UnauthorizedError}
30
- *
31
- * @example
32
- * await polytomic.bulkSync.executions.start("248df4b7-aa70-47b8-a036-33ac447e668d", {
33
- * resync: false,
34
- * test: false
35
- * })
36
- */
37
- start(id: string, request?: Polytomic.bulkSync.StartBulkSyncRequest, requestOptions?: Executions.RequestOptions): Promise<Polytomic.BulkSyncExecutionEnvelope>;
38
- /**
39
- * @throws {@link Polytomic.UnauthorizedError}
30
+ * @throws {@link Polytomic.NotFoundError}
40
31
  *
41
32
  * @example
42
33
  * await polytomic.bulkSync.executions.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
43
34
  */
44
35
  get(id: string, execId: string, requestOptions?: Executions.RequestOptions): Promise<Polytomic.BulkSyncExecutionEnvelope>;
45
- protected _getAuthorizationHeader(): Promise<string | undefined>;
36
+ protected _getAuthorizationHeader(): Promise<string>;
46
37
  }
@@ -45,11 +45,12 @@ const Polytomic = __importStar(require("../../../../.."));
45
45
  const url_join_1 = __importDefault(require("url-join"));
46
46
  const errors = __importStar(require("../../../../../../errors"));
47
47
  class Executions {
48
- constructor(_options = {}) {
48
+ constructor(_options) {
49
49
  this._options = _options;
50
50
  }
51
51
  /**
52
52
  * @throws {@link Polytomic.UnauthorizedError}
53
+ * @throws {@link Polytomic.NotFoundError}
53
54
  *
54
55
  * @example
55
56
  * await polytomic.bulkSync.executions.list("248df4b7-aa70-47b8-a036-33ac447e668d")
@@ -62,12 +63,10 @@ class Executions {
62
63
  method: "GET",
63
64
  headers: {
64
65
  Authorization: yield this._getAuthorizationHeader(),
65
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
66
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
67
- : undefined,
66
+ "X-Polytomic-Version": "2024-02-08",
68
67
  "X-Fern-Language": "JavaScript",
69
68
  "X-Fern-SDK-Name": "polytomic",
70
- "X-Fern-SDK-Version": "0.1.2",
69
+ "X-Fern-SDK-Version": "0.2.0",
71
70
  "X-Fern-Runtime": core.RUNTIME.type,
72
71
  "X-Fern-Runtime-Version": core.RUNTIME.version,
73
72
  },
@@ -82,6 +81,8 @@ class Executions {
82
81
  switch (_response.error.statusCode) {
83
82
  case 401:
84
83
  throw new Polytomic.UnauthorizedError(_response.error.body);
84
+ case 404:
85
+ throw new Polytomic.NotFoundError(_response.error.body);
85
86
  default:
86
87
  throw new errors.PolytomicError({
87
88
  statusCode: _response.error.statusCode,
@@ -106,66 +107,7 @@ class Executions {
106
107
  }
107
108
  /**
108
109
  * @throws {@link Polytomic.UnauthorizedError}
109
- *
110
- * @example
111
- * await polytomic.bulkSync.executions.start("248df4b7-aa70-47b8-a036-33ac447e668d", {
112
- * resync: false,
113
- * test: false
114
- * })
115
- */
116
- start(id, request = {}, requestOptions) {
117
- var _a;
118
- return __awaiter(this, void 0, void 0, function* () {
119
- const _response = yield core.fetcher({
120
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/bulk/syncs/${id}/executions`),
121
- method: "POST",
122
- headers: {
123
- Authorization: yield this._getAuthorizationHeader(),
124
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
125
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
126
- : undefined,
127
- "X-Fern-Language": "JavaScript",
128
- "X-Fern-SDK-Name": "polytomic",
129
- "X-Fern-SDK-Version": "0.1.2",
130
- "X-Fern-Runtime": core.RUNTIME.type,
131
- "X-Fern-Runtime-Version": core.RUNTIME.version,
132
- },
133
- contentType: "application/json",
134
- body: request,
135
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
136
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
137
- });
138
- if (_response.ok) {
139
- return _response.body;
140
- }
141
- if (_response.error.reason === "status-code") {
142
- switch (_response.error.statusCode) {
143
- case 401:
144
- throw new Polytomic.UnauthorizedError(_response.error.body);
145
- default:
146
- throw new errors.PolytomicError({
147
- statusCode: _response.error.statusCode,
148
- body: _response.error.body,
149
- });
150
- }
151
- }
152
- switch (_response.error.reason) {
153
- case "non-json":
154
- throw new errors.PolytomicError({
155
- statusCode: _response.error.statusCode,
156
- body: _response.error.rawBody,
157
- });
158
- case "timeout":
159
- throw new errors.PolytomicTimeoutError();
160
- case "unknown":
161
- throw new errors.PolytomicError({
162
- message: _response.error.errorMessage,
163
- });
164
- }
165
- });
166
- }
167
- /**
168
- * @throws {@link Polytomic.UnauthorizedError}
110
+ * @throws {@link Polytomic.NotFoundError}
169
111
  *
170
112
  * @example
171
113
  * await polytomic.bulkSync.executions.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
@@ -178,12 +120,10 @@ class Executions {
178
120
  method: "GET",
179
121
  headers: {
180
122
  Authorization: yield this._getAuthorizationHeader(),
181
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
182
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
183
- : undefined,
123
+ "X-Polytomic-Version": "2024-02-08",
184
124
  "X-Fern-Language": "JavaScript",
185
125
  "X-Fern-SDK-Name": "polytomic",
186
- "X-Fern-SDK-Version": "0.1.2",
126
+ "X-Fern-SDK-Version": "0.2.0",
187
127
  "X-Fern-Runtime": core.RUNTIME.type,
188
128
  "X-Fern-Runtime-Version": core.RUNTIME.version,
189
129
  },
@@ -198,6 +138,8 @@ class Executions {
198
138
  switch (_response.error.statusCode) {
199
139
  case 401:
200
140
  throw new Polytomic.UnauthorizedError(_response.error.body);
141
+ case 404:
142
+ throw new Polytomic.NotFoundError(_response.error.body);
201
143
  default:
202
144
  throw new errors.PolytomicError({
203
145
  statusCode: _response.error.statusCode,
@@ -222,11 +164,7 @@ class Executions {
222
164
  }
223
165
  _getAuthorizationHeader() {
224
166
  return __awaiter(this, void 0, void 0, function* () {
225
- const bearer = yield core.Supplier.get(this._options.token);
226
- if (bearer != null) {
227
- return `Bearer ${bearer}`;
228
- }
229
- return undefined;
167
+ return `Bearer ${yield core.Supplier.get(this._options.token)}`;
230
168
  });
231
169
  }
232
170
  }
@@ -1 +1 @@
1
- export * from "./requests";
1
+ export {};
@@ -1,17 +1,2 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
2
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./requests"), exports);
@@ -1,4 +1,3 @@
1
1
  export * as executions from "./executions";
2
2
  export * as schemas from "./schemas";
3
- export * from "./executions/client/requests";
4
3
  export * from "./schemas/client/requests";
@@ -29,5 +29,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.schemas = exports.executions = void 0;
30
30
  exports.executions = __importStar(require("./executions"));
31
31
  exports.schemas = __importStar(require("./schemas"));
32
- __exportStar(require("./executions/client/requests"), exports);
33
32
  __exportStar(require("./schemas/client/requests"), exports);
@@ -7,8 +7,7 @@ import * as Polytomic from "../../../../..";
7
7
  export declare namespace Schemas {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.PolytomicEnvironment | string>;
10
- token?: core.Supplier<core.BearerToken | undefined>;
11
- xPolytomicVersion?: core.Supplier<"2023-04-25" | undefined>;
10
+ token: core.Supplier<core.BearerToken>;
12
11
  }
13
12
  interface RequestOptions {
14
13
  timeoutInSeconds?: number;
@@ -17,9 +16,10 @@ export declare namespace Schemas {
17
16
  }
18
17
  export declare class Schemas {
19
18
  protected readonly _options: Schemas.Options;
20
- constructor(_options?: Schemas.Options);
19
+ constructor(_options: Schemas.Options);
21
20
  /**
22
21
  * @throws {@link Polytomic.UnauthorizedError}
22
+ * @throws {@link Polytomic.NotFoundError}
23
23
  *
24
24
  * @example
25
25
  * await polytomic.bulkSync.schemas.list("248df4b7-aa70-47b8-a036-33ac447e668d", {})
@@ -27,20 +27,34 @@ export declare class Schemas {
27
27
  list(id: string, request?: Polytomic.bulkSync.SchemasListRequest, requestOptions?: Schemas.RequestOptions): Promise<Polytomic.ListBulkSchema>;
28
28
  /**
29
29
  * @throws {@link Polytomic.UnauthorizedError}
30
+ * @throws {@link Polytomic.ForbiddenError}
31
+ * @throws {@link Polytomic.NotFoundError}
32
+ * @throws {@link Polytomic.InternalServerError}
30
33
  *
31
34
  * @example
32
- * await polytomic.bulkSync.schemas.update("248df4b7-aa70-47b8-a036-33ac447e668d", "contact", {
33
- * enabled: true,
34
- * partition_key: "email"
35
- * })
35
+ * await polytomic.bulkSync.schemas.patch("248df4b7-aa70-47b8-a036-33ac447e668d", {})
36
36
  */
37
- update(id: string, schemaId: string, request?: Polytomic.bulkSync.UpdateBulkSchema, requestOptions?: Schemas.RequestOptions): Promise<Polytomic.BulkSchemaEnvelope>;
37
+ patch(id: string, request?: Polytomic.bulkSync.BulkSyncSchemasRequest, requestOptions?: Schemas.RequestOptions): Promise<Polytomic.ListBulkSchema>;
38
38
  /**
39
39
  * @throws {@link Polytomic.UnauthorizedError}
40
+ * @throws {@link Polytomic.NotFoundError}
40
41
  *
41
42
  * @example
42
43
  * await polytomic.bulkSync.schemas.get("248df4b7-aa70-47b8-a036-33ac447e668d", "Contact")
43
44
  */
44
45
  get(id: string, schemaId: string, requestOptions?: Schemas.RequestOptions): Promise<Polytomic.BulkSchemaEnvelope>;
45
- protected _getAuthorizationHeader(): Promise<string | undefined>;
46
+ /**
47
+ * @throws {@link Polytomic.UnauthorizedError}
48
+ * @throws {@link Polytomic.ForbiddenError}
49
+ * @throws {@link Polytomic.NotFoundError}
50
+ * @throws {@link Polytomic.InternalServerError}
51
+ *
52
+ * @example
53
+ * await polytomic.bulkSync.schemas.update("248df4b7-aa70-47b8-a036-33ac447e668d", "contact", {
54
+ * enabled: true,
55
+ * partition_key: "email"
56
+ * })
57
+ */
58
+ update(id: string, schemaId: string, request?: Polytomic.bulkSync.UpdateBulkSchema, requestOptions?: Schemas.RequestOptions): Promise<Polytomic.BulkSchemaEnvelope>;
59
+ protected _getAuthorizationHeader(): Promise<string>;
46
60
  }
@@ -45,11 +45,12 @@ const Polytomic = __importStar(require("../../../../.."));
45
45
  const url_join_1 = __importDefault(require("url-join"));
46
46
  const errors = __importStar(require("../../../../../../errors"));
47
47
  class Schemas {
48
- constructor(_options = {}) {
48
+ constructor(_options) {
49
49
  this._options = _options;
50
50
  }
51
51
  /**
52
52
  * @throws {@link Polytomic.UnauthorizedError}
53
+ * @throws {@link Polytomic.NotFoundError}
53
54
  *
54
55
  * @example
55
56
  * await polytomic.bulkSync.schemas.list("248df4b7-aa70-47b8-a036-33ac447e668d", {})
@@ -67,12 +68,10 @@ class Schemas {
67
68
  method: "GET",
68
69
  headers: {
69
70
  Authorization: yield this._getAuthorizationHeader(),
70
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
71
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
72
- : undefined,
71
+ "X-Polytomic-Version": "2024-02-08",
73
72
  "X-Fern-Language": "JavaScript",
74
73
  "X-Fern-SDK-Name": "polytomic",
75
- "X-Fern-SDK-Version": "0.1.2",
74
+ "X-Fern-SDK-Version": "0.2.0",
76
75
  "X-Fern-Runtime": core.RUNTIME.type,
77
76
  "X-Fern-Runtime-Version": core.RUNTIME.version,
78
77
  },
@@ -88,6 +87,8 @@ class Schemas {
88
87
  switch (_response.error.statusCode) {
89
88
  case 401:
90
89
  throw new Polytomic.UnauthorizedError(_response.error.body);
90
+ case 404:
91
+ throw new Polytomic.NotFoundError(_response.error.body);
91
92
  default:
92
93
  throw new errors.PolytomicError({
93
94
  statusCode: _response.error.statusCode,
@@ -112,27 +113,25 @@ class Schemas {
112
113
  }
113
114
  /**
114
115
  * @throws {@link Polytomic.UnauthorizedError}
116
+ * @throws {@link Polytomic.ForbiddenError}
117
+ * @throws {@link Polytomic.NotFoundError}
118
+ * @throws {@link Polytomic.InternalServerError}
115
119
  *
116
120
  * @example
117
- * await polytomic.bulkSync.schemas.update("248df4b7-aa70-47b8-a036-33ac447e668d", "contact", {
118
- * enabled: true,
119
- * partition_key: "email"
120
- * })
121
+ * await polytomic.bulkSync.schemas.patch("248df4b7-aa70-47b8-a036-33ac447e668d", {})
121
122
  */
122
- update(id, schemaId, request = {}, requestOptions) {
123
+ patch(id, request = {}, requestOptions) {
123
124
  var _a;
124
125
  return __awaiter(this, void 0, void 0, function* () {
125
126
  const _response = yield core.fetcher({
126
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/bulk/syncs/${id}/schemas/${schemaId}`),
127
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/bulk/syncs/${id}/schemas`),
127
128
  method: "PATCH",
128
129
  headers: {
129
130
  Authorization: yield this._getAuthorizationHeader(),
130
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
131
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
132
- : undefined,
131
+ "X-Polytomic-Version": "2024-02-08",
133
132
  "X-Fern-Language": "JavaScript",
134
133
  "X-Fern-SDK-Name": "polytomic",
135
- "X-Fern-SDK-Version": "0.1.2",
134
+ "X-Fern-SDK-Version": "0.2.0",
136
135
  "X-Fern-Runtime": core.RUNTIME.type,
137
136
  "X-Fern-Runtime-Version": core.RUNTIME.version,
138
137
  },
@@ -148,6 +147,12 @@ class Schemas {
148
147
  switch (_response.error.statusCode) {
149
148
  case 401:
150
149
  throw new Polytomic.UnauthorizedError(_response.error.body);
150
+ case 403:
151
+ throw new Polytomic.ForbiddenError(_response.error.body);
152
+ case 404:
153
+ throw new Polytomic.NotFoundError(_response.error.body);
154
+ case 500:
155
+ throw new Polytomic.InternalServerError(_response.error.body);
151
156
  default:
152
157
  throw new errors.PolytomicError({
153
158
  statusCode: _response.error.statusCode,
@@ -172,6 +177,7 @@ class Schemas {
172
177
  }
173
178
  /**
174
179
  * @throws {@link Polytomic.UnauthorizedError}
180
+ * @throws {@link Polytomic.NotFoundError}
175
181
  *
176
182
  * @example
177
183
  * await polytomic.bulkSync.schemas.get("248df4b7-aa70-47b8-a036-33ac447e668d", "Contact")
@@ -184,12 +190,10 @@ class Schemas {
184
190
  method: "GET",
185
191
  headers: {
186
192
  Authorization: yield this._getAuthorizationHeader(),
187
- "X-Polytomic-Version": (yield core.Supplier.get(this._options.xPolytomicVersion)) != null
188
- ? yield core.Supplier.get(this._options.xPolytomicVersion)
189
- : undefined,
193
+ "X-Polytomic-Version": "2024-02-08",
190
194
  "X-Fern-Language": "JavaScript",
191
195
  "X-Fern-SDK-Name": "polytomic",
192
- "X-Fern-SDK-Version": "0.1.2",
196
+ "X-Fern-SDK-Version": "0.2.0",
193
197
  "X-Fern-Runtime": core.RUNTIME.type,
194
198
  "X-Fern-Runtime-Version": core.RUNTIME.version,
195
199
  },
@@ -204,6 +208,8 @@ class Schemas {
204
208
  switch (_response.error.statusCode) {
205
209
  case 401:
206
210
  throw new Polytomic.UnauthorizedError(_response.error.body);
211
+ case 404:
212
+ throw new Polytomic.NotFoundError(_response.error.body);
207
213
  default:
208
214
  throw new errors.PolytomicError({
209
215
  statusCode: _response.error.statusCode,
@@ -226,13 +232,76 @@ class Schemas {
226
232
  }
227
233
  });
228
234
  }
229
- _getAuthorizationHeader() {
235
+ /**
236
+ * @throws {@link Polytomic.UnauthorizedError}
237
+ * @throws {@link Polytomic.ForbiddenError}
238
+ * @throws {@link Polytomic.NotFoundError}
239
+ * @throws {@link Polytomic.InternalServerError}
240
+ *
241
+ * @example
242
+ * await polytomic.bulkSync.schemas.update("248df4b7-aa70-47b8-a036-33ac447e668d", "contact", {
243
+ * enabled: true,
244
+ * partition_key: "email"
245
+ * })
246
+ */
247
+ update(id, schemaId, request = {}, requestOptions) {
248
+ var _a;
230
249
  return __awaiter(this, void 0, void 0, function* () {
231
- const bearer = yield core.Supplier.get(this._options.token);
232
- if (bearer != null) {
233
- return `Bearer ${bearer}`;
250
+ const _response = yield core.fetcher({
251
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/bulk/syncs/${id}/schemas/${schemaId}`),
252
+ method: "PUT",
253
+ headers: {
254
+ Authorization: yield this._getAuthorizationHeader(),
255
+ "X-Polytomic-Version": "2024-02-08",
256
+ "X-Fern-Language": "JavaScript",
257
+ "X-Fern-SDK-Name": "polytomic",
258
+ "X-Fern-SDK-Version": "0.2.0",
259
+ "X-Fern-Runtime": core.RUNTIME.type,
260
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
261
+ },
262
+ contentType: "application/json",
263
+ body: request,
264
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
265
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
266
+ });
267
+ if (_response.ok) {
268
+ return _response.body;
269
+ }
270
+ if (_response.error.reason === "status-code") {
271
+ switch (_response.error.statusCode) {
272
+ case 401:
273
+ throw new Polytomic.UnauthorizedError(_response.error.body);
274
+ case 403:
275
+ throw new Polytomic.ForbiddenError(_response.error.body);
276
+ case 404:
277
+ throw new Polytomic.NotFoundError(_response.error.body);
278
+ case 500:
279
+ throw new Polytomic.InternalServerError(_response.error.body);
280
+ default:
281
+ throw new errors.PolytomicError({
282
+ statusCode: _response.error.statusCode,
283
+ body: _response.error.body,
284
+ });
285
+ }
234
286
  }
235
- return undefined;
287
+ switch (_response.error.reason) {
288
+ case "non-json":
289
+ throw new errors.PolytomicError({
290
+ statusCode: _response.error.statusCode,
291
+ body: _response.error.rawBody,
292
+ });
293
+ case "timeout":
294
+ throw new errors.PolytomicTimeoutError();
295
+ case "unknown":
296
+ throw new errors.PolytomicError({
297
+ message: _response.error.errorMessage,
298
+ });
299
+ }
300
+ });
301
+ }
302
+ _getAuthorizationHeader() {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ return `Bearer ${yield core.Supplier.get(this._options.token)}`;
236
305
  });
237
306
  }
238
307
  }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file was auto-generated from our API Definition.
3
+ */
4
+ import * as Polytomic from "../../../../../..";
5
+ /**
6
+ * @example
7
+ * {}
8
+ */
9
+ export interface BulkSyncSchemasRequest {
10
+ schemas?: Polytomic.BulkSchema[];
11
+ }
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ /**
3
+ * This file was auto-generated from our API Definition.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,2 +1,3 @@
1
1
  export { SchemasListRequest } from "./SchemasListRequest";
2
+ export { BulkSyncSchemasRequest } from "./BulkSyncSchemasRequest";
2
3
  export { UpdateBulkSchema } from "./UpdateBulkSchema";