@nangohq/node 0.39.17 → 0.39.19

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.cjs CHANGED
@@ -145,26 +145,57 @@ var Nango = class {
145
145
  * DELETE
146
146
  * =======
147
147
  */
148
+ /**
149
+ * Returns a list of integrations
150
+ * @returns A promise that resolves with an object containing an array of integration configurations
151
+ */
148
152
  async listIntegrations() {
149
153
  const url = `${this.serverUrl}/config`;
150
154
  const response = await import_axios.default.get(url, { headers: this.enrichHeaders({}) });
151
155
  return response.data;
152
156
  }
157
+ /**
158
+ * Returns a specific integration
159
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
160
+ * @param includeIntegrationCredentials - An optional flag indicating whether to include integration credentials in the response. Default is false
161
+ * @returns A promise that resolves with an object containing an integration configuration
162
+ */
153
163
  async getIntegration(providerConfigKey, includeIntegrationCredentials = false) {
154
164
  const url = `${this.serverUrl}/config/${providerConfigKey}`;
155
165
  const response = await import_axios.default.get(url, { headers: this.enrichHeaders({}), params: { include_creds: includeIntegrationCredentials } });
156
166
  return response.data;
157
167
  }
168
+ /**
169
+ * Creates a new integration with the specified provider and configuration key
170
+ * Optionally, you can provide credentials for the integration
171
+ * @param provider - The provider of the integration
172
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
173
+ * @param credentials - Optional credentials for the integration
174
+ * @returns A promise that resolves with the created integration configuration
175
+ */
158
176
  async createIntegration(provider, providerConfigKey, credentials) {
159
177
  const url = `${this.serverUrl}/config`;
160
178
  const response = await import_axios.default.post(url, { provider, provider_config_key: providerConfigKey, ...credentials }, { headers: this.enrichHeaders({}) });
161
179
  return response.data;
162
180
  }
181
+ /**
182
+ * Updates an integration with the specified provider and configuration key
183
+ * Only integrations using OAuth 1 & 2 can be updated, not integrations using API keys & Basic auth (because there is nothing to update for them)
184
+ * @param provider - The Nango API Configuration (cf. [providers.yaml](https://github.com/NangoHQ/nango/blob/master/packages/shared/providers.yaml))
185
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
186
+ * @param credentials - Optional credentials to include, depending on the specific integration that you want to update
187
+ * @returns A promise that resolves with the updated integration configuration object
188
+ */
163
189
  async updateIntegration(provider, providerConfigKey, credentials) {
164
190
  const url = `${this.serverUrl}/config`;
165
191
  const response = await import_axios.default.put(url, { provider, provider_config_key: providerConfigKey, ...credentials }, { headers: this.enrichHeaders({}) });
166
192
  return response.data;
167
193
  }
194
+ /**
195
+ * Deletes an integration with the specified configuration key
196
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
197
+ * @returns A promise that resolves with the response from the server
198
+ */
168
199
  async deleteIntegration(providerConfigKey) {
169
200
  const url = `${this.serverUrl}/config/${providerConfigKey}`;
170
201
  return await import_axios.default.delete(url, { headers: this.enrichHeaders({}) });
@@ -183,20 +214,21 @@ var Nango = class {
183
214
  * =======
184
215
  */
185
216
  /**
186
- * Get the list of Connections, which does not contain access credentials.
217
+ * Returns a list of connections, optionally filtered by connection ID
218
+ * @param connectionId - Optional. The ID of the connection to retrieve details of
219
+ * @returns A promise that resolves with an array of connection objects
187
220
  */
188
221
  async listConnections(connectionId) {
189
222
  const response = await this.listConnectionDetails(connectionId);
190
223
  return response.data;
191
224
  }
192
225
  /**
193
- * Get the Connection object, which also contains access credentials and full credentials payload
194
- * returned by the external API.
195
- * @param providerConfigKey - This is the unique Config Key for the integration
226
+ * Returns a connection object, which also contains access credentials and full credentials payload
227
+ * @param providerConfigKey - The integration ID used to create the connection (i.e Unique Key)
196
228
  * @param connectionId - This is the unique connection identifier used to identify this connection
197
- * @param [forceRefresh] - When set, this is used to obtain a new refresh token from the provider before the current token has expired,
198
- * you can set the forceRefresh argument to true.
199
- * @param [refreshToken] - When set this returns the refresh token as part of the response
229
+ * @param forceRefresh - Optional. When set to true, this obtains a new access token from the provider before the current token has expired
230
+ * @param refreshToken - Optional. When set to true, this returns the refresh token as part of the response
231
+ * @returns A promise that resolves with a connection object
200
232
  */
201
233
  async getConnection(providerConfigKey, connectionId, forceRefresh, refreshToken) {
202
234
  const response = await this.getConnectionDetails(providerConfigKey, connectionId, forceRefresh, refreshToken);
@@ -215,15 +247,14 @@ var Nango = class {
215
247
  throw new Error("This method has been deprecated, please use the REST API to create a connection.");
216
248
  }
217
249
  /**
218
- * For OAuth 2: returns the access token directly as a string.
250
+ * For OAuth 2: returns the access token directly as a string
219
251
  * For OAuth 2: If you want to obtain a new refresh token from the provider before the current token has expired,
220
- * you can set the forceRefresh argument to true."
221
- * For OAuth 1: returns an object with 'oAuthToken' and 'oAuthTokenSecret' fields.
222
- * @param providerConfigKey - This is the unique Config Key for the integration
252
+ * you can set the forceRefresh argument to true
253
+ * For OAuth 1: returns an object with 'oAuthToken' and 'oAuthTokenSecret' fields
254
+ * @param providerConfigKey - The integration ID used to create the connection (i.e Unique Key)
223
255
  * @param connectionId - This is the unique connection identifier used to identify this connection
224
- * @param [forceRefresh] - When set, this is used to obtain a new refresh token from the provider before the current token has expired,
225
- * you can set the forceRefresh argument to true.
226
- * */
256
+ * @param forceRefresh - Optional. When set to true, this obtains a new access token from the provider before the current token has expired
257
+ */
227
258
  async getToken(providerConfigKey, connectionId, forceRefresh) {
228
259
  const response = await this.getConnectionDetails(providerConfigKey, connectionId, forceRefresh);
229
260
  switch (response.data.credentials.type) {
@@ -237,17 +268,23 @@ var Nango = class {
237
268
  }
238
269
  /**
239
270
  * Get the full (fresh) credentials payload returned by the external API,
240
- * which also contains access credentials.
241
- * @param providerConfigKey - This is the unique Config Key for the integration
271
+ * which also contains access credentials
272
+ * @param providerConfigKey - The integration ID used to create the connection (i.e Unique Key)
242
273
  * @param connectionId - This is the unique connection identifier used to identify this connection
243
- * @param [forceRefresh] - When set, this is used to obtain a new refresh token from the provider before the current token has expired,
244
- * you can set the forceRefresh argument to true.
245
- * */
274
+ * @param forceRefresh - Optional. When set to true, this obtains a new access token from the provider before the current token has expired
275
+ * @returns A promise that resolves with the raw token response
276
+ */
246
277
  async getRawTokenResponse(providerConfigKey, connectionId, forceRefresh) {
247
278
  const response = await this.getConnectionDetails(providerConfigKey, connectionId, forceRefresh);
248
279
  const credentials = response.data.credentials;
249
280
  return credentials.raw;
250
281
  }
282
+ /**
283
+ * Retrieves metadata for a given provider configuration key and connection ID
284
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
285
+ * @param connectionId - The ID of the connection for which to retrieve metadata
286
+ * @returns A promise that resolves with the retrieved metadata
287
+ */
251
288
  async getMetadata(providerConfigKey, connectionId) {
252
289
  if (!providerConfigKey) {
253
290
  throw new Error("Provider Config Key is required");
@@ -261,6 +298,13 @@ var Nango = class {
261
298
  });
262
299
  return response.data.metadata;
263
300
  }
301
+ /**
302
+ * Sets custom metadata for a connection
303
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
304
+ * @param connectionId - The ID of the connection for which to set metadata
305
+ * @param metadata - The custom metadata to set
306
+ * @returns A promise that resolves with the Axios response from the server
307
+ */
264
308
  async setMetadata(providerConfigKey, connectionId, metadata) {
265
309
  if (!providerConfigKey) {
266
310
  throw new Error("Provider Config Key is required");
@@ -277,6 +321,13 @@ var Nango = class {
277
321
  };
278
322
  return import_axios.default.post(url, metadata, { headers: this.enrichHeaders(headers) });
279
323
  }
324
+ /**
325
+ * Edits custom metadata for a connection, only overriding specified properties, not the entire metadata
326
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
327
+ * @param connectionId - The ID of the connection for which to update metadata
328
+ * @param metadata - The custom metadata to update
329
+ * @returns A promise that resolves with the Axios response from the server
330
+ */
280
331
  async updateMetadata(providerConfigKey, connectionId, metadata) {
281
332
  if (!providerConfigKey) {
282
333
  throw new Error("Provider Config Key is required");
@@ -293,6 +344,12 @@ var Nango = class {
293
344
  };
294
345
  return import_axios.default.patch(url, metadata, { headers: this.enrichHeaders(headers) });
295
346
  }
347
+ /**
348
+ * Deletes a specific connection
349
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
350
+ * @param connectionId - The ID of the connection to be deleted
351
+ * @returns A promise that resolves with the Axios response from the server
352
+ */
296
353
  async deleteConnection(providerConfigKey, connectionId) {
297
354
  const url = `${this.serverUrl}/connection/${connectionId}?provider_config_key=${providerConfigKey}`;
298
355
  const headers = {
@@ -306,6 +363,10 @@ var Nango = class {
306
363
  * CONFIG
307
364
  * =======
308
365
  */
366
+ /**
367
+ * Retrieves the configuration for all integration scripts
368
+ * @returns A promise that resolves with an array of configuration objects for all integration scripts
369
+ */
309
370
  async getScriptsConfig() {
310
371
  const url = `${this.serverUrl}/scripts/config`;
311
372
  const headers = {
@@ -358,6 +419,12 @@ var Nango = class {
358
419
  const response = await import_axios.default.get(url, options);
359
420
  return response.data;
360
421
  }
422
+ /**
423
+ * Returns the synced data, ordered by modification date ascending
424
+ * If some records are updated while you paginate through this endpoint, you might see these records multiple times
425
+ * @param config - Configuration object for listing records
426
+ * @returns A promise that resolves with an object containing an array of records and a cursor for pagination
427
+ */
361
428
  async listRecords(config) {
362
429
  const { connectionId, providerConfigKey, model, delta, modifiedAfter, limit, filter, cursor } = config;
363
430
  validateSyncRecordConfiguration(config);
@@ -372,6 +439,14 @@ var Nango = class {
372
439
  const response = await import_axios.default.get(url, options);
373
440
  return response.data;
374
441
  }
442
+ /**
443
+ * Triggers an additional, one-off execution of specified sync(s) for a given connection or all applicable connections if no connection is specified
444
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
445
+ * @param syncs - An optional array of sync names to trigger. If empty, all applicable syncs will be triggered
446
+ * @param connectionId - An optional ID of the connection for which to trigger the syncs. If not provided, syncs will be triggered for all applicable connections
447
+ * @param fullResync - An optional flag indicating whether to perform a full resynchronization. Default is false
448
+ * @returns A promise that resolves when the sync trigger request is sent
449
+ */
375
450
  async triggerSync(providerConfigKey, syncs, connectionId, fullResync) {
376
451
  const url = `${this.serverUrl}/sync/trigger`;
377
452
  if (typeof syncs === "string") {
@@ -385,6 +460,13 @@ var Nango = class {
385
460
  };
386
461
  return import_axios.default.post(url, body, { headers: this.enrichHeaders() });
387
462
  }
463
+ /**
464
+ * Starts the schedule of specified sync(s) for a given connection or all applicable connections if no connection is specified
465
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
466
+ * @param syncs - An optional array of sync names to start. If empty, all applicable syncs will be started
467
+ * @param connectionId - An optional ID of the connection for which to start the syncs. If not provided, syncs will be started for all applicable connections
468
+ * @returns A promise that resolves when the sync start request is sent
469
+ */
388
470
  async startSync(providerConfigKey, syncs, connectionId) {
389
471
  if (!providerConfigKey) {
390
472
  throw new Error("Provider Config Key is required");
@@ -403,6 +485,13 @@ var Nango = class {
403
485
  const url = `${this.serverUrl}/sync/start`;
404
486
  return import_axios.default.post(url, body, { headers: this.enrichHeaders() });
405
487
  }
488
+ /**
489
+ * Pauses the schedule of specified sync(s) for a given connection or all applicable connections
490
+ * @param providerConfigKey -The key identifying the provider configuration on Nango
491
+ * @param syncs - An optional array of sync names to pause. If empty, all applicable syncs will be paused
492
+ * @param connectionId - An optional ID of the connection for which to pause the syncs. If not provided, syncs will be paused for all applicable connections
493
+ * @returns A promise that resolves when the sync pause request is sent
494
+ */
406
495
  async pauseSync(providerConfigKey, syncs, connectionId) {
407
496
  if (!providerConfigKey) {
408
497
  throw new Error("Provider Config Key is required");
@@ -421,6 +510,13 @@ var Nango = class {
421
510
  };
422
511
  return import_axios.default.post(url, body, { headers: this.enrichHeaders() });
423
512
  }
513
+ /**
514
+ * Get the status of specified sync(s) for a given connection or all applicable connections
515
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
516
+ * @param syncs - An array of sync names to get status for, or '*' to get status for all syncs
517
+ * @param connectionId - An optional ID of the connection for which to get sync status. If not provided, status for all applicable connections will be retrieved
518
+ * @returns A promise that resolves with the status of the specified sync(s)
519
+ */
424
520
  async syncStatus(providerConfigKey, syncs, connectionId) {
425
521
  if (!providerConfigKey) {
426
522
  throw new Error("Provider Config Key is required");
@@ -440,6 +536,14 @@ var Nango = class {
440
536
  const response = await import_axios.default.get(url, { headers: this.enrichHeaders(), params });
441
537
  return response.data;
442
538
  }
539
+ /**
540
+ * Override a sync’s default frequency for a specific connection, or revert to the default frequency
541
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
542
+ * @param sync - The name of the sync to update
543
+ * @param connectionId - The ID of the connection for which to update the sync frequency
544
+ * @param frequency - The new frequency to set for the sync, or null to revert to the default frequency
545
+ * @returns A promise that resolves with the response data after updating the sync frequency
546
+ */
443
547
  async updateSyncConnectionFrequency(providerConfigKey, sync, connectionId, frequency) {
444
548
  if (!providerConfigKey) {
445
549
  throw new Error("Provider Config Key is required");
@@ -463,6 +567,10 @@ var Nango = class {
463
567
  const response = await import_axios.default.put(url, { headers: this.enrichHeaders(), params });
464
568
  return response.data;
465
569
  }
570
+ /**
571
+ * Retrieve the environment variables as added in the Nango dashboard
572
+ * @returns A promise that resolves with an array of environment variables
573
+ */
466
574
  async getEnvironmentVariables() {
467
575
  const url = `${this.serverUrl}/environment-variables`;
468
576
  const headers = {
@@ -480,6 +588,14 @@ var Nango = class {
480
588
  * TRIGGER
481
589
  * =======
482
590
  */
591
+ /**
592
+ * Triggers an action for a connection
593
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
594
+ * @param connectionId - The ID of the connection for which the action should be triggered
595
+ * @param actionName - The name of the action to trigger
596
+ * @param input - An optional input data for the action
597
+ * @returns A promise that resolves with an object containing the response data from the triggered action
598
+ */
483
599
  async triggerAction(providerConfigKey, connectionId, actionName, input) {
484
600
  const url = `${this.serverUrl}/action/trigger`;
485
601
  const headers = {
@@ -503,6 +619,11 @@ var Nango = class {
503
619
  * DELETE
504
620
  * =======
505
621
  */
622
+ /**
623
+ * Sends a proxied HTTP request based on the provided configuration
624
+ * @param config - The configuration object for the proxy request
625
+ * @returns A promise that resolves with the response from the proxied request
626
+ */
506
627
  async proxy(config) {
507
628
  if (!config.connectionId && this.connectionId) {
508
629
  config.connectionId = this.connectionId;
@@ -559,24 +680,44 @@ var Nango = class {
559
680
  return import_axios.default.get(url, options);
560
681
  }
561
682
  }
683
+ /**
684
+ * Sends a GET request using the proxy based on the provided configuration
685
+ * @param config - The configuration object for the GET request
686
+ * @returns A promise that resolves with the response from the GET request
687
+ */
562
688
  async get(config) {
563
689
  return this.proxy({
564
690
  ...config,
565
691
  method: "GET"
566
692
  });
567
693
  }
694
+ /**
695
+ * Sends a POST request using the proxy based on the provided configuration
696
+ * @param config - The configuration object for the POST request
697
+ * @returns A promise that resolves with the response from the POST request
698
+ */
568
699
  async post(config) {
569
700
  return this.proxy({
570
701
  ...config,
571
702
  method: "POST"
572
703
  });
573
704
  }
705
+ /**
706
+ * Sends a PATCH request using the proxy based on the provided configuration
707
+ * @param config - The configuration object for the PATCH request
708
+ * @returns A promise that resolves with the response from the PATCH request
709
+ */
574
710
  async patch(config) {
575
711
  return this.proxy({
576
712
  ...config,
577
713
  method: "PATCH"
578
714
  });
579
715
  }
716
+ /**
717
+ * Sends a DELETE request using the proxy based on the provided configuration
718
+ * @param config - The configuration object for the DELETE request
719
+ * @returns A promise that resolves with the response from the DELETE request
720
+ */
580
721
  async delete(config) {
581
722
  return this.proxy({
582
723
  ...config,
@@ -590,10 +731,20 @@ var Nango = class {
590
731
  *
591
732
  * @param signatureInHeader The value in the header X-Nango-Signature
592
733
  * @param jsonPayload The HTTP body as JSON
734
+ * @returns Whether the signature is valid
593
735
  */
594
736
  verifyWebhookSignature(signatureInHeader, jsonPayload) {
595
737
  return import_node_crypto.default.createHash("sha256").update(`${this.secretKey}${JSON.stringify(jsonPayload)}`).digest("hex") === signatureInHeader;
596
738
  }
739
+ /**
740
+ * Retrieves details of a specific connection
741
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
742
+ * @param connectionId - The ID of the connection for which to retrieve connection details
743
+ * @param forceRefresh - An optional flag indicating whether to force a refresh of the access tokens. Defaults to false
744
+ * @param refreshToken - An optional flag indicating whether to send the refresh token as part of the response. Defaults to false
745
+ * @param additionalHeader - Optional. Additional headers to include in the request
746
+ * @returns A promise that resolves with the response containing connection details
747
+ */
597
748
  async getConnectionDetails(providerConfigKey, connectionId, forceRefresh = false, refreshToken = false, additionalHeader = {}) {
598
749
  const url = `${this.serverUrl}/connection/${connectionId}`;
599
750
  const headers = {
@@ -611,6 +762,11 @@ var Nango = class {
611
762
  };
612
763
  return import_axios.default.get(url, { params, headers: this.enrichHeaders(headers) });
613
764
  }
765
+ /**
766
+ * Retrieves details of all connections from the server or details of a specific connection if a connection ID is provided
767
+ * @param connectionId - Optional. This is the unique connection identifier used to identify this connection
768
+ * @returns A promise that resolves with the response containing connection details
769
+ */
614
770
  async listConnectionDetails(connectionId) {
615
771
  let url = `${this.serverUrl}/connection?`;
616
772
  if (connectionId) {
@@ -621,6 +777,11 @@ var Nango = class {
621
777
  };
622
778
  return import_axios.default.get(url, { headers: this.enrichHeaders(headers) });
623
779
  }
780
+ /**
781
+ * Enriches the headers with the Authorization token
782
+ * @param - Optional. The headers to enrich
783
+ * @returns The enriched headers
784
+ */
624
785
  enrichHeaders(headers = {}) {
625
786
  headers["Authorization"] = "Bearer " + this.secretKey;
626
787
  return headers;
package/dist/index.d.ts CHANGED
@@ -26,18 +26,49 @@ export declare class Nango {
26
26
  * DELETE
27
27
  * =======
28
28
  */
29
+ /**
30
+ * Returns a list of integrations
31
+ * @returns A promise that resolves with an object containing an array of integration configurations
32
+ */
29
33
  listIntegrations(): Promise<{
30
34
  configs: Pick<Integration, 'unique_key' | 'provider'>[];
31
35
  }>;
36
+ /**
37
+ * Returns a specific integration
38
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
39
+ * @param includeIntegrationCredentials - An optional flag indicating whether to include integration credentials in the response. Default is false
40
+ * @returns A promise that resolves with an object containing an integration configuration
41
+ */
32
42
  getIntegration(providerConfigKey: string, includeIntegrationCredentials?: boolean): Promise<{
33
43
  config: Integration | IntegrationWithCreds;
34
44
  }>;
45
+ /**
46
+ * Creates a new integration with the specified provider and configuration key
47
+ * Optionally, you can provide credentials for the integration
48
+ * @param provider - The provider of the integration
49
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
50
+ * @param credentials - Optional credentials for the integration
51
+ * @returns A promise that resolves with the created integration configuration
52
+ */
35
53
  createIntegration(provider: string, providerConfigKey: string, credentials?: Record<string, string>): Promise<{
36
54
  config: Integration;
37
55
  }>;
56
+ /**
57
+ * Updates an integration with the specified provider and configuration key
58
+ * Only integrations using OAuth 1 & 2 can be updated, not integrations using API keys & Basic auth (because there is nothing to update for them)
59
+ * @param provider - The Nango API Configuration (cf. [providers.yaml](https://github.com/NangoHQ/nango/blob/master/packages/shared/providers.yaml))
60
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
61
+ * @param credentials - Optional credentials to include, depending on the specific integration that you want to update
62
+ * @returns A promise that resolves with the updated integration configuration object
63
+ */
38
64
  updateIntegration(provider: string, providerConfigKey: string, credentials?: Record<string, string>): Promise<{
39
65
  config: Integration;
40
66
  }>;
67
+ /**
68
+ * Deletes an integration with the specified configuration key
69
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
70
+ * @returns A promise that resolves with the response from the server
71
+ */
41
72
  deleteIntegration(providerConfigKey: string): Promise<AxiosResponse<void>>;
42
73
  /**
43
74
  * =======
@@ -53,19 +84,20 @@ export declare class Nango {
53
84
  * =======
54
85
  */
55
86
  /**
56
- * Get the list of Connections, which does not contain access credentials.
87
+ * Returns a list of connections, optionally filtered by connection ID
88
+ * @param connectionId - Optional. The ID of the connection to retrieve details of
89
+ * @returns A promise that resolves with an array of connection objects
57
90
  */
58
91
  listConnections(connectionId?: string): Promise<{
59
92
  connections: ConnectionList[];
60
93
  }>;
61
94
  /**
62
- * Get the Connection object, which also contains access credentials and full credentials payload
63
- * returned by the external API.
64
- * @param providerConfigKey - This is the unique Config Key for the integration
95
+ * Returns a connection object, which also contains access credentials and full credentials payload
96
+ * @param providerConfigKey - The integration ID used to create the connection (i.e Unique Key)
65
97
  * @param connectionId - This is the unique connection identifier used to identify this connection
66
- * @param [forceRefresh] - When set, this is used to obtain a new refresh token from the provider before the current token has expired,
67
- * you can set the forceRefresh argument to true.
68
- * @param [refreshToken] - When set this returns the refresh token as part of the response
98
+ * @param forceRefresh - Optional. When set to true, this obtains a new access token from the provider before the current token has expired
99
+ * @param refreshToken - Optional. When set to true, this returns the refresh token as part of the response
100
+ * @returns A promise that resolves with a connection object
69
101
  */
70
102
  getConnection(providerConfigKey: string, connectionId: string, forceRefresh?: boolean, refreshToken?: boolean): Promise<Connection>;
71
103
  /**
@@ -83,28 +115,53 @@ export declare class Nango {
83
115
  connection_config: string;
84
116
  })): void;
85
117
  /**
86
- * For OAuth 2: returns the access token directly as a string.
118
+ * For OAuth 2: returns the access token directly as a string
87
119
  * For OAuth 2: If you want to obtain a new refresh token from the provider before the current token has expired,
88
- * you can set the forceRefresh argument to true."
89
- * For OAuth 1: returns an object with 'oAuthToken' and 'oAuthTokenSecret' fields.
90
- * @param providerConfigKey - This is the unique Config Key for the integration
120
+ * you can set the forceRefresh argument to true
121
+ * For OAuth 1: returns an object with 'oAuthToken' and 'oAuthTokenSecret' fields
122
+ * @param providerConfigKey - The integration ID used to create the connection (i.e Unique Key)
91
123
  * @param connectionId - This is the unique connection identifier used to identify this connection
92
- * @param [forceRefresh] - When set, this is used to obtain a new refresh token from the provider before the current token has expired,
93
- * you can set the forceRefresh argument to true.
94
- * */
124
+ * @param forceRefresh - Optional. When set to true, this obtains a new access token from the provider before the current token has expired
125
+ */
95
126
  getToken(providerConfigKey: string, connectionId: string, forceRefresh?: boolean): Promise<string | OAuth1Token | BasicApiCredentials | ApiKeyCredentials | AppCredentials>;
96
127
  /**
97
128
  * Get the full (fresh) credentials payload returned by the external API,
98
- * which also contains access credentials.
99
- * @param providerConfigKey - This is the unique Config Key for the integration
129
+ * which also contains access credentials
130
+ * @param providerConfigKey - The integration ID used to create the connection (i.e Unique Key)
100
131
  * @param connectionId - This is the unique connection identifier used to identify this connection
101
- * @param [forceRefresh] - When set, this is used to obtain a new refresh token from the provider before the current token has expired,
102
- * you can set the forceRefresh argument to true.
103
- * */
132
+ * @param forceRefresh - Optional. When set to true, this obtains a new access token from the provider before the current token has expired
133
+ * @returns A promise that resolves with the raw token response
134
+ */
104
135
  getRawTokenResponse<T = Record<string, any>>(providerConfigKey: string, connectionId: string, forceRefresh?: boolean): Promise<T>;
136
+ /**
137
+ * Retrieves metadata for a given provider configuration key and connection ID
138
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
139
+ * @param connectionId - The ID of the connection for which to retrieve metadata
140
+ * @returns A promise that resolves with the retrieved metadata
141
+ */
105
142
  getMetadata<T = Metadata>(providerConfigKey: string, connectionId: string): Promise<T>;
143
+ /**
144
+ * Sets custom metadata for a connection
145
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
146
+ * @param connectionId - The ID of the connection for which to set metadata
147
+ * @param metadata - The custom metadata to set
148
+ * @returns A promise that resolves with the Axios response from the server
149
+ */
106
150
  setMetadata(providerConfigKey: string, connectionId: string, metadata: Record<string, any>): Promise<AxiosResponse<void>>;
151
+ /**
152
+ * Edits custom metadata for a connection, only overriding specified properties, not the entire metadata
153
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
154
+ * @param connectionId - The ID of the connection for which to update metadata
155
+ * @param metadata - The custom metadata to update
156
+ * @returns A promise that resolves with the Axios response from the server
157
+ */
107
158
  updateMetadata(providerConfigKey: string, connectionId: string, metadata: Record<string, any>): Promise<AxiosResponse<void>>;
159
+ /**
160
+ * Deletes a specific connection
161
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
162
+ * @param connectionId - The ID of the connection to be deleted
163
+ * @returns A promise that resolves with the Axios response from the server
164
+ */
108
165
  deleteConnection(providerConfigKey: string, connectionId: string): Promise<AxiosResponse<void>>;
109
166
  /**
110
167
  * =======
@@ -112,6 +169,10 @@ export declare class Nango {
112
169
  * CONFIG
113
170
  * =======
114
171
  */
172
+ /**
173
+ * Retrieves the configuration for all integration scripts
174
+ * @returns A promise that resolves with an array of configuration objects for all integration scripts
175
+ */
115
176
  getScriptsConfig(): Promise<StandardNangoConfig[]>;
116
177
  /**
117
178
  * =======
@@ -130,17 +191,64 @@ export declare class Nango {
130
191
  getRecords<T = any>(config: GetRecordsRequestConfig): Promise<(T & {
131
192
  _nango_metadata: RecordMetadata;
132
193
  })[]>;
194
+ /**
195
+ * Returns the synced data, ordered by modification date ascending
196
+ * If some records are updated while you paginate through this endpoint, you might see these records multiple times
197
+ * @param config - Configuration object for listing records
198
+ * @returns A promise that resolves with an object containing an array of records and a cursor for pagination
199
+ */
133
200
  listRecords<T extends Record<string, any> = Record<string, any>>(config: ListRecordsRequestConfig): Promise<{
134
201
  records: (T & {
135
202
  _nango_metadata: RecordMetadata;
136
203
  })[];
137
204
  next_cursor: string | null;
138
205
  }>;
206
+ /**
207
+ * Triggers an additional, one-off execution of specified sync(s) for a given connection or all applicable connections if no connection is specified
208
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
209
+ * @param syncs - An optional array of sync names to trigger. If empty, all applicable syncs will be triggered
210
+ * @param connectionId - An optional ID of the connection for which to trigger the syncs. If not provided, syncs will be triggered for all applicable connections
211
+ * @param fullResync - An optional flag indicating whether to perform a full resynchronization. Default is false
212
+ * @returns A promise that resolves when the sync trigger request is sent
213
+ */
139
214
  triggerSync(providerConfigKey: string, syncs?: string[], connectionId?: string, fullResync?: boolean): Promise<void>;
215
+ /**
216
+ * Starts the schedule of specified sync(s) for a given connection or all applicable connections if no connection is specified
217
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
218
+ * @param syncs - An optional array of sync names to start. If empty, all applicable syncs will be started
219
+ * @param connectionId - An optional ID of the connection for which to start the syncs. If not provided, syncs will be started for all applicable connections
220
+ * @returns A promise that resolves when the sync start request is sent
221
+ */
140
222
  startSync(providerConfigKey: string, syncs: string[], connectionId?: string): Promise<void>;
223
+ /**
224
+ * Pauses the schedule of specified sync(s) for a given connection or all applicable connections
225
+ * @param providerConfigKey -The key identifying the provider configuration on Nango
226
+ * @param syncs - An optional array of sync names to pause. If empty, all applicable syncs will be paused
227
+ * @param connectionId - An optional ID of the connection for which to pause the syncs. If not provided, syncs will be paused for all applicable connections
228
+ * @returns A promise that resolves when the sync pause request is sent
229
+ */
141
230
  pauseSync(providerConfigKey: string, syncs: string[], connectionId?: string): Promise<void>;
231
+ /**
232
+ * Get the status of specified sync(s) for a given connection or all applicable connections
233
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
234
+ * @param syncs - An array of sync names to get status for, or '*' to get status for all syncs
235
+ * @param connectionId - An optional ID of the connection for which to get sync status. If not provided, status for all applicable connections will be retrieved
236
+ * @returns A promise that resolves with the status of the specified sync(s)
237
+ */
142
238
  syncStatus(providerConfigKey: string, syncs: '*' | string[], connectionId?: string): Promise<SyncStatusResponse>;
239
+ /**
240
+ * Override a sync’s default frequency for a specific connection, or revert to the default frequency
241
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
242
+ * @param sync - The name of the sync to update
243
+ * @param connectionId - The ID of the connection for which to update the sync frequency
244
+ * @param frequency - The new frequency to set for the sync, or null to revert to the default frequency
245
+ * @returns A promise that resolves with the response data after updating the sync frequency
246
+ */
143
247
  updateSyncConnectionFrequency(providerConfigKey: string, sync: string, connectionId: string, frequency: string | null): Promise<UpdateSyncFrequencyResponse>;
248
+ /**
249
+ * Retrieve the environment variables as added in the Nango dashboard
250
+ * @returns A promise that resolves with an array of environment variables
251
+ */
144
252
  getEnvironmentVariables(): Promise<{
145
253
  name: string;
146
254
  value: string;
@@ -151,6 +259,14 @@ export declare class Nango {
151
259
  * TRIGGER
152
260
  * =======
153
261
  */
262
+ /**
263
+ * Triggers an action for a connection
264
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
265
+ * @param connectionId - The ID of the connection for which the action should be triggered
266
+ * @param actionName - The name of the action to trigger
267
+ * @param input - An optional input data for the action
268
+ * @returns A promise that resolves with an object containing the response data from the triggered action
269
+ */
154
270
  triggerAction(providerConfigKey: string, connectionId: string, actionName: string, input?: unknown): Promise<object>;
155
271
  /**
156
272
  * =======
@@ -162,10 +278,35 @@ export declare class Nango {
162
278
  * DELETE
163
279
  * =======
164
280
  */
281
+ /**
282
+ * Sends a proxied HTTP request based on the provided configuration
283
+ * @param config - The configuration object for the proxy request
284
+ * @returns A promise that resolves with the response from the proxied request
285
+ */
165
286
  proxy<T = any>(config: ProxyConfiguration): Promise<AxiosResponse<T>>;
287
+ /**
288
+ * Sends a GET request using the proxy based on the provided configuration
289
+ * @param config - The configuration object for the GET request
290
+ * @returns A promise that resolves with the response from the GET request
291
+ */
166
292
  get<T = any>(config: ProxyConfiguration): Promise<AxiosResponse<T>>;
293
+ /**
294
+ * Sends a POST request using the proxy based on the provided configuration
295
+ * @param config - The configuration object for the POST request
296
+ * @returns A promise that resolves with the response from the POST request
297
+ */
167
298
  post<T = any>(config: ProxyConfiguration): Promise<AxiosResponse<T>>;
299
+ /**
300
+ * Sends a PATCH request using the proxy based on the provided configuration
301
+ * @param config - The configuration object for the PATCH request
302
+ * @returns A promise that resolves with the response from the PATCH request
303
+ */
168
304
  patch<T = any>(config: ProxyConfiguration): Promise<AxiosResponse<T>>;
305
+ /**
306
+ * Sends a DELETE request using the proxy based on the provided configuration
307
+ * @param config - The configuration object for the DELETE request
308
+ * @returns A promise that resolves with the response from the DELETE request
309
+ */
169
310
  delete<T = any>(config: ProxyConfiguration): Promise<AxiosResponse<T>>;
170
311
  /**
171
312
  *
@@ -173,9 +314,29 @@ export declare class Nango {
173
314
  *
174
315
  * @param signatureInHeader The value in the header X-Nango-Signature
175
316
  * @param jsonPayload The HTTP body as JSON
317
+ * @returns Whether the signature is valid
318
+ */
319
+ verifyWebhookSignature(signatureInHeader: string, jsonPayload: unknown): boolean;
320
+ /**
321
+ * Retrieves details of a specific connection
322
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
323
+ * @param connectionId - The ID of the connection for which to retrieve connection details
324
+ * @param forceRefresh - An optional flag indicating whether to force a refresh of the access tokens. Defaults to false
325
+ * @param refreshToken - An optional flag indicating whether to send the refresh token as part of the response. Defaults to false
326
+ * @param additionalHeader - Optional. Additional headers to include in the request
327
+ * @returns A promise that resolves with the response containing connection details
176
328
  */
177
- verifyWebhookSignature(signatureInHeader: string, jsonPayload: Record<string, unknown>): boolean;
178
329
  private getConnectionDetails;
330
+ /**
331
+ * Retrieves details of all connections from the server or details of a specific connection if a connection ID is provided
332
+ * @param connectionId - Optional. This is the unique connection identifier used to identify this connection
333
+ * @returns A promise that resolves with the response containing connection details
334
+ */
179
335
  private listConnectionDetails;
336
+ /**
337
+ * Enriches the headers with the Authorization token
338
+ * @param - Optional. The headers to enrich
339
+ * @returns The enriched headers
340
+ */
180
341
  private enrichHeaders;
181
342
  }
package/dist/index.js CHANGED
@@ -56,26 +56,57 @@ export class Nango {
56
56
  * DELETE
57
57
  * =======
58
58
  */
59
+ /**
60
+ * Returns a list of integrations
61
+ * @returns A promise that resolves with an object containing an array of integration configurations
62
+ */
59
63
  async listIntegrations() {
60
64
  const url = `${this.serverUrl}/config`;
61
65
  const response = await axios.get(url, { headers: this.enrichHeaders({}) });
62
66
  return response.data;
63
67
  }
68
+ /**
69
+ * Returns a specific integration
70
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
71
+ * @param includeIntegrationCredentials - An optional flag indicating whether to include integration credentials in the response. Default is false
72
+ * @returns A promise that resolves with an object containing an integration configuration
73
+ */
64
74
  async getIntegration(providerConfigKey, includeIntegrationCredentials = false) {
65
75
  const url = `${this.serverUrl}/config/${providerConfigKey}`;
66
76
  const response = await axios.get(url, { headers: this.enrichHeaders({}), params: { include_creds: includeIntegrationCredentials } });
67
77
  return response.data;
68
78
  }
79
+ /**
80
+ * Creates a new integration with the specified provider and configuration key
81
+ * Optionally, you can provide credentials for the integration
82
+ * @param provider - The provider of the integration
83
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
84
+ * @param credentials - Optional credentials for the integration
85
+ * @returns A promise that resolves with the created integration configuration
86
+ */
69
87
  async createIntegration(provider, providerConfigKey, credentials) {
70
88
  const url = `${this.serverUrl}/config`;
71
89
  const response = await axios.post(url, { provider, provider_config_key: providerConfigKey, ...credentials }, { headers: this.enrichHeaders({}) });
72
90
  return response.data;
73
91
  }
92
+ /**
93
+ * Updates an integration with the specified provider and configuration key
94
+ * Only integrations using OAuth 1 & 2 can be updated, not integrations using API keys & Basic auth (because there is nothing to update for them)
95
+ * @param provider - The Nango API Configuration (cf. [providers.yaml](https://github.com/NangoHQ/nango/blob/master/packages/shared/providers.yaml))
96
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
97
+ * @param credentials - Optional credentials to include, depending on the specific integration that you want to update
98
+ * @returns A promise that resolves with the updated integration configuration object
99
+ */
74
100
  async updateIntegration(provider, providerConfigKey, credentials) {
75
101
  const url = `${this.serverUrl}/config`;
76
102
  const response = await axios.put(url, { provider, provider_config_key: providerConfigKey, ...credentials }, { headers: this.enrichHeaders({}) });
77
103
  return response.data;
78
104
  }
105
+ /**
106
+ * Deletes an integration with the specified configuration key
107
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
108
+ * @returns A promise that resolves with the response from the server
109
+ */
79
110
  async deleteIntegration(providerConfigKey) {
80
111
  const url = `${this.serverUrl}/config/${providerConfigKey}`;
81
112
  return await axios.delete(url, { headers: this.enrichHeaders({}) });
@@ -94,20 +125,21 @@ export class Nango {
94
125
  * =======
95
126
  */
96
127
  /**
97
- * Get the list of Connections, which does not contain access credentials.
128
+ * Returns a list of connections, optionally filtered by connection ID
129
+ * @param connectionId - Optional. The ID of the connection to retrieve details of
130
+ * @returns A promise that resolves with an array of connection objects
98
131
  */
99
132
  async listConnections(connectionId) {
100
133
  const response = await this.listConnectionDetails(connectionId);
101
134
  return response.data;
102
135
  }
103
136
  /**
104
- * Get the Connection object, which also contains access credentials and full credentials payload
105
- * returned by the external API.
106
- * @param providerConfigKey - This is the unique Config Key for the integration
137
+ * Returns a connection object, which also contains access credentials and full credentials payload
138
+ * @param providerConfigKey - The integration ID used to create the connection (i.e Unique Key)
107
139
  * @param connectionId - This is the unique connection identifier used to identify this connection
108
- * @param [forceRefresh] - When set, this is used to obtain a new refresh token from the provider before the current token has expired,
109
- * you can set the forceRefresh argument to true.
110
- * @param [refreshToken] - When set this returns the refresh token as part of the response
140
+ * @param forceRefresh - Optional. When set to true, this obtains a new access token from the provider before the current token has expired
141
+ * @param refreshToken - Optional. When set to true, this returns the refresh token as part of the response
142
+ * @returns A promise that resolves with a connection object
111
143
  */
112
144
  async getConnection(providerConfigKey, connectionId, forceRefresh, refreshToken) {
113
145
  const response = await this.getConnectionDetails(providerConfigKey, connectionId, forceRefresh, refreshToken);
@@ -126,15 +158,14 @@ export class Nango {
126
158
  throw new Error('This method has been deprecated, please use the REST API to create a connection.');
127
159
  }
128
160
  /**
129
- * For OAuth 2: returns the access token directly as a string.
161
+ * For OAuth 2: returns the access token directly as a string
130
162
  * For OAuth 2: If you want to obtain a new refresh token from the provider before the current token has expired,
131
- * you can set the forceRefresh argument to true."
132
- * For OAuth 1: returns an object with 'oAuthToken' and 'oAuthTokenSecret' fields.
133
- * @param providerConfigKey - This is the unique Config Key for the integration
163
+ * you can set the forceRefresh argument to true
164
+ * For OAuth 1: returns an object with 'oAuthToken' and 'oAuthTokenSecret' fields
165
+ * @param providerConfigKey - The integration ID used to create the connection (i.e Unique Key)
134
166
  * @param connectionId - This is the unique connection identifier used to identify this connection
135
- * @param [forceRefresh] - When set, this is used to obtain a new refresh token from the provider before the current token has expired,
136
- * you can set the forceRefresh argument to true.
137
- * */
167
+ * @param forceRefresh - Optional. When set to true, this obtains a new access token from the provider before the current token has expired
168
+ */
138
169
  async getToken(providerConfigKey, connectionId, forceRefresh) {
139
170
  const response = await this.getConnectionDetails(providerConfigKey, connectionId, forceRefresh);
140
171
  switch (response.data.credentials.type) {
@@ -148,17 +179,23 @@ export class Nango {
148
179
  }
149
180
  /**
150
181
  * Get the full (fresh) credentials payload returned by the external API,
151
- * which also contains access credentials.
152
- * @param providerConfigKey - This is the unique Config Key for the integration
182
+ * which also contains access credentials
183
+ * @param providerConfigKey - The integration ID used to create the connection (i.e Unique Key)
153
184
  * @param connectionId - This is the unique connection identifier used to identify this connection
154
- * @param [forceRefresh] - When set, this is used to obtain a new refresh token from the provider before the current token has expired,
155
- * you can set the forceRefresh argument to true.
156
- * */
185
+ * @param forceRefresh - Optional. When set to true, this obtains a new access token from the provider before the current token has expired
186
+ * @returns A promise that resolves with the raw token response
187
+ */
157
188
  async getRawTokenResponse(providerConfigKey, connectionId, forceRefresh) {
158
189
  const response = await this.getConnectionDetails(providerConfigKey, connectionId, forceRefresh);
159
190
  const credentials = response.data.credentials;
160
191
  return credentials.raw;
161
192
  }
193
+ /**
194
+ * Retrieves metadata for a given provider configuration key and connection ID
195
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
196
+ * @param connectionId - The ID of the connection for which to retrieve metadata
197
+ * @returns A promise that resolves with the retrieved metadata
198
+ */
162
199
  async getMetadata(providerConfigKey, connectionId) {
163
200
  if (!providerConfigKey) {
164
201
  throw new Error('Provider Config Key is required');
@@ -172,6 +209,13 @@ export class Nango {
172
209
  });
173
210
  return response.data.metadata;
174
211
  }
212
+ /**
213
+ * Sets custom metadata for a connection
214
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
215
+ * @param connectionId - The ID of the connection for which to set metadata
216
+ * @param metadata - The custom metadata to set
217
+ * @returns A promise that resolves with the Axios response from the server
218
+ */
175
219
  async setMetadata(providerConfigKey, connectionId, metadata) {
176
220
  if (!providerConfigKey) {
177
221
  throw new Error('Provider Config Key is required');
@@ -188,6 +232,13 @@ export class Nango {
188
232
  };
189
233
  return axios.post(url, metadata, { headers: this.enrichHeaders(headers) });
190
234
  }
235
+ /**
236
+ * Edits custom metadata for a connection, only overriding specified properties, not the entire metadata
237
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
238
+ * @param connectionId - The ID of the connection for which to update metadata
239
+ * @param metadata - The custom metadata to update
240
+ * @returns A promise that resolves with the Axios response from the server
241
+ */
191
242
  async updateMetadata(providerConfigKey, connectionId, metadata) {
192
243
  if (!providerConfigKey) {
193
244
  throw new Error('Provider Config Key is required');
@@ -204,6 +255,12 @@ export class Nango {
204
255
  };
205
256
  return axios.patch(url, metadata, { headers: this.enrichHeaders(headers) });
206
257
  }
258
+ /**
259
+ * Deletes a specific connection
260
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
261
+ * @param connectionId - The ID of the connection to be deleted
262
+ * @returns A promise that resolves with the Axios response from the server
263
+ */
207
264
  async deleteConnection(providerConfigKey, connectionId) {
208
265
  const url = `${this.serverUrl}/connection/${connectionId}?provider_config_key=${providerConfigKey}`;
209
266
  const headers = {
@@ -217,6 +274,10 @@ export class Nango {
217
274
  * CONFIG
218
275
  * =======
219
276
  */
277
+ /**
278
+ * Retrieves the configuration for all integration scripts
279
+ * @returns A promise that resolves with an array of configuration objects for all integration scripts
280
+ */
220
281
  async getScriptsConfig() {
221
282
  const url = `${this.serverUrl}/scripts/config`;
222
283
  const headers = {
@@ -267,6 +328,12 @@ export class Nango {
267
328
  const response = await axios.get(url, options);
268
329
  return response.data;
269
330
  }
331
+ /**
332
+ * Returns the synced data, ordered by modification date ascending
333
+ * If some records are updated while you paginate through this endpoint, you might see these records multiple times
334
+ * @param config - Configuration object for listing records
335
+ * @returns A promise that resolves with an object containing an array of records and a cursor for pagination
336
+ */
270
337
  async listRecords(config) {
271
338
  const { connectionId, providerConfigKey, model, delta, modifiedAfter, limit, filter, cursor } = config;
272
339
  validateSyncRecordConfiguration(config);
@@ -281,6 +348,14 @@ export class Nango {
281
348
  const response = await axios.get(url, options);
282
349
  return response.data;
283
350
  }
351
+ /**
352
+ * Triggers an additional, one-off execution of specified sync(s) for a given connection or all applicable connections if no connection is specified
353
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
354
+ * @param syncs - An optional array of sync names to trigger. If empty, all applicable syncs will be triggered
355
+ * @param connectionId - An optional ID of the connection for which to trigger the syncs. If not provided, syncs will be triggered for all applicable connections
356
+ * @param fullResync - An optional flag indicating whether to perform a full resynchronization. Default is false
357
+ * @returns A promise that resolves when the sync trigger request is sent
358
+ */
284
359
  async triggerSync(providerConfigKey, syncs, connectionId, fullResync) {
285
360
  const url = `${this.serverUrl}/sync/trigger`;
286
361
  if (typeof syncs === 'string') {
@@ -294,6 +369,13 @@ export class Nango {
294
369
  };
295
370
  return axios.post(url, body, { headers: this.enrichHeaders() });
296
371
  }
372
+ /**
373
+ * Starts the schedule of specified sync(s) for a given connection or all applicable connections if no connection is specified
374
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
375
+ * @param syncs - An optional array of sync names to start. If empty, all applicable syncs will be started
376
+ * @param connectionId - An optional ID of the connection for which to start the syncs. If not provided, syncs will be started for all applicable connections
377
+ * @returns A promise that resolves when the sync start request is sent
378
+ */
297
379
  async startSync(providerConfigKey, syncs, connectionId) {
298
380
  if (!providerConfigKey) {
299
381
  throw new Error('Provider Config Key is required');
@@ -312,6 +394,13 @@ export class Nango {
312
394
  const url = `${this.serverUrl}/sync/start`;
313
395
  return axios.post(url, body, { headers: this.enrichHeaders() });
314
396
  }
397
+ /**
398
+ * Pauses the schedule of specified sync(s) for a given connection or all applicable connections
399
+ * @param providerConfigKey -The key identifying the provider configuration on Nango
400
+ * @param syncs - An optional array of sync names to pause. If empty, all applicable syncs will be paused
401
+ * @param connectionId - An optional ID of the connection for which to pause the syncs. If not provided, syncs will be paused for all applicable connections
402
+ * @returns A promise that resolves when the sync pause request is sent
403
+ */
315
404
  async pauseSync(providerConfigKey, syncs, connectionId) {
316
405
  if (!providerConfigKey) {
317
406
  throw new Error('Provider Config Key is required');
@@ -330,6 +419,13 @@ export class Nango {
330
419
  };
331
420
  return axios.post(url, body, { headers: this.enrichHeaders() });
332
421
  }
422
+ /**
423
+ * Get the status of specified sync(s) for a given connection or all applicable connections
424
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
425
+ * @param syncs - An array of sync names to get status for, or '*' to get status for all syncs
426
+ * @param connectionId - An optional ID of the connection for which to get sync status. If not provided, status for all applicable connections will be retrieved
427
+ * @returns A promise that resolves with the status of the specified sync(s)
428
+ */
333
429
  async syncStatus(providerConfigKey, syncs, connectionId) {
334
430
  if (!providerConfigKey) {
335
431
  throw new Error('Provider Config Key is required');
@@ -349,6 +445,14 @@ export class Nango {
349
445
  const response = await axios.get(url, { headers: this.enrichHeaders(), params });
350
446
  return response.data;
351
447
  }
448
+ /**
449
+ * Override a sync’s default frequency for a specific connection, or revert to the default frequency
450
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
451
+ * @param sync - The name of the sync to update
452
+ * @param connectionId - The ID of the connection for which to update the sync frequency
453
+ * @param frequency - The new frequency to set for the sync, or null to revert to the default frequency
454
+ * @returns A promise that resolves with the response data after updating the sync frequency
455
+ */
352
456
  async updateSyncConnectionFrequency(providerConfigKey, sync, connectionId, frequency) {
353
457
  if (!providerConfigKey) {
354
458
  throw new Error('Provider Config Key is required');
@@ -372,6 +476,10 @@ export class Nango {
372
476
  const response = await axios.put(url, { headers: this.enrichHeaders(), params });
373
477
  return response.data;
374
478
  }
479
+ /**
480
+ * Retrieve the environment variables as added in the Nango dashboard
481
+ * @returns A promise that resolves with an array of environment variables
482
+ */
375
483
  async getEnvironmentVariables() {
376
484
  const url = `${this.serverUrl}/environment-variables`;
377
485
  const headers = {
@@ -389,6 +497,14 @@ export class Nango {
389
497
  * TRIGGER
390
498
  * =======
391
499
  */
500
+ /**
501
+ * Triggers an action for a connection
502
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
503
+ * @param connectionId - The ID of the connection for which the action should be triggered
504
+ * @param actionName - The name of the action to trigger
505
+ * @param input - An optional input data for the action
506
+ * @returns A promise that resolves with an object containing the response data from the triggered action
507
+ */
392
508
  async triggerAction(providerConfigKey, connectionId, actionName, input) {
393
509
  const url = `${this.serverUrl}/action/trigger`;
394
510
  const headers = {
@@ -412,6 +528,11 @@ export class Nango {
412
528
  * DELETE
413
529
  * =======
414
530
  */
531
+ /**
532
+ * Sends a proxied HTTP request based on the provided configuration
533
+ * @param config - The configuration object for the proxy request
534
+ * @returns A promise that resolves with the response from the proxied request
535
+ */
415
536
  async proxy(config) {
416
537
  if (!config.connectionId && this.connectionId) {
417
538
  config.connectionId = this.connectionId;
@@ -474,24 +595,44 @@ export class Nango {
474
595
  return axios.get(url, options);
475
596
  }
476
597
  }
598
+ /**
599
+ * Sends a GET request using the proxy based on the provided configuration
600
+ * @param config - The configuration object for the GET request
601
+ * @returns A promise that resolves with the response from the GET request
602
+ */
477
603
  async get(config) {
478
604
  return this.proxy({
479
605
  ...config,
480
606
  method: 'GET'
481
607
  });
482
608
  }
609
+ /**
610
+ * Sends a POST request using the proxy based on the provided configuration
611
+ * @param config - The configuration object for the POST request
612
+ * @returns A promise that resolves with the response from the POST request
613
+ */
483
614
  async post(config) {
484
615
  return this.proxy({
485
616
  ...config,
486
617
  method: 'POST'
487
618
  });
488
619
  }
620
+ /**
621
+ * Sends a PATCH request using the proxy based on the provided configuration
622
+ * @param config - The configuration object for the PATCH request
623
+ * @returns A promise that resolves with the response from the PATCH request
624
+ */
489
625
  async patch(config) {
490
626
  return this.proxy({
491
627
  ...config,
492
628
  method: 'PATCH'
493
629
  });
494
630
  }
631
+ /**
632
+ * Sends a DELETE request using the proxy based on the provided configuration
633
+ * @param config - The configuration object for the DELETE request
634
+ * @returns A promise that resolves with the response from the DELETE request
635
+ */
495
636
  async delete(config) {
496
637
  return this.proxy({
497
638
  ...config,
@@ -505,6 +646,7 @@ export class Nango {
505
646
  *
506
647
  * @param signatureInHeader The value in the header X-Nango-Signature
507
648
  * @param jsonPayload The HTTP body as JSON
649
+ * @returns Whether the signature is valid
508
650
  */
509
651
  verifyWebhookSignature(signatureInHeader, jsonPayload) {
510
652
  return (crypto
@@ -512,6 +654,15 @@ export class Nango {
512
654
  .update(`${this.secretKey}${JSON.stringify(jsonPayload)}`)
513
655
  .digest('hex') === signatureInHeader);
514
656
  }
657
+ /**
658
+ * Retrieves details of a specific connection
659
+ * @param providerConfigKey - The key identifying the provider configuration on Nango
660
+ * @param connectionId - The ID of the connection for which to retrieve connection details
661
+ * @param forceRefresh - An optional flag indicating whether to force a refresh of the access tokens. Defaults to false
662
+ * @param refreshToken - An optional flag indicating whether to send the refresh token as part of the response. Defaults to false
663
+ * @param additionalHeader - Optional. Additional headers to include in the request
664
+ * @returns A promise that resolves with the response containing connection details
665
+ */
515
666
  async getConnectionDetails(providerConfigKey, connectionId, forceRefresh = false, refreshToken = false, additionalHeader = {}) {
516
667
  const url = `${this.serverUrl}/connection/${connectionId}`;
517
668
  const headers = {
@@ -529,6 +680,11 @@ export class Nango {
529
680
  };
530
681
  return axios.get(url, { params: params, headers: this.enrichHeaders(headers) });
531
682
  }
683
+ /**
684
+ * Retrieves details of all connections from the server or details of a specific connection if a connection ID is provided
685
+ * @param connectionId - Optional. This is the unique connection identifier used to identify this connection
686
+ * @returns A promise that resolves with the response containing connection details
687
+ */
532
688
  async listConnectionDetails(connectionId) {
533
689
  let url = `${this.serverUrl}/connection?`;
534
690
  if (connectionId) {
@@ -539,6 +695,11 @@ export class Nango {
539
695
  };
540
696
  return axios.get(url, { headers: this.enrichHeaders(headers) });
541
697
  }
698
+ /**
699
+ * Enriches the headers with the Authorization token
700
+ * @param - Optional. The headers to enrich
701
+ * @returns The enriched headers
702
+ */
542
703
  enrichHeaders(headers = {}) {
543
704
  headers['Authorization'] = 'Bearer ' + this.secretKey;
544
705
  return headers;
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,KAAK,MAAM,OAAO,CAAC;AAwB1B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAC;AAEzF,MAAM,CAAC,MAAM,WAAW,GAAG,+BAA+B,CAAC;AAC3D,MAAM,CAAC,MAAM,QAAQ,GAAG,uBAAuB,CAAC;AAEhD,cAAc,YAAY,CAAC;AAI3B,MAAM,CAAN,IA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AAE,YAAY;SAC9B,CAAC;QAEF,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpF,CAAC;IAED;;;;OAIG;IACK,KAAK,CAAC,qBAAqB,CAAC,YAAqB;QACrD,IAAI,GAAG,GAAG,GAAG,IAAI,CAAC,SAAS,cAAc,CAAC;QAC1C,IAAI,YAAY,EAAE,CAAC;YACf,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,gBAAgB,YAAY,EAAE,CAAC,CAAC;QACrD,CAAC;QAED,MAAM,OAAO,GAAG;YACZ,cAAc,EAAE,kBAAkB;SACrC,CAAC;QAEF,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;OAIG;IACK,aAAa,CAAC,UAAqD,EAAE;QACzE,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAEtD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ"}
package/dist/types.d.ts CHANGED
@@ -240,7 +240,14 @@ export interface SyncResult {
240
240
  updated: number;
241
241
  deleted: number;
242
242
  }
243
+ export declare enum WebhookType {
244
+ SYNC = "sync",
245
+ AUTH = "auth",
246
+ FORWARD = "forward"
247
+ }
243
248
  export interface NangoSyncWebhookBody {
249
+ from: 'nango';
250
+ type: WebhookType.SYNC;
244
251
  connectionId: string;
245
252
  providerConfigKey: string;
246
253
  syncName: string;
@@ -248,12 +255,7 @@ export interface NangoSyncWebhookBody {
248
255
  responseResults: SyncResult;
249
256
  syncType: SyncType;
250
257
  queryTimeStamp: string | null;
251
- modifiedAfter: string | null;
252
- }
253
- export declare enum WebhookType {
254
- SYNC = "sync",
255
- AUTH = "auth",
256
- FORWARD = "forward"
258
+ modifiedAfter: string;
257
259
  }
258
260
  export declare enum AuthOperation {
259
261
  CREATION = "creation",
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AA6BA,MAAM,CAAN,IAAY,SAUX;AAVD,WAAY,SAAS;IACjB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,mCAAsB,CAAA;IACtB,4BAAe,CAAA;IACf,+BAAkB,CAAA;IAClB,mCAAsB,CAAA;IACtB,8BAAiB,CAAA;IACjB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACjB,CAAC,EAVW,SAAS,KAAT,SAAS,QAUpB;AA0LD,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,+BAAa,CAAA;IACb,mCAAiB,CAAA;AACrB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AAqED,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,kCAAmB,CAAA;AACvB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAED,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;AACvB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../lib/types.ts"],"names":[],"mappings":"AA6BA,MAAM,CAAN,IAAY,SAUX;AAVD,WAAY,SAAS;IACjB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,mCAAsB,CAAA;IACtB,4BAAe,CAAA;IACf,+BAAkB,CAAA;IAClB,mCAAsB,CAAA;IACtB,8BAAiB,CAAA;IACjB,wBAAW,CAAA;IACX,0BAAa,CAAA;AACjB,CAAC,EAVW,SAAS,KAAT,SAAS,QAUpB;AA0LD,MAAM,CAAN,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,+BAAa,CAAA;IACb,mCAAiB,CAAA;AACrB,CAAC,EAHW,cAAc,KAAd,cAAc,QAGzB;AA0DD,MAAM,CAAN,IAAY,WAIX;AAJD,WAAY,WAAW;IACnB,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,kCAAmB,CAAA;AACvB,CAAC,EAJW,WAAW,KAAX,WAAW,QAItB;AAeD,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;IACrB,oCAAmB,CAAA;AACvB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB"}
package/dist/utils.d.ts CHANGED
@@ -1,3 +1,13 @@
1
1
  import type { ProxyConfiguration, GetRecordsRequestConfig } from './types.js';
2
+ /**
3
+ * Validates the configuration for a proxy call
4
+ * @param config - Configuration object for the proxy call
5
+ * @throws If required parameters are missing in the configuration
6
+ */
2
7
  export declare const validateProxyConfiguration: (config: ProxyConfiguration) => void;
8
+ /**
9
+ * Validates the configuration for fetching sync records
10
+ * @param config - Configuration object for fetching sync records
11
+ * @throws If required parameters are missing in the configuration
12
+ */
3
13
  export declare const validateSyncRecordConfiguration: (config: GetRecordsRequestConfig) => void;
package/dist/utils.js CHANGED
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Validates the configuration for a proxy call
3
+ * @param config - Configuration object for the proxy call
4
+ * @throws If required parameters are missing in the configuration
5
+ */
1
6
  export const validateProxyConfiguration = (config) => {
2
7
  const requiredParams = ['endpoint', 'providerConfigKey', 'connectionId'];
3
8
  requiredParams.forEach((param) => {
@@ -6,6 +11,11 @@ export const validateProxyConfiguration = (config) => {
6
11
  }
7
12
  });
8
13
  };
14
+ /**
15
+ * Validates the configuration for fetching sync records
16
+ * @param config - Configuration object for fetching sync records
17
+ * @throws If required parameters are missing in the configuration
18
+ */
9
19
  export const validateSyncRecordConfiguration = (config) => {
10
20
  const requiredParams = ['model', 'providerConfigKey', 'connectionId'];
11
21
  requiredParams.forEach((param) => {
package/dist/utils.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../lib/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,MAA0B,EAAE,EAAE;IACrE,MAAM,cAAc,GAAiC,CAAC,UAAU,EAAE,mBAAmB,EAAE,cAAc,CAAC,CAAC;IAEvG,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7B,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,WAAW,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,mDAAmD,CAAC,CAAC;QACjF,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,MAA+B,EAAE,EAAE;IAC/E,MAAM,cAAc,GAAsC,CAAC,OAAO,EAAE,mBAAmB,EAAE,cAAc,CAAC,CAAC;IAEzG,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7B,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,WAAW,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,mDAAmD,CAAC,CAAC;QACjF,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../lib/utils.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,MAA0B,EAAE,EAAE;IACrE,MAAM,cAAc,GAAiC,CAAC,UAAU,EAAE,mBAAmB,EAAE,cAAc,CAAC,CAAC;IAEvG,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7B,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,WAAW,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,mDAAmD,CAAC,CAAC;QACjF,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,CAAC,MAA+B,EAAE,EAAE;IAC/E,MAAM,cAAc,GAAsC,CAAC,OAAO,EAAE,mBAAmB,EAAE,cAAc,CAAC,CAAC;IAEzG,cAAc,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QAC7B,IAAI,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,WAAW,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,mDAAmD,CAAC,CAAC;QACjF,CAAC;IACL,CAAC,CAAC,CAAC;AACP,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@nangohq/node",
3
- "version": "0.39.17",
3
+ "version": "0.39.19",
4
4
  "description": "Nango's Node client.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "./dist/index.js",
8
8
  "scripts": {
9
- "build": "tsup lib/index.ts --format cjs && tsc",
10
- "prepublishOnly": "npm install && npm run build"
9
+ "build": "tsup lib/index.ts --format cjs",
10
+ "prepublishOnly": "npm run build"
11
11
  },
12
12
  "exports": {
13
13
  ".": {
@@ -28,7 +28,7 @@
28
28
  "axios": "^1.2.0"
29
29
  },
30
30
  "engines": {
31
- "node": ">=16.7"
31
+ "node": ">=18.0"
32
32
  },
33
33
  "files": [
34
34
  "dist/**/*",