@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
package/dist/billing/types.d.ts
CHANGED
|
@@ -94,19 +94,12 @@ export interface GetBillingUsageOpts {
|
|
|
94
94
|
group_by?: 'environmentId' | 'environmentName' | 'integrationId' | 'type' | 'functionName' | 'model';
|
|
95
95
|
};
|
|
96
96
|
/**
|
|
97
|
-
*
|
|
98
|
-
* Honoured only when `FLAG_ALLOW_OVERRIDE_GETUSAGE_SERVICE` is enabled;
|
|
99
|
-
* ignored everywhere else. Default is ClickHouse.
|
|
100
|
-
*/
|
|
101
|
-
source?: 'clickhouse' | 'orb';
|
|
102
|
-
/**
|
|
103
|
-
* Per-metric dimension breakdown spec. Honoured only on the CH path
|
|
97
|
+
* Per-metric dimension breakdown spec, applied to CH-backed metrics
|
|
104
98
|
* (records / connections via `getDailySumAndBatches`, counters via
|
|
105
|
-
* `getDailyCounter`)
|
|
106
|
-
* `
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* the CH cap.
|
|
99
|
+
* `getDailyCounter`). Each metric's `BillingUsageMetric` gains a
|
|
100
|
+
* `breakdown` array of up to `top + 1` series (top-N dimension
|
|
101
|
+
* values + a single 'rest' aggregating the long tail). Top defaults
|
|
102
|
+
* to 10 and is clamped server-side to the CH cap.
|
|
110
103
|
*/
|
|
111
104
|
breakdown?: {
|
|
112
105
|
[M in UsageMetric]?: BreakdownDimensions[M] | undefined;
|
|
@@ -114,8 +107,7 @@ export interface GetBillingUsageOpts {
|
|
|
114
107
|
top?: number;
|
|
115
108
|
/**
|
|
116
109
|
* Subset of metrics to populate in the response. When set, only those
|
|
117
|
-
* metrics are fanned out
|
|
118
|
-
* Ignored on the Orb path.
|
|
110
|
+
* metrics are fanned out and returned. Omitted → all 7.
|
|
119
111
|
*/
|
|
120
112
|
metrics?: UsageMetric[];
|
|
121
113
|
/**
|
|
@@ -123,8 +115,7 @@ export interface GetBillingUsageOpts {
|
|
|
123
115
|
* where the given dimension equals the given value. Composes with
|
|
124
116
|
* `breakdown[<metric>]` on the same metric when the dimensions differ
|
|
125
117
|
* (drill-in: filter to one value, re-break-down by another); controllers
|
|
126
|
-
* reject only the same-dimension pairing.
|
|
127
|
-
* ignores it.
|
|
118
|
+
* reject only the same-dimension pairing.
|
|
128
119
|
*/
|
|
129
120
|
filter?: {
|
|
130
121
|
[M in UsageMetric]?: {
|
package/dist/cli/api.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint } from '../api.js';
|
|
2
2
|
export type CliTelemetryEvent = 'cli:init' | 'cli:create' | 'cli:compile' | 'cli:dev' | 'cli:dryrun' | 'cli:generate:docs' | 'cli:generate:tests' | 'cli:clone' | 'cli:migrate_to_zero_yaml' | 'cli:deploy' | 'cli:pull';
|
|
3
|
-
export type PostCliTelemetry =
|
|
3
|
+
export type PostCliTelemetry = ApiEndpoint<{
|
|
4
|
+
Audit: {
|
|
5
|
+
kind: 'no-audit';
|
|
6
|
+
reason: 'non-auditable';
|
|
7
|
+
};
|
|
4
8
|
Method: 'POST';
|
|
5
9
|
Path: '/cli/telemetry';
|
|
6
10
|
Body: {
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export type GetPublicClientMetadata =
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
|
+
export type GetPublicClientMetadata = ApiEndpoint<{
|
|
3
|
+
Audit: {
|
|
4
|
+
kind: 'no-audit';
|
|
5
|
+
reason: 'non-auditable';
|
|
6
|
+
};
|
|
3
7
|
Method: 'GET';
|
|
4
8
|
Path: '/oauth/client-metadata/:environmentUuid/:providerConfigKey';
|
|
5
9
|
Params: {
|
package/dist/connect/api.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint } from '../api.js';
|
|
2
2
|
import type { ConnectUISettings } from '../connectUISettings/dto.js';
|
|
3
3
|
import type { ApiEndUser } from '../endUser/index.js';
|
|
4
4
|
export interface ConnectSessionInput {
|
|
@@ -33,6 +33,11 @@ export type ConnectSessionOutput = Omit<ConnectSessionInput, 'end_user' | 'organ
|
|
|
33
33
|
endUser: ApiEndUser | null;
|
|
34
34
|
isReconnecting?: boolean;
|
|
35
35
|
connectUISettings: ConnectUISettings;
|
|
36
|
+
/**
|
|
37
|
+
* Server-side WebSocket upgrade path (NANGO_SERVER_WEBSOCKETS_PATH), sent on self-hosted
|
|
38
|
+
* deployments so Connect UI opens its OAuth-result socket on the matching path.
|
|
39
|
+
*/
|
|
40
|
+
websocketsPath?: string;
|
|
36
41
|
};
|
|
37
42
|
export type PostConnectSessionsBody = ConnectSessionInput | (Omit<ConnectSessionInput, 'end_user' | 'tags'> & {
|
|
38
43
|
/**
|
|
@@ -41,7 +46,11 @@ export type PostConnectSessionsBody = ConnectSessionInput | (Omit<ConnectSession
|
|
|
41
46
|
tags: NonNullable<ConnectSessionInput['tags']>;
|
|
42
47
|
end_user?: ConnectSessionInput['end_user'] | undefined;
|
|
43
48
|
});
|
|
44
|
-
export type PostConnectSessions =
|
|
49
|
+
export type PostConnectSessions = ApiEndpoint<{
|
|
50
|
+
Audit: {
|
|
51
|
+
kind: 'no-audit';
|
|
52
|
+
reason: 'non-auditable';
|
|
53
|
+
};
|
|
45
54
|
Method: 'POST';
|
|
46
55
|
Path: '/connect/sessions';
|
|
47
56
|
Body: PostConnectSessionsBody;
|
|
@@ -53,7 +62,11 @@ export type PostConnectSessions = Endpoint<{
|
|
|
53
62
|
};
|
|
54
63
|
};
|
|
55
64
|
}>;
|
|
56
|
-
export type PostPublicConnectSessionsReconnect =
|
|
65
|
+
export type PostPublicConnectSessionsReconnect = ApiEndpoint<{
|
|
66
|
+
Audit: {
|
|
67
|
+
kind: 'no-audit';
|
|
68
|
+
reason: 'non-auditable';
|
|
69
|
+
};
|
|
57
70
|
Method: 'POST';
|
|
58
71
|
Path: '/connect/sessions/reconnect';
|
|
59
72
|
Body: {
|
|
@@ -74,25 +87,41 @@ export type PostPublicConnectSessionsReconnect = Endpoint<{
|
|
|
74
87
|
};
|
|
75
88
|
};
|
|
76
89
|
}>;
|
|
77
|
-
export type GetConnectSession =
|
|
90
|
+
export type GetConnectSession = ApiEndpoint<{
|
|
91
|
+
Audit: {
|
|
92
|
+
kind: 'no-audit';
|
|
93
|
+
reason: 'non-auditable';
|
|
94
|
+
};
|
|
78
95
|
Method: 'GET';
|
|
79
96
|
Path: '/connect/session';
|
|
80
97
|
Success: {
|
|
81
98
|
data: ConnectSessionOutput;
|
|
82
99
|
};
|
|
83
100
|
}>;
|
|
84
|
-
export type DeleteConnectSession =
|
|
101
|
+
export type DeleteConnectSession = ApiEndpoint<{
|
|
102
|
+
Audit: {
|
|
103
|
+
kind: 'no-audit';
|
|
104
|
+
reason: 'non-auditable';
|
|
105
|
+
};
|
|
85
106
|
Method: 'DELETE';
|
|
86
107
|
Path: '/connect/session';
|
|
87
108
|
Success: never;
|
|
88
109
|
}>;
|
|
89
|
-
export type PostInternalConnectSessions =
|
|
110
|
+
export type PostInternalConnectSessions = ApiEndpoint<{
|
|
111
|
+
Audit: {
|
|
112
|
+
kind: 'no-audit';
|
|
113
|
+
reason: 'non-auditable';
|
|
114
|
+
};
|
|
90
115
|
Method: 'POST';
|
|
91
116
|
Path: '/api/v1/connect/sessions';
|
|
92
117
|
Success: PostConnectSessions['Success'];
|
|
93
118
|
Body: Pick<ConnectSessionInput, 'allowed_integrations' | 'end_user' | 'organization' | 'integrations_config_defaults' | 'overrides' | 'webhook_url_override'>;
|
|
94
119
|
}>;
|
|
95
|
-
export type PostPublicConnectTelemetry =
|
|
120
|
+
export type PostPublicConnectTelemetry = ApiEndpoint<{
|
|
121
|
+
Audit: {
|
|
122
|
+
kind: 'no-audit';
|
|
123
|
+
reason: 'non-auditable';
|
|
124
|
+
};
|
|
96
125
|
Method: 'POST';
|
|
97
126
|
Path: '/connect/telemetry';
|
|
98
127
|
Body: {
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
2
|
import type { ConnectUISettings } from './dto.js';
|
|
3
|
-
export type GetConnectUISettings =
|
|
3
|
+
export type GetConnectUISettings = ApiEndpoint<{
|
|
4
|
+
Audit: {
|
|
5
|
+
kind: 'no-audit';
|
|
6
|
+
reason: 'non-auditable';
|
|
7
|
+
};
|
|
4
8
|
Method: 'GET';
|
|
5
9
|
Path: '/api/v1/connect-ui-settings';
|
|
6
10
|
Querystring: {
|
|
@@ -11,7 +15,11 @@ export type GetConnectUISettings = Endpoint<{
|
|
|
11
15
|
};
|
|
12
16
|
Error: ApiError<'failed_to_get_connect_ui_settings'>;
|
|
13
17
|
}>;
|
|
14
|
-
export type PutConnectUISettings =
|
|
18
|
+
export type PutConnectUISettings = ApiEndpoint<{
|
|
19
|
+
Audit: {
|
|
20
|
+
kind: 'no-audit';
|
|
21
|
+
reason: 'non-auditable';
|
|
22
|
+
};
|
|
15
23
|
Method: 'PUT';
|
|
16
24
|
Path: '/api/v1/connect-ui-settings';
|
|
17
25
|
Querystring: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ApiError, ApiTimestamps
|
|
2
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError, ApiTimestamps } from '../../api.js';
|
|
2
|
+
import type { AuditPolicy } from '../../audit-trail/event.js';
|
|
3
|
+
import type { ApiKeyCredentials, ApiPublicAllAuthCredentials, BasicApiCredentials, OAuth1Credentials, OAuth2ClientCredentials, OAuth2Credentials, TbaCredentials } from '../../auth/api.js';
|
|
3
4
|
import type { EndUserInput } from '../../connect/api.js';
|
|
4
5
|
import type { Tags } from '../../db.js';
|
|
5
6
|
import type { ApiEndUser } from '../../endUser/index.js';
|
|
@@ -17,7 +18,11 @@ export type ApiConnectionSimple = Pick<Merge<DBConnection, ApiTimestamps>, 'id'
|
|
|
17
18
|
tags: Tags;
|
|
18
19
|
pausedSyncs: string[];
|
|
19
20
|
};
|
|
20
|
-
export type GetConnections =
|
|
21
|
+
export type GetConnections = ApiEndpoint<{
|
|
22
|
+
Audit: {
|
|
23
|
+
kind: 'no-audit';
|
|
24
|
+
reason: 'non-auditable';
|
|
25
|
+
};
|
|
21
26
|
Method: 'GET';
|
|
22
27
|
Querystring: {
|
|
23
28
|
env: string;
|
|
@@ -31,7 +36,11 @@ export type GetConnections = Endpoint<{
|
|
|
31
36
|
data: ApiConnectionSimple[];
|
|
32
37
|
};
|
|
33
38
|
}>;
|
|
34
|
-
export type GetConnectionsCount =
|
|
39
|
+
export type GetConnectionsCount = ApiEndpoint<{
|
|
40
|
+
Audit: {
|
|
41
|
+
kind: 'no-audit';
|
|
42
|
+
reason: 'non-auditable';
|
|
43
|
+
};
|
|
35
44
|
Method: 'GET';
|
|
36
45
|
Querystring: {
|
|
37
46
|
env: string;
|
|
@@ -58,7 +67,11 @@ export type ApiPublicConnection = Pick<DBConnection, 'id' | 'connection_id'> & {
|
|
|
58
67
|
end_user: ApiEndUser | null;
|
|
59
68
|
tags: Tags;
|
|
60
69
|
};
|
|
61
|
-
export type GetPublicConnections =
|
|
70
|
+
export type GetPublicConnections = ApiEndpoint<{
|
|
71
|
+
Audit: {
|
|
72
|
+
kind: 'no-audit';
|
|
73
|
+
reason: 'non-auditable';
|
|
74
|
+
};
|
|
62
75
|
Method: 'GET';
|
|
63
76
|
Querystring: {
|
|
64
77
|
connectionId?: string | undefined;
|
|
@@ -75,7 +88,8 @@ export type GetPublicConnections = Endpoint<{
|
|
|
75
88
|
connections: ApiPublicConnection[];
|
|
76
89
|
};
|
|
77
90
|
}>;
|
|
78
|
-
export type PostPublicConnection =
|
|
91
|
+
export type PostPublicConnection = ApiEndpoint<{
|
|
92
|
+
Audit: AuditPolicy<'connection', 'created', 'environment'>;
|
|
79
93
|
Method: 'POST';
|
|
80
94
|
Path: '/connections';
|
|
81
95
|
Body: {
|
|
@@ -102,7 +116,7 @@ export type PostPublicConnection = Endpoint<{
|
|
|
102
116
|
Success: ApiPublicConnectionFull;
|
|
103
117
|
}>;
|
|
104
118
|
export type ApiConnectionFull = Omit<ReplaceInObject<DBConnectionDecrypted, Date, string>, 'credentials_iv' | 'end_user_id' | 'credentials_tag' | 'deleted' | 'deleted_at'>;
|
|
105
|
-
export type GetConnection =
|
|
119
|
+
export type GetConnection = ApiEndpoint<{
|
|
106
120
|
Method: 'GET';
|
|
107
121
|
Params: {
|
|
108
122
|
connectionId: string;
|
|
@@ -113,6 +127,10 @@ export type GetConnection = Endpoint<{
|
|
|
113
127
|
};
|
|
114
128
|
Path: '/api/v1/connections/:connectionId';
|
|
115
129
|
Error: ApiError<'unknown_provider_config'>;
|
|
130
|
+
Audit: {
|
|
131
|
+
kind: 'no-audit';
|
|
132
|
+
reason: 'non-auditable';
|
|
133
|
+
};
|
|
116
134
|
Success: {
|
|
117
135
|
data: {
|
|
118
136
|
provider: string;
|
|
@@ -135,9 +153,13 @@ export type ApiPublicConnectionFull = Pick<DBConnection, 'id' | 'connection_id'
|
|
|
135
153
|
}[];
|
|
136
154
|
end_user: ApiEndUser | null;
|
|
137
155
|
tags: Tags;
|
|
138
|
-
credentials:
|
|
156
|
+
credentials: ApiPublicAllAuthCredentials;
|
|
139
157
|
};
|
|
140
|
-
export type GetPublicConnection =
|
|
158
|
+
export type GetPublicConnection = ApiEndpoint<{
|
|
159
|
+
Audit: {
|
|
160
|
+
kind: 'no-audit';
|
|
161
|
+
reason: 'non-auditable';
|
|
162
|
+
};
|
|
141
163
|
Method: 'GET';
|
|
142
164
|
Params: {
|
|
143
165
|
connectionId: string;
|
|
@@ -152,7 +174,8 @@ export type GetPublicConnection = Endpoint<{
|
|
|
152
174
|
Error: ApiError<'unknown_provider_config' | 'invalid_credentials'>;
|
|
153
175
|
Success: ApiPublicConnectionFull;
|
|
154
176
|
}>;
|
|
155
|
-
export type PatchPublicConnection =
|
|
177
|
+
export type PatchPublicConnection = ApiEndpoint<{
|
|
178
|
+
Audit: AuditPolicy<'connection', 'updated', 'environment'>;
|
|
156
179
|
Method: 'PATCH';
|
|
157
180
|
Path: '/connections/:connectionId';
|
|
158
181
|
Params: {
|
|
@@ -164,14 +187,15 @@ export type PatchPublicConnection = Endpoint<{
|
|
|
164
187
|
Body: {
|
|
165
188
|
end_user?: EndUserInput | undefined;
|
|
166
189
|
tags?: Tags | undefined;
|
|
167
|
-
|
|
190
|
+
webhook_url_override?: string | undefined;
|
|
168
191
|
};
|
|
169
192
|
Success: {
|
|
170
193
|
success: boolean;
|
|
171
194
|
};
|
|
172
195
|
Error: ApiError<'unknown_provider_config' | 'not_found' | 'server_error' | 'invalid_body'>;
|
|
173
196
|
}>;
|
|
174
|
-
export type PatchConnection =
|
|
197
|
+
export type PatchConnection = ApiEndpoint<{
|
|
198
|
+
Audit: AuditPolicy<'connection', 'updated', 'environment'>;
|
|
175
199
|
Method: 'PATCH';
|
|
176
200
|
Path: '/api/v1/connections/:connectionId';
|
|
177
201
|
Params: {
|
|
@@ -184,14 +208,15 @@ export type PatchConnection = Endpoint<{
|
|
|
184
208
|
Body: {
|
|
185
209
|
end_user?: EndUserInput | undefined;
|
|
186
210
|
tags?: Tags | undefined;
|
|
187
|
-
|
|
211
|
+
webhook_url_override?: string | undefined;
|
|
188
212
|
};
|
|
189
213
|
Success: {
|
|
190
214
|
success: boolean;
|
|
191
215
|
};
|
|
192
216
|
Error: ApiError<'unknown_provider_config' | 'not_found' | 'server_error' | 'invalid_body'>;
|
|
193
217
|
}>;
|
|
194
|
-
export type PostConnectionRefresh =
|
|
218
|
+
export type PostConnectionRefresh = ApiEndpoint<{
|
|
219
|
+
Audit: AuditPolicy<'connection', 'refreshed', 'environment'>;
|
|
195
220
|
Method: 'POST';
|
|
196
221
|
Params: {
|
|
197
222
|
connectionId: string;
|
|
@@ -208,7 +233,8 @@ export type PostConnectionRefresh = Endpoint<{
|
|
|
208
233
|
};
|
|
209
234
|
};
|
|
210
235
|
}>;
|
|
211
|
-
export type DeletePublicConnection =
|
|
236
|
+
export type DeletePublicConnection = ApiEndpoint<{
|
|
237
|
+
Audit: AuditPolicy<'connection', 'deleted', 'environment'>;
|
|
212
238
|
Method: 'DELETE';
|
|
213
239
|
Path: '/connection/:connectionId';
|
|
214
240
|
Params: {
|
|
@@ -222,7 +248,7 @@ export type DeletePublicConnection = Endpoint<{
|
|
|
222
248
|
success: boolean;
|
|
223
249
|
};
|
|
224
250
|
}>;
|
|
225
|
-
export type DeleteConnection =
|
|
251
|
+
export type DeleteConnection = ApiEndpoint<{
|
|
226
252
|
Method: 'DELETE';
|
|
227
253
|
Path: '/api/v1/connections/:connectionId';
|
|
228
254
|
Params: {
|
|
@@ -236,4 +262,5 @@ export type DeleteConnection = Endpoint<{
|
|
|
236
262
|
Success: {
|
|
237
263
|
success: boolean;
|
|
238
264
|
};
|
|
265
|
+
Audit: AuditPolicy<'connection', 'deleted', 'environment'>;
|
|
239
266
|
}>;
|
|
@@ -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 { Metadata } from '../db.js';
|
|
3
4
|
export interface MetadataBody {
|
|
4
5
|
connection_id: string | string[];
|
|
@@ -6,21 +7,24 @@ export interface MetadataBody {
|
|
|
6
7
|
metadata: Metadata;
|
|
7
8
|
}
|
|
8
9
|
type MetadataError = ApiError<'invalid_body'> | ApiError<'unknown_connection'>;
|
|
9
|
-
export type SetMetadata =
|
|
10
|
+
export type SetMetadata = ApiEndpoint<{
|
|
11
|
+
Audit: AuditPolicy<'connection', 'metadata_updated', 'environment'>;
|
|
10
12
|
Method: 'POST';
|
|
11
13
|
Body: MetadataBody;
|
|
12
14
|
Path: '/connection/metadata';
|
|
13
15
|
Error: MetadataError;
|
|
14
16
|
Success: MetadataBody;
|
|
15
17
|
}>;
|
|
16
|
-
export type UpdateMetadata =
|
|
18
|
+
export type UpdateMetadata = ApiEndpoint<{
|
|
19
|
+
Audit: AuditPolicy<'connection', 'metadata_updated', 'environment'>;
|
|
17
20
|
Method: 'PATCH';
|
|
18
21
|
Path: '/connection/metadata';
|
|
19
22
|
Body: MetadataBody;
|
|
20
23
|
Error: MetadataError;
|
|
21
24
|
Success: MetadataBody;
|
|
22
25
|
}>;
|
|
23
|
-
export type PostConnectionMetadata =
|
|
26
|
+
export type PostConnectionMetadata = ApiEndpoint<{
|
|
27
|
+
Audit: AuditPolicy<'connection', 'metadata_updated', 'environment'>;
|
|
24
28
|
Method: 'POST';
|
|
25
29
|
Path: '/api/v1/connections/:connectionId/metadata';
|
|
26
30
|
Params: {
|
package/dist/db.d.ts
CHANGED
|
@@ -10,8 +10,13 @@ export interface DeletedCorrect {
|
|
|
10
10
|
deleted_at: Date | null;
|
|
11
11
|
deleted: boolean;
|
|
12
12
|
}
|
|
13
|
+
export interface DeletedAt {
|
|
14
|
+
deleted_at: Date | null;
|
|
15
|
+
}
|
|
13
16
|
export interface TimestampsAndDeleted extends Timestamps, Deleted {
|
|
14
17
|
}
|
|
15
18
|
export interface TimestampsAndDeletedCorrect extends Timestamps, DeletedCorrect {
|
|
16
19
|
}
|
|
20
|
+
export interface TimestampsAndDeletedAt extends Timestamps, DeletedAt {
|
|
21
|
+
}
|
|
17
22
|
export type Tags = Record<string, string>;
|
package/dist/deploy/api.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../api.js';
|
|
2
|
+
import type { AuditPolicy } from '../audit-trail/event.js';
|
|
2
3
|
import type { OnEventType } from '../scripts/on-events/api.js';
|
|
3
4
|
import type { FunctionSource } from '../syncConfigs/db.js';
|
|
4
5
|
import type { CLIDeployFlowConfig, OnEventScriptsByProvider } from './incomingFlow.js';
|
|
5
6
|
import type { SyncDeploymentResult } from './index.js';
|
|
6
7
|
import type { JSONSchema7 } from 'json-schema';
|
|
7
|
-
export type PostDeployConfirmation =
|
|
8
|
+
export type PostDeployConfirmation = ApiEndpoint<{
|
|
9
|
+
Audit: {
|
|
10
|
+
kind: 'no-audit';
|
|
11
|
+
reason: 'TODO: audit coverage pending';
|
|
12
|
+
};
|
|
8
13
|
Method: 'POST';
|
|
9
14
|
Path: '/sync/deploy/confirmation';
|
|
10
15
|
Body: {
|
|
@@ -19,7 +24,8 @@ export type PostDeployConfirmation = Endpoint<{
|
|
|
19
24
|
};
|
|
20
25
|
Success: ScriptDifferences;
|
|
21
26
|
}>;
|
|
22
|
-
export type PostDeploy =
|
|
27
|
+
export type PostDeploy = ApiEndpoint<{
|
|
28
|
+
Audit: AuditPolicy<'function', 'deployed', 'environment'>;
|
|
23
29
|
Method: 'POST';
|
|
24
30
|
Path: '/sync/deploy';
|
|
25
31
|
Body: {
|
|
@@ -36,7 +42,11 @@ export type PostDeploy = Endpoint<{
|
|
|
36
42
|
};
|
|
37
43
|
Success: SyncDeploymentResult[];
|
|
38
44
|
}>;
|
|
39
|
-
export type PostDeployInternal =
|
|
45
|
+
export type PostDeployInternal = ApiEndpoint<{
|
|
46
|
+
Audit: {
|
|
47
|
+
kind: 'no-audit';
|
|
48
|
+
reason: 'TODO: audit coverage pending';
|
|
49
|
+
};
|
|
40
50
|
Method: 'POST';
|
|
41
51
|
Path: '/sync/deploy/internal';
|
|
42
52
|
Querystring: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ApiKeyScope } from '../../api-keys/scopes.js';
|
|
2
|
-
import type { ApiError, ApiTimestamps
|
|
2
|
+
import type { ApiEndpoint, ApiError, ApiTimestamps } from '../../api.js';
|
|
3
|
+
import type { AuditPolicy } from '../../audit-trail/event.js';
|
|
3
4
|
import type { ApiPlan } from '../../plans/http.api.js';
|
|
4
5
|
import type { DBEnvironment, DBExternalWebhook } from '../db.js';
|
|
5
6
|
import type { ApiEnvironmentVariable } from '../variable/api.js';
|
|
@@ -8,14 +9,19 @@ export type ApiEnvironment = Merge<DBEnvironment, {
|
|
|
8
9
|
callback_url: string;
|
|
9
10
|
} & ApiTimestamps>;
|
|
10
11
|
export type ApiWebhooks = Omit<DBExternalWebhook, 'id' | 'environment_id' | 'created_at' | 'updated_at'>;
|
|
11
|
-
export type GetEnvironments =
|
|
12
|
+
export type GetEnvironments = ApiEndpoint<{
|
|
13
|
+
Audit: {
|
|
14
|
+
kind: 'no-audit';
|
|
15
|
+
reason: 'non-auditable';
|
|
16
|
+
};
|
|
12
17
|
Method: 'GET';
|
|
13
18
|
Path: '/api/v1/environments';
|
|
14
19
|
Success: {
|
|
15
20
|
data: Pick<DBEnvironment, 'name' | 'is_production'>[];
|
|
16
21
|
};
|
|
17
22
|
}>;
|
|
18
|
-
export type PostEnvironment =
|
|
23
|
+
export type PostEnvironment = ApiEndpoint<{
|
|
24
|
+
Audit: AuditPolicy<'environment', 'created', 'account'>;
|
|
19
25
|
Method: 'POST';
|
|
20
26
|
Path: '/api/v1/environments';
|
|
21
27
|
Body: {
|
|
@@ -25,7 +31,11 @@ export type PostEnvironment = Endpoint<{
|
|
|
25
31
|
data: Pick<DBEnvironment, 'id' | 'name'>;
|
|
26
32
|
};
|
|
27
33
|
}>;
|
|
28
|
-
export type GetEnvironment =
|
|
34
|
+
export type GetEnvironment = ApiEndpoint<{
|
|
35
|
+
Audit: {
|
|
36
|
+
kind: 'no-audit';
|
|
37
|
+
reason: 'non-auditable';
|
|
38
|
+
};
|
|
29
39
|
Method: 'GET';
|
|
30
40
|
Path: '/api/v1/environments/current';
|
|
31
41
|
Success: {
|
|
@@ -43,7 +53,8 @@ export type GetEnvironment = Endpoint<{
|
|
|
43
53
|
};
|
|
44
54
|
};
|
|
45
55
|
}>;
|
|
46
|
-
export type PatchEnvironment =
|
|
56
|
+
export type PatchEnvironment = ApiEndpoint<{
|
|
57
|
+
Audit: AuditPolicy<'environment', 'updated', 'environment'>;
|
|
47
58
|
Method: 'PATCH';
|
|
48
59
|
Path: '/api/v1/environments';
|
|
49
60
|
Body: {
|
|
@@ -64,13 +75,18 @@ export type PatchEnvironment = Endpoint<{
|
|
|
64
75
|
};
|
|
65
76
|
Error: ApiError<'conflict' | 'cannot_toggle_prod_environment'>;
|
|
66
77
|
}>;
|
|
67
|
-
export type DeleteEnvironment =
|
|
78
|
+
export type DeleteEnvironment = ApiEndpoint<{
|
|
79
|
+
Audit: AuditPolicy<'environment', 'deleted', 'environment'>;
|
|
68
80
|
Method: 'DELETE';
|
|
69
81
|
Path: '/api/v1/environments';
|
|
70
82
|
Success: never;
|
|
71
83
|
Error: ApiError<'cannot_delete_prod_environment'>;
|
|
72
84
|
}>;
|
|
73
|
-
export type GetPublicEnvironmentVariables =
|
|
85
|
+
export type GetPublicEnvironmentVariables = ApiEndpoint<{
|
|
86
|
+
Audit: {
|
|
87
|
+
kind: 'no-audit';
|
|
88
|
+
reason: 'non-auditable';
|
|
89
|
+
};
|
|
74
90
|
Method: 'GET';
|
|
75
91
|
Path: '/api/v1/environment-variables';
|
|
76
92
|
Success: {
|
|
@@ -78,7 +94,11 @@ export type GetPublicEnvironmentVariables = Endpoint<{
|
|
|
78
94
|
value: string;
|
|
79
95
|
}[];
|
|
80
96
|
}>;
|
|
81
|
-
export type ListApiKeys =
|
|
97
|
+
export type ListApiKeys = ApiEndpoint<{
|
|
98
|
+
Audit: {
|
|
99
|
+
kind: 'no-audit';
|
|
100
|
+
reason: 'non-auditable';
|
|
101
|
+
};
|
|
82
102
|
Method: 'GET';
|
|
83
103
|
Path: '/api/v1/environment/api-keys';
|
|
84
104
|
Success: {
|
|
@@ -92,7 +112,8 @@ export type ListApiKeys = Endpoint<{
|
|
|
92
112
|
}[];
|
|
93
113
|
};
|
|
94
114
|
}>;
|
|
95
|
-
export type CreateApiKey =
|
|
115
|
+
export type CreateApiKey = ApiEndpoint<{
|
|
116
|
+
Audit: AuditPolicy<'api_key', 'created', 'environment'>;
|
|
96
117
|
Method: 'POST';
|
|
97
118
|
Path: '/api/v1/environment/api-keys';
|
|
98
119
|
Body: {
|
|
@@ -110,7 +131,8 @@ export type CreateApiKey = Endpoint<{
|
|
|
110
131
|
};
|
|
111
132
|
Error: ApiError<'conflict' | 'resource_capped'>;
|
|
112
133
|
}>;
|
|
113
|
-
export type DeleteApiKey =
|
|
134
|
+
export type DeleteApiKey = ApiEndpoint<{
|
|
135
|
+
Audit: AuditPolicy<'api_key', 'deleted', 'environment'>;
|
|
114
136
|
Method: 'DELETE';
|
|
115
137
|
Path: '/api/v1/environment/api-keys/:keyId';
|
|
116
138
|
Params: {
|
|
@@ -120,7 +142,8 @@ export type DeleteApiKey = Endpoint<{
|
|
|
120
142
|
success: true;
|
|
121
143
|
};
|
|
122
144
|
}>;
|
|
123
|
-
export type PatchApiKey =
|
|
145
|
+
export type PatchApiKey = ApiEndpoint<{
|
|
146
|
+
Audit: AuditPolicy<'api_key', 'updated', 'environment'>;
|
|
124
147
|
Method: 'PATCH';
|
|
125
148
|
Path: '/api/v1/environment/api-keys/:keyId';
|
|
126
149
|
Params: {
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ApiEndpoint, ApiError } from '../../api.js';
|
|
2
2
|
export interface OtlpSettings {
|
|
3
3
|
endpoint: string;
|
|
4
4
|
headers: Record<string, string>;
|
|
5
5
|
}
|
|
6
|
-
export type UpdateOtlpSettings =
|
|
6
|
+
export type UpdateOtlpSettings = ApiEndpoint<{
|
|
7
|
+
Audit: {
|
|
8
|
+
kind: 'no-audit';
|
|
9
|
+
reason: 'TODO: audit coverage pending';
|
|
10
|
+
};
|
|
7
11
|
Method: 'POST';
|
|
8
12
|
Querystring: {
|
|
9
13
|
env: string;
|
|
@@ -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: {
|