@nangohq/types 0.42.9 → 0.42.10
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/flow/http.api.d.ts +60 -2
- package/dist/index.d.ts +2 -0
- package/dist/integration/api.d.ts +109 -2
- package/dist/syncConfigs/api.d.ts +4 -0
- package/dist/syncConfigs/db.d.ts +28 -0
- package/package.json +1 -1
package/dist/flow/http.api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ApiError, Endpoint } from '../api';
|
|
|
2
2
|
import type { ScriptTypeLiteral } from '../nangoYaml';
|
|
3
3
|
export type PutUpgradePreBuiltFlow = Endpoint<{
|
|
4
4
|
Method: 'PUT';
|
|
5
|
-
Path: '/api/v1/
|
|
5
|
+
Path: '/api/v1/flows/pre-built/upgrade';
|
|
6
6
|
Body: {
|
|
7
7
|
id: number;
|
|
8
8
|
provider: string;
|
|
@@ -19,7 +19,7 @@ export type PutUpgradePreBuiltFlow = Endpoint<{
|
|
|
19
19
|
}>;
|
|
20
20
|
export type PostPreBuiltDeploy = Endpoint<{
|
|
21
21
|
Method: 'POST';
|
|
22
|
-
Path: '/api/v1/
|
|
22
|
+
Path: '/api/v1/flows/pre-built/deploy';
|
|
23
23
|
Body: {
|
|
24
24
|
provider: string;
|
|
25
25
|
providerConfigKey: string;
|
|
@@ -33,3 +33,61 @@ export type PostPreBuiltDeploy = Endpoint<{
|
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
}>;
|
|
36
|
+
export type PatchFlowEnable = Endpoint<{
|
|
37
|
+
Method: 'PATCH';
|
|
38
|
+
Path: '/api/v1/flows/:id/enable';
|
|
39
|
+
Params: {
|
|
40
|
+
id: number;
|
|
41
|
+
};
|
|
42
|
+
Body: {
|
|
43
|
+
provider: string;
|
|
44
|
+
providerConfigKey: string;
|
|
45
|
+
scriptName: string;
|
|
46
|
+
type: ScriptTypeLiteral;
|
|
47
|
+
};
|
|
48
|
+
Error: ApiError<'unknown_provider'> | ApiError<'resource_capped'> | ApiError<'unknown_sync_config'>;
|
|
49
|
+
Success: {
|
|
50
|
+
data: {
|
|
51
|
+
success: boolean;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
}>;
|
|
55
|
+
export type PatchFlowDisable = Endpoint<{
|
|
56
|
+
Method: 'PATCH';
|
|
57
|
+
Path: '/api/v1/flows/:id/disable';
|
|
58
|
+
Params: {
|
|
59
|
+
id: number;
|
|
60
|
+
};
|
|
61
|
+
Body: {
|
|
62
|
+
provider: string;
|
|
63
|
+
providerConfigKey: string;
|
|
64
|
+
scriptName: string;
|
|
65
|
+
type: ScriptTypeLiteral;
|
|
66
|
+
};
|
|
67
|
+
Error: ApiError<'unknown_provider'>;
|
|
68
|
+
Success: {
|
|
69
|
+
data: {
|
|
70
|
+
success: boolean;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}>;
|
|
74
|
+
export type PatchFlowFrequency = Endpoint<{
|
|
75
|
+
Method: 'PATCH';
|
|
76
|
+
Path: '/api/v1/flows/:id/frequency';
|
|
77
|
+
Params: {
|
|
78
|
+
id: number;
|
|
79
|
+
};
|
|
80
|
+
Body: {
|
|
81
|
+
provider: string;
|
|
82
|
+
providerConfigKey: string;
|
|
83
|
+
scriptName: string;
|
|
84
|
+
type: ScriptTypeLiteral;
|
|
85
|
+
frequency: string;
|
|
86
|
+
};
|
|
87
|
+
Error: ApiError<'unknown_provider'> | ApiError<'unknown_sync_config'> | ApiError<'failed_to_update_frequency'>;
|
|
88
|
+
Success: {
|
|
89
|
+
data: {
|
|
90
|
+
success: boolean;
|
|
91
|
+
};
|
|
92
|
+
};
|
|
93
|
+
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export type * from './connection/db.js';
|
|
|
14
14
|
export type * from './meta/api.js';
|
|
15
15
|
export type * from './invitations/api.js';
|
|
16
16
|
export type * from './invitations/db.js';
|
|
17
|
+
export type * from './syncConfigs/db.js';
|
|
18
|
+
export type * from './syncConfigs/api.js';
|
|
17
19
|
export type * from './team/api.js';
|
|
18
20
|
export type * from './team/db.js';
|
|
19
21
|
export type * from './proxy/api.js';
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Merge } from 'type-fest';
|
|
2
|
+
import type { ApiTimestamps, Endpoint } from '../api';
|
|
3
|
+
import type { IntegrationConfig } from './db';
|
|
4
|
+
import type { Template } from './template';
|
|
5
|
+
import type { AuthModeType } from '../auth/api';
|
|
6
|
+
import type { NangoModel, NangoSyncEndpoint, ScriptTypeLiteral } from '../nangoYaml';
|
|
7
|
+
import type { LegacySyncModelSchema, NangoConfigMetadata } from '../deploy/incomingFlow';
|
|
8
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
9
|
+
import type { SyncType } from '../scripts/syncs/api';
|
|
2
10
|
export type GetListIntegrations = Endpoint<{
|
|
3
11
|
Method: 'GET';
|
|
4
12
|
Path: '/config';
|
|
@@ -19,9 +27,70 @@ export type DeleteIntegrationPublic = Endpoint<{
|
|
|
19
27
|
success: true;
|
|
20
28
|
};
|
|
21
29
|
}>;
|
|
30
|
+
export type PostIntegration = Endpoint<{
|
|
31
|
+
Method: 'POST';
|
|
32
|
+
Path: '/api/v1/integrations';
|
|
33
|
+
Body: {
|
|
34
|
+
provider: string;
|
|
35
|
+
};
|
|
36
|
+
Success: {
|
|
37
|
+
data: ApiIntegration;
|
|
38
|
+
};
|
|
39
|
+
}>;
|
|
40
|
+
export type ApiIntegration = Merge<IntegrationConfig, ApiTimestamps>;
|
|
41
|
+
export type GetIntegration = Endpoint<{
|
|
42
|
+
Method: 'GET';
|
|
43
|
+
Path: '/api/v1/integrations/:providerConfigKey';
|
|
44
|
+
Params: {
|
|
45
|
+
providerConfigKey: string;
|
|
46
|
+
};
|
|
47
|
+
Success: {
|
|
48
|
+
data: {
|
|
49
|
+
integration: ApiIntegration;
|
|
50
|
+
template: Template;
|
|
51
|
+
meta: {
|
|
52
|
+
connectionsCount: number;
|
|
53
|
+
webhookUrl: string | null;
|
|
54
|
+
webhookSecret: string | null;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
}>;
|
|
59
|
+
export type PatchIntegration = Endpoint<{
|
|
60
|
+
Method: 'PATCH';
|
|
61
|
+
Path: '/api/v1/integrations/:providerConfigKey';
|
|
62
|
+
Params: {
|
|
63
|
+
providerConfigKey: string;
|
|
64
|
+
};
|
|
65
|
+
Body: {
|
|
66
|
+
integrationId?: string | undefined;
|
|
67
|
+
} | {
|
|
68
|
+
authType: Extract<AuthModeType, 'OAUTH1' | 'OAUTH2' | 'TBA'>;
|
|
69
|
+
clientId: string;
|
|
70
|
+
clientSecret: string;
|
|
71
|
+
scopes?: string | undefined;
|
|
72
|
+
} | {
|
|
73
|
+
authType: Extract<AuthModeType, 'APP'>;
|
|
74
|
+
appId: string;
|
|
75
|
+
appLink: string;
|
|
76
|
+
privateKey: string;
|
|
77
|
+
} | {
|
|
78
|
+
authType: Extract<AuthModeType, 'CUSTOM'>;
|
|
79
|
+
clientId: string;
|
|
80
|
+
clientSecret: string;
|
|
81
|
+
appId: string;
|
|
82
|
+
appLink: string;
|
|
83
|
+
privateKey: string;
|
|
84
|
+
};
|
|
85
|
+
Success: {
|
|
86
|
+
data: {
|
|
87
|
+
success: boolean;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
}>;
|
|
22
91
|
export type DeleteIntegration = Endpoint<{
|
|
23
92
|
Method: 'DELETE';
|
|
24
|
-
Path: '/api/v1/
|
|
93
|
+
Path: '/api/v1/integrations/:providerConfigKey';
|
|
25
94
|
Params: {
|
|
26
95
|
providerConfigKey: string;
|
|
27
96
|
};
|
|
@@ -31,3 +100,41 @@ export type DeleteIntegration = Endpoint<{
|
|
|
31
100
|
};
|
|
32
101
|
};
|
|
33
102
|
}>;
|
|
103
|
+
export interface NangoSyncConfig {
|
|
104
|
+
name: string;
|
|
105
|
+
type?: ScriptTypeLiteral;
|
|
106
|
+
runs: string;
|
|
107
|
+
auto_start?: boolean;
|
|
108
|
+
attributes?: object;
|
|
109
|
+
description?: string;
|
|
110
|
+
scopes?: string[];
|
|
111
|
+
metadata?: NangoConfigMetadata;
|
|
112
|
+
track_deletes?: boolean;
|
|
113
|
+
returns: string[] | string;
|
|
114
|
+
models: any[];
|
|
115
|
+
endpoints: NangoSyncEndpoint[];
|
|
116
|
+
is_public?: boolean | null;
|
|
117
|
+
pre_built?: boolean | null;
|
|
118
|
+
version?: string | null;
|
|
119
|
+
last_deployed?: string | null;
|
|
120
|
+
id?: number;
|
|
121
|
+
input?: NangoModel | LegacySyncModelSchema;
|
|
122
|
+
sync_type?: SyncType;
|
|
123
|
+
nango_yaml_version?: string;
|
|
124
|
+
webhookSubscriptions?: string[];
|
|
125
|
+
enabled?: boolean;
|
|
126
|
+
json_schema: JSONSchema7 | null;
|
|
127
|
+
upgrade_version?: string;
|
|
128
|
+
}
|
|
129
|
+
export type GetIntegrationFlows = Endpoint<{
|
|
130
|
+
Method: 'GET';
|
|
131
|
+
Path: '/api/v1/integrations/:providerConfigKey/flows';
|
|
132
|
+
Params: {
|
|
133
|
+
providerConfigKey: string;
|
|
134
|
+
};
|
|
135
|
+
Success: {
|
|
136
|
+
data: {
|
|
137
|
+
flows: NangoSyncConfig[];
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
}>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
2
|
+
import type { TimestampsAndDeleted } from '../db';
|
|
3
|
+
import type { LegacySyncModelSchema, NangoConfigMetadata } from '../deploy/incomingFlow';
|
|
4
|
+
import type { NangoModel, ScriptTypeLiteral, SyncTypeLiteral } from '../nangoYaml';
|
|
5
|
+
export interface DBSyncConfig extends TimestampsAndDeleted {
|
|
6
|
+
id: number;
|
|
7
|
+
sync_name: string;
|
|
8
|
+
nango_config_id: number;
|
|
9
|
+
file_location: string;
|
|
10
|
+
version: string;
|
|
11
|
+
models: string[] | null;
|
|
12
|
+
active: boolean;
|
|
13
|
+
runs: string | null;
|
|
14
|
+
model_schema: LegacySyncModelSchema[] | NangoModel[] | null;
|
|
15
|
+
environment_id: number;
|
|
16
|
+
track_deletes: boolean;
|
|
17
|
+
type: ScriptTypeLiteral;
|
|
18
|
+
auto_start: boolean;
|
|
19
|
+
attributes: object;
|
|
20
|
+
pre_built: boolean;
|
|
21
|
+
is_public: boolean;
|
|
22
|
+
metadata: NangoConfigMetadata;
|
|
23
|
+
input: string | undefined;
|
|
24
|
+
sync_type: SyncTypeLiteral | undefined;
|
|
25
|
+
webhook_subscriptions: string[] | null;
|
|
26
|
+
enabled: boolean;
|
|
27
|
+
models_json_schema: JSONSchema7 | null;
|
|
28
|
+
}
|