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.
- package/Client.d.ts +8 -6
- package/Client.js +27 -22
- package/api/errors/BadRequestError.d.ts +8 -0
- package/api/errors/BadRequestError.js +41 -0
- package/api/errors/ForbiddenError.d.ts +8 -0
- package/api/errors/ForbiddenError.js +41 -0
- package/api/errors/InternalServerError.d.ts +8 -0
- package/api/errors/InternalServerError.js +41 -0
- package/api/errors/NotFoundError.d.ts +8 -0
- package/api/errors/NotFoundError.js +41 -0
- package/api/errors/UnprocessableEntityError.d.ts +8 -0
- package/api/errors/UnprocessableEntityError.js +41 -0
- package/api/errors/index.d.ts +5 -0
- package/api/errors/index.js +5 -0
- package/api/resources/bulkSync/client/Client.d.ts +78 -47
- package/api/resources/bulkSync/client/Client.js +188 -183
- package/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +0 -1
- package/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +8 -2
- package/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +8 -2
- package/api/resources/bulkSync/client/requests/index.d.ts +3 -2
- package/api/resources/bulkSync/resources/executions/client/Client.d.ts +5 -14
- package/api/resources/bulkSync/resources/executions/client/Client.js +12 -74
- package/api/resources/bulkSync/resources/executions/client/index.d.ts +1 -1
- package/api/resources/bulkSync/resources/executions/client/index.js +0 -15
- package/api/resources/bulkSync/resources/index.d.ts +0 -1
- package/api/resources/bulkSync/resources/index.js +0 -1
- package/api/resources/bulkSync/resources/schemas/client/Client.d.ts +23 -9
- package/api/resources/bulkSync/resources/schemas/client/Client.js +93 -24
- package/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +11 -0
- package/api/resources/bulkSync/resources/schemas/client/requests/index.d.ts +1 -0
- package/api/resources/connections/client/Client.d.ts +43 -45
- package/api/resources/connections/client/Client.js +116 -294
- package/api/resources/connections/client/requests/ConnectCardRequest.d.ts +20 -0
- package/api/resources/connections/client/requests/CreateConnectionRequestSchema.d.ts +2 -2
- package/api/resources/connections/client/requests/UpdateConnectionRequestSchema.d.ts +2 -2
- package/api/resources/connections/client/requests/index.d.ts +2 -4
- package/api/resources/events/client/Client.d.ts +9 -8
- package/api/resources/events/client/Client.js +16 -18
- package/{dist/api/resources/events/client/requests/EventsApiV2GetEventsRequest.d.ts → api/resources/events/client/requests/EventsListRequest.d.ts} +1 -1
- package/api/resources/events/client/requests/index.d.ts +1 -1
- package/api/resources/identity/client/Client.d.ts +29 -0
- package/api/resources/identity/client/Client.js +114 -0
- package/api/resources/identity/client/index.d.ts +1 -0
- package/api/resources/identity/index.d.ts +1 -0
- package/api/resources/identity/index.js +17 -0
- package/api/resources/index.d.ts +3 -2
- package/api/resources/index.js +4 -3
- package/api/resources/jobs/client/Client.d.ts +6 -4
- package/api/resources/jobs/client/Client.js +13 -10
- package/api/resources/modelSync/client/Client.d.ts +82 -11
- package/api/resources/modelSync/client/Client.js +421 -79
- package/api/resources/{connections/client/requests/ModelFieldsRequest.d.ts → modelSync/client/requests/ModelSyncGetSourceRequest.d.ts} +2 -2
- package/{dist/api/resources/connections/client/requests/TargetRequest.d.ts → api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.d.ts} +4 -4
- package/{dist/api/resources/connections/client/requests/ConnectionsGetTargetRequest.d.ts → api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.d.ts} +2 -5
- package/api/resources/modelSync/client/requests/index.d.ts +3 -0
- package/api/resources/modelSync/resources/executions/client/Client.d.ts +16 -64
- package/api/resources/modelSync/resources/executions/client/Client.js +43 -476
- package/api/resources/models/client/Client.d.ts +22 -11
- package/api/resources/models/client/Client.js +68 -46
- package/api/resources/organization/client/Client.d.ts +21 -14
- package/api/resources/organization/client/Client.js +52 -42
- package/api/resources/permissions/client/Client.d.ts +2 -3
- package/api/resources/permissions/client/Client.js +1 -1
- package/api/resources/permissions/resources/policies/client/Client.d.ts +24 -11
- package/api/resources/permissions/resources/policies/client/Client.js +69 -41
- package/api/resources/permissions/resources/roles/client/Client.d.ts +22 -10
- package/api/resources/permissions/resources/roles/client/Client.js +62 -37
- package/api/resources/schemas/client/Client.d.ts +39 -6
- package/api/resources/schemas/client/Client.js +208 -13
- package/api/resources/users/client/Client.d.ts +21 -11
- package/api/resources/users/client/Client.js +57 -40
- package/api/resources/webhooks/client/Client.d.ts +18 -11
- package/api/resources/webhooks/client/Client.js +53 -43
- package/api/types/ApiError.d.ts +8 -0
- package/api/types/GetModelSyncSourceMetaEnvelope.d.ts +7 -0
- package/api/types/ModelSyncSourceMetaResponse.d.ts +9 -0
- package/api/types/SourceMeta.d.ts +8 -0
- package/api/types/SourceMeta.js +5 -0
- package/api/types/index.d.ts +4 -0
- package/api/types/index.js +4 -0
- package/dist/Client.d.ts +8 -6
- package/dist/Client.js +27 -22
- package/dist/api/errors/BadRequestError.d.ts +8 -0
- package/dist/api/errors/BadRequestError.js +41 -0
- package/dist/api/errors/ForbiddenError.d.ts +8 -0
- package/dist/api/errors/ForbiddenError.js +41 -0
- package/dist/api/errors/InternalServerError.d.ts +8 -0
- package/dist/api/errors/InternalServerError.js +41 -0
- package/dist/api/errors/NotFoundError.d.ts +8 -0
- package/dist/api/errors/NotFoundError.js +41 -0
- package/dist/api/errors/UnprocessableEntityError.d.ts +8 -0
- package/dist/api/errors/UnprocessableEntityError.js +41 -0
- package/dist/api/errors/index.d.ts +5 -0
- package/dist/api/errors/index.js +5 -0
- package/dist/api/resources/bulkSync/client/Client.d.ts +78 -47
- package/dist/api/resources/bulkSync/client/Client.js +188 -183
- package/dist/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +0 -1
- package/dist/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +8 -2
- package/dist/api/resources/bulkSync/client/requests/StartBulkSyncRequest.js +5 -0
- package/dist/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +8 -2
- package/dist/api/resources/bulkSync/client/requests/index.d.ts +3 -2
- package/dist/api/resources/bulkSync/resources/executions/client/Client.d.ts +5 -14
- package/dist/api/resources/bulkSync/resources/executions/client/Client.js +12 -74
- package/dist/api/resources/bulkSync/resources/executions/client/index.d.ts +1 -1
- package/dist/api/resources/bulkSync/resources/executions/client/index.js +0 -15
- package/dist/api/resources/bulkSync/resources/index.d.ts +0 -1
- package/dist/api/resources/bulkSync/resources/index.js +0 -1
- package/dist/api/resources/bulkSync/resources/schemas/client/Client.d.ts +23 -9
- package/dist/api/resources/bulkSync/resources/schemas/client/Client.js +93 -24
- package/dist/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +11 -0
- package/dist/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.js +5 -0
- package/dist/api/resources/bulkSync/resources/schemas/client/requests/index.d.ts +1 -0
- package/dist/api/resources/connections/client/Client.d.ts +43 -45
- package/dist/api/resources/connections/client/Client.js +116 -294
- package/dist/api/resources/connections/client/requests/ConnectCardRequest.d.ts +20 -0
- package/dist/api/resources/connections/client/requests/ConnectCardRequest.js +5 -0
- package/dist/api/resources/connections/client/requests/CreateConnectionRequestSchema.d.ts +2 -2
- package/dist/api/resources/connections/client/requests/UpdateConnectionRequestSchema.d.ts +2 -2
- package/dist/api/resources/connections/client/requests/index.d.ts +2 -4
- package/dist/api/resources/events/client/Client.d.ts +9 -8
- package/dist/api/resources/events/client/Client.js +16 -18
- package/{api/resources/events/client/requests/EventsApiV2GetEventsRequest.d.ts → dist/api/resources/events/client/requests/EventsListRequest.d.ts} +1 -1
- package/dist/api/resources/events/client/requests/EventsListRequest.js +5 -0
- package/dist/api/resources/events/client/requests/index.d.ts +1 -1
- package/dist/api/resources/identity/client/Client.d.ts +29 -0
- package/dist/api/resources/identity/client/Client.js +114 -0
- package/dist/api/resources/identity/client/index.d.ts +1 -0
- package/dist/api/resources/identity/index.d.ts +1 -0
- package/dist/api/resources/identity/index.js +17 -0
- package/dist/api/resources/index.d.ts +3 -2
- package/dist/api/resources/index.js +4 -3
- package/dist/api/resources/jobs/client/Client.d.ts +6 -4
- package/dist/api/resources/jobs/client/Client.js +13 -10
- package/dist/api/resources/modelSync/client/Client.d.ts +82 -11
- package/dist/api/resources/modelSync/client/Client.js +421 -79
- package/dist/api/resources/{connections/client/requests/ModelFieldsRequest.d.ts → modelSync/client/requests/ModelSyncGetSourceRequest.d.ts} +2 -2
- package/dist/api/resources/modelSync/client/requests/ModelSyncGetSourceRequest.js +5 -0
- package/{api/resources/connections/client/requests/TargetRequest.d.ts → dist/api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.d.ts} +4 -4
- package/dist/api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.js +5 -0
- package/{api/resources/connections/client/requests/ConnectionsGetTargetRequest.d.ts → dist/api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.d.ts} +2 -5
- package/dist/api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.js +5 -0
- package/dist/api/resources/modelSync/client/requests/index.d.ts +3 -0
- package/dist/api/resources/modelSync/resources/executions/client/Client.d.ts +16 -64
- package/dist/api/resources/modelSync/resources/executions/client/Client.js +43 -476
- package/dist/api/resources/models/client/Client.d.ts +22 -11
- package/dist/api/resources/models/client/Client.js +68 -46
- package/dist/api/resources/organization/client/Client.d.ts +21 -14
- package/dist/api/resources/organization/client/Client.js +52 -42
- package/dist/api/resources/permissions/client/Client.d.ts +2 -3
- package/dist/api/resources/permissions/client/Client.js +1 -1
- package/dist/api/resources/permissions/resources/policies/client/Client.d.ts +24 -11
- package/dist/api/resources/permissions/resources/policies/client/Client.js +69 -41
- package/dist/api/resources/permissions/resources/roles/client/Client.d.ts +22 -10
- package/dist/api/resources/permissions/resources/roles/client/Client.js +62 -37
- package/dist/api/resources/schemas/client/Client.d.ts +39 -6
- package/dist/api/resources/schemas/client/Client.js +208 -13
- package/dist/api/resources/users/client/Client.d.ts +21 -11
- package/dist/api/resources/users/client/Client.js +57 -40
- package/dist/api/resources/webhooks/client/Client.d.ts +18 -11
- package/dist/api/resources/webhooks/client/Client.js +53 -43
- package/dist/api/types/ApiError.d.ts +8 -0
- package/dist/api/types/ApiError.js +5 -0
- package/dist/api/types/GetModelSyncSourceMetaEnvelope.d.ts +7 -0
- package/dist/api/types/GetModelSyncSourceMetaEnvelope.js +5 -0
- package/dist/api/types/ModelSyncSourceMetaResponse.d.ts +9 -0
- package/dist/api/types/ModelSyncSourceMetaResponse.js +5 -0
- package/dist/api/types/SourceMeta.d.ts +8 -0
- package/dist/api/types/SourceMeta.js +5 -0
- package/dist/api/types/index.d.ts +4 -0
- package/dist/api/types/index.js +4 -0
- package/package.json +1 -1
- package/api/resources/bulkSync/resources/executions/client/requests/index.d.ts +0 -1
- package/dist/api/resources/bulkSync/resources/executions/client/requests/index.d.ts +0 -1
- /package/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.d.ts +0 -0
- /package/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.js +0 -0
- /package/api/resources/{connections/client/requests/ConnectionsGetTargetRequest.js → bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.js} +0 -0
- /package/api/resources/connections/client/requests/{ModelFieldsRequest.js → ConnectCardRequest.js} +0 -0
- /package/api/resources/{connections/client/requests/TargetRequest.js → events/client/requests/EventsListRequest.js} +0 -0
- /package/api/resources/{bulkSync/resources/executions/client/requests → identity/client}/index.js +0 -0
- /package/api/resources/{events/client/requests/EventsApiV2GetEventsRequest.js → modelSync/client/requests/ModelSyncGetSourceRequest.js} +0 -0
- /package/{dist/api/resources/bulkSync/resources/executions/client/requests/StartBulkSyncRequest.js → api/resources/modelSync/client/requests/ModelSyncGetTargetFieldsRequest.js} +0 -0
- /package/{dist/api/resources/connections/client/requests/ConnectionsGetTargetRequest.js → api/resources/modelSync/client/requests/ModelSyncGetTargetRequest.js} +0 -0
- /package/{dist/api/resources/connections/client/requests/ModelFieldsRequest.js → api/types/ApiError.js} +0 -0
- /package/{dist/api/resources/connections/client/requests/TargetRequest.js → api/types/GetModelSyncSourceMetaEnvelope.js} +0 -0
- /package/{dist/api/resources/events/client/requests/EventsApiV2GetEventsRequest.js → api/types/ModelSyncSourceMetaResponse.js} +0 -0
- /package/dist/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.d.ts +0 -0
- /package/dist/api/resources/{bulkSync/resources/executions/client/requests → identity/client}/index.js +0 -0
|
@@ -45,7 +45,7 @@ const Polytomic = __importStar(require("../../.."));
|
|
|
45
45
|
const url_join_1 = __importDefault(require("url-join"));
|
|
46
46
|
const errors = __importStar(require("../../../../errors"));
|
|
47
47
|
class Users {
|
|
48
|
-
constructor(_options
|
|
48
|
+
constructor(_options) {
|
|
49
49
|
this._options = _options;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
@@ -53,6 +53,7 @@ class Users {
|
|
|
53
53
|
* >
|
|
54
54
|
* > User endpoints are only accessible using [partner keys](https://docs.polytomic.com/reference/authentication#partner-keys)
|
|
55
55
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
56
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
56
57
|
*
|
|
57
58
|
* @example
|
|
58
59
|
* await polytomic.users.list("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
@@ -65,12 +66,10 @@ class Users {
|
|
|
65
66
|
method: "GET",
|
|
66
67
|
headers: {
|
|
67
68
|
Authorization: yield this._getAuthorizationHeader(),
|
|
68
|
-
"X-Polytomic-Version":
|
|
69
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
70
|
-
: undefined,
|
|
69
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
71
70
|
"X-Fern-Language": "JavaScript",
|
|
72
71
|
"X-Fern-SDK-Name": "polytomic",
|
|
73
|
-
"X-Fern-SDK-Version": "0.
|
|
72
|
+
"X-Fern-SDK-Version": "0.2.0",
|
|
74
73
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
75
74
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
76
75
|
},
|
|
@@ -85,6 +84,8 @@ class Users {
|
|
|
85
84
|
switch (_response.error.statusCode) {
|
|
86
85
|
case 401:
|
|
87
86
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
87
|
+
case 404:
|
|
88
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
88
89
|
default:
|
|
89
90
|
throw new errors.PolytomicError({
|
|
90
91
|
statusCode: _response.error.statusCode,
|
|
@@ -112,6 +113,8 @@ class Users {
|
|
|
112
113
|
* >
|
|
113
114
|
* > User endpoints are only accessible using [partner keys](https://docs.polytomic.com/reference/authentication#partner-keys)
|
|
114
115
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
116
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
117
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
115
118
|
*
|
|
116
119
|
* @example
|
|
117
120
|
* await polytomic.users.create("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
@@ -127,12 +130,10 @@ class Users {
|
|
|
127
130
|
method: "POST",
|
|
128
131
|
headers: {
|
|
129
132
|
Authorization: yield this._getAuthorizationHeader(),
|
|
130
|
-
"X-Polytomic-Version":
|
|
131
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
132
|
-
: undefined,
|
|
133
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
133
134
|
"X-Fern-Language": "JavaScript",
|
|
134
135
|
"X-Fern-SDK-Name": "polytomic",
|
|
135
|
-
"X-Fern-SDK-Version": "0.
|
|
136
|
+
"X-Fern-SDK-Version": "0.2.0",
|
|
136
137
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
137
138
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
138
139
|
},
|
|
@@ -148,6 +149,10 @@ class Users {
|
|
|
148
149
|
switch (_response.error.statusCode) {
|
|
149
150
|
case 401:
|
|
150
151
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
152
|
+
case 422:
|
|
153
|
+
throw new Polytomic.UnprocessableEntityError(_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,
|
|
@@ -175,6 +180,8 @@ class Users {
|
|
|
175
180
|
* >
|
|
176
181
|
* > User endpoints are only accessible using [partner keys](https://docs.polytomic.com/reference/authentication#partner-keys)
|
|
177
182
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
183
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
184
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
178
185
|
*
|
|
179
186
|
* @example
|
|
180
187
|
* await polytomic.users.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
@@ -187,12 +194,10 @@ class Users {
|
|
|
187
194
|
method: "GET",
|
|
188
195
|
headers: {
|
|
189
196
|
Authorization: yield this._getAuthorizationHeader(),
|
|
190
|
-
"X-Polytomic-Version":
|
|
191
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
192
|
-
: undefined,
|
|
197
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
193
198
|
"X-Fern-Language": "JavaScript",
|
|
194
199
|
"X-Fern-SDK-Name": "polytomic",
|
|
195
|
-
"X-Fern-SDK-Version": "0.
|
|
200
|
+
"X-Fern-SDK-Version": "0.2.0",
|
|
196
201
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
197
202
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
198
203
|
},
|
|
@@ -207,6 +212,10 @@ class Users {
|
|
|
207
212
|
switch (_response.error.statusCode) {
|
|
208
213
|
case 401:
|
|
209
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);
|
|
210
219
|
default:
|
|
211
220
|
throw new errors.PolytomicError({
|
|
212
221
|
statusCode: _response.error.statusCode,
|
|
@@ -234,28 +243,32 @@ class Users {
|
|
|
234
243
|
* >
|
|
235
244
|
* > User endpoints are only accessible using [partner keys](https://docs.polytomic.com/reference/authentication#partner-keys)
|
|
236
245
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
246
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
247
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
237
248
|
*
|
|
238
249
|
* @example
|
|
239
|
-
* await polytomic.users.
|
|
250
|
+
* await polytomic.users.update("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
251
|
+
* email: "mail@example.com",
|
|
252
|
+
* role: "admin"
|
|
253
|
+
* })
|
|
240
254
|
*/
|
|
241
|
-
|
|
255
|
+
update(id, orgId, request, requestOptions) {
|
|
242
256
|
var _a;
|
|
243
257
|
return __awaiter(this, void 0, void 0, function* () {
|
|
244
258
|
const _response = yield core.fetcher({
|
|
245
259
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/organizations/${orgId}/users/${id}`),
|
|
246
|
-
method: "
|
|
260
|
+
method: "PUT",
|
|
247
261
|
headers: {
|
|
248
262
|
Authorization: yield this._getAuthorizationHeader(),
|
|
249
|
-
"X-Polytomic-Version":
|
|
250
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
251
|
-
: undefined,
|
|
263
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
252
264
|
"X-Fern-Language": "JavaScript",
|
|
253
265
|
"X-Fern-SDK-Name": "polytomic",
|
|
254
|
-
"X-Fern-SDK-Version": "0.
|
|
266
|
+
"X-Fern-SDK-Version": "0.2.0",
|
|
255
267
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
256
268
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
257
269
|
},
|
|
258
270
|
contentType: "application/json",
|
|
271
|
+
body: request,
|
|
259
272
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
260
273
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
261
274
|
});
|
|
@@ -266,6 +279,10 @@ class Users {
|
|
|
266
279
|
switch (_response.error.statusCode) {
|
|
267
280
|
case 401:
|
|
268
281
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
282
|
+
case 422:
|
|
283
|
+
throw new Polytomic.UnprocessableEntityError(_response.error.body);
|
|
284
|
+
case 500:
|
|
285
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
269
286
|
default:
|
|
270
287
|
throw new errors.PolytomicError({
|
|
271
288
|
statusCode: _response.error.statusCode,
|
|
@@ -293,32 +310,28 @@ class Users {
|
|
|
293
310
|
* >
|
|
294
311
|
* > User endpoints are only accessible using [partner keys](https://docs.polytomic.com/reference/authentication#partner-keys)
|
|
295
312
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
313
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
314
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
296
315
|
*
|
|
297
316
|
* @example
|
|
298
|
-
* await polytomic.users.
|
|
299
|
-
* email: "mail@example.com",
|
|
300
|
-
* role: "admin"
|
|
301
|
-
* })
|
|
317
|
+
* await polytomic.users.remove("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
302
318
|
*/
|
|
303
|
-
|
|
319
|
+
remove(id, orgId, requestOptions) {
|
|
304
320
|
var _a;
|
|
305
321
|
return __awaiter(this, void 0, void 0, function* () {
|
|
306
322
|
const _response = yield core.fetcher({
|
|
307
323
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/organizations/${orgId}/users/${id}`),
|
|
308
|
-
method: "
|
|
324
|
+
method: "DELETE",
|
|
309
325
|
headers: {
|
|
310
326
|
Authorization: yield this._getAuthorizationHeader(),
|
|
311
|
-
"X-Polytomic-Version":
|
|
312
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
313
|
-
: undefined,
|
|
327
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
314
328
|
"X-Fern-Language": "JavaScript",
|
|
315
329
|
"X-Fern-SDK-Name": "polytomic",
|
|
316
|
-
"X-Fern-SDK-Version": "0.
|
|
330
|
+
"X-Fern-SDK-Version": "0.2.0",
|
|
317
331
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
318
332
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
319
333
|
},
|
|
320
334
|
contentType: "application/json",
|
|
321
|
-
body: request,
|
|
322
335
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
323
336
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
324
337
|
});
|
|
@@ -329,6 +342,10 @@ class Users {
|
|
|
329
342
|
switch (_response.error.statusCode) {
|
|
330
343
|
case 401:
|
|
331
344
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
345
|
+
case 404:
|
|
346
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
347
|
+
case 500:
|
|
348
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
332
349
|
default:
|
|
333
350
|
throw new errors.PolytomicError({
|
|
334
351
|
statusCode: _response.error.statusCode,
|
|
@@ -356,6 +373,8 @@ class Users {
|
|
|
356
373
|
* >
|
|
357
374
|
* > User endpoints are only accessible using [partner keys](https://docs.polytomic.com/reference/authentication#partner-keys)
|
|
358
375
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
376
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
377
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
359
378
|
*
|
|
360
379
|
* @example
|
|
361
380
|
* await polytomic.users.createApiKey("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
@@ -375,12 +394,10 @@ class Users {
|
|
|
375
394
|
method: "POST",
|
|
376
395
|
headers: {
|
|
377
396
|
Authorization: yield this._getAuthorizationHeader(),
|
|
378
|
-
"X-Polytomic-Version":
|
|
379
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
380
|
-
: undefined,
|
|
397
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
381
398
|
"X-Fern-Language": "JavaScript",
|
|
382
399
|
"X-Fern-SDK-Name": "polytomic",
|
|
383
|
-
"X-Fern-SDK-Version": "0.
|
|
400
|
+
"X-Fern-SDK-Version": "0.2.0",
|
|
384
401
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
385
402
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
386
403
|
},
|
|
@@ -396,6 +413,10 @@ class Users {
|
|
|
396
413
|
switch (_response.error.statusCode) {
|
|
397
414
|
case 401:
|
|
398
415
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
416
|
+
case 404:
|
|
417
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
418
|
+
case 500:
|
|
419
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
399
420
|
default:
|
|
400
421
|
throw new errors.PolytomicError({
|
|
401
422
|
statusCode: _response.error.statusCode,
|
|
@@ -420,11 +441,7 @@ class Users {
|
|
|
420
441
|
}
|
|
421
442
|
_getAuthorizationHeader() {
|
|
422
443
|
return __awaiter(this, void 0, void 0, function* () {
|
|
423
|
-
|
|
424
|
-
if (bearer != null) {
|
|
425
|
-
return `Bearer ${bearer}`;
|
|
426
|
-
}
|
|
427
|
-
return undefined;
|
|
444
|
+
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
428
445
|
});
|
|
429
446
|
}
|
|
430
447
|
}
|
|
@@ -7,8 +7,7 @@ import * as Polytomic from "../../..";
|
|
|
7
7
|
export declare namespace Webhooks {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.PolytomicEnvironment | string>;
|
|
10
|
-
token
|
|
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,7 +16,7 @@ export declare namespace Webhooks {
|
|
|
17
16
|
}
|
|
18
17
|
export declare class Webhooks {
|
|
19
18
|
protected readonly _options: Webhooks.Options;
|
|
20
|
-
constructor(_options
|
|
19
|
+
constructor(_options: Webhooks.Options);
|
|
21
20
|
/**
|
|
22
21
|
* Webooks can be set up using the webhook API endpoints. Currently, only one
|
|
23
22
|
* webhook may be created per organization. The webhook will be called for events
|
|
@@ -25,6 +24,7 @@ export declare class Webhooks {
|
|
|
25
24
|
*
|
|
26
25
|
* Consult the [Events documentation](https://docs.polytomic.com/reference/events) for more information.
|
|
27
26
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
27
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* await polytomic.webhooks.list()
|
|
@@ -37,6 +37,8 @@ export declare class Webhooks {
|
|
|
37
37
|
*
|
|
38
38
|
* Consult the [Events documentation](https://docs.polytomic.com/reference/events) for more information.
|
|
39
39
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
40
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
41
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
40
42
|
*
|
|
41
43
|
* @example
|
|
42
44
|
* await polytomic.webhooks.create({
|
|
@@ -52,18 +54,12 @@ export declare class Webhooks {
|
|
|
52
54
|
*
|
|
53
55
|
* Consult the [Events documentation](https://docs.polytomic.com/reference/events) for more information.
|
|
54
56
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
57
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
55
58
|
*
|
|
56
59
|
* @example
|
|
57
60
|
* await polytomic.webhooks.get("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
58
61
|
*/
|
|
59
62
|
get(id: string, requestOptions?: Webhooks.RequestOptions): Promise<Polytomic.WebhookEnvelope>;
|
|
60
|
-
/**
|
|
61
|
-
* @throws {@link Polytomic.UnauthorizedError}
|
|
62
|
-
*
|
|
63
|
-
* @example
|
|
64
|
-
* await polytomic.webhooks.delete("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
65
|
-
*/
|
|
66
|
-
delete(id: string, requestOptions?: Webhooks.RequestOptions): Promise<void>;
|
|
67
63
|
/**
|
|
68
64
|
* Webooks can be set up using the webhook API endpoints. Currently, only one
|
|
69
65
|
* webhook may be created per organization. The webhook will be called for events
|
|
@@ -71,6 +67,8 @@ export declare class Webhooks {
|
|
|
71
67
|
*
|
|
72
68
|
* Consult the [Events documentation](https://docs.polytomic.com/reference/events) for more information.
|
|
73
69
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
70
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
71
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
74
72
|
*
|
|
75
73
|
* @example
|
|
76
74
|
* await polytomic.webhooks.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
@@ -79,5 +77,14 @@ export declare class Webhooks {
|
|
|
79
77
|
* })
|
|
80
78
|
*/
|
|
81
79
|
update(id: string, request: Polytomic.UpdateWebhooksSchema, requestOptions?: Webhooks.RequestOptions): Promise<Polytomic.WebhookEnvelope>;
|
|
82
|
-
|
|
80
|
+
/**
|
|
81
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
82
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
83
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* await polytomic.webhooks.remove("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
87
|
+
*/
|
|
88
|
+
remove(id: string, requestOptions?: Webhooks.RequestOptions): Promise<void>;
|
|
89
|
+
protected _getAuthorizationHeader(): Promise<string>;
|
|
83
90
|
}
|
|
@@ -45,7 +45,7 @@ const Polytomic = __importStar(require("../../.."));
|
|
|
45
45
|
const url_join_1 = __importDefault(require("url-join"));
|
|
46
46
|
const errors = __importStar(require("../../../../errors"));
|
|
47
47
|
class Webhooks {
|
|
48
|
-
constructor(_options
|
|
48
|
+
constructor(_options) {
|
|
49
49
|
this._options = _options;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
@@ -55,6 +55,7 @@ class Webhooks {
|
|
|
55
55
|
*
|
|
56
56
|
* Consult the [Events documentation](https://docs.polytomic.com/reference/events) for more information.
|
|
57
57
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
58
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
58
59
|
*
|
|
59
60
|
* @example
|
|
60
61
|
* await polytomic.webhooks.list()
|
|
@@ -67,12 +68,10 @@ class Webhooks {
|
|
|
67
68
|
method: "GET",
|
|
68
69
|
headers: {
|
|
69
70
|
Authorization: yield this._getAuthorizationHeader(),
|
|
70
|
-
"X-Polytomic-Version":
|
|
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.
|
|
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
|
},
|
|
@@ -87,6 +86,8 @@ class Webhooks {
|
|
|
87
86
|
switch (_response.error.statusCode) {
|
|
88
87
|
case 401:
|
|
89
88
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
89
|
+
case 500:
|
|
90
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
90
91
|
default:
|
|
91
92
|
throw new errors.PolytomicError({
|
|
92
93
|
statusCode: _response.error.statusCode,
|
|
@@ -116,6 +117,8 @@ class Webhooks {
|
|
|
116
117
|
*
|
|
117
118
|
* Consult the [Events documentation](https://docs.polytomic.com/reference/events) for more information.
|
|
118
119
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
120
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
121
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
119
122
|
*
|
|
120
123
|
* @example
|
|
121
124
|
* await polytomic.webhooks.create({
|
|
@@ -131,12 +134,10 @@ class Webhooks {
|
|
|
131
134
|
method: "POST",
|
|
132
135
|
headers: {
|
|
133
136
|
Authorization: yield this._getAuthorizationHeader(),
|
|
134
|
-
"X-Polytomic-Version":
|
|
135
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
136
|
-
: undefined,
|
|
137
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
137
138
|
"X-Fern-Language": "JavaScript",
|
|
138
139
|
"X-Fern-SDK-Name": "polytomic",
|
|
139
|
-
"X-Fern-SDK-Version": "0.
|
|
140
|
+
"X-Fern-SDK-Version": "0.2.0",
|
|
140
141
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
141
142
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
142
143
|
},
|
|
@@ -152,6 +153,10 @@ class Webhooks {
|
|
|
152
153
|
switch (_response.error.statusCode) {
|
|
153
154
|
case 401:
|
|
154
155
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
156
|
+
case 422:
|
|
157
|
+
throw new Polytomic.UnprocessableEntityError(_response.error.body);
|
|
158
|
+
case 500:
|
|
159
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
155
160
|
default:
|
|
156
161
|
throw new errors.PolytomicError({
|
|
157
162
|
statusCode: _response.error.statusCode,
|
|
@@ -181,6 +186,7 @@ class Webhooks {
|
|
|
181
186
|
*
|
|
182
187
|
* Consult the [Events documentation](https://docs.polytomic.com/reference/events) for more information.
|
|
183
188
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
189
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
184
190
|
*
|
|
185
191
|
* @example
|
|
186
192
|
* await polytomic.webhooks.get("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
@@ -193,12 +199,10 @@ class Webhooks {
|
|
|
193
199
|
method: "GET",
|
|
194
200
|
headers: {
|
|
195
201
|
Authorization: yield this._getAuthorizationHeader(),
|
|
196
|
-
"X-Polytomic-Version":
|
|
197
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
198
|
-
: undefined,
|
|
202
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
199
203
|
"X-Fern-Language": "JavaScript",
|
|
200
204
|
"X-Fern-SDK-Name": "polytomic",
|
|
201
|
-
"X-Fern-SDK-Version": "0.
|
|
205
|
+
"X-Fern-SDK-Version": "0.2.0",
|
|
202
206
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
203
207
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
204
208
|
},
|
|
@@ -213,6 +217,8 @@ class Webhooks {
|
|
|
213
217
|
switch (_response.error.statusCode) {
|
|
214
218
|
case 401:
|
|
215
219
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
220
|
+
case 404:
|
|
221
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
216
222
|
default:
|
|
217
223
|
throw new errors.PolytomicError({
|
|
218
224
|
statusCode: _response.error.statusCode,
|
|
@@ -236,39 +242,52 @@ class Webhooks {
|
|
|
236
242
|
});
|
|
237
243
|
}
|
|
238
244
|
/**
|
|
245
|
+
* Webooks can be set up using the webhook API endpoints. Currently, only one
|
|
246
|
+
* webhook may be created per organization. The webhook will be called for events
|
|
247
|
+
* in that organization.
|
|
248
|
+
*
|
|
249
|
+
* Consult the [Events documentation](https://docs.polytomic.com/reference/events) for more information.
|
|
239
250
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
251
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
252
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
240
253
|
*
|
|
241
254
|
* @example
|
|
242
|
-
* await polytomic.webhooks.
|
|
255
|
+
* await polytomic.webhooks.update("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
256
|
+
* endpoint: "https://example.com/webhook",
|
|
257
|
+
* secret: "secret"
|
|
258
|
+
* })
|
|
243
259
|
*/
|
|
244
|
-
|
|
260
|
+
update(id, request, requestOptions) {
|
|
245
261
|
var _a;
|
|
246
262
|
return __awaiter(this, void 0, void 0, function* () {
|
|
247
263
|
const _response = yield core.fetcher({
|
|
248
264
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/webhooks/${id}`),
|
|
249
|
-
method: "
|
|
265
|
+
method: "PUT",
|
|
250
266
|
headers: {
|
|
251
267
|
Authorization: yield this._getAuthorizationHeader(),
|
|
252
|
-
"X-Polytomic-Version":
|
|
253
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
254
|
-
: undefined,
|
|
268
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
255
269
|
"X-Fern-Language": "JavaScript",
|
|
256
270
|
"X-Fern-SDK-Name": "polytomic",
|
|
257
|
-
"X-Fern-SDK-Version": "0.
|
|
271
|
+
"X-Fern-SDK-Version": "0.2.0",
|
|
258
272
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
259
273
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
260
274
|
},
|
|
261
275
|
contentType: "application/json",
|
|
276
|
+
body: request,
|
|
262
277
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
263
278
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
264
279
|
});
|
|
265
280
|
if (_response.ok) {
|
|
266
|
-
return;
|
|
281
|
+
return _response.body;
|
|
267
282
|
}
|
|
268
283
|
if (_response.error.reason === "status-code") {
|
|
269
284
|
switch (_response.error.statusCode) {
|
|
270
285
|
case 401:
|
|
271
286
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
287
|
+
case 422:
|
|
288
|
+
throw new Polytomic.UnprocessableEntityError(_response.error.body);
|
|
289
|
+
case 500:
|
|
290
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
272
291
|
default:
|
|
273
292
|
throw new errors.PolytomicError({
|
|
274
293
|
statusCode: _response.error.statusCode,
|
|
@@ -292,48 +311,43 @@ class Webhooks {
|
|
|
292
311
|
});
|
|
293
312
|
}
|
|
294
313
|
/**
|
|
295
|
-
* Webooks can be set up using the webhook API endpoints. Currently, only one
|
|
296
|
-
* webhook may be created per organization. The webhook will be called for events
|
|
297
|
-
* in that organization.
|
|
298
|
-
*
|
|
299
|
-
* Consult the [Events documentation](https://docs.polytomic.com/reference/events) for more information.
|
|
300
314
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
315
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
316
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
301
317
|
*
|
|
302
318
|
* @example
|
|
303
|
-
* await polytomic.webhooks.
|
|
304
|
-
* endpoint: "https://example.com/webhook",
|
|
305
|
-
* secret: "secret"
|
|
306
|
-
* })
|
|
319
|
+
* await polytomic.webhooks.remove("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
307
320
|
*/
|
|
308
|
-
|
|
321
|
+
remove(id, requestOptions) {
|
|
309
322
|
var _a;
|
|
310
323
|
return __awaiter(this, void 0, void 0, function* () {
|
|
311
324
|
const _response = yield core.fetcher({
|
|
312
325
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/webhooks/${id}`),
|
|
313
|
-
method: "
|
|
326
|
+
method: "DELETE",
|
|
314
327
|
headers: {
|
|
315
328
|
Authorization: yield this._getAuthorizationHeader(),
|
|
316
|
-
"X-Polytomic-Version":
|
|
317
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
318
|
-
: undefined,
|
|
329
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
319
330
|
"X-Fern-Language": "JavaScript",
|
|
320
331
|
"X-Fern-SDK-Name": "polytomic",
|
|
321
|
-
"X-Fern-SDK-Version": "0.
|
|
332
|
+
"X-Fern-SDK-Version": "0.2.0",
|
|
322
333
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
323
334
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
324
335
|
},
|
|
325
336
|
contentType: "application/json",
|
|
326
|
-
body: request,
|
|
327
337
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
328
338
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
329
339
|
});
|
|
330
340
|
if (_response.ok) {
|
|
331
|
-
return
|
|
341
|
+
return;
|
|
332
342
|
}
|
|
333
343
|
if (_response.error.reason === "status-code") {
|
|
334
344
|
switch (_response.error.statusCode) {
|
|
335
345
|
case 401:
|
|
336
346
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
347
|
+
case 404:
|
|
348
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
349
|
+
case 500:
|
|
350
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
337
351
|
default:
|
|
338
352
|
throw new errors.PolytomicError({
|
|
339
353
|
statusCode: _response.error.statusCode,
|
|
@@ -358,11 +372,7 @@ class Webhooks {
|
|
|
358
372
|
}
|
|
359
373
|
_getAuthorizationHeader() {
|
|
360
374
|
return __awaiter(this, void 0, void 0, function* () {
|
|
361
|
-
|
|
362
|
-
if (bearer != null) {
|
|
363
|
-
return `Bearer ${bearer}`;
|
|
364
|
-
}
|
|
365
|
-
return undefined;
|
|
375
|
+
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
366
376
|
});
|
|
367
377
|
}
|
|
368
378
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Polytomic from "..";
|
|
5
|
+
export interface ModelSyncSourceMetaResponse {
|
|
6
|
+
configuration?: Record<string, Polytomic.ConfigurationValue>;
|
|
7
|
+
items?: Record<string, Polytomic.SourceMeta | undefined>;
|
|
8
|
+
requires_one_of?: string[];
|
|
9
|
+
}
|
package/api/types/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./ApiError";
|
|
1
2
|
export * from "./BulkDiscover";
|
|
2
3
|
export * from "./BulkExecutionStatus";
|
|
3
4
|
export * from "./BulkItemizedSchedule";
|
|
@@ -121,4 +122,7 @@ export * from "./PickValue";
|
|
|
121
122
|
export * from "./Schema";
|
|
122
123
|
export * from "./SchemaField";
|
|
123
124
|
export * from "./SchemaRecordsResponseEnvelope";
|
|
125
|
+
export * from "./GetModelSyncSourceMetaEnvelope";
|
|
126
|
+
export * from "./SourceMeta";
|
|
127
|
+
export * from "./ModelSyncSourceMetaResponse";
|
|
124
128
|
export * from "./WorkTaskStatus";
|
package/api/types/index.js
CHANGED
|
@@ -14,6 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./ApiError"), exports);
|
|
17
18
|
__exportStar(require("./BulkDiscover"), exports);
|
|
18
19
|
__exportStar(require("./BulkExecutionStatus"), exports);
|
|
19
20
|
__exportStar(require("./BulkItemizedSchedule"), exports);
|
|
@@ -137,4 +138,7 @@ __exportStar(require("./PickValue"), exports);
|
|
|
137
138
|
__exportStar(require("./Schema"), exports);
|
|
138
139
|
__exportStar(require("./SchemaField"), exports);
|
|
139
140
|
__exportStar(require("./SchemaRecordsResponseEnvelope"), exports);
|
|
141
|
+
__exportStar(require("./GetModelSyncSourceMetaEnvelope"), exports);
|
|
142
|
+
__exportStar(require("./SourceMeta"), exports);
|
|
143
|
+
__exportStar(require("./ModelSyncSourceMetaResponse"), exports);
|
|
140
144
|
__exportStar(require("./WorkTaskStatus"), exports);
|