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
|
@@ -7,8 +7,7 @@ import * as Polytomic from "../../..";
|
|
|
7
7
|
export declare namespace Users {
|
|
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,12 +16,13 @@ export declare namespace Users {
|
|
|
17
16
|
}
|
|
18
17
|
export declare class Users {
|
|
19
18
|
protected readonly _options: Users.Options;
|
|
20
|
-
constructor(_options
|
|
19
|
+
constructor(_options: Users.Options);
|
|
21
20
|
/**
|
|
22
21
|
* > 🚧 Requires partner key
|
|
23
22
|
* >
|
|
24
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
23
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys)
|
|
25
24
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
25
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
26
26
|
*
|
|
27
27
|
* @example
|
|
28
28
|
* await polytomic.users.list("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
@@ -31,21 +31,24 @@ export declare class Users {
|
|
|
31
31
|
/**
|
|
32
32
|
* > 🚧 Requires partner key
|
|
33
33
|
* >
|
|
34
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
34
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys)
|
|
35
35
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
36
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
37
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
36
38
|
*
|
|
37
39
|
* @example
|
|
38
40
|
* await polytomic.users.create("248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
39
|
-
* email: "mail@example.com"
|
|
40
|
-
* role: "admin"
|
|
41
|
+
* email: "mail@example.com"
|
|
41
42
|
* })
|
|
42
43
|
*/
|
|
43
44
|
create(orgId: string, request: Polytomic.CreateUserRequestSchema, requestOptions?: Users.RequestOptions): Promise<Polytomic.UserEnvelope>;
|
|
44
45
|
/**
|
|
45
46
|
* > 🚧 Requires partner key
|
|
46
47
|
* >
|
|
47
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
48
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys)
|
|
48
49
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
50
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
51
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
49
52
|
*
|
|
50
53
|
* @example
|
|
51
54
|
* await polytomic.users.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
@@ -54,31 +57,36 @@ export declare class Users {
|
|
|
54
57
|
/**
|
|
55
58
|
* > 🚧 Requires partner key
|
|
56
59
|
* >
|
|
57
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
60
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys)
|
|
58
61
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
62
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
63
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
59
64
|
*
|
|
60
65
|
* @example
|
|
61
|
-
* await polytomic.users.
|
|
66
|
+
* await polytomic.users.update("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
67
|
+
* email: "mail@example.com"
|
|
68
|
+
* })
|
|
62
69
|
*/
|
|
63
|
-
|
|
70
|
+
update(id: string, orgId: string, request: Polytomic.UpdateUserRequestSchema, requestOptions?: Users.RequestOptions): Promise<Polytomic.UserEnvelope>;
|
|
64
71
|
/**
|
|
65
72
|
* > 🚧 Requires partner key
|
|
66
73
|
* >
|
|
67
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
74
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys)
|
|
68
75
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
76
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
77
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
69
78
|
*
|
|
70
79
|
* @example
|
|
71
|
-
* await polytomic.users.
|
|
72
|
-
* email: "mail@example.com",
|
|
73
|
-
* role: "admin"
|
|
74
|
-
* })
|
|
80
|
+
* await polytomic.users.remove("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
75
81
|
*/
|
|
76
|
-
|
|
82
|
+
remove(id: string, orgId: string, requestOptions?: Users.RequestOptions): Promise<Polytomic.UserEnvelope>;
|
|
77
83
|
/**
|
|
78
84
|
* > 🚧 Requires partner key
|
|
79
85
|
* >
|
|
80
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
86
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys)
|
|
81
87
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
88
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
89
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
82
90
|
*
|
|
83
91
|
* @example
|
|
84
92
|
* await polytomic.users.createApiKey("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
@@ -86,5 +94,5 @@ export declare class Users {
|
|
|
86
94
|
* })
|
|
87
95
|
*/
|
|
88
96
|
createApiKey(orgId: string, id: string, request?: Polytomic.UsersCreateApiKeyRequest, requestOptions?: Users.RequestOptions): Promise<Polytomic.ApiKeyResponseEnvelope>;
|
|
89
|
-
protected _getAuthorizationHeader(): Promise<string
|
|
97
|
+
protected _getAuthorizationHeader(): Promise<string>;
|
|
90
98
|
}
|
|
@@ -45,14 +45,15 @@ 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
|
/**
|
|
52
52
|
* > 🚧 Requires partner key
|
|
53
53
|
* >
|
|
54
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
54
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#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": "1.0.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,
|
|
@@ -110,13 +111,14 @@ class Users {
|
|
|
110
111
|
/**
|
|
111
112
|
* > 🚧 Requires partner key
|
|
112
113
|
* >
|
|
113
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
114
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#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", {
|
|
118
|
-
* email: "mail@example.com"
|
|
119
|
-
* role: "admin"
|
|
121
|
+
* email: "mail@example.com"
|
|
120
122
|
* })
|
|
121
123
|
*/
|
|
122
124
|
create(orgId, request, requestOptions) {
|
|
@@ -127,12 +129,10 @@ class Users {
|
|
|
127
129
|
method: "POST",
|
|
128
130
|
headers: {
|
|
129
131
|
Authorization: yield this._getAuthorizationHeader(),
|
|
130
|
-
"X-Polytomic-Version":
|
|
131
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
132
|
-
: undefined,
|
|
132
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
133
133
|
"X-Fern-Language": "JavaScript",
|
|
134
134
|
"X-Fern-SDK-Name": "polytomic",
|
|
135
|
-
"X-Fern-SDK-Version": "0.
|
|
135
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
136
136
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
137
137
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
138
138
|
},
|
|
@@ -148,6 +148,10 @@ class Users {
|
|
|
148
148
|
switch (_response.error.statusCode) {
|
|
149
149
|
case 401:
|
|
150
150
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
151
|
+
case 422:
|
|
152
|
+
throw new Polytomic.UnprocessableEntityError(_response.error.body);
|
|
153
|
+
case 500:
|
|
154
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
151
155
|
default:
|
|
152
156
|
throw new errors.PolytomicError({
|
|
153
157
|
statusCode: _response.error.statusCode,
|
|
@@ -173,8 +177,10 @@ class Users {
|
|
|
173
177
|
/**
|
|
174
178
|
* > 🚧 Requires partner key
|
|
175
179
|
* >
|
|
176
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
180
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys)
|
|
177
181
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
182
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
183
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
178
184
|
*
|
|
179
185
|
* @example
|
|
180
186
|
* await polytomic.users.get("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
@@ -187,12 +193,10 @@ class Users {
|
|
|
187
193
|
method: "GET",
|
|
188
194
|
headers: {
|
|
189
195
|
Authorization: yield this._getAuthorizationHeader(),
|
|
190
|
-
"X-Polytomic-Version":
|
|
191
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
192
|
-
: undefined,
|
|
196
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
193
197
|
"X-Fern-Language": "JavaScript",
|
|
194
198
|
"X-Fern-SDK-Name": "polytomic",
|
|
195
|
-
"X-Fern-SDK-Version": "0.
|
|
199
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
196
200
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
197
201
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
198
202
|
},
|
|
@@ -207,6 +211,10 @@ class Users {
|
|
|
207
211
|
switch (_response.error.statusCode) {
|
|
208
212
|
case 401:
|
|
209
213
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
214
|
+
case 404:
|
|
215
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
216
|
+
case 500:
|
|
217
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
210
218
|
default:
|
|
211
219
|
throw new errors.PolytomicError({
|
|
212
220
|
statusCode: _response.error.statusCode,
|
|
@@ -232,30 +240,33 @@ class Users {
|
|
|
232
240
|
/**
|
|
233
241
|
* > 🚧 Requires partner key
|
|
234
242
|
* >
|
|
235
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
243
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys)
|
|
236
244
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
245
|
+
* @throws {@link Polytomic.UnprocessableEntityError}
|
|
246
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
237
247
|
*
|
|
238
248
|
* @example
|
|
239
|
-
* await polytomic.users.
|
|
249
|
+
* await polytomic.users.update("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
250
|
+
* email: "mail@example.com"
|
|
251
|
+
* })
|
|
240
252
|
*/
|
|
241
|
-
|
|
253
|
+
update(id, orgId, request, requestOptions) {
|
|
242
254
|
var _a;
|
|
243
255
|
return __awaiter(this, void 0, void 0, function* () {
|
|
244
256
|
const _response = yield core.fetcher({
|
|
245
257
|
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: "
|
|
258
|
+
method: "PUT",
|
|
247
259
|
headers: {
|
|
248
260
|
Authorization: yield this._getAuthorizationHeader(),
|
|
249
|
-
"X-Polytomic-Version":
|
|
250
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
251
|
-
: undefined,
|
|
261
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
252
262
|
"X-Fern-Language": "JavaScript",
|
|
253
263
|
"X-Fern-SDK-Name": "polytomic",
|
|
254
|
-
"X-Fern-SDK-Version": "0.
|
|
264
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
255
265
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
256
266
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
257
267
|
},
|
|
258
268
|
contentType: "application/json",
|
|
269
|
+
body: request,
|
|
259
270
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
260
271
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
261
272
|
});
|
|
@@ -266,6 +277,10 @@ class Users {
|
|
|
266
277
|
switch (_response.error.statusCode) {
|
|
267
278
|
case 401:
|
|
268
279
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
280
|
+
case 422:
|
|
281
|
+
throw new Polytomic.UnprocessableEntityError(_response.error.body);
|
|
282
|
+
case 500:
|
|
283
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
269
284
|
default:
|
|
270
285
|
throw new errors.PolytomicError({
|
|
271
286
|
statusCode: _response.error.statusCode,
|
|
@@ -291,34 +306,30 @@ class Users {
|
|
|
291
306
|
/**
|
|
292
307
|
* > 🚧 Requires partner key
|
|
293
308
|
* >
|
|
294
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
309
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys)
|
|
295
310
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
311
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
312
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
296
313
|
*
|
|
297
314
|
* @example
|
|
298
|
-
* await polytomic.users.
|
|
299
|
-
* email: "mail@example.com",
|
|
300
|
-
* role: "admin"
|
|
301
|
-
* })
|
|
315
|
+
* await polytomic.users.remove("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
302
316
|
*/
|
|
303
|
-
|
|
317
|
+
remove(id, orgId, requestOptions) {
|
|
304
318
|
var _a;
|
|
305
319
|
return __awaiter(this, void 0, void 0, function* () {
|
|
306
320
|
const _response = yield core.fetcher({
|
|
307
321
|
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: "
|
|
322
|
+
method: "DELETE",
|
|
309
323
|
headers: {
|
|
310
324
|
Authorization: yield this._getAuthorizationHeader(),
|
|
311
|
-
"X-Polytomic-Version":
|
|
312
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
313
|
-
: undefined,
|
|
325
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
314
326
|
"X-Fern-Language": "JavaScript",
|
|
315
327
|
"X-Fern-SDK-Name": "polytomic",
|
|
316
|
-
"X-Fern-SDK-Version": "0.
|
|
328
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
317
329
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
318
330
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
319
331
|
},
|
|
320
332
|
contentType: "application/json",
|
|
321
|
-
body: request,
|
|
322
333
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
323
334
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
324
335
|
});
|
|
@@ -329,6 +340,10 @@ class Users {
|
|
|
329
340
|
switch (_response.error.statusCode) {
|
|
330
341
|
case 401:
|
|
331
342
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
343
|
+
case 404:
|
|
344
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
345
|
+
case 500:
|
|
346
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
332
347
|
default:
|
|
333
348
|
throw new errors.PolytomicError({
|
|
334
349
|
statusCode: _response.error.statusCode,
|
|
@@ -354,8 +369,10 @@ class Users {
|
|
|
354
369
|
/**
|
|
355
370
|
* > 🚧 Requires partner key
|
|
356
371
|
* >
|
|
357
|
-
* > User endpoints are only accessible using [partner keys](https://
|
|
372
|
+
* > User endpoints are only accessible using [partner keys](https://apidocs.polytomic.com/getting-started/obtaining-api-keys#partner-keys)
|
|
358
373
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
374
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
375
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
359
376
|
*
|
|
360
377
|
* @example
|
|
361
378
|
* await polytomic.users.createApiKey("248df4b7-aa70-47b8-a036-33ac447e668d", "248df4b7-aa70-47b8-a036-33ac447e668d", {
|
|
@@ -375,12 +392,10 @@ class Users {
|
|
|
375
392
|
method: "POST",
|
|
376
393
|
headers: {
|
|
377
394
|
Authorization: yield this._getAuthorizationHeader(),
|
|
378
|
-
"X-Polytomic-Version":
|
|
379
|
-
? yield core.Supplier.get(this._options.xPolytomicVersion)
|
|
380
|
-
: undefined,
|
|
395
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
381
396
|
"X-Fern-Language": "JavaScript",
|
|
382
397
|
"X-Fern-SDK-Name": "polytomic",
|
|
383
|
-
"X-Fern-SDK-Version": "0.
|
|
398
|
+
"X-Fern-SDK-Version": "1.0.0",
|
|
384
399
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
385
400
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
386
401
|
},
|
|
@@ -396,6 +411,10 @@ class Users {
|
|
|
396
411
|
switch (_response.error.statusCode) {
|
|
397
412
|
case 401:
|
|
398
413
|
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
414
|
+
case 404:
|
|
415
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
416
|
+
case 500:
|
|
417
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
399
418
|
default:
|
|
400
419
|
throw new errors.PolytomicError({
|
|
401
420
|
statusCode: _response.error.statusCode,
|
|
@@ -420,11 +439,7 @@ class Users {
|
|
|
420
439
|
}
|
|
421
440
|
_getAuthorizationHeader() {
|
|
422
441
|
return __awaiter(this, void 0, void 0, function* () {
|
|
423
|
-
|
|
424
|
-
if (bearer != null) {
|
|
425
|
-
return `Bearer ${bearer}`;
|
|
426
|
-
}
|
|
427
|
-
return undefined;
|
|
442
|
+
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
428
443
|
});
|
|
429
444
|
}
|
|
430
445
|
}
|
|
@@ -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,14 +16,15 @@ 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
|
|
24
23
|
* in that organization.
|
|
25
24
|
*
|
|
26
|
-
* Consult the [Events documentation](https://
|
|
25
|
+
* Consult the [Events documentation](https://apidocs.polytomic.com/getting-started/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()
|
|
@@ -35,8 +35,10 @@ export declare class Webhooks {
|
|
|
35
35
|
* webhook may be created per organization. The webhook will be called for events
|
|
36
36
|
* in that organization.
|
|
37
37
|
*
|
|
38
|
-
* Consult the [Events documentation](https://
|
|
38
|
+
* Consult the [Events documentation](https://apidocs.polytomic.com/getting-started/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({
|
|
@@ -50,27 +52,23 @@ export declare class Webhooks {
|
|
|
50
52
|
* webhook may be created per organization. The webhook will be called for events
|
|
51
53
|
* in that organization.
|
|
52
54
|
*
|
|
53
|
-
* Consult the [Events documentation](https://
|
|
55
|
+
* Consult the [Events documentation](https://apidocs.polytomic.com/getting-started/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
|
|
70
66
|
* in that organization.
|
|
71
67
|
*
|
|
72
|
-
* Consult the [Events documentation](https://
|
|
68
|
+
* Consult the [Events documentation](https://apidocs.polytomic.com/getting-started/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
|
}
|