@nangohq/types 0.71.1 → 0.71.3
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 +73 -19
- package/dist/action/api.d.ts +21 -5
- package/dist/admin/http.api.d.ts +8 -2
- package/dist/api.d.ts +7 -0
- package/dist/api.endpoints.d.ts +6 -5
- package/dist/audit-trail/api.d.ts +39 -0
- package/dist/audit-trail/event.d.ts +54 -0
- package/dist/auth/api.d.ts +4 -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/billing/types.d.ts +7 -16
- 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 +43 -16
- 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/db.d.ts +40 -0
- package/dist/functions/api.d.ts +73 -17
- package/dist/functions/config.d.ts +58 -0
- package/dist/gettingStarted/api.d.ts +11 -3
- package/dist/index.d.ts +4 -0
- package/dist/integration/api.d.ts +51 -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 -3
- 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 +5 -7
- package/dist/proxy/api.d.ts +4 -1
- 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/utils.d.ts +3 -0
- package/dist/webhooks/http.api.d.ts +6 -2
- package/package.json +1 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { TimestampsAndDeletedAt } from '../db.js';
|
|
2
|
+
import type { FunctionCapabilities } from '../functions/capabilities.js';
|
|
3
|
+
import type { FunctionLimits, FunctionTriggerDefinition, Requires } from '../functions/config.js';
|
|
4
|
+
import type { FunctionSource } from '../syncConfigs/db.js';
|
|
5
|
+
import type { JSONSchema7 } from 'json-schema';
|
|
6
|
+
export interface DBFunctionConfig extends TimestampsAndDeletedAt {
|
|
7
|
+
id: number;
|
|
8
|
+
nango_config_id: number;
|
|
9
|
+
environment_id: number;
|
|
10
|
+
name: string;
|
|
11
|
+
current_version_id: number | null;
|
|
12
|
+
enabled: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface DBFunctionConfigVersion extends TimestampsAndDeletedAt {
|
|
15
|
+
id: number;
|
|
16
|
+
function_config_id: number;
|
|
17
|
+
description: string;
|
|
18
|
+
file_location: string;
|
|
19
|
+
version: string;
|
|
20
|
+
source: FunctionSource;
|
|
21
|
+
trigger: FunctionTriggerDefinition;
|
|
22
|
+
requires: Requires;
|
|
23
|
+
capabilities: FunctionCapabilities;
|
|
24
|
+
limits: FunctionLimits;
|
|
25
|
+
input_schema_ref: string | null;
|
|
26
|
+
output_schema_ref: string | null;
|
|
27
|
+
model_schema_refs: string[];
|
|
28
|
+
metadata_schema_ref: string | null;
|
|
29
|
+
checkpoint_schema_ref: string | null;
|
|
30
|
+
json_schema: JSONSchema7;
|
|
31
|
+
}
|
|
32
|
+
export interface DBFunctionInstance extends TimestampsAndDeletedAt {
|
|
33
|
+
id: number;
|
|
34
|
+
nango_connection_id: number;
|
|
35
|
+
function_config_id: number;
|
|
36
|
+
name: string;
|
|
37
|
+
variant: string;
|
|
38
|
+
last_run_at: Date | null;
|
|
39
|
+
frequency: string | null;
|
|
40
|
+
}
|
package/dist/functions/api.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
|
+
import type { AuditPolicy } from '../audit-trail/event.js';
|
|
2
3
|
import type { DeployedNangoFunction, FunctionType, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
|
|
3
4
|
export type RunnableFunctionType = Extract<FunctionType, 'action' | 'sync'>;
|
|
4
5
|
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';
|
|
@@ -130,21 +131,33 @@ export type FunctionDeploymentResultBody = {
|
|
|
130
131
|
payload?: unknown;
|
|
131
132
|
};
|
|
132
133
|
};
|
|
133
|
-
export type PostFunctionCompile =
|
|
134
|
+
export type PostFunctionCompile = ApiEndpoint<{
|
|
135
|
+
Audit: {
|
|
136
|
+
kind: 'no-audit';
|
|
137
|
+
reason: 'TODO: audit coverage pending';
|
|
138
|
+
};
|
|
134
139
|
Method: 'POST';
|
|
135
140
|
Path: '/functions/compile';
|
|
136
141
|
Body: FunctionCompileBody;
|
|
137
142
|
Error: ApiError<FunctionErrorCode>;
|
|
138
143
|
Success: FunctionCompileSuccess;
|
|
139
144
|
}>;
|
|
140
|
-
export type PostFunctionDryrun =
|
|
145
|
+
export type PostFunctionDryrun = ApiEndpoint<{
|
|
146
|
+
Audit: {
|
|
147
|
+
kind: 'no-audit';
|
|
148
|
+
reason: 'TODO: audit coverage pending';
|
|
149
|
+
};
|
|
141
150
|
Method: 'POST';
|
|
142
151
|
Path: '/functions/dryruns';
|
|
143
152
|
Body: FunctionDryrunBody;
|
|
144
153
|
Error: ApiError<FunctionErrorCode>;
|
|
145
154
|
Success: FunctionDryrunCreateSuccess;
|
|
146
155
|
}>;
|
|
147
|
-
export type GetFunctionDryrun =
|
|
156
|
+
export type GetFunctionDryrun = ApiEndpoint<{
|
|
157
|
+
Audit: {
|
|
158
|
+
kind: 'no-audit';
|
|
159
|
+
reason: 'non-auditable';
|
|
160
|
+
};
|
|
148
161
|
Method: 'GET';
|
|
149
162
|
Path: '/functions/dryruns/:id';
|
|
150
163
|
Params: {
|
|
@@ -153,7 +166,11 @@ export type GetFunctionDryrun = Endpoint<{
|
|
|
153
166
|
Error: ApiError<FunctionErrorCode>;
|
|
154
167
|
Success: FunctionDryrunResultSuccess;
|
|
155
168
|
}>;
|
|
156
|
-
export type PostFunctionDryrunResult =
|
|
169
|
+
export type PostFunctionDryrunResult = ApiEndpoint<{
|
|
170
|
+
Audit: {
|
|
171
|
+
kind: 'no-audit';
|
|
172
|
+
reason: 'TODO: audit coverage pending';
|
|
173
|
+
};
|
|
157
174
|
Method: 'POST';
|
|
158
175
|
Path: '/functions/dryruns/:id/result';
|
|
159
176
|
Params: {
|
|
@@ -165,14 +182,19 @@ export type PostFunctionDryrunResult = Endpoint<{
|
|
|
165
182
|
ok: true;
|
|
166
183
|
};
|
|
167
184
|
}>;
|
|
168
|
-
export type PostFunctionDeployment =
|
|
185
|
+
export type PostFunctionDeployment = ApiEndpoint<{
|
|
186
|
+
Audit: AuditPolicy<'function', 'deployed', 'environment'>;
|
|
169
187
|
Method: 'POST';
|
|
170
188
|
Path: '/functions/deployments';
|
|
171
189
|
Body: FunctionDeploymentBody;
|
|
172
190
|
Error: ApiError<FunctionErrorCode> | ApiError<'template_not_found' | 'ambiguous_function' | 'plan_limit' | 'template_already_deployed'>;
|
|
173
191
|
Success: FunctionDeploymentCreateSuccess;
|
|
174
192
|
}>;
|
|
175
|
-
export type GetFunctionDeployment =
|
|
193
|
+
export type GetFunctionDeployment = ApiEndpoint<{
|
|
194
|
+
Audit: {
|
|
195
|
+
kind: 'no-audit';
|
|
196
|
+
reason: 'non-auditable';
|
|
197
|
+
};
|
|
176
198
|
Method: 'GET';
|
|
177
199
|
Path: '/functions/deployments/:id';
|
|
178
200
|
Params: {
|
|
@@ -181,7 +203,11 @@ export type GetFunctionDeployment = Endpoint<{
|
|
|
181
203
|
Error: ApiError<FunctionErrorCode>;
|
|
182
204
|
Success: FunctionDeploymentResultSuccess;
|
|
183
205
|
}>;
|
|
184
|
-
export type PostFunctionDeploymentResult =
|
|
206
|
+
export type PostFunctionDeploymentResult = ApiEndpoint<{
|
|
207
|
+
Audit: {
|
|
208
|
+
kind: 'no-audit';
|
|
209
|
+
reason: 'TODO: audit coverage pending';
|
|
210
|
+
};
|
|
185
211
|
Method: 'POST';
|
|
186
212
|
Path: '/functions/deployments/:id/result';
|
|
187
213
|
Params: {
|
|
@@ -218,7 +244,11 @@ export interface FunctionDeletionSuccess {
|
|
|
218
244
|
export interface ProviderTemplatesSuccess {
|
|
219
245
|
data: (NangoSyncFunction | NangoActionFunction)[];
|
|
220
246
|
}
|
|
221
|
-
export type GetIntegrationFunctions =
|
|
247
|
+
export type GetIntegrationFunctions = ApiEndpoint<{
|
|
248
|
+
Audit: {
|
|
249
|
+
kind: 'no-audit';
|
|
250
|
+
reason: 'non-auditable';
|
|
251
|
+
};
|
|
222
252
|
Method: 'GET';
|
|
223
253
|
Path: '/api/v1/integrations/:providerConfigKey/functions';
|
|
224
254
|
Querystring: {
|
|
@@ -229,7 +259,11 @@ export type GetIntegrationFunctions = Endpoint<{
|
|
|
229
259
|
};
|
|
230
260
|
Success: FunctionListSuccess;
|
|
231
261
|
}>;
|
|
232
|
-
export type GetIntegrationFunction =
|
|
262
|
+
export type GetIntegrationFunction = ApiEndpoint<{
|
|
263
|
+
Audit: {
|
|
264
|
+
kind: 'no-audit';
|
|
265
|
+
reason: 'non-auditable';
|
|
266
|
+
};
|
|
233
267
|
Method: 'GET';
|
|
234
268
|
Path: '/api/v1/integrations/:providerConfigKey/functions/:functionName';
|
|
235
269
|
Querystring: {
|
|
@@ -242,7 +276,8 @@ export type GetIntegrationFunction = Endpoint<{
|
|
|
242
276
|
};
|
|
243
277
|
Success: DeployedFunctionSuccess;
|
|
244
278
|
}>;
|
|
245
|
-
export type DeleteIntegrationFunction =
|
|
279
|
+
export type DeleteIntegrationFunction = ApiEndpoint<{
|
|
280
|
+
Audit: AuditPolicy<'function', 'deleted', 'environment'>;
|
|
246
281
|
Method: 'DELETE';
|
|
247
282
|
Path: '/api/v1/integrations/:providerConfigKey/functions/:functionName';
|
|
248
283
|
/** TODO: support deleting on-event functions */
|
|
@@ -257,7 +292,11 @@ export type DeleteIntegrationFunction = Endpoint<{
|
|
|
257
292
|
Error: ApiError<'function_managed_by_deploy'>;
|
|
258
293
|
Success: FunctionDeletionSuccess;
|
|
259
294
|
}>;
|
|
260
|
-
export type GetProviderTemplates =
|
|
295
|
+
export type GetProviderTemplates = ApiEndpoint<{
|
|
296
|
+
Audit: {
|
|
297
|
+
kind: 'no-audit';
|
|
298
|
+
reason: 'non-auditable';
|
|
299
|
+
};
|
|
261
300
|
Method: 'GET';
|
|
262
301
|
Path: '/api/v1/providers/:providerConfigKey/templates';
|
|
263
302
|
Querystring: {
|
|
@@ -268,7 +307,11 @@ export type GetProviderTemplates = Endpoint<{
|
|
|
268
307
|
};
|
|
269
308
|
Success: ProviderTemplatesSuccess;
|
|
270
309
|
}>;
|
|
271
|
-
export type GetPublicIntegrationFunctions =
|
|
310
|
+
export type GetPublicIntegrationFunctions = ApiEndpoint<{
|
|
311
|
+
Audit: {
|
|
312
|
+
kind: 'no-audit';
|
|
313
|
+
reason: 'non-auditable';
|
|
314
|
+
};
|
|
272
315
|
Method: 'GET';
|
|
273
316
|
Path: '/integrations/:uniqueKey/functions';
|
|
274
317
|
Querystring: FunctionListFilters;
|
|
@@ -277,7 +320,11 @@ export type GetPublicIntegrationFunctions = Endpoint<{
|
|
|
277
320
|
};
|
|
278
321
|
Success: FunctionListSuccess;
|
|
279
322
|
}>;
|
|
280
|
-
export type GetPublicIntegrationFunction =
|
|
323
|
+
export type GetPublicIntegrationFunction = ApiEndpoint<{
|
|
324
|
+
Audit: {
|
|
325
|
+
kind: 'no-audit';
|
|
326
|
+
reason: 'non-auditable';
|
|
327
|
+
};
|
|
281
328
|
Method: 'GET';
|
|
282
329
|
Path: '/integrations/:uniqueKey/functions/:name';
|
|
283
330
|
Querystring: {
|
|
@@ -289,7 +336,8 @@ export type GetPublicIntegrationFunction = Endpoint<{
|
|
|
289
336
|
};
|
|
290
337
|
Success: DeployedFunctionSuccess;
|
|
291
338
|
}>;
|
|
292
|
-
export type DeletePublicIntegrationFunction =
|
|
339
|
+
export type DeletePublicIntegrationFunction = ApiEndpoint<{
|
|
340
|
+
Audit: AuditPolicy<'function', 'deleted', 'environment'>;
|
|
293
341
|
Method: 'DELETE';
|
|
294
342
|
Path: '/integrations/:uniqueKey/functions/:name';
|
|
295
343
|
/** TODO: support deleting on-event functions */
|
|
@@ -303,7 +351,11 @@ export type DeletePublicIntegrationFunction = Endpoint<{
|
|
|
303
351
|
Error: ApiError<'function_managed_by_deploy'>;
|
|
304
352
|
Success: FunctionDeletionSuccess;
|
|
305
353
|
}>;
|
|
306
|
-
export type GetPublicProviderTemplates =
|
|
354
|
+
export type GetPublicProviderTemplates = ApiEndpoint<{
|
|
355
|
+
Audit: {
|
|
356
|
+
kind: 'no-audit';
|
|
357
|
+
reason: 'non-auditable';
|
|
358
|
+
};
|
|
307
359
|
Method: 'GET';
|
|
308
360
|
Path: '/providers/:provider/templates';
|
|
309
361
|
Params: {
|
|
@@ -311,7 +363,11 @@ export type GetPublicProviderTemplates = Endpoint<{
|
|
|
311
363
|
};
|
|
312
364
|
Success: ProviderTemplatesSuccess;
|
|
313
365
|
}>;
|
|
314
|
-
export type GetIntegrationTemplates =
|
|
366
|
+
export type GetIntegrationTemplates = ApiEndpoint<{
|
|
367
|
+
Audit: {
|
|
368
|
+
kind: 'no-audit';
|
|
369
|
+
reason: 'non-auditable';
|
|
370
|
+
};
|
|
315
371
|
Method: 'GET';
|
|
316
372
|
Path: '/api/v1/integrations/:providerConfigKey/templates';
|
|
317
373
|
Querystring: {
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { OnEventType } from '../scripts/on-events/api.js';
|
|
2
|
+
/**
|
|
3
|
+
* Declares where the debounce/coalescing key is extracted from:
|
|
4
|
+
* - `{ body: '$.portalId' }`: dot notation path into the body
|
|
5
|
+
* - `{ header: 'x-goog-resource-id' }`: flat, case-insensitive header lookup
|
|
6
|
+
*/
|
|
7
|
+
export type DebounceKeySource = {
|
|
8
|
+
body: string;
|
|
9
|
+
} | {
|
|
10
|
+
header: string;
|
|
11
|
+
};
|
|
12
|
+
/** Coalesces a burst of inbound HTTP requests into a single function run within a sliding window. */
|
|
13
|
+
export interface DebounceOptions {
|
|
14
|
+
/** Events sharing the same resolved key coalesce together. */
|
|
15
|
+
keyBy?: DebounceKeySource | DebounceKeySource[];
|
|
16
|
+
/** Sliding window in milliseconds. */
|
|
17
|
+
windowMs: number;
|
|
18
|
+
/** When exceeded, the window stops sliding. */
|
|
19
|
+
maxEntities?: number;
|
|
20
|
+
/** Which payloads from the coalesced window the handler receives. */
|
|
21
|
+
take?: 'latest' | 'first' | 'all';
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Declares how a function is initiated from outside; `kind` discriminates the source.
|
|
25
|
+
* - `none`: no external trigger; the function is invoke-only
|
|
26
|
+
* - `schedule`: a periodic schedule
|
|
27
|
+
* - `http`: an incoming HTTP call or webhook request
|
|
28
|
+
* - `event`: an internal Nango lifecycle event
|
|
29
|
+
*/
|
|
30
|
+
export type FunctionTriggerDefinition = {
|
|
31
|
+
kind: 'none';
|
|
32
|
+
} | {
|
|
33
|
+
kind: 'schedule';
|
|
34
|
+
frequency: string;
|
|
35
|
+
autoStart?: boolean;
|
|
36
|
+
} | {
|
|
37
|
+
kind: 'http';
|
|
38
|
+
subscriptions?: string[];
|
|
39
|
+
debounce?: DebounceOptions;
|
|
40
|
+
} | {
|
|
41
|
+
kind: 'event';
|
|
42
|
+
events: OnEventType[];
|
|
43
|
+
};
|
|
44
|
+
export type FunctionConcurrencyLimit = 1 | 'max';
|
|
45
|
+
export interface FunctionLimits {
|
|
46
|
+
concurrency?: {
|
|
47
|
+
perConnection: FunctionConcurrencyLimit;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
export type Requires = {
|
|
51
|
+
connection?: true;
|
|
52
|
+
outbound?: boolean;
|
|
53
|
+
invoke?: boolean;
|
|
54
|
+
} | {
|
|
55
|
+
connection: false;
|
|
56
|
+
outbound?: false;
|
|
57
|
+
invoke?: boolean;
|
|
58
|
+
};
|
|
@@ -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';
|
|
@@ -93,8 +95,10 @@ export type * from './checkpoint/db.js';
|
|
|
93
95
|
export type * from './mcp/api.js';
|
|
94
96
|
export type * from './mfa/api.js';
|
|
95
97
|
export type * from './mfa/db.js';
|
|
98
|
+
export type * from './function/db.js';
|
|
96
99
|
export type * from './functions/api.js';
|
|
97
100
|
export type * from './functions/capabilities.js';
|
|
101
|
+
export type * from './functions/config.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';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import type { ApiError, ApiTimestamps
|
|
1
|
+
import type { ApiEndpoint, ApiError, ApiTimestamps } from '../api.js';
|
|
2
|
+
import type { AuditPolicy } from '../audit-trail/event.js';
|
|
2
3
|
import type { AuthModes, AuthModeType } from '../auth/api.js';
|
|
3
4
|
import type { NangoSyncConfig } from '../flow/index.js';
|
|
4
5
|
import type { ScriptTypeLiteral } from '../nangoYaml/index.js';
|
|
@@ -32,7 +33,11 @@ export interface ApiPublicIntegrationInclude {
|
|
|
32
33
|
private_key: string | null;
|
|
33
34
|
} | null;
|
|
34
35
|
}
|
|
35
|
-
export type GetPublicListIntegrations =
|
|
36
|
+
export type GetPublicListIntegrations = ApiEndpoint<{
|
|
37
|
+
Audit: {
|
|
38
|
+
kind: 'no-audit';
|
|
39
|
+
reason: 'non-auditable';
|
|
40
|
+
};
|
|
36
41
|
Method: 'GET';
|
|
37
42
|
Path: '/integrations';
|
|
38
43
|
Querystring?: {
|
|
@@ -42,7 +47,8 @@ export type GetPublicListIntegrations = Endpoint<{
|
|
|
42
47
|
data: ApiPublicIntegration[];
|
|
43
48
|
};
|
|
44
49
|
}>;
|
|
45
|
-
export type PostPublicIntegration =
|
|
50
|
+
export type PostPublicIntegration = ApiEndpoint<{
|
|
51
|
+
Audit: AuditPolicy<'integration', 'created', 'environment'>;
|
|
46
52
|
Method: 'POST';
|
|
47
53
|
Path: '/integrations';
|
|
48
54
|
Body: {
|
|
@@ -57,7 +63,8 @@ export type PostPublicIntegration = Endpoint<{
|
|
|
57
63
|
data: ApiPublicIntegration;
|
|
58
64
|
};
|
|
59
65
|
}>;
|
|
60
|
-
export type PostPublicQuickstartIntegration =
|
|
66
|
+
export type PostPublicQuickstartIntegration = ApiEndpoint<{
|
|
67
|
+
Audit: AuditPolicy<'integration', 'created', 'environment'>;
|
|
61
68
|
Method: 'POST';
|
|
62
69
|
Path: '/integrations/quickstart';
|
|
63
70
|
Body: {
|
|
@@ -70,7 +77,11 @@ export type PostPublicQuickstartIntegration = Endpoint<{
|
|
|
70
77
|
data: ApiPublicIntegration;
|
|
71
78
|
};
|
|
72
79
|
}>;
|
|
73
|
-
export type GetPublicIntegration =
|
|
80
|
+
export type GetPublicIntegration = ApiEndpoint<{
|
|
81
|
+
Audit: {
|
|
82
|
+
kind: 'no-audit';
|
|
83
|
+
reason: 'non-auditable';
|
|
84
|
+
};
|
|
74
85
|
Method: 'GET';
|
|
75
86
|
Path: '/integrations/:uniqueKey';
|
|
76
87
|
Params: {
|
|
@@ -83,7 +94,8 @@ export type GetPublicIntegration = Endpoint<{
|
|
|
83
94
|
data: ApiPublicIntegration;
|
|
84
95
|
};
|
|
85
96
|
}>;
|
|
86
|
-
export type PatchPublicIntegration =
|
|
97
|
+
export type PatchPublicIntegration = ApiEndpoint<{
|
|
98
|
+
Audit: AuditPolicy<'integration', 'updated', 'environment'>;
|
|
87
99
|
Method: 'PATCH';
|
|
88
100
|
Path: '/integrations/:uniqueKey';
|
|
89
101
|
Params: {
|
|
@@ -101,7 +113,8 @@ export type PatchPublicIntegration = Endpoint<{
|
|
|
101
113
|
data: ApiPublicIntegration;
|
|
102
114
|
};
|
|
103
115
|
}>;
|
|
104
|
-
export type DeletePublicIntegration =
|
|
116
|
+
export type DeletePublicIntegration = ApiEndpoint<{
|
|
117
|
+
Audit: AuditPolicy<'integration', 'deleted', 'environment'>;
|
|
105
118
|
Method: 'DELETE';
|
|
106
119
|
Path: '/integrations/:uniqueKey';
|
|
107
120
|
Params: {
|
|
@@ -111,7 +124,11 @@ export type DeletePublicIntegration = Endpoint<{
|
|
|
111
124
|
success: true;
|
|
112
125
|
};
|
|
113
126
|
}>;
|
|
114
|
-
export type GetPublicFunctionCode =
|
|
127
|
+
export type GetPublicFunctionCode = ApiEndpoint<{
|
|
128
|
+
Audit: {
|
|
129
|
+
kind: 'no-audit';
|
|
130
|
+
reason: 'non-auditable';
|
|
131
|
+
};
|
|
115
132
|
Method: 'GET';
|
|
116
133
|
Path: '/integrations/:uniqueKey/functions/:name/code';
|
|
117
134
|
Params: {
|
|
@@ -132,7 +149,11 @@ export type GetPublicFunctionCode = Endpoint<{
|
|
|
132
149
|
}[];
|
|
133
150
|
}>;
|
|
134
151
|
}>;
|
|
135
|
-
export type GetFunctionCode =
|
|
152
|
+
export type GetFunctionCode = ApiEndpoint<{
|
|
153
|
+
Audit: {
|
|
154
|
+
kind: 'no-audit';
|
|
155
|
+
reason: 'non-auditable';
|
|
156
|
+
};
|
|
136
157
|
Method: 'GET';
|
|
137
158
|
Path: '/api/v1/integrations/:providerConfigKey/functions/:functionName/code';
|
|
138
159
|
Params: {
|
|
@@ -171,7 +192,11 @@ export type ApiIntegrationList = ApiIntegration & {
|
|
|
171
192
|
installation?: 'outbound';
|
|
172
193
|
};
|
|
173
194
|
};
|
|
174
|
-
export type GetIntegrations =
|
|
195
|
+
export type GetIntegrations = ApiEndpoint<{
|
|
196
|
+
Audit: {
|
|
197
|
+
kind: 'no-audit';
|
|
198
|
+
reason: 'non-auditable';
|
|
199
|
+
};
|
|
175
200
|
Method: 'GET';
|
|
176
201
|
Path: '/api/v1/integrations';
|
|
177
202
|
Success: {
|
|
@@ -221,7 +246,8 @@ export interface InstallPluginAuthBody {
|
|
|
221
246
|
password?: string | undefined;
|
|
222
247
|
}
|
|
223
248
|
export type IntegrationAuthBody = OAuthAuthBody | OAuth2CCAuthBody | AppAuthBody | CustomAuthBody | MCPOAuth2AuthBody | MCPOAuth2GenericAuthBody | InstallPluginAuthBody;
|
|
224
|
-
export type PostIntegration =
|
|
249
|
+
export type PostIntegration = ApiEndpoint<{
|
|
250
|
+
Audit: AuditPolicy<'integration', 'created', 'environment'>;
|
|
225
251
|
Method: 'POST';
|
|
226
252
|
Path: '/api/v1/integrations';
|
|
227
253
|
Querystring: {
|
|
@@ -241,7 +267,11 @@ export type PostIntegration = Endpoint<{
|
|
|
241
267
|
data: ApiIntegration;
|
|
242
268
|
};
|
|
243
269
|
}>;
|
|
244
|
-
export type GetIntegration =
|
|
270
|
+
export type GetIntegration = ApiEndpoint<{
|
|
271
|
+
Audit: {
|
|
272
|
+
kind: 'no-audit';
|
|
273
|
+
reason: 'non-auditable';
|
|
274
|
+
};
|
|
245
275
|
Method: 'GET';
|
|
246
276
|
Path: '/api/v1/integrations/:providerConfigKey';
|
|
247
277
|
Querystring: {
|
|
@@ -263,7 +293,8 @@ export type GetIntegration = Endpoint<{
|
|
|
263
293
|
};
|
|
264
294
|
};
|
|
265
295
|
}>;
|
|
266
|
-
export type PatchIntegration =
|
|
296
|
+
export type PatchIntegration = ApiEndpoint<{
|
|
297
|
+
Audit: AuditPolicy<'integration', 'updated', 'environment'>;
|
|
267
298
|
Method: 'PATCH';
|
|
268
299
|
Path: '/api/v1/integrations/:providerConfigKey';
|
|
269
300
|
Querystring: {
|
|
@@ -285,7 +316,8 @@ export type PatchIntegration = Endpoint<{
|
|
|
285
316
|
};
|
|
286
317
|
};
|
|
287
318
|
}>;
|
|
288
|
-
export type DeleteIntegration =
|
|
319
|
+
export type DeleteIntegration = ApiEndpoint<{
|
|
320
|
+
Audit: AuditPolicy<'integration', 'deleted', 'environment'>;
|
|
289
321
|
Method: 'DELETE';
|
|
290
322
|
Path: '/api/v1/integrations/:providerConfigKey';
|
|
291
323
|
Querystring: {
|
|
@@ -300,7 +332,11 @@ export type DeleteIntegration = Endpoint<{
|
|
|
300
332
|
};
|
|
301
333
|
};
|
|
302
334
|
}>;
|
|
303
|
-
export type GetIntegrationFlows =
|
|
335
|
+
export type GetIntegrationFlows = ApiEndpoint<{
|
|
336
|
+
Audit: {
|
|
337
|
+
kind: 'no-audit';
|
|
338
|
+
reason: 'non-auditable';
|
|
339
|
+
};
|
|
304
340
|
Method: 'GET';
|
|
305
341
|
Path: '/api/v1/integrations/:providerConfigKey/flows';
|
|
306
342
|
Querystring: {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
|
+
import type { AuditPolicy } from '../audit-trail/event.js';
|
|
2
3
|
import type { ApiInvitation, ApiTeam } from '../team/api.js';
|
|
3
4
|
import type { ApiUser } from '../user/api.js';
|
|
4
5
|
import type { Role } from '../user/db.js';
|
|
5
|
-
export type PostInvite =
|
|
6
|
+
export type PostInvite = ApiEndpoint<{
|
|
7
|
+
Audit: AuditPolicy<'member', 'invited', 'account'>;
|
|
6
8
|
Method: 'POST';
|
|
7
9
|
Path: '/api/v1/invite';
|
|
8
10
|
Querystring: {
|
|
@@ -18,7 +20,8 @@ export type PostInvite = Endpoint<{
|
|
|
18
20
|
};
|
|
19
21
|
};
|
|
20
22
|
}>;
|
|
21
|
-
export type DeleteInvite =
|
|
23
|
+
export type DeleteInvite = ApiEndpoint<{
|
|
24
|
+
Audit: AuditPolicy<'member', 'invite_revoked', 'account'>;
|
|
22
25
|
Method: 'DELETE';
|
|
23
26
|
Path: '/api/v1/invite';
|
|
24
27
|
Querystring: {
|
|
@@ -33,7 +36,11 @@ export type DeleteInvite = Endpoint<{
|
|
|
33
36
|
};
|
|
34
37
|
};
|
|
35
38
|
}>;
|
|
36
|
-
export type GetInvite =
|
|
39
|
+
export type GetInvite = ApiEndpoint<{
|
|
40
|
+
Audit: {
|
|
41
|
+
kind: 'no-audit';
|
|
42
|
+
reason: 'non-auditable';
|
|
43
|
+
};
|
|
37
44
|
Method: 'GET';
|
|
38
45
|
Path: '/api/v1/invite/:id';
|
|
39
46
|
Params: {
|
|
@@ -49,7 +56,8 @@ export type GetInvite = Endpoint<{
|
|
|
49
56
|
};
|
|
50
57
|
Errors: ApiError<'not_found'>;
|
|
51
58
|
}>;
|
|
52
|
-
export type AcceptInvite =
|
|
59
|
+
export type AcceptInvite = ApiEndpoint<{
|
|
60
|
+
Audit: AuditPolicy<'member', 'invite_accepted', 'account'>;
|
|
53
61
|
Method: 'POST';
|
|
54
62
|
Path: '/api/v1/invite/:id';
|
|
55
63
|
Params: {
|
|
@@ -61,7 +69,8 @@ export type AcceptInvite = Endpoint<{
|
|
|
61
69
|
};
|
|
62
70
|
};
|
|
63
71
|
}>;
|
|
64
|
-
export type DeclineInvite =
|
|
72
|
+
export type DeclineInvite = ApiEndpoint<{
|
|
73
|
+
Audit: AuditPolicy<'member', 'invite_declined', 'account'>;
|
|
65
74
|
Method: 'DELETE';
|
|
66
75
|
Path: '/api/v1/invite/:id';
|
|
67
76
|
Params: {
|
package/dist/logs/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint } from '../api.js';
|
|
2
2
|
import type { PickFromUnion } from '../utils.js';
|
|
3
3
|
import type { MessageRow, OperationList, OperationRow, OperationState } from './messages.js';
|
|
4
4
|
type Concat<T extends OperationList> = T extends {
|
|
@@ -6,7 +6,11 @@ type Concat<T extends OperationList> = T extends {
|
|
|
6
6
|
} ? `${T['type']}:${T['action']}` : never;
|
|
7
7
|
export type ConcatOperationList = Concat<OperationList>;
|
|
8
8
|
export type ConcatOperationListWithGroup = OperationList['type'] | ConcatOperationList;
|
|
9
|
-
export type SearchOperations =
|
|
9
|
+
export type SearchOperations = ApiEndpoint<{
|
|
10
|
+
Audit: {
|
|
11
|
+
kind: 'no-audit';
|
|
12
|
+
reason: 'non-auditable';
|
|
13
|
+
};
|
|
10
14
|
Method: 'POST';
|
|
11
15
|
Path: '/api/v1/logs/operations';
|
|
12
16
|
Querystring: {
|
|
@@ -41,7 +45,11 @@ export interface SearchPeriod {
|
|
|
41
45
|
to: string;
|
|
42
46
|
}
|
|
43
47
|
export type SearchOperationsData = SearchOperations['Success']['data'][0];
|
|
44
|
-
export type GetOperation =
|
|
48
|
+
export type GetOperation = ApiEndpoint<{
|
|
49
|
+
Audit: {
|
|
50
|
+
kind: 'no-audit';
|
|
51
|
+
reason: 'non-auditable';
|
|
52
|
+
};
|
|
45
53
|
Method: 'GET';
|
|
46
54
|
Path: `/api/v1/logs/operations/:operationId`;
|
|
47
55
|
Querystring: {
|
|
@@ -54,7 +62,11 @@ export type GetOperation = Endpoint<{
|
|
|
54
62
|
data: OperationRow;
|
|
55
63
|
};
|
|
56
64
|
}>;
|
|
57
|
-
export type SearchMessages =
|
|
65
|
+
export type SearchMessages = ApiEndpoint<{
|
|
66
|
+
Audit: {
|
|
67
|
+
kind: 'no-audit';
|
|
68
|
+
reason: 'non-auditable';
|
|
69
|
+
};
|
|
58
70
|
Method: 'POST';
|
|
59
71
|
Path: '/api/v1/logs/messages';
|
|
60
72
|
Querystring: {
|
|
@@ -79,7 +91,11 @@ export type SearchMessages = Endpoint<{
|
|
|
79
91
|
};
|
|
80
92
|
}>;
|
|
81
93
|
export type SearchMessagesData = SearchMessages['Success']['data'][0];
|
|
82
|
-
export type SearchFilters =
|
|
94
|
+
export type SearchFilters = ApiEndpoint<{
|
|
95
|
+
Audit: {
|
|
96
|
+
kind: 'no-audit';
|
|
97
|
+
reason: 'non-auditable';
|
|
98
|
+
};
|
|
83
99
|
Method: 'POST';
|
|
84
100
|
Path: '/api/v1/logs/filters';
|
|
85
101
|
Querystring: {
|
|
@@ -97,7 +113,11 @@ export type SearchFilters = Endpoint<{
|
|
|
97
113
|
};
|
|
98
114
|
}>;
|
|
99
115
|
export type SearchFiltersData = SearchMessages['Success']['data'][0];
|
|
100
|
-
export type PostInsights =
|
|
116
|
+
export type PostInsights = ApiEndpoint<{
|
|
117
|
+
Audit: {
|
|
118
|
+
kind: 'no-audit';
|
|
119
|
+
reason: 'non-auditable';
|
|
120
|
+
};
|
|
101
121
|
Method: 'POST';
|
|
102
122
|
Path: '/api/v1/logs/insights';
|
|
103
123
|
Querystring: {
|
package/dist/mcp/api.d.ts
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type PostConnectionToolsMcp =
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
|
+
export type PostConnectionToolsMcp = ApiEndpoint<{
|
|
3
|
+
Audit: {
|
|
4
|
+
kind: 'no-audit';
|
|
5
|
+
reason: 'non-auditable';
|
|
6
|
+
};
|
|
3
7
|
Method: 'POST';
|
|
4
8
|
Path: '/mcp';
|
|
5
9
|
Body: Record<string, unknown>;
|
|
@@ -10,18 +14,30 @@ export type PostConnectionToolsMcp = Endpoint<{
|
|
|
10
14
|
Success: Record<string, unknown>;
|
|
11
15
|
Error: ApiError<'missing_connection_id' | 'unknown_connection'>;
|
|
12
16
|
}>;
|
|
13
|
-
export type GetConnectionToolsMcp =
|
|
17
|
+
export type GetConnectionToolsMcp = ApiEndpoint<{
|
|
18
|
+
Audit: {
|
|
19
|
+
kind: 'no-audit';
|
|
20
|
+
reason: 'non-auditable';
|
|
21
|
+
};
|
|
14
22
|
Method: 'GET';
|
|
15
23
|
Path: '/mcp';
|
|
16
24
|
Success: Record<string, unknown>;
|
|
17
25
|
}>;
|
|
18
|
-
export type PostControlPlaneMcp =
|
|
26
|
+
export type PostControlPlaneMcp = ApiEndpoint<{
|
|
27
|
+
Audit: {
|
|
28
|
+
kind: 'no-audit';
|
|
29
|
+
reason: 'non-auditable';
|
|
30
|
+
};
|
|
19
31
|
Method: 'POST';
|
|
20
32
|
Path: '/mcp';
|
|
21
33
|
Body: Record<string, unknown>;
|
|
22
34
|
Success: Record<string, unknown>;
|
|
23
35
|
}>;
|
|
24
|
-
export type GetControlPlaneMcp =
|
|
36
|
+
export type GetControlPlaneMcp = ApiEndpoint<{
|
|
37
|
+
Audit: {
|
|
38
|
+
kind: 'no-audit';
|
|
39
|
+
reason: 'non-auditable';
|
|
40
|
+
};
|
|
25
41
|
Method: 'GET';
|
|
26
42
|
Path: '/mcp';
|
|
27
43
|
Success: Record<string, unknown>;
|