@nangohq/types 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api.endpoints.d.ts +12 -9
- package/dist/auth/api.d.ts +9 -1
- package/dist/auth/http.api.d.ts +38 -34
- package/dist/connection/api/get.d.ts +2 -0
- package/dist/deploy/api.d.ts +4 -4
- package/dist/deploy/incomingFlow.d.ts +5 -4
- package/dist/endpoints/db.d.ts +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/integration/api.d.ts +15 -1
- package/dist/nangoYaml/index.d.ts +18 -4
- package/dist/onboarding/api.d.ts +6 -11
- package/dist/providers/provider.d.ts +12 -3
- package/dist/runner/index.d.ts +10 -0
- package/dist/scripts/post-connection/db.d.ts +2 -1
- package/dist/user/db.d.ts +1 -1
- package/dist/web/env.d.ts +1 -1
- package/package.json +1 -1
package/dist/api.endpoints.d.ts
CHANGED
|
@@ -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 {
|
|
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
|
-
|
|
15
|
-
|
|
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
|
package/dist/auth/api.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface AuthModes {
|
|
|
13
13
|
Jwt: 'JWT';
|
|
14
14
|
Bill: 'BILL';
|
|
15
15
|
TwoStep: 'TWO_STEP';
|
|
16
|
+
Signature: 'SIGNATURE';
|
|
16
17
|
}
|
|
17
18
|
export type AuthModeType = AuthModes[keyof AuthModes];
|
|
18
19
|
export interface AuthOperation {
|
|
@@ -142,9 +143,16 @@ export interface TwoStepCredentials extends CredentialsCommon {
|
|
|
142
143
|
token?: string;
|
|
143
144
|
expires_at?: Date | undefined;
|
|
144
145
|
}
|
|
146
|
+
export interface SignatureCredentials {
|
|
147
|
+
type: AuthModes['Signature'];
|
|
148
|
+
username: string;
|
|
149
|
+
password: string;
|
|
150
|
+
token?: string;
|
|
151
|
+
expires_at?: Date | undefined;
|
|
152
|
+
}
|
|
145
153
|
export type UnauthCredentials = Record<string, never>;
|
|
146
154
|
export type RefreshTokenResponse = AuthorizationTokenResponse;
|
|
147
155
|
export interface AuthorizationTokenResponse extends Omit<OAuth2Credentials, 'type' | 'raw'> {
|
|
148
156
|
expires_in?: number;
|
|
149
157
|
}
|
|
150
|
-
export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | TableauCredentials | JwtCredentials | BillCredentials | TwoStepCredentials;
|
|
158
|
+
export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | TableauCredentials | JwtCredentials | BillCredentials | TwoStepCredentials | SignatureCredentials;
|
package/dist/auth/http.api.d.ts
CHANGED
|
@@ -1,4 +1,14 @@
|
|
|
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
|
+
});
|
|
2
12
|
export type PostPublicTbaAuthorization = Endpoint<{
|
|
3
13
|
Method: 'POST';
|
|
4
14
|
Body: {
|
|
@@ -7,15 +17,11 @@ export type PostPublicTbaAuthorization = Endpoint<{
|
|
|
7
17
|
oauth_client_id_override?: string | undefined;
|
|
8
18
|
oauth_client_secret_override?: string | undefined;
|
|
9
19
|
};
|
|
10
|
-
Querystring:
|
|
11
|
-
connection_id?: string | undefined;
|
|
12
|
-
params?: Record<string, any> | undefined;
|
|
13
|
-
hmac?: string | undefined;
|
|
14
|
-
};
|
|
20
|
+
Querystring: ConnectionQueryString;
|
|
15
21
|
Params: {
|
|
16
22
|
providerConfigKey: string;
|
|
17
23
|
};
|
|
18
|
-
Path: '/auth/tba';
|
|
24
|
+
Path: '/auth/tba/:providerConfigKey';
|
|
19
25
|
Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
|
|
20
26
|
Success: {
|
|
21
27
|
providerConfigKey: string;
|
|
@@ -29,15 +35,11 @@ export type PostPublicTableauAuthorization = Endpoint<{
|
|
|
29
35
|
pat_secret: string;
|
|
30
36
|
content_url?: string | undefined;
|
|
31
37
|
};
|
|
32
|
-
Querystring:
|
|
33
|
-
connection_id?: string | undefined;
|
|
34
|
-
params?: Record<string, any> | undefined;
|
|
35
|
-
hmac?: string | undefined;
|
|
36
|
-
};
|
|
38
|
+
Querystring: ConnectionQueryString;
|
|
37
39
|
Params: {
|
|
38
40
|
providerConfigKey: string;
|
|
39
41
|
};
|
|
40
|
-
Path: '/auth/tableau';
|
|
42
|
+
Path: '/auth/tableau/:providerConfigKey';
|
|
41
43
|
Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
|
|
42
44
|
Success: {
|
|
43
45
|
providerConfigKey: string;
|
|
@@ -54,15 +56,11 @@ export type PostPublicJwtAuthorization = Endpoint<{
|
|
|
54
56
|
secret: string;
|
|
55
57
|
} | string;
|
|
56
58
|
};
|
|
57
|
-
Querystring:
|
|
58
|
-
connection_id?: string | undefined;
|
|
59
|
-
params?: Record<string, any> | undefined;
|
|
60
|
-
hmac?: string | undefined;
|
|
61
|
-
};
|
|
59
|
+
Querystring: ConnectionQueryString;
|
|
62
60
|
Params: {
|
|
63
61
|
providerConfigKey: string;
|
|
64
62
|
};
|
|
65
|
-
Path: '/auth/jwt';
|
|
63
|
+
Path: '/auth/jwt/:providerConfigKey';
|
|
66
64
|
Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
|
|
67
65
|
Success: {
|
|
68
66
|
providerConfigKey: string;
|
|
@@ -71,14 +69,11 @@ export type PostPublicJwtAuthorization = Endpoint<{
|
|
|
71
69
|
}>;
|
|
72
70
|
export type PostPublicUnauthenticatedAuthorization = Endpoint<{
|
|
73
71
|
Method: 'POST';
|
|
74
|
-
Querystring:
|
|
75
|
-
connection_id?: string | undefined;
|
|
76
|
-
hmac?: string | undefined;
|
|
77
|
-
};
|
|
72
|
+
Querystring: ConnectionQueryString;
|
|
78
73
|
Params: {
|
|
79
74
|
providerConfigKey: string;
|
|
80
75
|
};
|
|
81
|
-
Path: '/auth/unauthenticated';
|
|
76
|
+
Path: '/auth/unauthenticated/:providerConfigKey';
|
|
82
77
|
Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
|
|
83
78
|
Success: {
|
|
84
79
|
providerConfigKey: string;
|
|
@@ -93,15 +88,11 @@ export type PostPublicBillAuthorization = Endpoint<{
|
|
|
93
88
|
organization_id: string;
|
|
94
89
|
dev_key: string;
|
|
95
90
|
};
|
|
96
|
-
Querystring:
|
|
97
|
-
connection_id?: string | undefined;
|
|
98
|
-
params?: Record<string, any> | undefined;
|
|
99
|
-
hmac?: string | undefined;
|
|
100
|
-
};
|
|
91
|
+
Querystring: ConnectionQueryString;
|
|
101
92
|
Params: {
|
|
102
93
|
providerConfigKey: string;
|
|
103
94
|
};
|
|
104
|
-
Path: '/auth/bill';
|
|
95
|
+
Path: '/auth/bill/:providerConfigKey';
|
|
105
96
|
Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
|
|
106
97
|
Success: {
|
|
107
98
|
providerConfigKey: string;
|
|
@@ -111,15 +102,28 @@ export type PostPublicBillAuthorization = Endpoint<{
|
|
|
111
102
|
export type PostPublicTwoStepAuthorization = Endpoint<{
|
|
112
103
|
Method: 'POST';
|
|
113
104
|
Body: Record<string, any>;
|
|
114
|
-
Querystring:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
105
|
+
Querystring: ConnectionQueryString;
|
|
106
|
+
Params: {
|
|
107
|
+
providerConfigKey: string;
|
|
108
|
+
};
|
|
109
|
+
Path: '/auth/two-step/:providerConfigKey';
|
|
110
|
+
Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
|
|
111
|
+
Success: {
|
|
112
|
+
providerConfigKey: string;
|
|
113
|
+
connectionId: string;
|
|
114
|
+
};
|
|
115
|
+
}>;
|
|
116
|
+
export type PostPublicSignatureAuthorization = Endpoint<{
|
|
117
|
+
Method: 'POST';
|
|
118
|
+
Body: {
|
|
119
|
+
username: string;
|
|
120
|
+
password: string;
|
|
118
121
|
};
|
|
122
|
+
Querystring: ConnectionQueryString;
|
|
119
123
|
Params: {
|
|
120
124
|
providerConfigKey: string;
|
|
121
125
|
};
|
|
122
|
-
Path: '/auth/
|
|
126
|
+
Path: '/auth/signature-based/:providerConfigKey';
|
|
123
127
|
Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
|
|
124
128
|
Success: {
|
|
125
129
|
providerConfigKey: string;
|
package/dist/deploy/api.d.ts
CHANGED
|
@@ -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,
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
7
|
+
export interface IncomingOnEventScript {
|
|
8
8
|
name: string;
|
|
9
9
|
fileBody: IncomingScriptFiles;
|
|
10
|
+
event: OnEventType;
|
|
10
11
|
}
|
|
11
|
-
export interface
|
|
12
|
+
export interface OnEventScriptsByProvider {
|
|
12
13
|
providerConfigKey: string;
|
|
13
|
-
scripts:
|
|
14
|
+
scripts: IncomingOnEventScript[];
|
|
14
15
|
}
|
|
15
16
|
export interface NangoConfigMetadata {
|
|
16
17
|
scopes?: string[] | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SetOptional } from 'type-fest';
|
|
2
|
+
import type { Timestamps } from '../db';
|
|
3
|
+
import type { HTTP_METHOD } from '../nangoYaml';
|
|
4
|
+
export interface DBSyncEndpoint extends Timestamps {
|
|
5
|
+
id: number;
|
|
6
|
+
sync_config_id: number;
|
|
7
|
+
method: HTTP_METHOD;
|
|
8
|
+
path: string;
|
|
9
|
+
model: string | null;
|
|
10
|
+
group_name: string | null;
|
|
11
|
+
}
|
|
12
|
+
export type DBSyncEndpointCreate = SetOptional<Omit<DBSyncEndpoint, 'id'>, 'model' | 'group_name'>;
|
package/dist/index.d.ts
CHANGED
|
@@ -36,9 +36,11 @@ export type * from './auth/http.api.js';
|
|
|
36
36
|
export type * from './deploy/api.js';
|
|
37
37
|
export type * from './deploy/index.js';
|
|
38
38
|
export type * from './deploy/incomingFlow.js';
|
|
39
|
+
export type * from './endpoints/db.js';
|
|
39
40
|
export type * from './connect/api.js';
|
|
40
41
|
export type * from './connect/session.js';
|
|
41
42
|
export type * from './endUser/index.js';
|
|
43
|
+
export type * from './runner/index.js';
|
|
42
44
|
export type * from './nangoYaml/index.js';
|
|
43
45
|
export type * from './environment/db.js';
|
|
44
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
|
};
|
|
@@ -65,6 +68,9 @@ export type ApiIntegration = Merge<IntegrationConfig, ApiTimestamps>;
|
|
|
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,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>>;
|
|
@@ -22,12 +22,16 @@ export interface NangoYamlV2 {
|
|
|
22
22
|
export interface NangoYamlV2Endpoint {
|
|
23
23
|
method?: HTTP_METHOD;
|
|
24
24
|
path: string;
|
|
25
|
-
|
|
25
|
+
group?: string | undefined;
|
|
26
26
|
}
|
|
27
27
|
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
|
-
|
|
76
|
+
onEventScripts: Record<OnEventType, string[]>;
|
|
77
|
+
/**
|
|
78
|
+
* @deprecated
|
|
79
|
+
*/
|
|
80
|
+
postConnectionScripts?: string[];
|
|
72
81
|
}
|
|
73
82
|
export interface ParsedNangoSync {
|
|
74
83
|
name: string;
|
|
@@ -119,5 +128,10 @@ export type NangoSyncEndpointOld = {
|
|
|
119
128
|
export interface NangoSyncEndpointV2 {
|
|
120
129
|
method: HTTP_METHOD;
|
|
121
130
|
path: string;
|
|
122
|
-
|
|
131
|
+
group?: string | undefined;
|
|
132
|
+
}
|
|
133
|
+
export interface FlowsYaml {
|
|
134
|
+
integrations: Record<string, NangoYamlV2Integration & {
|
|
135
|
+
models: NangoYamlModel;
|
|
136
|
+
}>;
|
|
123
137
|
}
|
package/dist/onboarding/api.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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
|
-
|
|
43
|
+
connection_config?: Record<string, string>;
|
|
44
44
|
query?: {
|
|
45
45
|
api_key: string;
|
|
46
46
|
};
|
|
@@ -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,5 +121,14 @@ 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
|
-
export
|
|
126
|
+
export interface ProviderSignature extends BaseProvider {
|
|
127
|
+
signature: {
|
|
128
|
+
protocol: 'WSSE';
|
|
129
|
+
};
|
|
130
|
+
token: {
|
|
131
|
+
expires_in_ms: number;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
export type Provider = BaseProvider | ProviderOAuth1 | ProviderOAuth2 | ProviderJwt | ProviderTwoStep | ProviderSignature;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { Timestamps } from '../../db.js';
|
|
2
|
-
export interface
|
|
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 |
|
|
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