@nangohq/types 0.44.0 → 0.45.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.
@@ -1,18 +1,21 @@
1
1
  import type { EndpointMethod } from './api';
2
2
  import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api';
3
- import type { GetOnboardingStatus } from './onboarding/api';
3
+ import type { PatchOnboarding } from './onboarding/api';
4
4
  import type { SetMetadata, UpdateMetadata } from './connection/api/metadata';
5
- import type { PostDeploy, PostDeployConfirmation } from './deploy/api';
5
+ import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api';
6
6
  import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api';
7
- import type { PostForgotPassword, PutResetPassword, PostSignin, PostSignup } from './account/api';
8
- import type { DeleteInvite, PostInvite } from './invitations/api';
7
+ import type { PostForgotPassword, PutResetPassword, PostSignin, PostSignup, GetEmailByExpiredToken, GetEmailByUuid, GetManagedCallback, PostManagedSignup } from './account/api';
8
+ import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api';
9
9
  import type { GetUser, PatchUser } from './user/api';
10
- import type { DeletePublicIntegration, GetPublicIntegration, GetPublicListIntegrations, GetPublicListIntegrationsLegacy } from './integration/api';
11
- import type { PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicUnauthenticatedAuthorization, PostPublicJwtAuthorization } from './auth/http.api';
10
+ import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetIntegrationFlows, GetPublicIntegration, GetPublicListIntegrations, GetPublicListIntegrationsLegacy, PatchIntegration, PostIntegration } from './integration/api';
11
+ import type { PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicUnauthenticatedAuthorization, PostPublicJwtAuthorization, PostPublicBillAuthorization, PostPublicSignatureAuthorization, PostPublicTwoStepAuthorization } from './auth/http.api';
12
12
  import type { GetPublicProvider, GetPublicProviders } from './providers/api';
