polytomic 1.0.0 → 1.3.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 +3 -3
- package/Client.js +11 -11
- package/api/errors/index.d.ts +2 -2
- package/api/errors/index.js +2 -2
- package/api/resources/bulkSync/client/Client.js +10 -10
- package/api/resources/bulkSync/resources/executions/client/Client.js +2 -2
- package/api/resources/bulkSync/resources/schemas/client/Client.js +4 -4
- package/api/resources/connections/client/Client.js +8 -8
- package/api/resources/events/client/Client.js +2 -2
- package/api/resources/identity/client/Client.js +1 -1
- package/api/resources/index.d.ts +2 -2
- package/api/resources/index.js +3 -3
- package/api/resources/jobs/client/Client.js +1 -1
- package/api/resources/modelSync/client/Client.js +13 -13
- package/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +3 -0
- package/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +3 -0
- package/api/resources/modelSync/resources/executions/client/Client.js +4 -4
- package/api/resources/models/client/Client.d.ts +46 -7
- package/api/resources/models/client/Client.js +236 -12
- package/api/resources/models/client/requests/GetEnrichmentInputFieldsRequest.d.ts +11 -0
- package/api/resources/models/client/requests/ModelsCreateRequest.d.ts +17 -0
- package/api/resources/models/client/requests/ModelsGetRequest.d.ts +10 -0
- package/api/resources/models/client/requests/ModelsGetRequest.js +5 -0
- package/api/resources/models/client/requests/ModelsPreviewRequest.d.ts +17 -0
- package/api/resources/models/client/requests/ModelsPreviewRequest.js +5 -0
- package/api/resources/models/client/requests/ModelsRemoveRequest.d.ts +10 -0
- package/api/resources/models/client/requests/ModelsRemoveRequest.js +5 -0
- package/api/resources/models/client/requests/ModelsSampleRequest.d.ts +10 -0
- package/api/resources/models/client/requests/ModelsSampleRequest.js +5 -0
- package/api/resources/models/client/requests/UpdateModelRequest.d.ts +1 -0
- package/api/resources/models/client/requests/index.d.ts +6 -1
- package/api/resources/organization/client/Client.js +5 -5
- package/api/resources/permissions/resources/policies/client/Client.js +5 -5
- package/api/resources/permissions/resources/roles/client/Client.js +5 -5
- package/api/resources/schemas/client/Client.js +4 -4
- package/api/resources/users/client/Client.js +6 -6
- package/api/resources/webhooks/client/Client.js +5 -5
- package/api/types/ConnectionResponseSchema.d.ts +2 -0
- package/api/{resources/models/client/requests → types}/CreateModelRequest.d.ts +2 -9
- package/api/types/CreateModelRequest.js +5 -0
- package/api/types/Enrichment.d.ts +13 -0
- package/api/types/Enrichment.js +5 -0
- package/api/types/Filter.d.ts +9 -3
- package/api/types/FilterFieldReferenceType.d.ts +8 -0
- package/api/types/FilterFieldReferenceType.js +10 -0
- package/api/types/FilterFunction.d.ts +31 -0
- package/api/types/FilterFunction.js +33 -0
- package/api/types/Identity.d.ts +1 -1
- package/api/types/ModelField.d.ts +1 -0
- package/api/types/ModelResponse.d.ts +1 -0
- package/api/types/ModelSample.d.ts +8 -0
- package/api/types/ModelSample.js +5 -0
- package/api/types/ModelSampleResponseEnvelope.d.ts +8 -0
- package/api/types/ModelSampleResponseEnvelope.js +5 -0
- package/api/types/Override.d.ts +7 -1
- package/api/types/Schedule.d.ts +1 -1
- package/api/types/SchemaIdentityFunction.d.ts +9 -0
- package/api/types/SchemaIdentityFunction.js +11 -0
- package/api/types/V2EnricherConfiguration.d.ts +7 -0
- package/api/types/V2EnricherConfiguration.js +5 -0
- package/api/types/V2EnricherMapping.d.ts +7 -0
- package/api/types/V2EnricherMapping.js +5 -0
- package/api/types/V2GetEnrichmentInputFieldsResponseEnvelope.d.ts +6 -0
- package/api/types/V2GetEnrichmentInputFieldsResponseEnvelope.js +5 -0
- package/api/types/V2SampleRecord.d.ts +7 -0
- package/api/types/V2SampleRecord.js +5 -0
- package/api/types/index.d.ts +11 -0
- package/api/types/index.js +11 -0
- package/dist/Client.d.ts +3 -3
- package/dist/Client.js +11 -11
- package/dist/api/errors/index.d.ts +2 -2
- package/dist/api/errors/index.js +2 -2
- package/dist/api/resources/bulkSync/client/Client.js +10 -10
- package/dist/api/resources/bulkSync/resources/executions/client/Client.js +2 -2
- package/dist/api/resources/bulkSync/resources/schemas/client/Client.js +4 -4
- package/dist/api/resources/connections/client/Client.js +8 -8
- package/dist/api/resources/events/client/Client.js +2 -2
- package/dist/api/resources/identity/client/Client.js +1 -1
- package/dist/api/resources/index.d.ts +2 -2
- package/dist/api/resources/index.js +3 -3
- package/dist/api/resources/jobs/client/Client.js +1 -1
- package/dist/api/resources/modelSync/client/Client.js +13 -13
- package/dist/api/resources/modelSync/client/requests/CreateModelSyncRequest.d.ts +3 -0
- package/dist/api/resources/modelSync/client/requests/UpdateModelSyncRequest.d.ts +3 -0
- package/dist/api/resources/modelSync/resources/executions/client/Client.js +4 -4
- package/dist/api/resources/models/client/Client.d.ts +46 -7
- package/dist/api/resources/models/client/Client.js +236 -12
- package/dist/api/resources/models/client/requests/GetEnrichmentInputFieldsRequest.d.ts +11 -0
- package/dist/api/resources/models/client/requests/GetEnrichmentInputFieldsRequest.js +5 -0
- package/dist/api/resources/models/client/requests/ModelsCreateRequest.d.ts +17 -0
- package/dist/api/resources/models/client/requests/ModelsCreateRequest.js +5 -0
- package/dist/api/resources/models/client/requests/ModelsGetRequest.d.ts +10 -0
- package/dist/api/resources/models/client/requests/ModelsGetRequest.js +5 -0
- package/dist/api/resources/models/client/requests/ModelsPreviewRequest.d.ts +17 -0
- package/dist/api/resources/models/client/requests/ModelsPreviewRequest.js +5 -0
- package/dist/api/resources/models/client/requests/ModelsRemoveRequest.d.ts +10 -0
- package/dist/api/resources/models/client/requests/ModelsRemoveRequest.js +5 -0
- package/dist/api/resources/models/client/requests/ModelsSampleRequest.d.ts +10 -0
- package/dist/api/resources/models/client/requests/ModelsSampleRequest.js +5 -0
- package/dist/api/resources/models/client/requests/UpdateModelRequest.d.ts +1 -0
- package/dist/api/resources/models/client/requests/index.d.ts +6 -1
- package/dist/api/resources/organization/client/Client.js +5 -5
- package/dist/api/resources/permissions/resources/policies/client/Client.js +5 -5
- package/dist/api/resources/permissions/resources/roles/client/Client.js +5 -5
- package/dist/api/resources/schemas/client/Client.js +4 -4
- package/dist/api/resources/users/client/Client.js +6 -6
- package/dist/api/resources/webhooks/client/Client.js +5 -5
- package/dist/api/types/ConnectionResponseSchema.d.ts +2 -0
- package/dist/api/{resources/models/client/requests → types}/CreateModelRequest.d.ts +2 -9
- package/dist/api/types/CreateModelRequest.js +5 -0
- package/dist/api/types/Enrichment.d.ts +13 -0
- package/dist/api/types/Enrichment.js +5 -0
- package/dist/api/types/Filter.d.ts +9 -3
- package/dist/api/types/FilterFieldReferenceType.d.ts +8 -0
- package/dist/api/types/FilterFieldReferenceType.js +10 -0
- package/dist/api/types/FilterFunction.d.ts +31 -0
- package/dist/api/types/FilterFunction.js +33 -0
- package/dist/api/types/Identity.d.ts +1 -1
- package/dist/api/types/ModelField.d.ts +1 -0
- package/dist/api/types/ModelResponse.d.ts +1 -0
- package/dist/api/types/ModelSample.d.ts +8 -0
- package/dist/api/types/ModelSample.js +5 -0
- package/dist/api/types/ModelSampleResponseEnvelope.d.ts +8 -0
- package/dist/api/types/ModelSampleResponseEnvelope.js +5 -0
- package/dist/api/types/Override.d.ts +7 -1
- package/dist/api/types/Schedule.d.ts +1 -1
- package/dist/api/types/SchemaIdentityFunction.d.ts +9 -0
- package/dist/api/types/SchemaIdentityFunction.js +11 -0
- package/dist/api/types/V2EnricherConfiguration.d.ts +7 -0
- package/dist/api/types/V2EnricherConfiguration.js +5 -0
- package/dist/api/types/V2EnricherMapping.d.ts +7 -0
- package/dist/api/types/V2EnricherMapping.js +5 -0
- package/dist/api/types/V2GetEnrichmentInputFieldsResponseEnvelope.d.ts +6 -0
- package/dist/api/types/V2GetEnrichmentInputFieldsResponseEnvelope.js +5 -0
- package/dist/api/types/V2SampleRecord.d.ts +7 -0
- package/dist/api/types/V2SampleRecord.js +5 -0
- package/dist/api/types/index.d.ts +11 -0
- package/dist/api/types/index.js +11 -0
- package/package.json +1 -1
- /package/api/resources/models/client/requests/{CreateModelRequest.js → GetEnrichmentInputFieldsRequest.js} +0 -0
- /package/{dist/api/resources/models/client/requests/CreateModelRequest.js → api/resources/models/client/requests/ModelsCreateRequest.js} +0 -0
|
@@ -17,6 +17,32 @@ export declare namespace Models {
|
|
|
17
17
|
export declare class Models {
|
|
18
18
|
protected readonly _options: Models.Options;
|
|
19
19
|
constructor(_options: Models.Options);
|
|
20
|
+
/**
|
|
21
|
+
* For a given connection and enrichment configuration, provides the valid sets of input fields.
|
|
22
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
23
|
+
* @throws {@link Polytomic.ForbiddenError}
|
|
24
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
25
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* await polytomic.models.post("248df4b7-aa70-47b8-a036-33ac447e668d", {})
|
|
29
|
+
*/
|
|
30
|
+
post(connectionId: string, request?: Polytomic.GetEnrichmentInputFieldsRequest, requestOptions?: Models.RequestOptions): Promise<Polytomic.V2GetEnrichmentInputFieldsResponseEnvelope>;
|
|
31
|
+
/**
|
|
32
|
+
* @throws {@link Polytomic.BadRequestError}
|
|
33
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
34
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
35
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* await polytomic.models.preview({
|
|
39
|
+
* body: {
|
|
40
|
+
* connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
|
|
41
|
+
* name: "Users"
|
|
42
|
+
* }
|
|
43
|
+
* })
|
|
44
|
+
*/
|
|
45
|
+
preview(request: Polytomic.ModelsPreviewRequest, requestOptions?: Models.RequestOptions): Promise<Polytomic.ModelResponseEnvelope>;
|
|
20
46
|
/**
|
|
21
47
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
22
48
|
* @throws {@link Polytomic.NotFoundError}
|
|
@@ -33,20 +59,22 @@ export declare class Models {
|
|
|
33
59
|
*
|
|
34
60
|
* @example
|
|
35
61
|
* await polytomic.models.create({
|
|
36
|
-
*
|
|
37
|
-
*
|
|
62
|
+
* body: {
|
|
63
|
+
* connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
|
|
64
|
+
* name: "Users"
|
|
65
|
+
* }
|
|
38
66
|
* })
|
|
39
67
|
*/
|
|
40
|
-
create(request: Polytomic.
|
|
68
|
+
create(request: Polytomic.ModelsCreateRequest, requestOptions?: Models.RequestOptions): Promise<Polytomic.ModelResponseEnvelope>;
|
|
41
69
|
/**
|
|
42
70
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
43
71
|
* @throws {@link Polytomic.NotFoundError}
|
|
44
72
|
* @throws {@link Polytomic.InternalServerError}
|
|
45
73
|
*
|
|
46
74
|
* @example
|
|
47
|
-
* await polytomic.models.get("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
75
|
+
* await polytomic.models.get("248df4b7-aa70-47b8-a036-33ac447e668d", {})
|
|
48
76
|
*/
|
|
49
|
-
get(id: string, requestOptions?: Models.RequestOptions): Promise<Polytomic.ModelResponseEnvelope>;
|
|
77
|
+
get(id: string, request?: Polytomic.ModelsGetRequest, requestOptions?: Models.RequestOptions): Promise<Polytomic.ModelResponseEnvelope>;
|
|
50
78
|
/**
|
|
51
79
|
* @throws {@link Polytomic.BadRequestError}
|
|
52
80
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
@@ -68,8 +96,19 @@ export declare class Models {
|
|
|
68
96
|
* @throws {@link Polytomic.InternalServerError}
|
|
69
97
|
*
|
|
70
98
|
* @example
|
|
71
|
-
* await polytomic.models.remove("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
99
|
+
* await polytomic.models.remove("248df4b7-aa70-47b8-a036-33ac447e668d", {})
|
|
100
|
+
*/
|
|
101
|
+
remove(id: string, request?: Polytomic.ModelsRemoveRequest, requestOptions?: Models.RequestOptions): Promise<void>;
|
|
102
|
+
/**
|
|
103
|
+
* Returns sample records from the model. The first ten records that the source provides will be returned after being enriched (if applicable). Synchronous requests must complete within 10s. If either querying or enrichment exceeds 10s, please use the async option.
|
|
104
|
+
* @throws {@link Polytomic.BadRequestError}
|
|
105
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
106
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
107
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* await polytomic.models.sample("248df4b7-aa70-47b8-a036-33ac447e668d", {})
|
|
72
111
|
*/
|
|
73
|
-
|
|
112
|
+
sample(id: string, request?: Polytomic.ModelsSampleRequest, requestOptions?: Models.RequestOptions): Promise<Polytomic.ModelSampleResponseEnvelope>;
|
|
74
113
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
75
114
|
}
|
|
@@ -59,6 +59,146 @@ class Models {
|
|
|
59
59
|
constructor(_options) {
|
|
60
60
|
this._options = _options;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* For a given connection and enrichment configuration, provides the valid sets of input fields.
|
|
64
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
65
|
+
* @throws {@link Polytomic.ForbiddenError}
|
|
66
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
67
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* await polytomic.models.post("248df4b7-aa70-47b8-a036-33ac447e668d", {})
|
|
71
|
+
*/
|
|
72
|
+
post(connectionId, request = {}, requestOptions) {
|
|
73
|
+
var _a;
|
|
74
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
75
|
+
const _response = yield core.fetcher({
|
|
76
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/enrichment/${connectionId}/inputfields`),
|
|
77
|
+
method: "POST",
|
|
78
|
+
headers: {
|
|
79
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
80
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
81
|
+
"X-Fern-Language": "JavaScript",
|
|
82
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
83
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
84
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
85
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
86
|
+
},
|
|
87
|
+
contentType: "application/json",
|
|
88
|
+
body: request,
|
|
89
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
90
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
91
|
+
});
|
|
92
|
+
if (_response.ok) {
|
|
93
|
+
return _response.body;
|
|
94
|
+
}
|
|
95
|
+
if (_response.error.reason === "status-code") {
|
|
96
|
+
switch (_response.error.statusCode) {
|
|
97
|
+
case 401:
|
|
98
|
+
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
99
|
+
case 403:
|
|
100
|
+
throw new Polytomic.ForbiddenError(_response.error.body);
|
|
101
|
+
case 404:
|
|
102
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
103
|
+
case 500:
|
|
104
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
105
|
+
default:
|
|
106
|
+
throw new errors.PolytomicError({
|
|
107
|
+
statusCode: _response.error.statusCode,
|
|
108
|
+
body: _response.error.body,
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
switch (_response.error.reason) {
|
|
113
|
+
case "non-json":
|
|
114
|
+
throw new errors.PolytomicError({
|
|
115
|
+
statusCode: _response.error.statusCode,
|
|
116
|
+
body: _response.error.rawBody,
|
|
117
|
+
});
|
|
118
|
+
case "timeout":
|
|
119
|
+
throw new errors.PolytomicTimeoutError();
|
|
120
|
+
case "unknown":
|
|
121
|
+
throw new errors.PolytomicError({
|
|
122
|
+
message: _response.error.errorMessage,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* @throws {@link Polytomic.BadRequestError}
|
|
129
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
130
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
131
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* await polytomic.models.preview({
|
|
135
|
+
* body: {
|
|
136
|
+
* connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
|
|
137
|
+
* name: "Users"
|
|
138
|
+
* }
|
|
139
|
+
* })
|
|
140
|
+
*/
|
|
141
|
+
preview(request, requestOptions) {
|
|
142
|
+
var _a;
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
const { async, body: _body } = request;
|
|
145
|
+
const _queryParams = {};
|
|
146
|
+
if (async != null) {
|
|
147
|
+
_queryParams["async"] = async.toString();
|
|
148
|
+
}
|
|
149
|
+
const _response = yield core.fetcher({
|
|
150
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, "api/model-preview"),
|
|
151
|
+
method: "POST",
|
|
152
|
+
headers: {
|
|
153
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
154
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
155
|
+
"X-Fern-Language": "JavaScript",
|
|
156
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
157
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
158
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
159
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
160
|
+
},
|
|
161
|
+
contentType: "application/json",
|
|
162
|
+
queryParameters: _queryParams,
|
|
163
|
+
body: _body,
|
|
164
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
165
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
166
|
+
});
|
|
167
|
+
if (_response.ok) {
|
|
168
|
+
return _response.body;
|
|
169
|
+
}
|
|
170
|
+
if (_response.error.reason === "status-code") {
|
|
171
|
+
switch (_response.error.statusCode) {
|
|
172
|
+
case 400:
|
|
173
|
+
throw new Polytomic.BadRequestError(_response.error.body);
|
|
174
|
+
case 401:
|
|
175
|
+
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
176
|
+
case 404:
|
|
177
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
178
|
+
case 500:
|
|
179
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
180
|
+
default:
|
|
181
|
+
throw new errors.PolytomicError({
|
|
182
|
+
statusCode: _response.error.statusCode,
|
|
183
|
+
body: _response.error.body,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
switch (_response.error.reason) {
|
|
188
|
+
case "non-json":
|
|
189
|
+
throw new errors.PolytomicError({
|
|
190
|
+
statusCode: _response.error.statusCode,
|
|
191
|
+
body: _response.error.rawBody,
|
|
192
|
+
});
|
|
193
|
+
case "timeout":
|
|
194
|
+
throw new errors.PolytomicTimeoutError();
|
|
195
|
+
case "unknown":
|
|
196
|
+
throw new errors.PolytomicError({
|
|
197
|
+
message: _response.error.errorMessage,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
});
|
|
201
|
+
}
|
|
62
202
|
/**
|
|
63
203
|
* @throws {@link Polytomic.UnauthorizedError}
|
|
64
204
|
* @throws {@link Polytomic.NotFoundError}
|
|
@@ -77,7 +217,7 @@ class Models {
|
|
|
77
217
|
"X-Polytomic-Version": "2024-02-08",
|
|
78
218
|
"X-Fern-Language": "JavaScript",
|
|
79
219
|
"X-Fern-SDK-Name": "polytomic",
|
|
80
|
-
"X-Fern-SDK-Version": "1.
|
|
220
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
81
221
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
82
222
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
83
223
|
},
|
|
@@ -124,14 +264,16 @@ class Models {
|
|
|
124
264
|
*
|
|
125
265
|
* @example
|
|
126
266
|
* await polytomic.models.create({
|
|
127
|
-
*
|
|
128
|
-
*
|
|
267
|
+
* body: {
|
|
268
|
+
* connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
|
|
269
|
+
* name: "Users"
|
|
270
|
+
* }
|
|
129
271
|
* })
|
|
130
272
|
*/
|
|
131
273
|
create(request, requestOptions) {
|
|
132
274
|
var _a;
|
|
133
275
|
return __awaiter(this, void 0, void 0, function* () {
|
|
134
|
-
const { async
|
|
276
|
+
const { async, body: _body } = request;
|
|
135
277
|
const _queryParams = {};
|
|
136
278
|
if (async != null) {
|
|
137
279
|
_queryParams["async"] = async.toString();
|
|
@@ -144,7 +286,7 @@ class Models {
|
|
|
144
286
|
"X-Polytomic-Version": "2024-02-08",
|
|
145
287
|
"X-Fern-Language": "JavaScript",
|
|
146
288
|
"X-Fern-SDK-Name": "polytomic",
|
|
147
|
-
"X-Fern-SDK-Version": "1.
|
|
289
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
148
290
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
149
291
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
150
292
|
},
|
|
@@ -195,11 +337,16 @@ class Models {
|
|
|
195
337
|
* @throws {@link Polytomic.InternalServerError}
|
|
196
338
|
*
|
|
197
339
|
* @example
|
|
198
|
-
* await polytomic.models.get("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
340
|
+
* await polytomic.models.get("248df4b7-aa70-47b8-a036-33ac447e668d", {})
|
|
199
341
|
*/
|
|
200
|
-
get(id, requestOptions) {
|
|
342
|
+
get(id, request = {}, requestOptions) {
|
|
201
343
|
var _a;
|
|
202
344
|
return __awaiter(this, void 0, void 0, function* () {
|
|
345
|
+
const { async } = request;
|
|
346
|
+
const _queryParams = {};
|
|
347
|
+
if (async != null) {
|
|
348
|
+
_queryParams["async"] = async.toString();
|
|
349
|
+
}
|
|
203
350
|
const _response = yield core.fetcher({
|
|
204
351
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/models/${id}`),
|
|
205
352
|
method: "GET",
|
|
@@ -208,11 +355,12 @@ class Models {
|
|
|
208
355
|
"X-Polytomic-Version": "2024-02-08",
|
|
209
356
|
"X-Fern-Language": "JavaScript",
|
|
210
357
|
"X-Fern-SDK-Name": "polytomic",
|
|
211
|
-
"X-Fern-SDK-Version": "1.
|
|
358
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
212
359
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
213
360
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
214
361
|
},
|
|
215
362
|
contentType: "application/json",
|
|
363
|
+
queryParameters: _queryParams,
|
|
216
364
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
217
365
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
218
366
|
});
|
|
@@ -278,7 +426,7 @@ class Models {
|
|
|
278
426
|
"X-Polytomic-Version": "2024-02-08",
|
|
279
427
|
"X-Fern-Language": "JavaScript",
|
|
280
428
|
"X-Fern-SDK-Name": "polytomic",
|
|
281
|
-
"X-Fern-SDK-Version": "1.
|
|
429
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
282
430
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
283
431
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
284
432
|
},
|
|
@@ -330,11 +478,16 @@ class Models {
|
|
|
330
478
|
* @throws {@link Polytomic.InternalServerError}
|
|
331
479
|
*
|
|
332
480
|
* @example
|
|
333
|
-
* await polytomic.models.remove("248df4b7-aa70-47b8-a036-33ac447e668d")
|
|
481
|
+
* await polytomic.models.remove("248df4b7-aa70-47b8-a036-33ac447e668d", {})
|
|
334
482
|
*/
|
|
335
|
-
remove(id, requestOptions) {
|
|
483
|
+
remove(id, request = {}, requestOptions) {
|
|
336
484
|
var _a;
|
|
337
485
|
return __awaiter(this, void 0, void 0, function* () {
|
|
486
|
+
const { async } = request;
|
|
487
|
+
const _queryParams = {};
|
|
488
|
+
if (async != null) {
|
|
489
|
+
_queryParams["async"] = async.toString();
|
|
490
|
+
}
|
|
338
491
|
const _response = yield core.fetcher({
|
|
339
492
|
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/models/${id}`),
|
|
340
493
|
method: "DELETE",
|
|
@@ -343,11 +496,12 @@ class Models {
|
|
|
343
496
|
"X-Polytomic-Version": "2024-02-08",
|
|
344
497
|
"X-Fern-Language": "JavaScript",
|
|
345
498
|
"X-Fern-SDK-Name": "polytomic",
|
|
346
|
-
"X-Fern-SDK-Version": "1.
|
|
499
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
347
500
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
348
501
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
349
502
|
},
|
|
350
503
|
contentType: "application/json",
|
|
504
|
+
queryParameters: _queryParams,
|
|
351
505
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
352
506
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
353
507
|
});
|
|
@@ -386,6 +540,76 @@ class Models {
|
|
|
386
540
|
}
|
|
387
541
|
});
|
|
388
542
|
}
|
|
543
|
+
/**
|
|
544
|
+
* Returns sample records from the model. The first ten records that the source provides will be returned after being enriched (if applicable). Synchronous requests must complete within 10s. If either querying or enrichment exceeds 10s, please use the async option.
|
|
545
|
+
* @throws {@link Polytomic.BadRequestError}
|
|
546
|
+
* @throws {@link Polytomic.UnauthorizedError}
|
|
547
|
+
* @throws {@link Polytomic.NotFoundError}
|
|
548
|
+
* @throws {@link Polytomic.InternalServerError}
|
|
549
|
+
*
|
|
550
|
+
* @example
|
|
551
|
+
* await polytomic.models.sample("248df4b7-aa70-47b8-a036-33ac447e668d", {})
|
|
552
|
+
*/
|
|
553
|
+
sample(id, request = {}, requestOptions) {
|
|
554
|
+
var _a;
|
|
555
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
556
|
+
const { async } = request;
|
|
557
|
+
const _queryParams = {};
|
|
558
|
+
if (async != null) {
|
|
559
|
+
_queryParams["async"] = async.toString();
|
|
560
|
+
}
|
|
561
|
+
const _response = yield core.fetcher({
|
|
562
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.PolytomicEnvironment.Default, `api/models/${id}/sample`),
|
|
563
|
+
method: "GET",
|
|
564
|
+
headers: {
|
|
565
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
566
|
+
"X-Polytomic-Version": "2024-02-08",
|
|
567
|
+
"X-Fern-Language": "JavaScript",
|
|
568
|
+
"X-Fern-SDK-Name": "polytomic",
|
|
569
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
570
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
571
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
572
|
+
},
|
|
573
|
+
contentType: "application/json",
|
|
574
|
+
queryParameters: _queryParams,
|
|
575
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
576
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
577
|
+
});
|
|
578
|
+
if (_response.ok) {
|
|
579
|
+
return _response.body;
|
|
580
|
+
}
|
|
581
|
+
if (_response.error.reason === "status-code") {
|
|
582
|
+
switch (_response.error.statusCode) {
|
|
583
|
+
case 400:
|
|
584
|
+
throw new Polytomic.BadRequestError(_response.error.body);
|
|
585
|
+
case 401:
|
|
586
|
+
throw new Polytomic.UnauthorizedError(_response.error.body);
|
|
587
|
+
case 404:
|
|
588
|
+
throw new Polytomic.NotFoundError(_response.error.body);
|
|
589
|
+
case 500:
|
|
590
|
+
throw new Polytomic.InternalServerError(_response.error.body);
|
|
591
|
+
default:
|
|
592
|
+
throw new errors.PolytomicError({
|
|
593
|
+
statusCode: _response.error.statusCode,
|
|
594
|
+
body: _response.error.body,
|
|
595
|
+
});
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
switch (_response.error.reason) {
|
|
599
|
+
case "non-json":
|
|
600
|
+
throw new errors.PolytomicError({
|
|
601
|
+
statusCode: _response.error.statusCode,
|
|
602
|
+
body: _response.error.rawBody,
|
|
603
|
+
});
|
|
604
|
+
case "timeout":
|
|
605
|
+
throw new errors.PolytomicTimeoutError();
|
|
606
|
+
case "unknown":
|
|
607
|
+
throw new errors.PolytomicError({
|
|
608
|
+
message: _response.error.errorMessage,
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
});
|
|
612
|
+
}
|
|
389
613
|
_getAuthorizationHeader() {
|
|
390
614
|
return __awaiter(this, void 0, void 0, function* () {
|
|
391
615
|
return `Bearer ${yield core.Supplier.get(this._options.token)}`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Polytomic from "../../../..";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* body: {
|
|
9
|
+
* connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
|
|
10
|
+
* name: "Users"
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export interface ModelsCreateRequest {
|
|
15
|
+
async?: boolean;
|
|
16
|
+
body: Polytomic.CreateModelRequest;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Polytomic from "../../../..";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* body: {
|
|
9
|
+
* connection_id: "248df4b7-aa70-47b8-a036-33ac447e668d",
|
|
10
|
+
* name: "Users"
|
|
11
|
+
* }
|
|
12
|
+
* }
|
|
13
|
+
*/
|
|
14
|
+
export interface ModelsPreviewRequest {
|
|
15
|
+
async?: boolean;
|
|
16
|
+
body: Polytomic.CreateModelRequest;
|
|
17
|
+
}
|
|
@@ -15,6 +15,7 @@ export interface UpdateModelRequest {
|
|
|
15
15
|
additional_fields?: Polytomic.ModelModelFieldRequest[];
|
|
16
16
|
configuration?: Record<string, unknown>;
|
|
17
17
|
connection_id: string;
|
|
18
|
+
enricher?: Polytomic.Enrichment;
|
|
18
19
|
fields?: string[];
|
|
19
20
|
identifier?: string;
|
|
20
21
|
labels?: string[];
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { GetEnrichmentInputFieldsRequest } from "./GetEnrichmentInputFieldsRequest";
|
|
2
|
+
export { ModelsPreviewRequest } from "./ModelsPreviewRequest";
|
|
3
|
+
export { ModelsCreateRequest } from "./ModelsCreateRequest";
|
|
4
|
+
export { ModelsGetRequest } from "./ModelsGetRequest";
|
|
2
5
|
export { UpdateModelRequest } from "./UpdateModelRequest";
|
|
6
|
+
export { ModelsRemoveRequest } from "./ModelsRemoveRequest";
|
|
7
|
+
export { ModelsSampleRequest } from "./ModelsSampleRequest";
|
|
@@ -69,7 +69,7 @@ class Organization {
|
|
|
69
69
|
"X-Polytomic-Version": "2024-02-08",
|
|
70
70
|
"X-Fern-Language": "JavaScript",
|
|
71
71
|
"X-Fern-SDK-Name": "polytomic",
|
|
72
|
-
"X-Fern-SDK-Version": "1.
|
|
72
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
73
73
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
74
74
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
75
75
|
},
|
|
@@ -132,7 +132,7 @@ class Organization {
|
|
|
132
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": "1.
|
|
135
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
136
136
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
137
137
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
138
138
|
},
|
|
@@ -195,7 +195,7 @@ class Organization {
|
|
|
195
195
|
"X-Polytomic-Version": "2024-02-08",
|
|
196
196
|
"X-Fern-Language": "JavaScript",
|
|
197
197
|
"X-Fern-SDK-Name": "polytomic",
|
|
198
|
-
"X-Fern-SDK-Version": "1.
|
|
198
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
199
199
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
200
200
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
201
201
|
},
|
|
@@ -258,7 +258,7 @@ class Organization {
|
|
|
258
258
|
"X-Polytomic-Version": "2024-02-08",
|
|
259
259
|
"X-Fern-Language": "JavaScript",
|
|
260
260
|
"X-Fern-SDK-Name": "polytomic",
|
|
261
|
-
"X-Fern-SDK-Version": "1.
|
|
261
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
262
262
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
263
263
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
264
264
|
},
|
|
@@ -322,7 +322,7 @@ class Organization {
|
|
|
322
322
|
"X-Polytomic-Version": "2024-02-08",
|
|
323
323
|
"X-Fern-Language": "JavaScript",
|
|
324
324
|
"X-Fern-SDK-Name": "polytomic",
|
|
325
|
-
"X-Fern-SDK-Version": "1.
|
|
325
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
326
326
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
327
327
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
328
328
|
},
|
|
@@ -66,7 +66,7 @@ class Policies {
|
|
|
66
66
|
"X-Polytomic-Version": "2024-02-08",
|
|
67
67
|
"X-Fern-Language": "JavaScript",
|
|
68
68
|
"X-Fern-SDK-Name": "polytomic",
|
|
69
|
-
"X-Fern-SDK-Version": "1.
|
|
69
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
70
70
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
71
71
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
72
72
|
},
|
|
@@ -128,7 +128,7 @@ class Policies {
|
|
|
128
128
|
"X-Polytomic-Version": "2024-02-08",
|
|
129
129
|
"X-Fern-Language": "JavaScript",
|
|
130
130
|
"X-Fern-SDK-Name": "polytomic",
|
|
131
|
-
"X-Fern-SDK-Version": "1.
|
|
131
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
132
132
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
133
133
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
134
134
|
},
|
|
@@ -193,7 +193,7 @@ class Policies {
|
|
|
193
193
|
"X-Polytomic-Version": "2024-02-08",
|
|
194
194
|
"X-Fern-Language": "JavaScript",
|
|
195
195
|
"X-Fern-SDK-Name": "polytomic",
|
|
196
|
-
"X-Fern-SDK-Version": "1.
|
|
196
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
197
197
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
198
198
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
199
199
|
},
|
|
@@ -257,7 +257,7 @@ class Policies {
|
|
|
257
257
|
"X-Polytomic-Version": "2024-02-08",
|
|
258
258
|
"X-Fern-Language": "JavaScript",
|
|
259
259
|
"X-Fern-SDK-Name": "polytomic",
|
|
260
|
-
"X-Fern-SDK-Version": "1.
|
|
260
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
261
261
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
262
262
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
263
263
|
},
|
|
@@ -323,7 +323,7 @@ class Policies {
|
|
|
323
323
|
"X-Polytomic-Version": "2024-02-08",
|
|
324
324
|
"X-Fern-Language": "JavaScript",
|
|
325
325
|
"X-Fern-SDK-Name": "polytomic",
|
|
326
|
-
"X-Fern-SDK-Version": "1.
|
|
326
|
+
"X-Fern-SDK-Version": "1.3.0",
|
|
327
327
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
328
328
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
329
329
|
},
|