@nangohq/types 0.71.2 → 0.71.4
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/account/api.d.ts +100 -19
- package/dist/action/api.d.ts +21 -5
- package/dist/admin/http.api.d.ts +8 -2
- package/dist/api-keys/auth.d.ts +38 -0
- package/dist/api-keys/scopes.d.ts +3 -1
- package/dist/api.d.ts +7 -0
- package/dist/api.endpoints.d.ts +7 -6
- package/dist/audit-trail/api.d.ts +41 -0
- package/dist/audit-trail/event.d.ts +56 -0
- package/dist/auth/api.d.ts +2 -10
- package/dist/auth/http.api.d.ts +50 -26
- package/dist/authz/types.d.ts +1 -1
- package/dist/billing/http.api.d.ts +6 -2
- package/dist/cli/api.d.ts +6 -2
- package/dist/clientMetadata/http.api.d.ts +6 -2
- package/dist/connect/api.d.ts +36 -7
- package/dist/connectUISettings/api.d.ts +11 -3
- package/dist/connection/api/get.d.ts +39 -12
- package/dist/connection/api/metadata.d.ts +8 -4
- package/dist/db.d.ts +5 -0
- package/dist/deploy/api.d.ts +14 -4
- package/dist/environment/api/index.d.ts +34 -11
- package/dist/environment/api/otlp.d.ts +6 -2
- package/dist/environment/api/webhook.d.ts +4 -2
- package/dist/environment/variable/api.d.ts +4 -2
- package/dist/flow/http.api.d.ts +17 -7
- package/dist/function/config.d.ts +65 -0
- package/dist/function/db.d.ts +39 -0
- package/dist/functions/api.d.ts +141 -17
- package/dist/gettingStarted/api.d.ts +11 -3
- package/dist/index.d.ts +7 -3
- package/dist/integration/api.d.ts +52 -15
- package/dist/invitations/api.d.ts +15 -6
- package/dist/logs/api.d.ts +26 -6
- package/dist/mcp/api.d.ts +21 -5
- package/dist/meta/api.d.ts +7 -2
- package/dist/mfa/api.d.ts +35 -6
- package/dist/plain/api.d.ts +6 -2
- package/dist/plans/http.api.d.ts +33 -9
- package/dist/providers/api.d.ts +21 -5
- package/dist/providers/provider.d.ts +4 -7
- package/dist/proxy/http.api.d.ts +6 -2
- package/dist/pubsub/events.d.ts +3 -1
- package/dist/record/api.d.ts +21 -5
- package/dist/scripts/http.api.d.ts +6 -2
- package/dist/stripe/http.api.d.ts +16 -5
- package/dist/sync/api.d.ts +22 -8
- package/dist/team/api.d.ts +18 -6
- package/dist/user/api.d.ts +11 -4
- package/dist/user/db.d.ts +2 -0
- package/dist/webhooks/http.api.d.ts +6 -2
- package/package.json +1 -1
- package/dist/functions/capabilities.d.ts +0 -7
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { ApiEndpoint } from '../../api.js';
|
|
2
|
+
import type { AuditPolicy } from '../../audit-trail/event.js';
|
|
3
|
+
export type PatchWebhook = ApiEndpoint<{
|
|
4
|
+
Audit: AuditPolicy<'environment', 'webhook_urls_changed', 'environment'>;
|
|
3
5
|
Method: 'PATCH';
|
|
4
6
|
Querystring: {
|
|
5
7
|
env: string;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint } from '../../api.js';
|
|
2
|
+
import type { AuditPolicy } from '../../audit-trail/event.js';
|
|
2
3
|
import type { DBEnvironmentVariable } from '../db.js';
|
|
3
4
|
export type ApiEnvironmentVariable = Pick<DBEnvironmentVariable, 'name' | 'value'>;
|
|
4
|
-
export type PostEnvironmentVariables =
|
|
5
|
+
export type PostEnvironmentVariables = ApiEndpoint<{
|
|
6
|
+
Audit: AuditPolicy<'environment', 'variables_changed', 'environment'>;
|
|
5
7
|
Method: 'POST';
|
|
6
8
|
Path: '/api/v1/environments/variables';
|
|
7
9
|
Querystring: {
|
package/dist/flow/http.api.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
|
+
import type { AuditPolicy } from '../audit-trail/event.js';
|
|
2
3
|
import type { ScriptTypeLiteral } from '../nangoYaml/index.js';
|
|
3
|
-
export type PutUpgradePreBuiltFlow =
|
|
4
|
+
export type PutUpgradePreBuiltFlow = ApiEndpoint<{
|
|
5
|
+
Audit: AuditPolicy<'function', 'upgraded', 'environment'>;
|
|
4
6
|
Method: 'PUT';
|
|
5
7
|
Path: '/api/v1/flows/pre-built/upgrade';
|
|
6
8
|
Querystring: {
|
|
@@ -20,7 +22,8 @@ export type PutUpgradePreBuiltFlow = Endpoint<{
|
|
|
20
22
|
success: true;
|
|
21
23
|
};
|
|
22
24
|
}>;
|
|
23
|
-
export type PostPreBuiltDeploy =
|
|
25
|
+
export type PostPreBuiltDeploy = ApiEndpoint<{
|
|
26
|
+
Audit: AuditPolicy<'function', 'deployed', 'environment'>;
|
|
24
27
|
Method: 'POST';
|
|
25
28
|
Path: '/api/v1/flows/pre-built/deploy';
|
|
26
29
|
Querystring: {
|
|
@@ -38,7 +41,8 @@ export type PostPreBuiltDeploy = Endpoint<{
|
|
|
38
41
|
};
|
|
39
42
|
};
|
|
40
43
|
}>;
|
|
41
|
-
export type PatchFlowEnable =
|
|
44
|
+
export type PatchFlowEnable = ApiEndpoint<{
|
|
45
|
+
Audit: AuditPolicy<'sync', 'enabled', 'environment'>;
|
|
42
46
|
Method: 'PATCH';
|
|
43
47
|
Path: '/api/v1/flows/:id/enable';
|
|
44
48
|
Querystring: {
|
|
@@ -60,7 +64,8 @@ export type PatchFlowEnable = Endpoint<{
|
|
|
60
64
|
};
|
|
61
65
|
};
|
|
62
66
|
}>;
|
|
63
|
-
export type PatchFlowDisable =
|
|
67
|
+
export type PatchFlowDisable = ApiEndpoint<{
|
|
68
|
+
Audit: AuditPolicy<'sync', 'disabled', 'environment'>;
|
|
64
69
|
Method: 'PATCH';
|
|
65
70
|
Path: '/api/v1/flows/:id/disable';
|
|
66
71
|
Querystring: {
|
|
@@ -82,7 +87,8 @@ export type PatchFlowDisable = Endpoint<{
|
|
|
82
87
|
};
|
|
83
88
|
};
|
|
84
89
|
}>;
|
|
85
|
-
export type PatchFlowFrequency =
|
|
90
|
+
export type PatchFlowFrequency = ApiEndpoint<{
|
|
91
|
+
Audit: AuditPolicy<'sync', 'frequency_changed', 'environment'>;
|
|
86
92
|
Method: 'PATCH';
|
|
87
93
|
Path: '/api/v1/flows/:id/frequency';
|
|
88
94
|
Querystring: {
|
|
@@ -105,7 +111,11 @@ export type PatchFlowFrequency = Endpoint<{
|
|
|
105
111
|
};
|
|
106
112
|
};
|
|
107
113
|
}>;
|
|
108
|
-
export type GetFlowDownload =
|
|
114
|
+
export type GetFlowDownload = ApiEndpoint<{
|
|
115
|
+
Audit: {
|
|
116
|
+
kind: 'no-audit';
|
|
117
|
+
reason: 'non-auditable';
|
|
118
|
+
};
|
|
109
119
|
Method: 'GET';
|
|
110
120
|
Path: '/api/v1/flows/:id/download';
|
|
111
121
|
Querystring: {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { OnEventType } from '../scripts/on-events/api.js';
|
|
2
|
+
export interface FunctionCapabilities {
|
|
3
|
+
usesRecords: boolean;
|
|
4
|
+
usesOutbound: boolean;
|
|
5
|
+
usesCheckpoints: boolean;
|
|
6
|
+
usesMetadata: boolean;
|
|
7
|
+
usesInvoke: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Declares where the debounce/coalescing key is extracted from:
|
|
11
|
+
* - `{ body: '$.portalId' }`: dot notation path into the body
|
|
12
|
+
* - `{ header: 'x-goog-resource-id' }`: flat, case-insensitive header lookup
|
|
13
|
+
*/
|
|
14
|
+
export type DebounceKeySource = {
|
|
15
|
+
body: string;
|
|
16
|
+
} | {
|
|
17
|
+
header: string;
|
|
18
|
+
};
|
|
19
|
+
/** Coalesces a burst of inbound HTTP requests into a single function run within a sliding window. */
|
|
20
|
+
export interface DebounceOptions {
|
|
21
|
+
/** Events sharing the same resolved key coalesce together. */
|
|
22
|
+
keyBy?: DebounceKeySource | DebounceKeySource[] | undefined;
|
|
23
|
+
/** Sliding window in milliseconds. */
|
|
24
|
+
windowMs: number;
|
|
25
|
+
/** When exceeded, the window stops sliding. */
|
|
26
|
+
maxEntities?: number | undefined;
|
|
27
|
+
/** Which payloads from the coalesced window the handler receives. */
|
|
28
|
+
take?: 'latest' | 'first' | 'all' | undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Declares how a function is initiated from outside; `kind` discriminates the source.
|
|
32
|
+
* - `none`: no external trigger; the function is invoke-only
|
|
33
|
+
* - `schedule`: a periodic schedule
|
|
34
|
+
* - `http`: an incoming HTTP call or webhook request
|
|
35
|
+
* - `event`: an internal Nango lifecycle event
|
|
36
|
+
*/
|
|
37
|
+
export type FunctionTriggerDefinition = {
|
|
38
|
+
kind: 'none';
|
|
39
|
+
} | {
|
|
40
|
+
kind: 'schedule';
|
|
41
|
+
frequency: string;
|
|
42
|
+
autoStart?: boolean | undefined;
|
|
43
|
+
} | {
|
|
44
|
+
kind: 'http';
|
|
45
|
+
subscriptions?: string[] | undefined;
|
|
46
|
+
debounce?: DebounceOptions | undefined;
|
|
47
|
+
} | {
|
|
48
|
+
kind: 'event';
|
|
49
|
+
events: OnEventType[];
|
|
50
|
+
};
|
|
51
|
+
export type FunctionConcurrencyLimit = 1 | 'max';
|
|
52
|
+
export interface FunctionLimits {
|
|
53
|
+
concurrency?: {
|
|
54
|
+
perConnection: FunctionConcurrencyLimit;
|
|
55
|
+
} | undefined;
|
|
56
|
+
}
|
|
57
|
+
export type FunctionRequires = {
|
|
58
|
+
connection?: true | undefined;
|
|
59
|
+
outbound?: boolean | undefined;
|
|
60
|
+
invoke?: boolean | undefined;
|
|
61
|
+
} | {
|
|
62
|
+
connection: false;
|
|
63
|
+
outbound?: false | undefined;
|
|
64
|
+
invoke?: boolean | undefined;
|
|
65
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { TimestampsAndDeletedAt } from '../db.js';
|
|
2
|
+
import type { FunctionSource } from '../syncConfigs/db.js';
|
|
3
|
+
import type { FunctionCapabilities, FunctionLimits, FunctionRequires, FunctionTriggerDefinition } from './config.js';
|
|
4
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
5
|
+
export interface DBFunctionConfig extends TimestampsAndDeletedAt {
|
|
6
|
+
id: number;
|
|
7
|
+
nango_config_id: number;
|
|
8
|
+
environment_id: number;
|
|
9
|
+
name: string;
|
|
10
|
+
current_version_id: number | null;
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface DBFunctionConfigVersion extends TimestampsAndDeletedAt {
|
|
14
|
+
id: number;
|
|
15
|
+
function_config_id: number;
|
|
16
|
+
description: string;
|
|
17
|
+
file_location: string;
|
|
18
|
+
version: string;
|
|
19
|
+
source: FunctionSource;
|
|
20
|
+
trigger: FunctionTriggerDefinition;
|
|
21
|
+
requires: FunctionRequires;
|
|
22
|
+
capabilities: FunctionCapabilities;
|
|
23
|
+
limits: FunctionLimits;
|
|
24
|
+
input_schema_ref: string | null;
|
|
25
|
+
output_schema_ref: string | null;
|
|
26
|
+
model_schema_refs: string[];
|
|
27
|
+
metadata_schema_ref: string | null;
|
|
28
|
+
checkpoint_schema_ref: string | null;
|
|
29
|
+
json_schema: JSONSchema7;
|
|
30
|
+
}
|
|
31
|
+
export interface DBFunctionInstance extends TimestampsAndDeletedAt {
|
|
32
|
+
id: number;
|
|
33
|
+
nango_connection_id: number;
|
|
34
|
+
function_config_id: number;
|
|
35
|
+
name: string;
|
|
36
|
+
variant: string;
|
|
37
|
+
last_run_at: Date | null;
|
|
38
|
+
frequency: string | null;
|
|
39
|
+
}
|
package/dist/functions/api.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
|
+
import type { AuditPolicy } from '../audit-trail/event.js';
|
|
3
|
+
import type { FunctionCapabilities, FunctionLimits, FunctionRequires, FunctionTriggerDefinition } from '../function/config.js';
|
|
2
4
|
import type { DeployedNangoFunction, FunctionType, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
|
|
5
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
3
6
|
export type RunnableFunctionType = Extract<FunctionType, 'action' | 'sync'>;
|
|
4
7
|
export type FunctionErrorCode = 'invalid_request' | 'server_error' | 'integration_not_found' | 'compilation_error' | 'dryrun_error' | 'deployment_error' | 'connection_not_found' | 'dryrun_not_found' | 'deployment_not_found' | 'function_disabled' | 'execution_environment_unavailable' | 'timeout' | 'validation_error';
|
|
5
8
|
export interface ProxyCall {
|
|
@@ -130,21 +133,33 @@ export type FunctionDeploymentResultBody = {
|
|
|
130
133
|
payload?: unknown;
|
|
131
134
|
};
|
|
132
135
|
};
|
|
133
|
-
export type PostFunctionCompile =
|
|
136
|
+
export type PostFunctionCompile = ApiEndpoint<{
|
|
137
|
+
Audit: {
|
|
138
|
+
kind: 'no-audit';
|
|
139
|
+
reason: 'TODO: audit coverage pending';
|
|
140
|
+
};
|
|
134
141
|
Method: 'POST';
|
|
135
142
|
Path: '/functions/compile';
|
|
136
143
|
Body: FunctionCompileBody;
|
|
137
144
|
Error: ApiError<FunctionErrorCode>;
|
|
138
145
|
Success: FunctionCompileSuccess;
|
|
139
146
|
}>;
|
|
140
|
-
export type PostFunctionDryrun =
|
|
147
|
+
export type PostFunctionDryrun = ApiEndpoint<{
|
|
148
|
+
Audit: {
|
|
149
|
+
kind: 'no-audit';
|
|
150
|
+
reason: 'TODO: audit coverage pending';
|
|
151
|
+
};
|
|
141
152
|
Method: 'POST';
|
|
142
153
|
Path: '/functions/dryruns';
|
|
143
154
|
Body: FunctionDryrunBody;
|
|
144
155
|
Error: ApiError<FunctionErrorCode>;
|
|
145
156
|
Success: FunctionDryrunCreateSuccess;
|
|
146
157
|
}>;
|
|
147
|
-
export type GetFunctionDryrun =
|
|
158
|
+
export type GetFunctionDryrun = ApiEndpoint<{
|
|
159
|
+
Audit: {
|
|
160
|
+
kind: 'no-audit';
|
|
161
|
+
reason: 'non-auditable';
|
|
162
|
+
};
|
|
148
163
|
Method: 'GET';
|
|
149
164
|
Path: '/functions/dryruns/:id';
|
|
150
165
|
Params: {
|
|
@@ -153,7 +168,11 @@ export type GetFunctionDryrun = Endpoint<{
|
|
|
153
168
|
Error: ApiError<FunctionErrorCode>;
|
|
154
169
|
Success: FunctionDryrunResultSuccess;
|
|
155
170
|
}>;
|
|
156
|
-
export type PostFunctionDryrunResult =
|
|
171
|
+
export type PostFunctionDryrunResult = ApiEndpoint<{
|
|
172
|
+
Audit: {
|
|
173
|
+
kind: 'no-audit';
|
|
174
|
+
reason: 'TODO: audit coverage pending';
|
|
175
|
+
};
|
|
157
176
|
Method: 'POST';
|
|
158
177
|
Path: '/functions/dryruns/:id/result';
|
|
159
178
|
Params: {
|
|
@@ -165,14 +184,19 @@ export type PostFunctionDryrunResult = Endpoint<{
|
|
|
165
184
|
ok: true;
|
|
166
185
|
};
|
|
167
186
|
}>;
|
|
168
|
-
export type PostFunctionDeployment =
|
|
187
|
+
export type PostFunctionDeployment = ApiEndpoint<{
|
|
188
|
+
Audit: AuditPolicy<'function', 'deployed', 'environment'>;
|
|
169
189
|
Method: 'POST';
|
|
170
190
|
Path: '/functions/deployments';
|
|
171
191
|
Body: FunctionDeploymentBody;
|
|
172
192
|
Error: ApiError<FunctionErrorCode> | ApiError<'template_not_found' | 'ambiguous_function' | 'plan_limit' | 'template_already_deployed'>;
|
|
173
193
|
Success: FunctionDeploymentCreateSuccess;
|
|
174
194
|
}>;
|
|
175
|
-
export type GetFunctionDeployment =
|
|
195
|
+
export type GetFunctionDeployment = ApiEndpoint<{
|
|
196
|
+
Audit: {
|
|
197
|
+
kind: 'no-audit';
|
|
198
|
+
reason: 'non-auditable';
|
|
199
|
+
};
|
|
176
200
|
Method: 'GET';
|
|
177
201
|
Path: '/functions/deployments/:id';
|
|
178
202
|
Params: {
|
|
@@ -181,7 +205,11 @@ export type GetFunctionDeployment = Endpoint<{
|
|
|
181
205
|
Error: ApiError<FunctionErrorCode>;
|
|
182
206
|
Success: FunctionDeploymentResultSuccess;
|
|
183
207
|
}>;
|
|
184
|
-
export type PostFunctionDeploymentResult =
|
|
208
|
+
export type PostFunctionDeploymentResult = ApiEndpoint<{
|
|
209
|
+
Audit: {
|
|
210
|
+
kind: 'no-audit';
|
|
211
|
+
reason: 'TODO: audit coverage pending';
|
|
212
|
+
};
|
|
185
213
|
Method: 'POST';
|
|
186
214
|
Path: '/functions/deployments/:id/result';
|
|
187
215
|
Params: {
|
|
@@ -218,7 +246,11 @@ export interface FunctionDeletionSuccess {
|
|
|
218
246
|
export interface ProviderTemplatesSuccess {
|
|
219
247
|
data: (NangoSyncFunction | NangoActionFunction)[];
|
|
220
248
|
}
|
|
221
|
-
export type GetIntegrationFunctions =
|
|
249
|
+
export type GetIntegrationFunctions = ApiEndpoint<{
|
|
250
|
+
Audit: {
|
|
251
|
+
kind: 'no-audit';
|
|
252
|
+
reason: 'non-auditable';
|
|
253
|
+
};
|
|
222
254
|
Method: 'GET';
|
|
223
255
|
Path: '/api/v1/integrations/:providerConfigKey/functions';
|
|
224
256
|
Querystring: {
|
|
@@ -229,7 +261,11 @@ export type GetIntegrationFunctions = Endpoint<{
|
|
|
229
261
|
};
|
|
230
262
|
Success: FunctionListSuccess;
|
|
231
263
|
}>;
|
|
232
|
-
export type GetIntegrationFunction =
|
|
264
|
+
export type GetIntegrationFunction = ApiEndpoint<{
|
|
265
|
+
Audit: {
|
|
266
|
+
kind: 'no-audit';
|
|
267
|
+
reason: 'non-auditable';
|
|
268
|
+
};
|
|
233
269
|
Method: 'GET';
|
|
234
270
|
Path: '/api/v1/integrations/:providerConfigKey/functions/:functionName';
|
|
235
271
|
Querystring: {
|
|
@@ -242,7 +278,8 @@ export type GetIntegrationFunction = Endpoint<{
|
|
|
242
278
|
};
|
|
243
279
|
Success: DeployedFunctionSuccess;
|
|
244
280
|
}>;
|
|
245
|
-
export type DeleteIntegrationFunction =
|
|
281
|
+
export type DeleteIntegrationFunction = ApiEndpoint<{
|
|
282
|
+
Audit: AuditPolicy<'function', 'deleted', 'environment'>;
|
|
246
283
|
Method: 'DELETE';
|
|
247
284
|
Path: '/api/v1/integrations/:providerConfigKey/functions/:functionName';
|
|
248
285
|
/** TODO: support deleting on-event functions */
|
|
@@ -257,7 +294,11 @@ export type DeleteIntegrationFunction = Endpoint<{
|
|
|
257
294
|
Error: ApiError<'function_managed_by_deploy'>;
|
|
258
295
|
Success: FunctionDeletionSuccess;
|
|
259
296
|
}>;
|
|
260
|
-
export type GetProviderTemplates =
|
|
297
|
+
export type GetProviderTemplates = ApiEndpoint<{
|
|
298
|
+
Audit: {
|
|
299
|
+
kind: 'no-audit';
|
|
300
|
+
reason: 'non-auditable';
|
|
301
|
+
};
|
|
261
302
|
Method: 'GET';
|
|
262
303
|
Path: '/api/v1/providers/:providerConfigKey/templates';
|
|
263
304
|
Querystring: {
|
|
@@ -268,7 +309,11 @@ export type GetProviderTemplates = Endpoint<{
|
|
|
268
309
|
};
|
|
269
310
|
Success: ProviderTemplatesSuccess;
|
|
270
311
|
}>;
|
|
271
|
-
export type GetPublicIntegrationFunctions =
|
|
312
|
+
export type GetPublicIntegrationFunctions = ApiEndpoint<{
|
|
313
|
+
Audit: {
|
|
314
|
+
kind: 'no-audit';
|
|
315
|
+
reason: 'non-auditable';
|
|
316
|
+
};
|
|
272
317
|
Method: 'GET';
|
|
273
318
|
Path: '/integrations/:uniqueKey/functions';
|
|
274
319
|
Querystring: FunctionListFilters;
|
|
@@ -277,7 +322,11 @@ export type GetPublicIntegrationFunctions = Endpoint<{
|
|
|
277
322
|
};
|
|
278
323
|
Success: FunctionListSuccess;
|
|
279
324
|
}>;
|
|
280
|
-
export type GetPublicIntegrationFunction =
|
|
325
|
+
export type GetPublicIntegrationFunction = ApiEndpoint<{
|
|
326
|
+
Audit: {
|
|
327
|
+
kind: 'no-audit';
|
|
328
|
+
reason: 'non-auditable';
|
|
329
|
+
};
|
|
281
330
|
Method: 'GET';
|
|
282
331
|
Path: '/integrations/:uniqueKey/functions/:name';
|
|
283
332
|
Querystring: {
|
|
@@ -289,7 +338,8 @@ export type GetPublicIntegrationFunction = Endpoint<{
|
|
|
289
338
|
};
|
|
290
339
|
Success: DeployedFunctionSuccess;
|
|
291
340
|
}>;
|
|
292
|
-
export type DeletePublicIntegrationFunction =
|
|
341
|
+
export type DeletePublicIntegrationFunction = ApiEndpoint<{
|
|
342
|
+
Audit: AuditPolicy<'function', 'deleted', 'environment'>;
|
|
293
343
|
Method: 'DELETE';
|
|
294
344
|
Path: '/integrations/:uniqueKey/functions/:name';
|
|
295
345
|
/** TODO: support deleting on-event functions */
|
|
@@ -303,7 +353,11 @@ export type DeletePublicIntegrationFunction = Endpoint<{
|
|
|
303
353
|
Error: ApiError<'function_managed_by_deploy'>;
|
|
304
354
|
Success: FunctionDeletionSuccess;
|
|
305
355
|
}>;
|
|
306
|
-
export type GetPublicProviderTemplates =
|
|
356
|
+
export type GetPublicProviderTemplates = ApiEndpoint<{
|
|
357
|
+
Audit: {
|
|
358
|
+
kind: 'no-audit';
|
|
359
|
+
reason: 'non-auditable';
|
|
360
|
+
};
|
|
307
361
|
Method: 'GET';
|
|
308
362
|
Path: '/providers/:provider/templates';
|
|
309
363
|
Params: {
|
|
@@ -311,7 +365,11 @@ export type GetPublicProviderTemplates = Endpoint<{
|
|
|
311
365
|
};
|
|
312
366
|
Success: ProviderTemplatesSuccess;
|
|
313
367
|
}>;
|
|
314
|
-
export type GetIntegrationTemplates =
|
|
368
|
+
export type GetIntegrationTemplates = ApiEndpoint<{
|
|
369
|
+
Audit: {
|
|
370
|
+
kind: 'no-audit';
|
|
371
|
+
reason: 'non-auditable';
|
|
372
|
+
};
|
|
315
373
|
Method: 'GET';
|
|
316
374
|
Path: '/api/v1/integrations/:providerConfigKey/templates';
|
|
317
375
|
Querystring: {
|
|
@@ -324,3 +382,69 @@ export type GetIntegrationTemplates = Endpoint<{
|
|
|
324
382
|
data: NangoFunctionTemplate[];
|
|
325
383
|
};
|
|
326
384
|
}>;
|
|
385
|
+
export interface FunctionDeploymentArtifact {
|
|
386
|
+
name: string;
|
|
387
|
+
integrationId: string;
|
|
388
|
+
description: string;
|
|
389
|
+
trigger: FunctionTriggerDefinition;
|
|
390
|
+
requires: FunctionRequires;
|
|
391
|
+
capabilities: FunctionCapabilities;
|
|
392
|
+
limits: FunctionLimits;
|
|
393
|
+
input_schema_ref: string | null;
|
|
394
|
+
output_schema_ref: string | null;
|
|
395
|
+
model_schema_refs: string[];
|
|
396
|
+
metadata_schema_ref: string | null;
|
|
397
|
+
checkpoint_schema_ref: string | null;
|
|
398
|
+
json_schema: JSONSchema7;
|
|
399
|
+
fileBody: {
|
|
400
|
+
js: string;
|
|
401
|
+
ts: string;
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
export type FunctionReconciliationScope = {
|
|
405
|
+
kind: 'environment';
|
|
406
|
+
} | {
|
|
407
|
+
kind: 'integration';
|
|
408
|
+
integrationId: string;
|
|
409
|
+
};
|
|
410
|
+
export interface FunctionDeploymentBundleBody {
|
|
411
|
+
reconciliationScope: FunctionReconciliationScope;
|
|
412
|
+
functions: FunctionDeploymentArtifact[];
|
|
413
|
+
}
|
|
414
|
+
export interface FunctionDeploymentBundleSuccess {
|
|
415
|
+
created: {
|
|
416
|
+
integrationId: string;
|
|
417
|
+
name: string;
|
|
418
|
+
}[];
|
|
419
|
+
updated: {
|
|
420
|
+
integrationId: string;
|
|
421
|
+
name: string;
|
|
422
|
+
}[];
|
|
423
|
+
unchanged: {
|
|
424
|
+
integrationId: string;
|
|
425
|
+
name: string;
|
|
426
|
+
}[];
|
|
427
|
+
deleted: {
|
|
428
|
+
integrationId: string;
|
|
429
|
+
name: string;
|
|
430
|
+
}[];
|
|
431
|
+
}
|
|
432
|
+
export type PostFunctionDeploymentBundlePreview = ApiEndpoint<{
|
|
433
|
+
Audit: {
|
|
434
|
+
kind: 'no-audit';
|
|
435
|
+
reason: 'non-auditable';
|
|
436
|
+
};
|
|
437
|
+
Method: 'POST';
|
|
438
|
+
Path: '/functions/deployments/bundle/preview';
|
|
439
|
+
Body: FunctionDeploymentBundleBody;
|
|
440
|
+
Error: ApiError<'functions_deployment_error' | 'integration_not_found'>;
|
|
441
|
+
Success: FunctionDeploymentBundleSuccess;
|
|
442
|
+
}>;
|
|
443
|
+
export type PostFunctionDeploymentBundle = ApiEndpoint<{
|
|
444
|
+
Audit: AuditPolicy<'function', 'deployed', 'environment'>;
|
|
445
|
+
Method: 'POST';
|
|
446
|
+
Path: '/functions/deployments/bundle';
|
|
447
|
+
Body: FunctionDeploymentBundleBody;
|
|
448
|
+
Error: ApiError<'functions_deployment_error' | 'concurrent_deployment' | 'integration_not_found'>;
|
|
449
|
+
Success: FunctionDeploymentBundleSuccess;
|
|
450
|
+
}>;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
2
|
import type { GettingStartedOutput as GettingStartedProgressOutput, PatchGettingStartedInput as PatchGettingStartedProgressInput } from './dto.js';
|
|
3
|
-
export type GetGettingStarted =
|
|
3
|
+
export type GetGettingStarted = ApiEndpoint<{
|
|
4
|
+
Audit: {
|
|
5
|
+
kind: 'no-audit';
|
|
6
|
+
reason: 'non-auditable';
|
|
7
|
+
};
|
|
4
8
|
Method: 'GET';
|
|
5
9
|
Path: '/api/v1/getting-started';
|
|
6
10
|
Querystring: {
|
|
@@ -11,7 +15,11 @@ export type GetGettingStarted = Endpoint<{
|
|
|
11
15
|
};
|
|
12
16
|
Error: ApiError<'failed_to_get_or_create_getting_started_progress'>;
|
|
13
17
|
}>;
|
|
14
|
-
export type PatchGettingStarted =
|
|
18
|
+
export type PatchGettingStarted = ApiEndpoint<{
|
|
19
|
+
Audit: {
|
|
20
|
+
kind: 'no-audit';
|
|
21
|
+
reason: 'non-auditable';
|
|
22
|
+
};
|
|
15
23
|
Method: 'PATCH';
|
|
16
24
|
Path: '/api/v1/getting-started';
|
|
17
25
|
Querystring: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export type * from './db.js';
|
|
2
2
|
export type * from './api.js';
|
|
3
3
|
export type * from './api.endpoints.js';
|
|
4
|
+
export type * from './audit-trail/api.js';
|
|
5
|
+
export type * from './audit-trail/event.js';
|
|
4
6
|
export type * from './gettingStarted/db.js';
|
|
5
7
|
export type * from './gettingStarted/dto.js';
|
|
6
8
|
export type * from './gettingStarted/api.js';
|
|
@@ -69,8 +71,9 @@ export type * from './proxy/http.api.js';
|
|
|
69
71
|
export type * from './dbConfig/db.js';
|
|
70
72
|
export type * from './nangoYaml/index.js';
|
|
71
73
|
export type * from './environment/db.js';
|
|
72
|
-
export {
|
|
73
|
-
export type { ApiKeyScope } from './api-keys/scopes.js';
|
|
74
|
+
export { ACCOUNT_API_KEY_SCOPES, API_KEY_SCOPES } from './api-keys/scopes.js';
|
|
75
|
+
export type { AccountApiKeyScope, ApiKeyScope, CustomerKeyScope } from './api-keys/scopes.js';
|
|
76
|
+
export type * from './api-keys/auth.js';
|
|
74
77
|
export type * from './environment/api/index.js';
|
|
75
78
|
export type * from './environment/api/webhook.js';
|
|
76
79
|
export type * from './environment/api/otlp.js';
|
|
@@ -93,8 +96,9 @@ export type * from './checkpoint/db.js';
|
|
|
93
96
|
export type * from './mcp/api.js';
|
|
94
97
|
export type * from './mfa/api.js';
|
|
95
98
|
export type * from './mfa/db.js';
|
|
99
|
+
export type * from './function/config.js';
|
|
100
|
+
export type * from './function/db.js';
|
|
96
101
|
export type * from './functions/api.js';
|
|
97
|
-
export type * from './functions/capabilities.js';
|
|
98
102
|
export type * from './functions/domain.js';
|
|
99
103
|
export type * from './lambda/index.js';
|
|
100
104
|
export type * from './authz/types.js';
|