13
- import type { PostConnectSessions, PostInternalConnectSessions } from './connect/api';
14
- export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions;
15
- export type PrivateApiEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus | PostInternalConnectSessions;
13
+ import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions } from './connect/api';
14
+ import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnections, PostConnectionRefresh } from './connection/api/get';
15
+ import type { GetMeta } from './meta/api';
16
+ import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api';
17
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | GetPublicConnections | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization;
18
+ export type PrivateApiEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | 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;
16
19
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
17
20
  /**
18
21
  * Automatically narrow endpoints type with Method + Path
@@ -1,4 +1,15 @@
1
1
  import type { ApiError, Endpoint } from '../api';
2
+ export type ConnectionQueryString = {
3
+ connection_id?: string | undefined;
4
+ params?: Record<string, any> | undefined;
5
+ user_scope?: string | undefined;
6
+ } & ({
7
+ public_key: string;
8
+ hmac?: string | undefined;
9
+ } | {
10
+ connect_session_token: string;
11
+ });
12
+ type AuthErrors = ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'> | ApiError<'integration_not_allowed'>;
2
13
  export type PostPublicTbaAuthorization = Endpoint<{
3
14
  Method: 'POST';
4
15
  Body: {
@@ -7,16 +18,12 @@ export type PostPublicTbaAuthorization = Endpoint<{
7
18
  oauth_client_id_override?: string | undefined;
8
19
  oauth_client_secret_override?: string | undefined;
9
20
  };
10
- Querystring: {
11
- connection_id?: string | undefined;
12
- params?: Record<string, any> | undefined;
13
- hmac?: string | undefined;
14
- };
21
+ Querystring: ConnectionQueryString;
15
22
  Params: {
16
23
  providerConfigKey: string;
17
24
  };
18
- Path: '/auth/tba';
19
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
25
+ Path: '/auth/tba/:providerConfigKey';
26
+ Error: AuthErrors;
20
27
  Success: {
21
28
  providerConfigKey: string;
22
29
  connectionId: string;
@@ -29,16 +36,12 @@ export type PostPublicTableauAuthorization = Endpoint<{
29
36
  pat_secret: string;
30
37
  content_url?: string | undefined;
31
38
  };
32
- Querystring: {
33
- connection_id?: string | undefined;
34
- params?: Record<string, any> | undefined;
35
- hmac?: string | undefined;
36
- };
39
+ Querystring: ConnectionQueryString;
37
40
  Params: {
38
41
  providerConfigKey: string;
39
42
  };
40
- Path: '/auth/tableau';
41
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
43
+ Path: '/auth/tableau/:providerConfigKey';
44
+ Error: AuthErrors;
42
45
  Success: {
43
46
  providerConfigKey: string;
44
47
  connectionId: string;
@@ -54,16 +57,12 @@ export type PostPublicJwtAuthorization = Endpoint<{
54
57
  secret: string;
55
58
  } | string;
56
59
  };
57
- Querystring: {
58
- connection_id?: string | undefined;
59
- params?: Record<string, any> | undefined;
60
- hmac?: string | undefined;
61
- };
60
+ Querystring: ConnectionQueryString;
62
61
  Params: {
63
62
  providerConfigKey: string;
64
63
  };
65
- Path: '/auth/jwt';
66
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
64
+ Path: '/auth/jwt/:providerConfigKey';
65
+ Error: AuthErrors;
67
66
  Success: {
68
67
  providerConfigKey: string;
69
68
  connectionId: string;
@@ -71,15 +70,12 @@ export type PostPublicJwtAuthorization = Endpoint<{
71
70
  }>;
72
71
  export type PostPublicUnauthenticatedAuthorization = Endpoint<{
73
72
  Method: 'POST';
74
- Querystring: {
75
- connection_id?: string | undefined;
76
- hmac?: string | undefined;
77
- };
73
+ Querystring: ConnectionQueryString;
78
74
  Params: {
79
75
  providerConfigKey: string;
80
76
  };
81
- Path: '/auth/unauthenticated';
82
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
77
+ Path: '/auth/unauthenticated/:providerConfigKey';
78
+ Error: AuthErrors;
83
79
  Success: {
84
80
  providerConfigKey: string;
85
81
  connectionId: string;
@@ -93,16 +89,12 @@ export type PostPublicBillAuthorization = Endpoint<{
93
89
  organization_id: string;
94
90
  dev_key: string;
95
91
  };
96
- Querystring: {
97
- connection_id?: string | undefined;
98
- params?: Record<string, any> | undefined;
99
- hmac?: string | undefined;
100
- };
92
+ Querystring: ConnectionQueryString;
101
93
  Params: {
102
94
  providerConfigKey: string;
103
95
  };
104
- Path: '/auth/bill';
105
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
96
+ Path: '/auth/bill/:providerConfigKey';
97
+ Error: AuthErrors;
106
98
  Success: {
107
99
  providerConfigKey: string;
108
100
  connectionId: string;
@@ -111,16 +103,12 @@ export type PostPublicBillAuthorization = Endpoint<{
111
103
  export type PostPublicTwoStepAuthorization = Endpoint<{
112
104
  Method: 'POST';
113
105
  Body: Record<string, any>;
114
- Querystring: {
115
- connection_id?: string | undefined;
116
- params?: Record<string, any> | undefined;
117
- hmac?: string | undefined;
118
- };
106
+ Querystring: ConnectionQueryString;
119
107
  Params: {
120
108
  providerConfigKey: string;
121
109
  };
122
- Path: '/auth/two-step';
123
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
110
+ Path: '/auth/two-step/:providerConfigKey';
111
+ Error: AuthErrors;
124
112
  Success: {
125
113
  providerConfigKey: string;
126
114
  connectionId: string;
@@ -132,18 +120,15 @@ export type PostPublicSignatureAuthorization = Endpoint<{
132
120
  username: string;
133
121
  password: string;
134
122
  };
135
- Querystring: {
136
- connection_id?: string | undefined;
137
- params?: Record<string, any> | undefined;
138
- hmac?: string | undefined;
139
- };
123
+ Querystring: ConnectionQueryString;
140
124
  Params: {
141
125
  providerConfigKey: string;
142
126
  };
143
- Path: '/auth/signature-based';
144
- Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
127
+ Path: '/auth/signature-based/:providerConfigKey';
128
+ Error: AuthErrors;
145
129
  Success: {
146
130
  providerConfigKey: string;
147
131
  connectionId: string;
148
132
  };
149
133
  }>;
134
+ export {};
@@ -35,6 +35,8 @@ export type GetConnectionsCount = Endpoint<{
35
35
  data: {
36
36
  total: number;
37
37
  withAuthError: number;
38
+ withSyncError: number;
39
+ withError: number;
38
40
  };
39
41
  };
40
42
  }>;
@@ -1,13 +1,13 @@
1
1
  import type { JSONSchema7 } from 'json-schema';
2
2
  import type { Endpoint, ApiError } from '../api.js';
3
- import type { IncomingFlowConfig, PostConnectionScriptByProvider } from './incomingFlow.js';
3
+ import type { IncomingFlowConfig, OnEventScriptsByProvider } from './incomingFlow.js';
4
4
  import type { SyncDeploymentResult } from './index.js';
5
5
  export type PostDeployConfirmation = Endpoint<{
6
6
  Method: 'POST';
7
7
  Path: '/sync/deploy/confirmation';
8
8
  Body: {
9
9
  flowConfigs: IncomingFlowConfig[];
10
- postConnectionScriptsByProvider: PostConnectionScriptByProvider[];
10
+ onEventScriptsByProvider?: OnEventScriptsByProvider[] | undefined;
11
11
  reconcile: boolean;
12
12
  debug: boolean;
13
13
  singleDeployMode?: boolean;
@@ -20,7 +20,7 @@ export type PostDeploy = Endpoint<{
20
20
  Path: '/sync/deploy';
21
21
  Body: {
22
22
  flowConfigs: IncomingFlowConfig[];
23
- postConnectionScriptsByProvider: PostConnectionScriptByProvider[];
23
+ onEventScriptsByProvider?: OnEventScriptsByProvider[] | undefined;
24
24
  nangoYamlBody: string;
25
25
  reconcile: boolean;
26
26
  debug: boolean;
@@ -37,7 +37,7 @@ export type PostDeployInternal = Endpoint<{
37
37
  };
38
38
  Body: {
39
39
  flowConfigs: IncomingFlowConfig[];
40
- postConnectionScriptsByProvider: PostConnectionScriptByProvider[];
40
+ onEventScriptsByProvider?: OnEventScriptsByProvider[] | undefined;
41
41
  nangoYamlBody: string;
42
42
  reconcile: boolean;
43
43
  debug: boolean;
@@ -1,16 +1,17 @@
1
1
  import type { Merge } from 'type-fest';
2
- import type { NangoModel, NangoSyncEndpointOld, NangoSyncEndpointV2, ScriptTypeLiteral, SyncTypeLiteral } from '../nangoYaml';
2
+ import type { NangoModel, NangoSyncEndpointOld, NangoSyncEndpointV2, OnEventType, ScriptTypeLiteral, SyncTypeLiteral } from '../nangoYaml';
3
3
  export interface IncomingScriptFiles {
4
4
  js: string;
5
5
  ts: string;
6
6
  }
7
- export interface IncomingPostConnectionScript {
7
+ export interface IncomingOnEventScript {
8
8
  name: string;
9
9
  fileBody: IncomingScriptFiles;
10
+ event: OnEventType;
10
11
  }
11
- export interface PostConnectionScriptByProvider {
12
+ export interface OnEventScriptsByProvider {
12
13
  providerConfigKey: string;
13
- scripts: IncomingPostConnectionScript[];
14
+ scripts: IncomingOnEventScript[];
14
15
  }
15
16
  export interface NangoConfigMetadata {
16
17
  scopes?: string[] | undefined;
package/dist/index.d.ts CHANGED
@@ -40,6 +40,7 @@ export type * from './endpoints/db.js';
40
40
  export type * from './connect/api.js';
41
41
  export type * from './connect/session.js';
42
42
  export type * from './endUser/index.js';
43
+ export type * from './runner/index.js';
43
44
  export type * from './nangoYaml/index.js';
44
45
  export type * from './environment/db.js';
45
46
  export type * from './environment/api/webhook.js';
@@ -54,6 +54,9 @@ export type DeletePublicIntegration = Endpoint<{
54
54
  export type PostIntegration = Endpoint<{
55
55
  Method: 'POST';
56
56
  Path: '/api/v1/integrations';
57
+ Querystring: {
58
+ env: string;
59
+ };
57
60
  Body: {
58
61
  provider: string;
59
62
  };
@@ -61,10 +64,13 @@ export type PostIntegration = Endpoint<{
61
64
  data: ApiIntegration;
62
65
  };
63
66
  }>;
64
- export type ApiIntegration = Merge<IntegrationConfig, ApiTimestamps>;
67
+ export type ApiIntegration = Omit<Merge<IntegrationConfig, ApiTimestamps>, 'oauth_client_secret_iv' | 'oauth_client_secret_tag'>;
65
68
  export type GetIntegration = Endpoint<{
66
69
  Method: 'GET';
67
70
  Path: '/api/v1/integrations/:providerConfigKey';
71
+ Querystring: {
72
+ env: string;
73
+ };
68
74
  Params: {
69
75
  providerConfigKey: string;
70
76
  };
@@ -83,6 +89,9 @@ export type GetIntegration = Endpoint<{
83
89
  export type PatchIntegration = Endpoint<{
84
90
  Method: 'PATCH';
85
91
  Path: '/api/v1/integrations/:providerConfigKey';
92
+ Querystring: {
93
+ env: string;
94
+ };
86
95
  Params: {
87
96
  providerConfigKey: string;
88
97
  };
@@ -116,6 +125,9 @@ export type PatchIntegration = Endpoint<{
116
125
  export type DeleteIntegration = Endpoint<{
117
126
  Method: 'DELETE';
118
127
  Path: '/api/v1/integrations/:providerConfigKey';
128
+ Querystring: {
129
+ env: string;
130
+ };
119
131
  Params: {
120
132
  providerConfigKey: string;
121
133
  };
@@ -145,7 +157,6 @@ export interface NangoSyncConfig {
145
157
  id?: number;
146
158
  input?: NangoModel | LegacySyncModelSchema;
147
159
  sync_type?: SyncType;
148
- nango_yaml_version?: string;
149
160
  webhookSubscriptions?: string[];
150
161
  enabled?: boolean;
151
162
  json_schema: JSONSchema7 | null;
@@ -154,6 +165,9 @@ export interface NangoSyncConfig {
154
165
  export type GetIntegrationFlows = Endpoint<{
155
166
  Method: 'GET';
156
167
  Path: '/api/v1/integrations/:providerConfigKey/flows';
168
+ Querystring: {
169
+ env: string;
170
+ };
157
171
  Params: {
158
172
  providerConfigKey: string;
159
173
  };
@@ -1,14 +1,15 @@
1
1
  import type { TimestampsAndDeleted } from '../db.js';
2
2
  export interface IntegrationConfig extends TimestampsAndDeleted {
3
- id?: number;
3
+ id?: number | undefined;
4
4
  unique_key: string;
5
5
  provider: string;
6
6
  oauth_client_id: string;
7
7
  oauth_client_secret: string;
8
- oauth_scopes?: string;
8
+ oauth_scopes?: string | undefined;
9
9
  environment_id: number;
10
10
  oauth_client_secret_iv?: string | null;
11
11
  oauth_client_secret_tag?: string | null;
12
- app_link?: string | null;
13
- custom?: Record<string, string>;
12
+ app_link?: string | null | undefined;
13
+ custom?: Record<string, string> | undefined;
14
+ missing_fields: string[];
14
15
  }
@@ -37,6 +37,10 @@ export interface OperationAction {
37
37
  type: 'action';
38
38
  action: 'run';
39
39
  }
40
+ export interface OperationOnEvents {
41
+ type: 'events';
42
+ action: 'post_connection_creation' | 'pre_connection_deletion';
43
+ }
40
44
  export interface OperationAuth {
41
45
  type: 'auth';
42
46
  action: 'create_connection' | 'refresh_token' | 'post_connection' | 'connection_test';
@@ -53,7 +57,7 @@ export interface OperationDeploy {
53
57
  type: 'deploy';
54
58
  action: 'prebuilt' | 'custom';
55
59
  }
56
- export type OperationList = OperationSync | OperationProxy | OperationAction | OperationWebhook | OperationDeploy | OperationAuth | OperationAdmin;
60
+ export type OperationList = OperationSync | OperationProxy | OperationAction | OperationWebhook | OperationOnEvents | OperationDeploy | OperationAuth | OperationAdmin;
57
61
  /**
58
62
  * Full schema
59
63
  */
