@nangohq/types 0.58.7 → 0.59.1

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.
@@ -0,0 +1,13 @@
1
+ import type { Endpoint } from '../api';
2
+ export interface AsyncActionResponse {
3
+ id: string;
4
+ statusUrl: string;
5
+ }
6
+ export type GetAsyncActionResult = Endpoint<{
7
+ Method: 'GET';
8
+ Path: `/action/:id`;
9
+ Params: {
10
+ id: string;
11
+ };
12
+ Success: Record<string, any>;
13
+ }>;
@@ -1,4 +1,5 @@
1
1
  import type { GetEmailByExpiredToken, GetEmailByUuid, GetManagedCallback, PostForgotPassword, PostLogout, PostManagedSignup, PostSignin, PostSignup, PutResetPassword } from './account/api';
2
+ import type { GetAsyncActionResult } from './action/api';
2
3
  import type { EndpointMethod } from './api';
3
4
  import type { PostPublicApiKeyAuthorization, PostPublicAppStoreAuthorization, PostPublicBasicAuthorization, PostPublicBillAuthorization, PostPublicJwtAuthorization, PostPublicSignatureAuthorization, PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicTwoStepAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api';
4
5
  import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect, PostPublicConnectTelemetry } from './connect/api';
@@ -22,7 +23,7 @@ import type { PostPublicTrigger, PutPublicSyncConnectionFrequency } from './sync
22
23
  import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api';
23
24
  import type { GetUser, PatchUser } from './user/api';
24
25
  import type { PostPublicWebhook } from './webhooks/http.api';
25
- export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PatchPublicIntegration;
26
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PatchPublicIntegration | GetAsyncActionResult;
26
27
  export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PatchOnboarding | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | PatchWebhook | PostEnvironmentVariables;
27
28
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
28
29
  /**
@@ -12,6 +12,7 @@ export type PatchWebhook = Endpoint<{
12
12
  on_auth_creation?: boolean | undefined;
13
13
  on_auth_refresh_error?: boolean | undefined;
14
14
  on_sync_error?: boolean | undefined;
15
+ on_async_action_completion?: boolean | undefined;
15
16
  };
16
17
  Success: {
17
18
  success: boolean;
@@ -54,4 +54,5 @@ export interface DBExternalWebhook extends Timestamps {
54
54
  on_auth_creation: boolean;
55
55
  on_auth_refresh_error: boolean;
56
56
  on_sync_error: boolean;
57
+ on_async_action_completion: boolean;
57
58
  }
package/dist/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export type * from './record/api.js';
7
7
  export type * from './logs/api.js';
8
8
  export type * from './logs/messages.js';
9
9
  export type * from './keystore/index.js';
10
+ export type * from './action/api.js';
10
11
  export type * from './account/api.js';
11
12
  export type * from './user/api.js';
12
13
  export type * from './user/db.js';
@@ -65,3 +66,4 @@ export type * from './fleet/api.js';
65
66
  export type * from './fleet/index.js';
66
67
  export type * from './persist/api.js';
67
68
  export type * from './jobs/api.js';
69
+ export type * from './mcp/api.js';
@@ -20,7 +20,7 @@ export type SearchOperations = Endpoint<{
20
20
  integrations?: SearchOperationsIntegration[] | undefined;
21
21
  connections?: SearchOperationsConnection[] | undefined;
22
22
  syncs?: SearchOperationsSync[] | undefined;
23
- period?: SearchOperationsPeriod | undefined;
23
+ period?: SearchPeriod | undefined;
24
24
  cursor?: string | null | undefined;
25
25
  };
26
26
  Success: {
@@ -36,7 +36,7 @@ export type SearchOperationsType = 'all' | ConcatOperationListWithGroup;
36
36
  export type SearchOperationsIntegration = 'all' | string;
37
37
  export type SearchOperationsConnection = 'all' | string;
38
38
  export type SearchOperationsSync = 'all' | string;
39
- export interface SearchOperationsPeriod {
39
+ export interface SearchPeriod {
40
40
  from: string;
41
41
  to: string;
42
42
  }
@@ -67,6 +67,7 @@ export type SearchMessages = Endpoint<{
67
67
  search?: string | undefined;
68
68
  cursorBefore?: string | null | undefined;
69
69
  cursorAfter?: string | null | undefined;
70
+ period?: SearchPeriod | undefined;
70
71
  };
71
72
  Success: {
72
73
  data: MessageRow[];
@@ -0,0 +1,17 @@
1
+ import type { ApiError, Endpoint } from '../api.js';
2
+ export type PostMcp = Endpoint<{
3
+ Method: 'POST';
4
+ Path: '/mcp';
5
+ Body: Record<string, unknown>;
6
+ Headers: {
7
+ 'connection-id': string;
8
+ 'provider-config-key': string;
9
+ };
10
+ Success: Record<string, unknown>;
11
+ Error: ApiError<'missing_connection_id' | 'unknown_connection'>;
12
+ }>;
13
+ export type GetMcp = Endpoint<{
14
+ Method: 'GET';
15
+ Path: '/mcp';
16
+ Success: Record<string, unknown>;
17
+ }>;
@@ -47,6 +47,11 @@ export interface RetryHeaderConfig {
47
47
  after?: string;
48
48
  remaining?: string;
49
49
  error_code?: number;
50
+ in_body?: {
51
+ path: string;
52
+ value?: string;
53
+ strategy: 'at' | 'after';
54
+ };
50
55
  }
51
56
  export declare enum PaginationType {
52
57
  CURSOR = "cursor",
@@ -1,7 +1,7 @@
1
- import type { JSONSchema7 } from 'json-schema';
2
1
  import type { TimestampsAndDeleted } from '../db';
3
2
  import type { LegacySyncModelSchema, NangoConfigMetadata } from '../deploy/incomingFlow';
4
3
  import type { NangoModel, ScriptTypeLiteral, SyncTypeLiteral } from '../nangoYaml';
4
+ import type { JSONSchema7 } from 'json-schema';
5
5
  export interface DBSyncConfig extends TimestampsAndDeleted {
6
6
  id: number;
7
7
  sync_name: string;
@@ -1,7 +1,8 @@
1
1
  import type { AuthOperationType, AuthModeType } from '../auth/api.js';
2
2
  import type { SyncResult } from '../scripts/syncs/api.js';
3
3
  import type { ErrorPayload } from '../api.js';
4
- export type WebhookTypes = 'sync' | 'auth' | 'forward';
4
+ import type { AsyncActionResponse } from '../action/api.js';
5
+ export type WebhookTypes = 'sync' | 'auth' | 'forward' | 'async_action';
5
6
  export interface NangoWebhookBase {
6
7
  from: string;
7
8
  type: WebhookTypes;
@@ -64,3 +65,9 @@ export interface NangoForwardWebhookBody extends NangoWebhookBase {
64
65
  providerConfigKey: string;
65
66
  payload: unknown;
66
67
  }
68
+ export interface NangoAsyncActionWebhookBody extends NangoWebhookBase {
69
+ type: 'async_action';
70
+ connectionId: string;
71
+ providerConfigKey: string;
72
+ payload: AsyncActionResponse;
73
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.58.7",
3
+ "version": "0.59.1",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",