polytomic 0.1.2 → 1.0.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 +62 -46
- package/api/resources/bulkSync/client/Client.js +174 -184
- package/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +0 -1
- package/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +1 -1
- package/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.d.ts +1 -4
- package/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +1 -1
- 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 +20 -9
- package/api/resources/bulkSync/resources/schemas/client/Client.js +90 -24
- package/api/resources/bulkSync/resources/schemas/client/requests/BulkSyncSchemasRequest.d.ts +11 -0
- package/api/resources/bulkSync/resources/schemas/client/requests/UpdateBulkSchema.d.ts +1 -4
- package/api/resources/bulkSync/resources/schemas/client/requests/index.d.ts +1 -0
- package/api/resources/connections/client/Client.d.ts +40 -49
- package/api/resources/connections/client/Client.js +113 -298
- package/api/resources/connections/client/requests/ConnectCardRequest.d.ts +18 -0
- package/api/resources/connections/client/requests/CreateConnectionRequestSchema.d.ts +2 -4
- package/api/resources/connections/client/requests/UpdateConnectionRequestSchema.d.ts +1 -4
- 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 +87 -53
- package/api/resources/modelSync/client/Client.js +405 -100
- package/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +1 -21
- 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/StartModelSyncRequest.d.ts +1 -0
- package/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +1 -21
- 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 -13
- package/api/resources/models/client/Client.js +67 -47
- package/api/resources/models/client/requests/CreateModelRequest.d.ts +0 -1
- package/api/resources/models/client/requests/UpdateModelRequest.d.ts +0 -1
- package/api/resources/organization/client/Client.d.ts +23 -26
- package/api/resources/organization/client/Client.js +53 -53
- package/api/resources/organization/client/requests/CreateOrganizationRequestSchema.d.ts +1 -6
- package/api/resources/organization/client/requests/UpdateOrganizationRequestSchema.d.ts +1 -6
- 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 -19
- package/api/resources/permissions/resources/policies/client/Client.js +66 -46
- package/api/resources/permissions/resources/policies/client/requests/CreatePolicyRequest.d.ts +1 -5
- package/api/resources/permissions/resources/policies/client/requests/UpdatePolicyRequest.d.ts +1 -5
- 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 +27 -19
- package/api/resources/users/client/Client.js +63 -48
- package/api/resources/users/client/requests/CreateUserRequestSchema.d.ts +1 -2
- package/api/resources/users/client/requests/UpdateUserRequestSchema.d.ts +1 -2
- package/api/resources/webhooks/client/Client.d.ts +22 -15
- package/api/resources/webhooks/client/Client.js +56 -46
- 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 +62 -46
- package/dist/api/resources/bulkSync/client/Client.js +174 -184
- package/dist/api/resources/bulkSync/client/requests/BulkSyncGetSourceRequest.d.ts +0 -1
- package/dist/api/resources/bulkSync/client/requests/CreateBulkSyncRequest.d.ts +1 -1
- package/dist/api/resources/bulkSync/{resources/executions/client → client}/requests/StartBulkSyncRequest.d.ts +1 -4
- package/dist/api/resources/bulkSync/client/requests/StartBulkSyncRequest.js +5 -0
- package/dist/api/resources/bulkSync/client/requests/UpdateBulkSyncRequest.d.ts +1 -1
- 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 +20 -9
- package/dist/api/resources/bulkSync/resources/schemas/client/Client.js +90 -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/UpdateBulkSchema.d.ts +1 -4
- package/dist/api/resources/bulkSync/resources/schemas/client/requests/index.d.ts +1 -0
- package/dist/api/resources/connections/client/Client.d.ts +40 -49
- package/dist/api/resources/connections/client/Client.js +113 -298
- package/dist/api/resources/connections/client/requests/ConnectCardRequest.d.ts +18 -0
- package/dist/api/resources/connections/client/requests/ConnectCardRequest.js +5 -0
- package/dist/api/resources/connections/client/requests/CreateConnectionRequestSchema.d.ts +2 -4
- package/dist/api/resources/connections/client/requests/UpdateConnectionRequestSchema.d.ts +1 -4
- 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 +87 -53
- package/dist/api/resources/modelSync/client/Client.js +405 -100
- package/dist/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +1 -21
- 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/StartModelSyncRequest.d.ts +1 -0
- package/dist/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +1 -21
- 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 -13
- package/dist/api/resources/models/client/Client.js +67 -47
- package/dist/api/resources/models/client/requests/CreateModelRequest.d.ts +0 -1
- package/dist/api/resources/models/client/requests/UpdateModelRequest.d.ts +0 -1
- package/dist/api/resources/organization/client/Client.d.ts +23 -26
- package/dist/api/resources/organization/client/Client.js +53 -53
- package/dist/api/resources/organization/client/requests/CreateOrganizationRequestSchema.d.ts +1 -6
- package/dist/api/resources/organization/client/requests/UpdateOrganizationRequestSchema.d.ts +1 -6
- 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 -19
- package/dist/api/resources/permissions/resources/policies/client/Client.js +66 -46
- package/dist/api/resources/permissions/resources/policies/client/requests/CreatePolicyRequest.d.ts +1 -5
- package/dist/api/resources/permissions/resources/policies/client/requests/UpdatePolicyRequest.d.ts +1 -5
- 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 +27 -19
- package/dist/api/resources/users/client/Client.js +63 -48
- package/dist/api/resources/users/client/requests/CreateUserRequestSchema.d.ts +1 -2
- package/dist/api/resources/users/client/requests/UpdateUserRequestSchema.d.ts +1 -2
- package/dist/api/resources/webhooks/client/Client.d.ts +22 -15
- package/dist/api/resources/webhooks/client/Client.js +56 -46
- 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 +2 -2
- 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.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/requests → identity/client}/index.js +0 -0
|
@@ -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
|
|
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
|
|
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
|
|
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":
|
|
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.
|
|
69
|
+
"X-Fern-SDK-Version": "1.0.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":
|
|
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.
|
|
126
|
+
"X-Fern-SDK-Version": "1.0.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
|
-
|
|
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
|
|
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);
|
|
@@ -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
|
|
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
|
|
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,31 @@ 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.
|
|
33
|
-
* enabled: true,
|
|
34
|
-
* partition_key: "email"
|
|
35
|
-
* })
|
|
35
|
+
* await polytomic.bulkSync.schemas.patch("248df4b7-aa70-47b8-a036-33ac447e668d", {})
|
|
36
36
|
*/
|
|
37
|
-
|
|
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
|
-
|
|
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
|
+
*/
|
|
55
|
+
update(id: string, schemaId: string, request?: Polytomic.bulkSync.UpdateBulkSchema, requestOptions?: Schemas.RequestOptions): Promise<Polytomic.BulkSchemaEnvelope>;
|
|
56
|
+
protected _getAuthorizationHeader(): Promise<string>;
|
|
46
57
|
}
|
|
@@ -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":
|
|
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": "1.0.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.
|
|
118
|
-
* enabled: true,
|
|
119
|
-
* partition_key: "email"
|
|
120
|
-
* })
|
|
121
|
+
* await polytomic.bulkSync.schemas.patch("248df4b7-aa70-47b8-a036-33ac447e668d", {})
|
|
121
122
|
*/
|
|
122
|
-
|
|
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
|
|
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":
|
|
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.
|
|
134
|
+
"X-Fern-SDK-Version": "1.0.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":
|
|
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.
|
|
196
|
+
"X-Fern-SDK-Version": "1.0.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,73 @@ class Schemas {
|
|
|
226
232
|
}
|
|
227
233
|
});
|
|
228
234
|
}
|
|
229
|
-
|
|
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
|
+
*/
|
|
244
|
+
update(id, schemaId, request = {}, requestOptions) {
|
|
245
|
+
var _a;
|
|
230
246
|
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
-
const
|
|
232
|
-
|
|
233
|
-
|
|
247
|
+
const _response = yield core.fetcher({
|
|
248
|
+
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}`),
|
|
249
|
+
method: "PUT",
|
|
250
|
+
headers: {
|
|
251
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
252
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
253
|
+
"X-Fern-Language": "JavaScript",
|
|
254
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
255
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
256
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
257
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
258
|
+
},
|
|
259
|
+
contentType: "application/json",
|
|
260
|
+
body: request,
|
|
261
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
262
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
263
|
+
});
|
|
264
|
+
if (_response.ok) {
|
|
265
|
+
return _response.body;
|
|
234
266
|
}
|
|
235
|
-
|
|
267
|
+
if (_response.error.reason === "status-code") {
|
|
268
|
+
switch (_response.error.statusCode) {
|
|
269
|
+
case 401:
|
|
270
|
+
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
271
|
+
case 403:
|
|
272
|
+
throw new Polytomic.ForbiddenError(_response.error.body);
|
|
273
|
+
case 404:
|
|
274
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
275
|
+
case 500:
|
|
276
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
277
|
+
default:
|
|
278
|
+
throw new errors.PolytomicError({
|
|
279
|
+
statusCode: _response.error.statusCode,
|
|
280
|
+
body: _response.error.body,
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
switch (_response.error.reason) {
|
|
285
|
+
case "non-json":
|
|
286
|
+
throw new errors.PolytomicError({
|
|
287
|
+
statusCode: _response.error.statusCode,
|
|
288
|
+
body: _response.error.rawBody,
|
|
289
|
+
});
|
|
290
|
+
case "timeout":
|
|
291
|
+
throw new errors.PolytomicTimeoutError();
|
|
292
|
+
case "unknown":
|
|
293
|
+
throw new errors.PolytomicError({
|
|
294
|
+
message: _response.error.errorMessage,
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
_getAuthorizationHeader() {
|
|
300
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
301
|
+
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
236
302
|
});
|
|
237
303
|
}
|
|
238
304
|
}
|