@@ -1,6 +1,6 @@
1
1
  export type HTTP_METHOD = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
2
2
  export type SyncTypeLiteral = 'incremental' | 'full';
3
- export type ScriptFileType = 'actions' | 'syncs' | 'post-connection-scripts';
3
+ export type ScriptFileType = 'actions' | 'syncs' | 'on-events' | 'post-connection-scripts';
4
4
  export type ScriptTypeLiteral = 'action' | 'sync';
5
5
  export interface NangoYamlV1 {
6
6
  integrations: Record<string, Record<string, NangoYamlV1Integration>>;
@@ -28,6 +28,10 @@ export interface NangoYamlV2Integration {
28
28
  provider?: string;
29
29
  syncs?: Record<string, NangoYamlV2IntegrationSync>;
30
30
  actions?: Record<string, NangoYamlV2IntegrationAction>;
31
+ 'on-events'?: Record<string, string[]>;
32
+ /**
33
+ * @deprecated
34
+ */
31
35
  'post-connection-scripts'?: string[];
32
36
  }
33
37
  export interface NangoYamlV2IntegrationSync {
@@ -59,6 +63,7 @@ export interface NangoYamlModelFields {
59
63
  }
60
64
  export type NangoYamlModelField = boolean | number | string | null | string[] | NangoYamlModelFields;
61
65
  export type NangoYaml = NangoYamlV1 | NangoYamlV2;
66
+ export type OnEventType = 'post-connection-creation' | 'pre-connection-deletion';
62
67
  export interface NangoYamlParsed {
63
68
  yamlVersion: 'v1' | 'v2';
64
69
  integrations: NangoYamlParsedIntegration[];
@@ -68,7 +73,11 @@ export interface NangoYamlParsedIntegration {
68
73
  providerConfigKey: string;
69
74
  syncs: ParsedNangoSync[];
70
75
  actions: ParsedNangoAction[];
71
- postConnectionScripts: string[];
76
+ onEventScripts: Record<OnEventType, string[]>;
77
+ /**
78
+ * @deprecated
79
+ */
80
+ postConnectionScripts?: string[];
72
81
  }
73
82
  export interface ParsedNangoSync {
74
83
  name: string;
@@ -121,3 +130,8 @@ export interface NangoSyncEndpointV2 {
121
130
  path: string;
122
131
  group?: string | undefined;
123
132
  }
133
+ export interface FlowsYaml {
134
+ integrations: Record<string, NangoYamlV2Integration & {
135
+ models: NangoYamlModel;
136
+ }>;
137
+ }
@@ -1,18 +1,13 @@
1
- import type { ApiError, Endpoint } from '../api';
2
- import type { NangoRecord } from '../record/api';
3
- export type GetOnboardingStatus = Endpoint<{
4
- Method: 'GET';
1
+ import type { Endpoint } from '../api';
2
+ export type PatchOnboarding = Endpoint<{
3
+ Method: 'PATCH';
5
4
  Path: '/api/v1/onboarding';
6
5
  Querystring: {
7
6
  env: string;
8
7
  };
9
- Error: ApiError<'onboarding_dev_only'> | ApiError<'no_onboarding'> | ApiError<'failed_to_get_records'> | ApiError<'invalid_query_params'>;
10
8
  Success: {
11
- id: number;
12
- progress: number;
13
- records: NangoRecord[] | null;
14
- provider: boolean;
15
- connection: boolean;
16
- sync: boolean;
9
+ data: {
10
+ success: boolean;
11
+ };
17
12
  };
18
13
  }>;
@@ -40,7 +40,7 @@ export interface BaseProvider {
40
40
  proxy?: {
41
41
  base_url: string;
42
42
  headers?: Record<string, string>;
43
- connection_base_url?: string;
43
+ connection_config?: Record<string, string>;
44
44
  query?: {
45
45
  api_key: string;
46
46
  };
@@ -55,13 +55,13 @@ export interface BaseProvider {
55
55
  };
56
56
  };
57
57
  authorization_url?: string;
58
- authorization_url_encode?: boolean;
58
+ authorization_url_skip_encode?: string[];
59
59
  access_token_url?: string;
60
60
  authorization_params?: Record<string, string>;
61
61
  scope_separator?: string;
62
62
  default_scopes?: string[];
63
63
  token_url?: string | TokenUrlObject;
64
- token_url_encode?: boolean;
64
+ token_url_skip_encode?: string[];
65
65
  token_params?: Record<string, string>;
66
66
  authorization_url_replacements?: Record<string, string>;
67
67
  redirect_uri_metadata?: string[];
@@ -112,7 +112,7 @@ export interface ProviderJwt extends BaseProvider {
112
112
  };
113
113
  };
114
114
  }
115
- export interface ProviderTwoStep extends BaseProvider {
115
+ export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
116
116
  token_headers?: Record<string, string>;
117
117
  token_response: {
118
118
  token: string;
@@ -121,6 +121,7 @@ export interface ProviderTwoStep extends BaseProvider {
121
121
  };
122
122
  token_expires_in_ms?: number;
123
123
  proxy_header_authorization?: string;
124
+ body_format?: 'xml' | 'json';
124
125
  }
125
126
  export interface ProviderSignature extends BaseProvider {
126
127
  signature: {
@@ -0,0 +1,10 @@
1
+ export interface RunnerOutputError {
2
+ type: string;
3
+ payload: Record<string, unknown>;
4
+ status: number;
5
+ }
6
+ export interface RunnerOutput {
7
+ success: boolean;
8
+ error: RunnerOutputError | null;
9
+ response?: any;
10
+ }
@@ -1,9 +1,10 @@
1
1
  import type { Timestamps } from '../../db.js';
2
- export interface PostConnectionScript extends Timestamps {
2
+ export interface OnEventScript extends Timestamps {
3
3
  id: number;
4
4
  config_id: number;
5
5
  name: string;
6
6
  file_location: string;
7
7
  version: string;
8
8
  active: boolean;
9
+ event: 'POST_CONNECTION_CREATION' | 'PRE_CONNECTION_DELETION';
9
10
  }
package/dist/user/db.d.ts CHANGED
@@ -6,7 +6,7 @@ export interface DBUser extends Timestamps {
6
6
  hashed_password: string;
7
7
  salt: string;
8
8
  account_id: number;
9
- reset_password_token: string | undefined;
9
+ reset_password_token: string | null;
10
10
  suspended: boolean;
11
11
  suspended_at: Date;
12
12
  email_verified: boolean;
package/dist/web/env.d.ts CHANGED
@@ -12,6 +12,6 @@ export interface WindowEnv {
12
12
  scripts: boolean;
13
13
  auth: boolean;
14
14
  managedAuth: boolean;
15
- interactiveDemo: boolean;
15
+ gettingStarted: boolean;
16
16
  };
17
17
  }
@@ -39,6 +39,13 @@ export interface NangoAuthWebhookBodyBase extends NangoWebhookBase {
39
39
  provider: string;
40
40
  environment: string;
41
41
  operation: AuthOperationType;
42
+ /**
43
+ * Only presents if the connection happened with a session token
44
+ */
45
+ endUser?: {
46
+ endUserId: string;
47
+ organizationId?: string | undefined;
48
+ } | undefined;
42
49
  }
43
50
  export interface NangoAuthWebhookBodySuccess extends NangoAuthWebhookBodyBase {
44
51
  success: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.44.0",
3
+ "version": "0.45.1",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",