@nangohq/runner-sdk 0.48.3
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/action.d.ts +81 -0
- package/dist/action.js +243 -0
- package/dist/action.js.map +1 -0
- package/dist/dataValidation.d.ts +11 -0
- package/dist/dataValidation.js +56 -0
- package/dist/dataValidation.js.map +1 -0
- package/dist/dataValidation.unit.test.d.ts +1 -0
- package/dist/dataValidation.unit.test.js +140 -0
- package/dist/dataValidation.unit.test.js.map +1 -0
- package/dist/errors.d.ts +28 -0
- package/dist/errors.js +37 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/paginate.service.d.ts +12 -0
- package/dist/paginate.service.js +146 -0
- package/dist/paginate.service.js.map +1 -0
- package/dist/sdk.d.ts +111 -0
- package/dist/sdk.js +303 -0
- package/dist/sdk.js.map +1 -0
- package/dist/sync.d.ts +19 -0
- package/dist/sync.js +42 -0
- package/dist/sync.js.map +1 -0
- package/models.d.ts +422 -0
- package/package.json +26 -0
package/dist/sync.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.js","sourceRoot":"","sources":["../lib/sync.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,OAAgB,aAAc,SAAQ,eAAe;IACvD,YAAY,CAAQ;IACpB,aAAa,GAAG,KAAK,CAAC;IAEtB,YAAY,MAAkB;QAC1B,KAAK,CAAC,MAAM,CAAC,CAAC;QAEd,IAAI,MAAM,CAAC,YAAY,EAAE,CAAC;YACtB,IAAI,CAAC,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;QAC5C,CAAC;QAED,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACvB,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,aAAa,CAAC;QAC9C,CAAC;IACL,CAAC;IAED;;OAEG;IACI,KAAK,CAAC,SAAS,CAAU,OAAY,EAAE,KAAa;QACvD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC1C,CAAC;IAQS,eAAe,CAAC,KAAa,EAAE,OAAkB;QACvD,mBAAmB;QACnB,MAAM,SAAS,GAAqD,EAAE,CAAC;QACvE,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC3B,MAAM,UAAU,GAAG,YAAY,CAAC;gBAC5B,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,IAAI,GAAG;gBACxC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;gBACzC,UAAU,EAAE,IAAI,CAAC,UAAW,CAAC,kBAAkB;gBAC/C,SAAS,EAAE,KAAK;aACnB,CAAC,CAAC;YACH,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;gBACtB,SAAS;YACb,CAAC;YAED,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;YAE7C,IAAI,IAAI,CAAC,WAAW,EAAE,mBAAmB,EAAE,CAAC;gBACxC,MAAM;YACV,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;CACJ"}
|
package/models.d.ts
ADDED
|
@@ -0,0 +1,422 @@
|
|
|
1
|
+
import type { Nango } from '@nangohq/node';
|
|
2
|
+
import type { AxiosInstance, AxiosInterceptorManager, AxiosRequestConfig, AxiosResponse, AxiosError } from 'axios';
|
|
3
|
+
import type { ApiEndUser, DBSyncConfig, DBTeam, GetPublicIntegration, RunnerFlags } from '@nangohq/types';
|
|
4
|
+
|
|
5
|
+
export declare const oldLevelToNewLevel: {
|
|
6
|
+
readonly debug: 'debug';
|
|
7
|
+
readonly info: 'info';
|
|
8
|
+
readonly warn: 'warn';
|
|
9
|
+
readonly error: 'error';
|
|
10
|
+
readonly verbose: 'debug';
|
|
11
|
+
readonly silly: 'debug';
|
|
12
|
+
readonly http: 'info';
|
|
13
|
+
};
|
|
14
|
+
type LogLevel = 'info' | 'debug' | 'error' | 'warn' | 'http' | 'verbose' | 'silly';
|
|
15
|
+
type ParamEncoder = (value: any, defaultEncoder: (value: any) => any) => any;
|
|
16
|
+
interface GenericFormData {
|
|
17
|
+
append(name: string, value: any, options?: any): any;
|
|
18
|
+
}
|
|
19
|
+
type SerializerVisitor = (this: GenericFormData, value: any, key: string | number, path: null | (string | number)[], helpers: FormDataVisitorHelpers) => boolean;
|
|
20
|
+
type CustomParamsSerializer = (params: Record<string, any>, options?: ParamsSerializerOptions) => string;
|
|
21
|
+
interface FormDataVisitorHelpers {
|
|
22
|
+
defaultVisitor: SerializerVisitor;
|
|
23
|
+
convertValue: (value: any) => any;
|
|
24
|
+
isVisitable: (value: any) => boolean;
|
|
25
|
+
}
|
|
26
|
+
interface SerializerOptions {
|
|
27
|
+
visitor?: SerializerVisitor;
|
|
28
|
+
dots?: boolean;
|
|
29
|
+
metaTokens?: boolean;
|
|
30
|
+
indexes?: boolean | null;
|
|
31
|
+
}
|
|
32
|
+
interface ParamsSerializerOptions extends SerializerOptions {
|
|
33
|
+
encode?: ParamEncoder;
|
|
34
|
+
serialize?: CustomParamsSerializer;
|
|
35
|
+
}
|
|
36
|
+
interface Pagination {
|
|
37
|
+
type: string;
|
|
38
|
+
limit?: number;
|
|
39
|
+
response_path?: string;
|
|
40
|
+
limit_name_in_request: string;
|
|
41
|
+
}
|
|
42
|
+
interface CursorPagination extends Pagination {
|
|
43
|
+
cursor_path_in_response: string;
|
|
44
|
+
cursor_name_in_request: string;
|
|
45
|
+
}
|
|
46
|
+
interface LinkPagination extends Pagination {
|
|
47
|
+
link_rel_in_response_header?: string;
|
|
48
|
+
link_path_in_response_body?: string;
|
|
49
|
+
}
|
|
50
|
+
interface OffsetPagination extends Pagination {
|
|
51
|
+
offset_name_in_request: string;
|
|
52
|
+
offset_start_value?: number;
|
|
53
|
+
offset_calculation_method?: 'per-page' | 'by-response-size';
|
|
54
|
+
}
|
|
55
|
+
interface RetryHeaderConfig {
|
|
56
|
+
at?: string;
|
|
57
|
+
after?: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ProxyConfiguration {
|
|
60
|
+
endpoint: string;
|
|
61
|
+
providerConfigKey?: string;
|
|
62
|
+
connectionId?: string;
|
|
63
|
+
method?: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE' | 'get' | 'post' | 'patch' | 'put' | 'delete';
|
|
64
|
+
headers?: Record<string, string>;
|
|
65
|
+
params?: string | Record<string, string | number>;
|
|
66
|
+
paramsSerializer?: ParamsSerializerOptions;
|
|
67
|
+
data?: unknown;
|
|
68
|
+
retries?: number;
|
|
69
|
+
baseUrlOverride?: string;
|
|
70
|
+
paginate?: Partial<CursorPagination> | Partial<LinkPagination> | Partial<OffsetPagination>;
|
|
71
|
+
retryHeader?: RetryHeaderConfig;
|
|
72
|
+
responseType?: 'arraybuffer' | 'blob' | 'document' | 'json' | 'text' | 'stream';
|
|
73
|
+
retryOn?: number[] | null;
|
|
74
|
+
}
|
|
75
|
+
export interface AuthModes {
|
|
76
|
+
OAuth1: 'OAUTH1';
|
|
77
|
+
OAuth2: 'OAUTH2';
|
|
78
|
+
OAuth2CC: 'OAUTH2_CC';
|
|
79
|
+
Basic: 'BASIC';
|
|
80
|
+
ApiKey: 'API_KEY';
|
|
81
|
+
AppStore: 'APP_STORE';
|
|
82
|
+
Custom: 'CUSTOM';
|
|
83
|
+
App: 'APP';
|
|
84
|
+
None: 'NONE';
|
|
85
|
+
TBA: 'TBA';
|
|
86
|
+
Tableau: 'TABLEAU';
|
|
87
|
+
Jwt: 'JWT';
|
|
88
|
+
Bill: 'BILL';
|
|
89
|
+
TwoStep: 'TWO_STEP';
|
|
90
|
+
Signature: 'SIGNATURE';
|
|
91
|
+
}
|
|
92
|
+
export type AuthModeType = AuthModes[keyof AuthModes];
|
|
93
|
+
interface OAuth1Token {
|
|
94
|
+
oAuthToken: string;
|
|
95
|
+
oAuthTokenSecret: string;
|
|
96
|
+
}
|
|
97
|
+
interface AppCredentials {
|
|
98
|
+
type: AuthModes['App'];
|
|
99
|
+
access_token: string;
|
|
100
|
+
expires_at?: Date | undefined;
|
|
101
|
+
raw: Record<string, any>;
|
|
102
|
+
}
|
|
103
|
+
interface AppStoreCredentials {
|
|
104
|
+
type?: AuthModes['AppStore'];
|
|
105
|
+
access_token: string;
|
|
106
|
+
expires_at?: Date | undefined;
|
|
107
|
+
raw: Record<string, any>;
|
|
108
|
+
private_key: string;
|
|
109
|
+
}
|
|
110
|
+
interface BasicApiCredentials {
|
|
111
|
+
type: AuthModes['Basic'];
|
|
112
|
+
username: string;
|
|
113
|
+
password: string;
|
|
114
|
+
}
|
|
115
|
+
interface ApiKeyCredentials {
|
|
116
|
+
type: AuthModes['ApiKey'];
|
|
117
|
+
apiKey: string;
|
|
118
|
+
}
|
|
119
|
+
interface CredentialsCommon<T = Record<string, any>> {
|
|
120
|
+
type: AuthModeType;
|
|
121
|
+
raw: T;
|
|
122
|
+
}
|
|
123
|
+
interface OAuth2Credentials extends CredentialsCommon {
|
|
124
|
+
type: AuthModes['OAuth2'];
|
|
125
|
+
access_token: string;
|
|
126
|
+
refresh_token?: string;
|
|
127
|
+
expires_at?: Date | undefined;
|
|
128
|
+
}
|
|
129
|
+
interface OAuth2ClientCredentials extends CredentialsCommon {
|
|
130
|
+
type: AuthModes['OAuth2CC'];
|
|
131
|
+
token: string;
|
|
132
|
+
expires_at?: Date | undefined;
|
|
133
|
+
client_id: string;
|
|
134
|
+
client_secret: string;
|
|
135
|
+
}
|
|
136
|
+
interface OAuth1Credentials extends CredentialsCommon {
|
|
137
|
+
type: AuthModes['OAuth1'];
|
|
138
|
+
oauth_token: string;
|
|
139
|
+
oauth_token_secret: string;
|
|
140
|
+
}
|
|
141
|
+
interface TbaCredentials {
|
|
142
|
+
type: AuthModes['TBA'];
|
|
143
|
+
token_id: string;
|
|
144
|
+
token_secret: string;
|
|
145
|
+
config_override: {
|
|
146
|
+
client_id?: string;
|
|
147
|
+
client_secret?: string;
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
interface TableauCredentials extends CredentialsCommon {
|
|
151
|
+
type: AuthModes['Tableau'];
|
|
152
|
+
pat_name: string;
|
|
153
|
+
pat_secret: string;
|
|
154
|
+
content_url?: string;
|
|
155
|
+
token?: string;
|
|
156
|
+
expires_at?: Date | undefined;
|
|
157
|
+
}
|
|
158
|
+
interface JwtCredentials {
|
|
159
|
+
type: AuthModes['Jwt'];
|
|
160
|
+
privateKeyId?: string;
|
|
161
|
+
issuerId?: string;
|
|
162
|
+
privateKey:{
|
|
163
|
+
id: string;
|
|
164
|
+
secret: string;
|
|
165
|
+
} | string;
|
|
166
|
+
token?: string;
|
|
167
|
+
expires_at?: Date | undefined;
|
|
168
|
+
}
|
|
169
|
+
interface BillCredentials extends CredentialsCommon {
|
|
170
|
+
type: AuthModes['Bill'];
|
|
171
|
+
username: string;
|
|
172
|
+
password: string;
|
|
173
|
+
organization_id: string;
|
|
174
|
+
dev_key: string;
|
|
175
|
+
session_id?: string;
|
|
176
|
+
user_id?: string;
|
|
177
|
+
expires_at?: Date | undefined;
|
|
178
|
+
}
|
|
179
|
+
interface TwoStepCredentials extends CredentialsCommon {
|
|
180
|
+
type: AuthModes['TwoStep'];
|
|
181
|
+
[key: string]: any;
|
|
182
|
+
token?: string;
|
|
183
|
+
expires_at?: Date | undefined;
|
|
184
|
+
}
|
|
185
|
+
interface SignatureCredentials {
|
|
186
|
+
type: AuthModes['Signature'];
|
|
187
|
+
username: string;
|
|
188
|
+
password: string;
|
|
189
|
+
token?: string;
|
|
190
|
+
expires_at?: Date | undefined;
|
|
191
|
+
}
|
|
192
|
+
interface CustomCredentials extends CredentialsCommon {
|
|
193
|
+
type: AuthModes['Custom'];
|
|
194
|
+
}
|
|
195
|
+
type UnauthCredentials = Record<string, never>;
|
|
196
|
+
type AuthCredentials = OAuth2Credentials | OAuth2ClientCredentials | OAuth1Credentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | TbaCredentials | TableauCredentials | JwtCredentials | BillCredentials | TwoStepCredentials | SignatureCredentials | CustomCredentials;
|
|
197
|
+
type Metadata = Record<string, unknown>;
|
|
198
|
+
interface MetadataChangeResponse {
|
|
199
|
+
metadata: Metadata;
|
|
200
|
+
provider_config_key: string;
|
|
201
|
+
connection_id: string | string[];
|
|
202
|
+
}
|
|
203
|
+
interface Connection {
|
|
204
|
+
id: number;
|
|
205
|
+
provider_config_key: string;
|
|
206
|
+
connection_id: string;
|
|
207
|
+
connection_config: Record<string, string>;
|
|
208
|
+
created_at: string;
|
|
209
|
+
updated_at: string;
|
|
210
|
+
last_fetched_at: string;
|
|
211
|
+
metadata: Record<string, unknown> | null;
|
|
212
|
+
provider: string;
|
|
213
|
+
errors: {
|
|
214
|
+
type: string;
|
|
215
|
+
log_id: string;
|
|
216
|
+
}[];
|
|
217
|
+
end_user: ApiEndUser | null;
|
|
218
|
+
credentials: AuthCredentials;
|
|
219
|
+
}
|
|
220
|
+
export declare class ActionError<T = Record<string, unknown>> extends Error {
|
|
221
|
+
type: string;
|
|
222
|
+
payload?: Record<string, unknown>;
|
|
223
|
+
constructor(payload?: T);
|
|
224
|
+
}
|
|
225
|
+
interface RunArgs {
|
|
226
|
+
sync: string;
|
|
227
|
+
connectionId: string;
|
|
228
|
+
lastSyncDate?: string;
|
|
229
|
+
useServerLastSyncDate?: boolean;
|
|
230
|
+
input?: object;
|
|
231
|
+
metadata?: Metadata;
|
|
232
|
+
autoConfirm: boolean;
|
|
233
|
+
debug: boolean;
|
|
234
|
+
optionalEnvironment?: string;
|
|
235
|
+
optionalProviderConfigKey?: string;
|
|
236
|
+
}
|
|
237
|
+
export interface DryRunServiceInterface {
|
|
238
|
+
run: (options: RunArgs, debug?: boolean) => Promise<string | void>;
|
|
239
|
+
}
|
|
240
|
+
export interface NangoProps {
|
|
241
|
+
scriptType: 'sync' | 'action' | 'webhook' | 'on-event';
|
|
242
|
+
host?: string;
|
|
243
|
+
secretKey: string;
|
|
244
|
+
team?: Pick<DBTeam, 'id' | 'name'>;
|
|
245
|
+
connectionId: string;
|
|
246
|
+
environmentId: number;
|
|
247
|
+
environmentName?: string;
|
|
248
|
+
activityLogId?: string | undefined;
|
|
249
|
+
providerConfigKey: string;
|
|
250
|
+
provider: string;
|
|
251
|
+
lastSyncDate?: Date;
|
|
252
|
+
syncId?: string | undefined;
|
|
253
|
+
nangoConnectionId?: number;
|
|
254
|
+
syncJobId?: number | undefined;
|
|
255
|
+
dryRun?: boolean;
|
|
256
|
+
track_deletes?: boolean;
|
|
257
|
+
attributes?: object | undefined;
|
|
258
|
+
logMessages?:
|
|
259
|
+
| {
|
|
260
|
+
counts: {
|
|
261
|
+
updated: number;
|
|
262
|
+
added: number;
|
|
263
|
+
deleted: number;
|
|
264
|
+
};
|
|
265
|
+
messages: unknown[];
|
|
266
|
+
}
|
|
267
|
+
| undefined;
|
|
268
|
+
rawSaveOutput?: Map<string, unknown[]> | undefined;
|
|
269
|
+
rawDeleteOutput?: Map<string, unknown[]> | undefined;
|
|
270
|
+
stubbedMetadata?: Metadata | undefined;
|
|
271
|
+
abortSignal?: AbortSignal;
|
|
272
|
+
dryRunService?: DryRunServiceInterface;
|
|
273
|
+
syncConfig: DBSyncConfig;
|
|
274
|
+
runnerFlags: RunnerFlags;
|
|
275
|
+
debug: boolean;
|
|
276
|
+
startedAt: Date;
|
|
277
|
+
endUser: {
|
|
278
|
+
id: number;
|
|
279
|
+
endUserId: string | null;
|
|
280
|
+
orgId: string | null;
|
|
281
|
+
} | null;
|
|
282
|
+
axios?: {
|
|
283
|
+
request?: AxiosInterceptorManager<AxiosRequestConfig>;
|
|
284
|
+
response?: {
|
|
285
|
+
onFulfilled: (value: AxiosResponse) => AxiosResponse | Promise<AxiosResponse>;
|
|
286
|
+
onRejected: (value: unknown) => AxiosError | Promise<AxiosError>;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
export interface EnvironmentVariable {
|
|
291
|
+
name: string;
|
|
292
|
+
value: string;
|
|
293
|
+
}
|
|
294
|
+
export declare const defaultPersistApi: AxiosInstance;
|
|
295
|
+
export declare class NangoAction {
|
|
296
|
+
protected nango: Nango;
|
|
297
|
+
private attributes;
|
|
298
|
+
protected persistApi: AxiosInstance;
|
|
299
|
+
activityLogId?: string | undefined;
|
|
300
|
+
syncId?: string;
|
|
301
|
+
nangoConnectionId?: number;
|
|
302
|
+
environmentId: number;
|
|
303
|
+
environmentName?: string;
|
|
304
|
+
syncJobId?: number;
|
|
305
|
+
dryRun?: boolean;
|
|
306
|
+
abortSignal?: AbortSignal;
|
|
307
|
+
dryRunService?: DryRunServiceInterface;
|
|
308
|
+
syncConfig?: DBSyncConfig;
|
|
309
|
+
runnerFlags: RunnerFlags;
|
|
310
|
+
connectionId: string;
|
|
311
|
+
providerConfigKey: string;
|
|
312
|
+
provider?: string;
|
|
313
|
+
ActionError: typeof ActionError;
|
|
314
|
+
private memoizedConnections;
|
|
315
|
+
private memoizedIntegration;
|
|
316
|
+
constructor(
|
|
317
|
+
config: NangoProps,
|
|
318
|
+
{
|
|
319
|
+
persistApi
|
|
320
|
+
}?: {
|
|
321
|
+
persistApi: AxiosInstance;
|
|
322
|
+
}
|
|
323
|
+
);
|
|
324
|
+
protected stringify(): string;
|
|
325
|
+
private proxyConfig;
|
|
326
|
+
protected throwIfAborted(): void;
|
|
327
|
+
proxy<T = any>(config: ProxyConfiguration): Promise<AxiosResponse<T>>;
|
|
328
|
+
get<T = any>(config: Omit<ProxyConfiguration, 'method'>): Promise<AxiosResponse<T>>;
|
|
329
|
+
post<T = any>(config: Omit<ProxyConfiguration, 'method'>): Promise<AxiosResponse<T>>;
|
|
330
|
+
put<T = any>(config: Omit<ProxyConfiguration, 'method'>): Promise<AxiosResponse<T>>;
|
|
331
|
+
patch<T = any>(config: Omit<ProxyConfiguration, 'method'>): Promise<AxiosResponse<T>>;
|
|
332
|
+
delete<T = any>(config: Omit<ProxyConfiguration, 'method'>): Promise<AxiosResponse<T>>;
|
|
333
|
+
getToken(): Promise<string | OAuth1Token | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | TableauCredentials | JwtCredentials | BillCredentials | TwoStepCredentials | SignatureCredentials>;
|
|
334
|
+
/**
|
|
335
|
+
* Get current integration
|
|
336
|
+
*/
|
|
337
|
+
getIntegration(queries?: GetPublicIntegration['Querystring']): Promise<GetPublicIntegration['Success']['data']>;
|
|
338
|
+
getConnection(providerConfigKeyOverride?: string, connectionIdOverride?: string): Promise<Connection>;
|
|
339
|
+
setMetadata(metadata: Metadata): Promise<AxiosResponse<MetadataChangeResponse>>;
|
|
340
|
+
updateMetadata(metadata: Metadata): Promise<AxiosResponse<MetadataChangeResponse>>;
|
|
341
|
+
/**
|
|
342
|
+
* @deprecated please use setMetadata instead.
|
|
343
|
+
*/
|
|
344
|
+
setFieldMapping(fieldMapping: Record<string, string>): Promise<AxiosResponse<object>>;
|
|
345
|
+
getMetadata<T = Metadata>(): Promise<T>;
|
|
346
|
+
getWebhookURL(): Promise<string | null | undefined>;
|
|
347
|
+
/**
|
|
348
|
+
* @deprecated please use getMetadata instead.
|
|
349
|
+
*/
|
|
350
|
+
getFieldMapping(): Promise<Metadata>;
|
|
351
|
+
/**
|
|
352
|
+
* Log
|
|
353
|
+
* @desc Log a message to the activity log which shows up in the Nango Dashboard
|
|
354
|
+
* note that the last argument can be an object with a level property to specify the log level
|
|
355
|
+
* @example
|
|
356
|
+
* ```ts
|
|
357
|
+
* await nango.log('This is a log message', { level: 'error' })
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
log(
|
|
361
|
+
message: any,
|
|
362
|
+
options?:
|
|
363
|
+
| {
|
|
364
|
+
level?: LogLevel;
|
|
365
|
+
}
|
|
366
|
+
| {
|
|
367
|
+
[key: string]: any;
|
|
368
|
+
level?: never;
|
|
369
|
+
}
|
|
370
|
+
): Promise<void>;
|
|
371
|
+
log(
|
|
372
|
+
message: string,
|
|
373
|
+
...args: [
|
|
374
|
+
any,
|
|
375
|
+
{
|
|
376
|
+
level?: LogLevel;
|
|
377
|
+
}
|
|
378
|
+
]
|
|
379
|
+
): Promise<void>;
|
|
380
|
+
getEnvironmentVariables(): Promise<EnvironmentVariable[] | null>;
|
|
381
|
+
getFlowAttributes<A = object>(): A | null;
|
|
382
|
+
paginate<T = any>(config: ProxyConfiguration): AsyncGenerator<T[], undefined, void>;
|
|
383
|
+
triggerAction<In = unknown, Out = object>(providerConfigKey: string, connectionId: string, actionName: string, input?: In): Promise<Out>;
|
|
384
|
+
triggerSync(providerConfigKey: string, connectionId: string, syncName: string, fullResync?: boolean): Promise<void | string>;
|
|
385
|
+
private sendLogToPersist;
|
|
386
|
+
private logAPICall;
|
|
387
|
+
}
|
|
388
|
+
export declare class NangoSync extends NangoAction {
|
|
389
|
+
lastSyncDate?: Date;
|
|
390
|
+
track_deletes: boolean;
|
|
391
|
+
logMessages?:
|
|
392
|
+
| {
|
|
393
|
+
counts: {
|
|
394
|
+
updated: number;
|
|
395
|
+
added: number;
|
|
396
|
+
deleted: number;
|
|
397
|
+
};
|
|
398
|
+
messages: unknown[];
|
|
399
|
+
}
|
|
400
|
+
| undefined;
|
|
401
|
+
rawSaveOutput?: Map<string, unknown[]>;
|
|
402
|
+
rawDeleteOutput?: Map<string, unknown[]>;
|
|
403
|
+
stubbedMetadata?: Metadata | undefined;
|
|
404
|
+
private batchSize;
|
|
405
|
+
constructor(config: NangoProps);
|
|
406
|
+
/**
|
|
407
|
+
* @deprecated please use batchSave
|
|
408
|
+
*/
|
|
409
|
+
batchSend<T = any>(results: T[], model: string): Promise<boolean | null>;
|
|
410
|
+
batchSave<T = any>(results: T[], model: string): Promise<boolean | null>;
|
|
411
|
+
batchDelete<T = any>(results: T[], model: string): Promise<boolean | null>;
|
|
412
|
+
batchUpdate<T = any>(results: T[], model: string): Promise<boolean | null>;
|
|
413
|
+
getMetadata<T = Metadata>(): Promise<T>;
|
|
414
|
+
}
|
|
415
|
+
/**
|
|
416
|
+
* @internal
|
|
417
|
+
*
|
|
418
|
+
* This function will enable tracing on the SDK
|
|
419
|
+
* It has been split from the actual code to avoid making the code too dirty and to easily enable/disable tracing if there is an issue with it
|
|
420
|
+
*/
|
|
421
|
+
export declare function instrumentSDK(rawNango: NangoAction | NangoSync): NangoAction | NangoSync;
|
|
422
|
+
export {};
|
package/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@nangohq/runner-sdk",
|
|
3
|
+
"version": "0.48.3",
|
|
4
|
+
"description": "Nango's Runner SDK",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@nangohq/node": "0.48.3",
|
|
9
|
+
"@nangohq/providers": "0.48.3",
|
|
10
|
+
"ajv": "8.17.1",
|
|
11
|
+
"ajv-formats": "3.0.1",
|
|
12
|
+
"axios": "1.7.9",
|
|
13
|
+
"lodash-es": "4.17.21",
|
|
14
|
+
"parse-link-header": "2.0.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@nangohq/types": "0.48.3",
|
|
18
|
+
"@types/json-schema": "7.0.15",
|
|
19
|
+
"json-schema": "0.4.0",
|
|
20
|
+
"vitest": "2.1.8"
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist/",
|
|
24
|
+
"models.d.ts"
|
|
25
|
+
]
|
|
26
|
+
}
|