@stackone/core 1.53.1 → 1.54.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/dist/index.d.mts +241 -9
- package/dist/index.d.ts +241 -9
- package/dist/index.js +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { HttpMethod, IHttpClient } from "@stackone/transport";
|
|
2
|
-
import { ILogger } from "@stackone/logger";
|
|
3
1
|
import { ZodType, z } from "zod/v4";
|
|
2
|
+
import http from "node:http";
|
|
3
|
+
import https from "node:https";
|
|
4
4
|
|
|
5
5
|
//#region src/categories/types.d.ts
|
|
6
|
-
type Category = 'hris' | 'crm' | 'ats' | 'lms' | 'marketing' | 'filestorage';
|
|
6
|
+
type Category = 'hris' | 'crm' | 'ats' | 'lms' | 'marketing' | 'filestorage' | 'internal';
|
|
7
7
|
type CategoryDetails = {
|
|
8
8
|
title: string;
|
|
9
9
|
key: Category;
|
|
@@ -87,6 +87,223 @@ declare const updateCursor: ({
|
|
|
87
87
|
position?: number | null;
|
|
88
88
|
}) => Cursor;
|
|
89
89
|
//#endregion
|
|
90
|
+
//#region ../logger/src/types.d.ts
|
|
91
|
+
interface ILogger {
|
|
92
|
+
debug({
|
|
93
|
+
category,
|
|
94
|
+
message,
|
|
95
|
+
traceId,
|
|
96
|
+
context
|
|
97
|
+
}: {
|
|
98
|
+
category?: string;
|
|
99
|
+
message: string;
|
|
100
|
+
traceId?: string;
|
|
101
|
+
context?: Record<string, unknown>;
|
|
102
|
+
}): void;
|
|
103
|
+
info({
|
|
104
|
+
category,
|
|
105
|
+
message,
|
|
106
|
+
traceId,
|
|
107
|
+
context
|
|
108
|
+
}: {
|
|
109
|
+
category?: string;
|
|
110
|
+
message: string;
|
|
111
|
+
traceId?: string;
|
|
112
|
+
context?: Record<string, unknown>;
|
|
113
|
+
}): void;
|
|
114
|
+
warning({
|
|
115
|
+
category,
|
|
116
|
+
message,
|
|
117
|
+
traceId,
|
|
118
|
+
error,
|
|
119
|
+
code,
|
|
120
|
+
context
|
|
121
|
+
}: {
|
|
122
|
+
category?: string;
|
|
123
|
+
message: string;
|
|
124
|
+
traceId?: string;
|
|
125
|
+
error?: LogError;
|
|
126
|
+
code?: string;
|
|
127
|
+
context?: Record<string, unknown>;
|
|
128
|
+
}): void;
|
|
129
|
+
error({
|
|
130
|
+
category,
|
|
131
|
+
message,
|
|
132
|
+
traceId,
|
|
133
|
+
error,
|
|
134
|
+
code,
|
|
135
|
+
context
|
|
136
|
+
}: {
|
|
137
|
+
category?: string;
|
|
138
|
+
message: string;
|
|
139
|
+
traceId?: string;
|
|
140
|
+
error?: LogError;
|
|
141
|
+
code: string;
|
|
142
|
+
context?: Record<string, unknown>;
|
|
143
|
+
}): void;
|
|
144
|
+
}
|
|
145
|
+
type LogError = Error & {
|
|
146
|
+
response?: {
|
|
147
|
+
data?: unknown;
|
|
148
|
+
};
|
|
149
|
+
context?: Record<string, unknown>;
|
|
150
|
+
url?: string;
|
|
151
|
+
};
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region ../transport/src/concurrencyManager/types.d.ts
|
|
154
|
+
type ConcurrencySubPoolConfig = {
|
|
155
|
+
subPoolKey: string;
|
|
156
|
+
urlPattern: RegExp | string;
|
|
157
|
+
maxConcurrency: number;
|
|
158
|
+
};
|
|
159
|
+
type ConcurrencyConfig = {
|
|
160
|
+
mainMaxConcurrency: number;
|
|
161
|
+
subPools?: ConcurrencySubPoolConfig[];
|
|
162
|
+
};
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region ../transport/src/rateLimitManager/types.d.ts
|
|
165
|
+
type RateLimitSubPoolConfig = {
|
|
166
|
+
subPoolKey: string;
|
|
167
|
+
urlPattern: RegExp | string;
|
|
168
|
+
rateLimit: number;
|
|
169
|
+
};
|
|
170
|
+
type RetryUnit = 'seconds' | 'milliseconds' | 'date';
|
|
171
|
+
type MappedRateLimitErrorConfig = {
|
|
172
|
+
errorStatus: number;
|
|
173
|
+
errorMessage: string | RegExp;
|
|
174
|
+
errorMessagePath?: string;
|
|
175
|
+
retryAfterPath?: string;
|
|
176
|
+
retryAfterUnit?: RetryUnit;
|
|
177
|
+
retryAfterValue?: number;
|
|
178
|
+
};
|
|
179
|
+
type RateLimitConfig = {
|
|
180
|
+
mainRatelimit: number;
|
|
181
|
+
subPools?: RateLimitSubPoolConfig[];
|
|
182
|
+
mappedRateLimitErrors?: MappedRateLimitErrorConfig[];
|
|
183
|
+
};
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region ../transport/src/interceptors/types.d.ts
|
|
186
|
+
type RequestConfig = {
|
|
187
|
+
rateLimits?: RateLimitConfig;
|
|
188
|
+
concurrency?: ConcurrencyConfig;
|
|
189
|
+
};
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region ../transport/src/httpClient/types.d.ts
|
|
192
|
+
type HttpHeaders = {
|
|
193
|
+
[key: string]: string;
|
|
194
|
+
};
|
|
195
|
+
type HttpQueryParams = {
|
|
196
|
+
[key: string]: string;
|
|
197
|
+
};
|
|
198
|
+
declare const HttpMethods: readonly ["get", "post", "put", "delete", "patch"];
|
|
199
|
+
type HttpMethod = (typeof HttpMethods)[number];
|
|
200
|
+
type HttpResponse<T = any> = {
|
|
201
|
+
data: T;
|
|
202
|
+
status: number;
|
|
203
|
+
headers: HttpHeaders;
|
|
204
|
+
requestUrl: string;
|
|
205
|
+
responseType?: string;
|
|
206
|
+
responseTime?: Date;
|
|
207
|
+
message?: string;
|
|
208
|
+
};
|
|
209
|
+
interface IHttpClient {
|
|
210
|
+
request<P, T>({
|
|
211
|
+
headers,
|
|
212
|
+
url,
|
|
213
|
+
method,
|
|
214
|
+
queryParams,
|
|
215
|
+
maxRedirects,
|
|
216
|
+
responseType,
|
|
217
|
+
cacheTTL,
|
|
218
|
+
context,
|
|
219
|
+
payload,
|
|
220
|
+
httpsAgent,
|
|
221
|
+
httpAgent,
|
|
222
|
+
requestConfig,
|
|
223
|
+
httpsAgentConfig
|
|
224
|
+
}: {
|
|
225
|
+
headers?: HttpHeaders;
|
|
226
|
+
url: string;
|
|
227
|
+
method?: HttpMethod;
|
|
228
|
+
queryParams?: HttpQueryParams;
|
|
229
|
+
maxRedirects?: number;
|
|
230
|
+
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';
|
|
231
|
+
cacheTTL?: number;
|
|
232
|
+
context?: RequestContext;
|
|
233
|
+
payload?: P;
|
|
234
|
+
httpsAgent?: https.Agent;
|
|
235
|
+
httpAgent?: http.Agent;
|
|
236
|
+
requestConfig?: RequestConfig;
|
|
237
|
+
httpsAgentConfig?: https.AgentOptions;
|
|
238
|
+
}): Promise<HttpResponse<T>>;
|
|
239
|
+
get<T>({
|
|
240
|
+
headers,
|
|
241
|
+
url,
|
|
242
|
+
queryParams,
|
|
243
|
+
maxRedirects,
|
|
244
|
+
cacheTTL,
|
|
245
|
+
context,
|
|
246
|
+
requestConfig
|
|
247
|
+
}: {
|
|
248
|
+
headers?: HttpHeaders;
|
|
249
|
+
url: string;
|
|
250
|
+
queryParams?: HttpQueryParams;
|
|
251
|
+
maxRedirects?: number;
|
|
252
|
+
cacheTTL?: number;
|
|
253
|
+
context?: RequestContext;
|
|
254
|
+
requestConfig?: RequestConfig;
|
|
255
|
+
}): Promise<HttpResponse<T>>;
|
|
256
|
+
post<P, T>({
|
|
257
|
+
headers,
|
|
258
|
+
url,
|
|
259
|
+
maxRedirects,
|
|
260
|
+
cacheTTL,
|
|
261
|
+
context,
|
|
262
|
+
payload,
|
|
263
|
+
requestConfig
|
|
264
|
+
}: {
|
|
265
|
+
headers?: HttpHeaders;
|
|
266
|
+
url: string;
|
|
267
|
+
maxRedirects?: number;
|
|
268
|
+
cacheTTL?: number;
|
|
269
|
+
context?: RequestContext;
|
|
270
|
+
payload?: P;
|
|
271
|
+
requestConfig?: RequestConfig;
|
|
272
|
+
}): Promise<HttpResponse<T>>;
|
|
273
|
+
}
|
|
274
|
+
interface OperationSetting {
|
|
275
|
+
url?: string;
|
|
276
|
+
query?: Record<string, string>;
|
|
277
|
+
config?: Partial<APIConfig>;
|
|
278
|
+
custom_settings?: Record<string, unknown>;
|
|
279
|
+
}
|
|
280
|
+
type OperationSettings = Record<string, OperationSetting>;
|
|
281
|
+
type AccountSettings = Record<string, string | number | boolean | object>;
|
|
282
|
+
type HttpClientBehaviour = 'CONCURRENCY' | 'RETRY';
|
|
283
|
+
type APIConfig = Record<string, unknown>;
|
|
284
|
+
type RequestContext = {
|
|
285
|
+
accountSecureId?: string;
|
|
286
|
+
projectSecureId?: string;
|
|
287
|
+
organizationId?: number;
|
|
288
|
+
environment?: string;
|
|
289
|
+
authConfigKey?: string;
|
|
290
|
+
provider?: string;
|
|
291
|
+
service?: string;
|
|
292
|
+
resource?: string;
|
|
293
|
+
subResource?: string;
|
|
294
|
+
childResource?: string;
|
|
295
|
+
operation?: string;
|
|
296
|
+
action?: string;
|
|
297
|
+
mode?: string;
|
|
298
|
+
testerUniqueToken?: string;
|
|
299
|
+
externalKey?: string;
|
|
300
|
+
dataKey?: string;
|
|
301
|
+
isDataSync?: boolean;
|
|
302
|
+
operationSettings?: OperationSettings;
|
|
303
|
+
accountSettings?: AccountSettings;
|
|
304
|
+
behaviours?: HttpClientBehaviour[];
|
|
305
|
+
};
|
|
306
|
+
//#endregion
|
|
90
307
|
//#region src/schema/types.d.ts
|
|
91
308
|
type Schema = {
|
|
92
309
|
name: string;
|
|
@@ -186,7 +403,7 @@ type Connector = {
|
|
|
186
403
|
type Assets = {
|
|
187
404
|
icon: string;
|
|
188
405
|
};
|
|
189
|
-
type OperationType = 'list' | 'get' | 'create' | 'update' | 'delete' | 'custom' | 'unknown';
|
|
406
|
+
type OperationType = 'list' | 'get' | 'create' | 'update' | 'delete' | 'custom' | 'refresh_token' | 'unknown';
|
|
190
407
|
type InputLocation = 'body' | 'query' | 'path' | 'headers';
|
|
191
408
|
type Input = {
|
|
192
409
|
name: string;
|
|
@@ -201,8 +418,8 @@ type Operation = {
|
|
|
201
418
|
description: string;
|
|
202
419
|
schema?: Schema;
|
|
203
420
|
operationType: OperationType;
|
|
204
|
-
entrypointUrl
|
|
205
|
-
entrypointHttpMethod
|
|
421
|
+
entrypointUrl?: string;
|
|
422
|
+
entrypointHttpMethod?: HttpMethod;
|
|
206
423
|
inputs?: Input[];
|
|
207
424
|
steps: {
|
|
208
425
|
[stepId: string]: Step;
|
|
@@ -265,15 +482,19 @@ type SupportConfig = {
|
|
|
265
482
|
type AuthenticationConfig = {
|
|
266
483
|
envKey: string;
|
|
267
484
|
envName: string;
|
|
268
|
-
type: 'custom' | 'oauth2'
|
|
485
|
+
type: 'custom' | 'oauth2';
|
|
269
486
|
label: string;
|
|
270
487
|
authorization: {
|
|
271
|
-
type: 'basic' | 'bearer';
|
|
488
|
+
type: 'basic' | 'bearer' | 'oauth2';
|
|
272
489
|
[authParam: string]: unknown;
|
|
273
490
|
};
|
|
274
491
|
support?: SupportConfig;
|
|
275
492
|
configFields?: AuthenticationField[];
|
|
276
493
|
setupFields?: AuthenticationField[];
|
|
494
|
+
refreshAuthentication?: {
|
|
495
|
+
schedule?: string;
|
|
496
|
+
operation: Operation;
|
|
497
|
+
};
|
|
277
498
|
testOperationsIds?: string[];
|
|
278
499
|
};
|
|
279
500
|
type Authentication = {
|
|
@@ -397,6 +618,17 @@ declare const AUTHENTICATION_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
397
618
|
}, z.core.$strip>, z.ZodObject<{
|
|
398
619
|
type: z.ZodLiteral<"bearer">;
|
|
399
620
|
token: z.ZodString;
|
|
621
|
+
includeBearer: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
622
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
623
|
+
type: z.ZodLiteral<"oauth2">;
|
|
624
|
+
authorizationUrl: z.ZodOptional<z.ZodString>;
|
|
625
|
+
authorizationParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
626
|
+
tokenUrl: z.ZodOptional<z.ZodString>;
|
|
627
|
+
tokenParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
628
|
+
tokenExpiry: z.ZodOptional<z.ZodNumber>;
|
|
629
|
+
token: z.ZodString;
|
|
630
|
+
includeBearer: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
631
|
+
scopes: z.ZodOptional<z.ZodString>;
|
|
400
632
|
}, z.core.$strip>]>;
|
|
401
633
|
//#endregion
|
|
402
634
|
//#region src/accounts/types.d.ts
|
|
@@ -411,4 +643,4 @@ type Account = {
|
|
|
411
643
|
projectSecureId: string;
|
|
412
644
|
};
|
|
413
645
|
//#endregion
|
|
414
|
-
export { AUTHENTICATION_SCHEMA, Account, Assets, Authentication, AuthenticationConfig, AuthenticationField, Block, BlockContext, BlockIndexedRecord, COMPOSITE_ID_LATEST_VERSION, Category, CompositeIdentifier, CompositeIdentifierConfig, CompositeIdentifierConnectorConfig, Connector, CoreError, Cursor, FieldConfig, Input, InputLocation, Operation, OperationResponse, OperationType, Schema, SchemaField, Step, StepFunction, StepFunctionName, StepFunctionOutput, StepFunctionParams, StepFunctionsFactory, StepsSnapshots, SupportConfig, areCursorsEqual, decodeCompositeId, encodeCompositeId, expandCursor, getCategoryDetails, isCompositeId, isCoreError, isCursorEmpty, isValidCategory, minifyCursor, updateCursor };
|
|
646
|
+
export { AUTHENTICATION_SCHEMA, type Account, type Assets, type Authentication, type AuthenticationConfig, type AuthenticationField, type Block, type BlockContext, type BlockIndexedRecord, COMPOSITE_ID_LATEST_VERSION, type Category, type CompositeIdentifier, type CompositeIdentifierConfig, type CompositeIdentifierConnectorConfig, type Connector, CoreError, type Cursor, type FieldConfig, type Input, type InputLocation, type Operation, type OperationResponse, type OperationType, type Schema, type SchemaField, type Step, type StepFunction, StepFunctionName, type StepFunctionOutput, type StepFunctionParams, StepFunctionsFactory, type StepsSnapshots, type SupportConfig, areCursorsEqual, decodeCompositeId, encodeCompositeId, expandCursor, getCategoryDetails, isCompositeId, isCoreError, isCursorEmpty, isValidCategory, minifyCursor, updateCursor };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { ILogger } from "@stackone/logger";
|
|
2
|
-
import { HttpMethod, IHttpClient } from "@stackone/transport";
|
|
3
1
|
import { ZodType, z } from "zod/v4";
|
|
2
|
+
import http from "node:http";
|
|
3
|
+
import https from "node:https";
|
|
4
4
|
|
|
5
5
|
//#region src/categories/types.d.ts
|
|
6
|
-
type Category = 'hris' | 'crm' | 'ats' | 'lms' | 'marketing' | 'filestorage';
|
|
6
|
+
type Category = 'hris' | 'crm' | 'ats' | 'lms' | 'marketing' | 'filestorage' | 'internal';
|
|
7
7
|
type CategoryDetails = {
|
|
8
8
|
title: string;
|
|
9
9
|
key: Category;
|
|
@@ -87,6 +87,223 @@ declare const updateCursor: ({
|
|
|
87
87
|
position?: number | null;
|
|
88
88
|
}) => Cursor;
|
|
89
89
|
//#endregion
|
|
90
|
+
//#region ../logger/src/types.d.ts
|
|
91
|
+
interface ILogger {
|
|
92
|
+
debug({
|
|
93
|
+
category,
|
|
94
|
+
message,
|
|
95
|
+
traceId,
|
|
96
|
+
context
|
|
97
|
+
}: {
|
|
98
|
+
category?: string;
|
|
99
|
+
message: string;
|
|
100
|
+
traceId?: string;
|
|
101
|
+
context?: Record<string, unknown>;
|
|
102
|
+
}): void;
|
|
103
|
+
info({
|
|
104
|
+
category,
|
|
105
|
+
message,
|
|
106
|
+
traceId,
|
|
107
|
+
context
|
|
108
|
+
}: {
|
|
109
|
+
category?: string;
|
|
110
|
+
message: string;
|
|
111
|
+
traceId?: string;
|
|
112
|
+
context?: Record<string, unknown>;
|
|
113
|
+
}): void;
|
|
114
|
+
warning({
|
|
115
|
+
category,
|
|
116
|
+
message,
|
|
117
|
+
traceId,
|
|
118
|
+
error,
|
|
119
|
+
code,
|
|
120
|
+
context
|
|
121
|
+
}: {
|
|
122
|
+
category?: string;
|
|
123
|
+
message: string;
|
|
124
|
+
traceId?: string;
|
|
125
|
+
error?: LogError;
|
|
126
|
+
code?: string;
|
|
127
|
+
context?: Record<string, unknown>;
|
|
128
|
+
}): void;
|
|
129
|
+
error({
|
|
130
|
+
category,
|
|
131
|
+
message,
|
|
132
|
+
traceId,
|
|
133
|
+
error,
|
|
134
|
+
code,
|
|
135
|
+
context
|
|
136
|
+
}: {
|
|
137
|
+
category?: string;
|
|
138
|
+
message: string;
|
|
139
|
+
traceId?: string;
|
|
140
|
+
error?: LogError;
|
|
141
|
+
code: string;
|
|
142
|
+
context?: Record<string, unknown>;
|
|
143
|
+
}): void;
|
|
144
|
+
}
|
|
145
|
+
type LogError = Error & {
|
|
146
|
+
response?: {
|
|
147
|
+
data?: unknown;
|
|
148
|
+
};
|
|
149
|
+
context?: Record<string, unknown>;
|
|
150
|
+
url?: string;
|
|
151
|
+
};
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region ../transport/src/concurrencyManager/types.d.ts
|
|
154
|
+
type ConcurrencySubPoolConfig = {
|
|
155
|
+
subPoolKey: string;
|
|
156
|
+
urlPattern: RegExp | string;
|
|
157
|
+
maxConcurrency: number;
|
|
158
|
+
};
|
|
159
|
+
type ConcurrencyConfig = {
|
|
160
|
+
mainMaxConcurrency: number;
|
|
161
|
+
subPools?: ConcurrencySubPoolConfig[];
|
|
162
|
+
};
|
|
163
|
+
//#endregion
|
|
164
|
+
//#region ../transport/src/rateLimitManager/types.d.ts
|
|
165
|
+
type RateLimitSubPoolConfig = {
|
|
166
|
+
subPoolKey: string;
|
|
167
|
+
urlPattern: RegExp | string;
|
|
168
|
+
rateLimit: number;
|
|
169
|
+
};
|
|
170
|
+
type RetryUnit = 'seconds' | 'milliseconds' | 'date';
|
|
171
|
+
type MappedRateLimitErrorConfig = {
|
|
172
|
+
errorStatus: number;
|
|
173
|
+
errorMessage: string | RegExp;
|
|
174
|
+
errorMessagePath?: string;
|
|
175
|
+
retryAfterPath?: string;
|
|
176
|
+
retryAfterUnit?: RetryUnit;
|
|
177
|
+
retryAfterValue?: number;
|
|
178
|
+
};
|
|
179
|
+
type RateLimitConfig = {
|
|
180
|
+
mainRatelimit: number;
|
|
181
|
+
subPools?: RateLimitSubPoolConfig[];
|
|
182
|
+
mappedRateLimitErrors?: MappedRateLimitErrorConfig[];
|
|
183
|
+
};
|
|
184
|
+
//#endregion
|
|
185
|
+
//#region ../transport/src/interceptors/types.d.ts
|
|
186
|
+
type RequestConfig = {
|
|
187
|
+
rateLimits?: RateLimitConfig;
|
|
188
|
+
concurrency?: ConcurrencyConfig;
|
|
189
|
+
};
|
|
190
|
+
//#endregion
|
|
191
|
+
//#region ../transport/src/httpClient/types.d.ts
|
|
192
|
+
type HttpHeaders = {
|
|
193
|
+
[key: string]: string;
|
|
194
|
+
};
|
|
195
|
+
type HttpQueryParams = {
|
|
196
|
+
[key: string]: string;
|
|
197
|
+
};
|
|
198
|
+
declare const HttpMethods: readonly ["get", "post", "put", "delete", "patch"];
|
|
199
|
+
type HttpMethod = (typeof HttpMethods)[number];
|
|
200
|
+
type HttpResponse<T = any> = {
|
|
201
|
+
data: T;
|
|
202
|
+
status: number;
|
|
203
|
+
headers: HttpHeaders;
|
|
204
|
+
requestUrl: string;
|
|
205
|
+
responseType?: string;
|
|
206
|
+
responseTime?: Date;
|
|
207
|
+
message?: string;
|
|
208
|
+
};
|
|
209
|
+
interface IHttpClient {
|
|
210
|
+
request<P, T>({
|
|
211
|
+
headers,
|
|
212
|
+
url,
|
|
213
|
+
method,
|
|
214
|
+
queryParams,
|
|
215
|
+
maxRedirects,
|
|
216
|
+
responseType,
|
|
217
|
+
cacheTTL,
|
|
218
|
+
context,
|
|
219
|
+
payload,
|
|
220
|
+
httpsAgent,
|
|
221
|
+
httpAgent,
|
|
222
|
+
requestConfig,
|
|
223
|
+
httpsAgentConfig
|
|
224
|
+
}: {
|
|
225
|
+
headers?: HttpHeaders;
|
|
226
|
+
url: string;
|
|
227
|
+
method?: HttpMethod;
|
|
228
|
+
queryParams?: HttpQueryParams;
|
|
229
|
+
maxRedirects?: number;
|
|
230
|
+
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text';
|
|
231
|
+
cacheTTL?: number;
|
|
232
|
+
context?: RequestContext;
|
|
233
|
+
payload?: P;
|
|
234
|
+
httpsAgent?: https.Agent;
|
|
235
|
+
httpAgent?: http.Agent;
|
|
236
|
+
requestConfig?: RequestConfig;
|
|
237
|
+
httpsAgentConfig?: https.AgentOptions;
|
|
238
|
+
}): Promise<HttpResponse<T>>;
|
|
239
|
+
get<T>({
|
|
240
|
+
headers,
|
|
241
|
+
url,
|
|
242
|
+
queryParams,
|
|
243
|
+
maxRedirects,
|
|
244
|
+
cacheTTL,
|
|
245
|
+
context,
|
|
246
|
+
requestConfig
|
|
247
|
+
}: {
|
|
248
|
+
headers?: HttpHeaders;
|
|
249
|
+
url: string;
|
|
250
|
+
queryParams?: HttpQueryParams;
|
|
251
|
+
maxRedirects?: number;
|
|
252
|
+
cacheTTL?: number;
|
|
253
|
+
context?: RequestContext;
|
|
254
|
+
requestConfig?: RequestConfig;
|
|
255
|
+
}): Promise<HttpResponse<T>>;
|
|
256
|
+
post<P, T>({
|
|
257
|
+
headers,
|
|
258
|
+
url,
|
|
259
|
+
maxRedirects,
|
|
260
|
+
cacheTTL,
|
|
261
|
+
context,
|
|
262
|
+
payload,
|
|
263
|
+
requestConfig
|
|
264
|
+
}: {
|
|
265
|
+
headers?: HttpHeaders;
|
|
266
|
+
url: string;
|
|
267
|
+
maxRedirects?: number;
|
|
268
|
+
cacheTTL?: number;
|
|
269
|
+
context?: RequestContext;
|
|
270
|
+
payload?: P;
|
|
271
|
+
requestConfig?: RequestConfig;
|
|
272
|
+
}): Promise<HttpResponse<T>>;
|
|
273
|
+
}
|
|
274
|
+
interface OperationSetting {
|
|
275
|
+
url?: string;
|
|
276
|
+
query?: Record<string, string>;
|
|
277
|
+
config?: Partial<APIConfig>;
|
|
278
|
+
custom_settings?: Record<string, unknown>;
|
|
279
|
+
}
|
|
280
|
+
type OperationSettings = Record<string, OperationSetting>;
|
|
281
|
+
type AccountSettings = Record<string, string | number | boolean | object>;
|
|
282
|
+
type HttpClientBehaviour = 'CONCURRENCY' | 'RETRY';
|
|
283
|
+
type APIConfig = Record<string, unknown>;
|
|
284
|
+
type RequestContext = {
|
|
285
|
+
accountSecureId?: string;
|
|
286
|
+
projectSecureId?: string;
|
|
287
|
+
organizationId?: number;
|
|
288
|
+
environment?: string;
|
|
289
|
+
authConfigKey?: string;
|
|
290
|
+
provider?: string;
|
|
291
|
+
service?: string;
|
|
292
|
+
resource?: string;
|
|
293
|
+
subResource?: string;
|
|
294
|
+
childResource?: string;
|
|
295
|
+
operation?: string;
|
|
296
|
+
action?: string;
|
|
297
|
+
mode?: string;
|
|
298
|
+
testerUniqueToken?: string;
|
|
299
|
+
externalKey?: string;
|
|
300
|
+
dataKey?: string;
|
|
301
|
+
isDataSync?: boolean;
|
|
302
|
+
operationSettings?: OperationSettings;
|
|
303
|
+
accountSettings?: AccountSettings;
|
|
304
|
+
behaviours?: HttpClientBehaviour[];
|
|
305
|
+
};
|
|
306
|
+
//#endregion
|
|
90
307
|
//#region src/schema/types.d.ts
|
|
91
308
|
type Schema = {
|
|
92
309
|
name: string;
|
|
@@ -186,7 +403,7 @@ type Connector = {
|
|
|
186
403
|
type Assets = {
|
|
187
404
|
icon: string;
|
|
188
405
|
};
|
|
189
|
-
type OperationType = 'list' | 'get' | 'create' | 'update' | 'delete' | 'custom' | 'unknown';
|
|
406
|
+
type OperationType = 'list' | 'get' | 'create' | 'update' | 'delete' | 'custom' | 'refresh_token' | 'unknown';
|
|
190
407
|
type InputLocation = 'body' | 'query' | 'path' | 'headers';
|
|
191
408
|
type Input = {
|
|
192
409
|
name: string;
|
|
@@ -201,8 +418,8 @@ type Operation = {
|
|
|
201
418
|
description: string;
|
|
202
419
|
schema?: Schema;
|
|
203
420
|
operationType: OperationType;
|
|
204
|
-
entrypointUrl
|
|
205
|
-
entrypointHttpMethod
|
|
421
|
+
entrypointUrl?: string;
|
|
422
|
+
entrypointHttpMethod?: HttpMethod;
|
|
206
423
|
inputs?: Input[];
|
|
207
424
|
steps: {
|
|
208
425
|
[stepId: string]: Step;
|
|
@@ -265,15 +482,19 @@ type SupportConfig = {
|
|
|
265
482
|
type AuthenticationConfig = {
|
|
266
483
|
envKey: string;
|
|
267
484
|
envName: string;
|
|
268
|
-
type: 'custom' | 'oauth2'
|
|
485
|
+
type: 'custom' | 'oauth2';
|
|
269
486
|
label: string;
|
|
270
487
|
authorization: {
|
|
271
|
-
type: 'basic' | 'bearer';
|
|
488
|
+
type: 'basic' | 'bearer' | 'oauth2';
|
|
272
489
|
[authParam: string]: unknown;
|
|
273
490
|
};
|
|
274
491
|
support?: SupportConfig;
|
|
275
492
|
configFields?: AuthenticationField[];
|
|
276
493
|
setupFields?: AuthenticationField[];
|
|
494
|
+
refreshAuthentication?: {
|
|
495
|
+
schedule?: string;
|
|
496
|
+
operation: Operation;
|
|
497
|
+
};
|
|
277
498
|
testOperationsIds?: string[];
|
|
278
499
|
};
|
|
279
500
|
type Authentication = {
|
|
@@ -397,6 +618,17 @@ declare const AUTHENTICATION_SCHEMA: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
397
618
|
}, z.core.$strip>, z.ZodObject<{
|
|
398
619
|
type: z.ZodLiteral<"bearer">;
|
|
399
620
|
token: z.ZodString;
|
|
621
|
+
includeBearer: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
622
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
623
|
+
type: z.ZodLiteral<"oauth2">;
|
|
624
|
+
authorizationUrl: z.ZodOptional<z.ZodString>;
|
|
625
|
+
authorizationParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
626
|
+
tokenUrl: z.ZodOptional<z.ZodString>;
|
|
627
|
+
tokenParams: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
628
|
+
tokenExpiry: z.ZodOptional<z.ZodNumber>;
|
|
629
|
+
token: z.ZodString;
|
|
630
|
+
includeBearer: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
631
|
+
scopes: z.ZodOptional<z.ZodString>;
|
|
400
632
|
}, z.core.$strip>]>;
|
|
401
633
|
//#endregion
|
|
402
634
|
//#region src/accounts/types.d.ts
|
|
@@ -411,4 +643,4 @@ type Account = {
|
|
|
411
643
|
projectSecureId: string;
|
|
412
644
|
};
|
|
413
645
|
//#endregion
|
|
414
|
-
export { AUTHENTICATION_SCHEMA, Account, Assets, Authentication, AuthenticationConfig, AuthenticationField, Block, BlockContext, BlockIndexedRecord, COMPOSITE_ID_LATEST_VERSION, Category, CompositeIdentifier, CompositeIdentifierConfig, CompositeIdentifierConnectorConfig, Connector, CoreError, Cursor, FieldConfig, Input, InputLocation, Operation, OperationResponse, OperationType, Schema, SchemaField, Step, StepFunction, StepFunctionName, StepFunctionOutput, StepFunctionParams, StepFunctionsFactory, StepsSnapshots, SupportConfig, areCursorsEqual, decodeCompositeId, encodeCompositeId, expandCursor, getCategoryDetails, isCompositeId, isCoreError, isCursorEmpty, isValidCategory, minifyCursor, updateCursor };
|
|
646
|
+
export { AUTHENTICATION_SCHEMA, type Account, type Assets, type Authentication, type AuthenticationConfig, type AuthenticationField, type Block, type BlockContext, type BlockIndexedRecord, COMPOSITE_ID_LATEST_VERSION, type Category, type CompositeIdentifier, type CompositeIdentifierConfig, type CompositeIdentifierConnectorConfig, type Connector, CoreError, type Cursor, type FieldConfig, type Input, type InputLocation, type Operation, type OperationResponse, type OperationType, type Schema, type SchemaField, type Step, type StepFunction, StepFunctionName, type StepFunctionOutput, type StepFunctionParams, StepFunctionsFactory, type StepsSnapshots, type SupportConfig, areCursorsEqual, decodeCompositeId, encodeCompositeId, expandCursor, getCategoryDetails, isCompositeId, isCoreError, isCursorEmpty, isValidCategory, minifyCursor, updateCursor };
|