@nangohq/types 0.71.4 → 0.71.6

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.
Files changed (49) hide show
  1. package/dist/account/api.d.ts +49 -2
  2. package/dist/action/api.d.ts +4 -0
  3. package/dist/admin/http.api.d.ts +1 -1
  4. package/dist/agent/api.d.ts +88 -0
  5. package/dist/agent/connections.d.ts +44 -0
  6. package/dist/agent/mcp.api.d.ts +28 -0
  7. package/dist/agent/session.d.ts +20 -0
  8. package/dist/agent/toolSearch.d.ts +34 -0
  9. package/dist/agent/toolset.d.ts +43 -0
  10. package/dist/api-keys/auth.d.ts +2 -0
  11. package/dist/api-keys/scopes.d.ts +9 -4
  12. package/dist/api.endpoints.d.ts +9 -7
  13. package/dist/audit-trail/api.d.ts +21 -8
  14. package/dist/audit-trail/event.d.ts +135 -15
  15. package/dist/audit-trail/metadata.d.ts +99 -0
  16. package/dist/auth/api.d.ts +1 -1
  17. package/dist/auth/http.api.d.ts +11 -40
  18. package/dist/authz/types.d.ts +1 -1
  19. package/dist/billing/types.d.ts +56 -10
  20. package/dist/connection/api/get.d.ts +1 -1
  21. package/dist/connection/api/metadata.d.ts +8 -2
  22. package/dist/environment/api/index.d.ts +92 -1
  23. package/dist/environment/api/webhook.d.ts +1 -0
  24. package/dist/environment/db.d.ts +2 -0
  25. package/dist/function/trigger.d.ts +61 -0
  26. package/dist/functions/api.d.ts +35 -0
  27. package/dist/index.d.ts +10 -2
  28. package/dist/keystore/index.d.ts +10 -2
  29. package/dist/logs/messages.d.ts +24 -3
  30. package/dist/meta/api.d.ts +1 -0
  31. package/dist/mfa/api.d.ts +2 -7
  32. package/dist/mfa/credential.d.ts +7 -0
  33. package/dist/mfa/db.d.ts +1 -0
  34. package/dist/persist/api.d.ts +1 -1
  35. package/dist/plans/db.d.ts +21 -1
  36. package/dist/plans/http.api.d.ts +109 -0
  37. package/dist/providers/provider.d.ts +1 -0
  38. package/dist/pubsub/events.d.ts +2 -2
  39. package/dist/runner/sdk.d.ts +1 -1
  40. package/dist/sharedCredentials/api.d.ts +2 -0
  41. package/dist/sharedCredentials/db.d.ts +1 -0
  42. package/dist/sharedCredentials/dto.d.ts +1 -1
  43. package/dist/stripe/http.api.d.ts +3 -0
  44. package/dist/sync/api.d.ts +1 -1
  45. package/dist/usage/index.d.ts +1 -1
  46. package/dist/user/api.d.ts +5 -1
  47. package/dist/web/env.d.ts +3 -0
  48. package/dist/webhooks/api.d.ts +2 -1
  49. package/package.json +1 -1
@@ -28,8 +28,41 @@ export type PostEnvironment = ApiEndpoint<{
28
28
  name: string;
29
29
  };
30
30
  Success: {
31
- data: Pick<DBEnvironment, 'id' | 'name'>;
31
+ data: Pick<DBEnvironment, 'id' | 'uuid' | 'name'>;
32
32
  };
33
+ Error: ApiError<'conflict' | 'resource_capped' | 'invalid_is_prod_flag'>;
34
+ }>;
35
+ export type PostPublicEnvironment = ApiEndpoint<{
36
+ Audit: AuditPolicy<'environment', 'created', 'account'>;
37
+ Method: 'POST';
38
+ Path: '/environments';
39
+ Body: {
40
+ name: string;
41
+ is_production?: boolean | undefined;
42
+ callback_url?: string | undefined;
43
+ hmac_key?: string | undefined;
44
+ hmac_enabled?: boolean | undefined;
45
+ slack_notifications?: boolean | undefined;
46
+ otlp_endpoint?: string | undefined;
47
+ otlp_headers?: {
48
+ name: string;
49
+ value: string;
50
+ }[] | undefined;
51
+ };
52
+ Success: {
53
+ data: Pick<DBEnvironment, 'id' | 'uuid' | 'name'>;
54
+ };
55
+ Error: ApiError<'conflict' | 'resource_capped' | 'invalid_is_prod_flag'>;
56
+ }>;
57
+ export type DeletePublicEnvironment = ApiEndpoint<{
58
+ Audit: AuditPolicy<'environment', 'deleted', 'account'>;
59
+ Method: 'DELETE';
60
+ Path: '/environments/:environmentUuid';
61
+ Params: {
62
+ environmentUuid: string;
63
+ };
64
+ Success: never;
65
+ Error: ApiError<'cannot_delete_prod_environment'>;
33
66
  }>;
34
67
  export type GetEnvironment = ApiEndpoint<{
35
68
  Audit: {
@@ -82,6 +115,28 @@ export type DeleteEnvironment = ApiEndpoint<{
82
115
  Success: never;
83
116
  Error: ApiError<'cannot_delete_prod_environment'>;
84
117
  }>;
118
+ export type PostRotateWebhookSigningKey = ApiEndpoint<{
119
+ Audit: AuditPolicy<'environment', 'webhook_signing_key_rotated', 'environment'>;
120
+ Method: 'POST';
121
+ Path: '/api/v1/environment/webhook-signing-key/rotate';
122
+ Success: {
123
+ data: {
124
+ webhook_signing_key: string;
125
+ };
126
+ };
127
+ Error: ApiError<'not_found'> | ApiError<'multiple_webhook_signing_keys'> | ApiError<'rotation_failed'>;
128
+ }>;
129
+ export type PostPublicRotateWebhookSigningKey = ApiEndpoint<{
130
+ Audit: AuditPolicy<'environment', 'webhook_signing_key_rotated', 'environment'>;
131
+ Method: 'POST';
132
+ Path: '/environment/webhook-signing-key/rotate';
133
+ Success: {
134
+ data: {
135
+ webhook_signing_key: string;
136
+ };
137
+ };
138
+ Error: ApiError<'not_found'> | ApiError<'multiple_webhook_signing_keys'> | ApiError<'rotation_failed'>;
139
+ }>;
85
140
  export type GetPublicEnvironmentVariables = ApiEndpoint<{
86
141
  Audit: {
87
142
  kind: 'no-audit';
@@ -104,6 +159,7 @@ export type ListApiKeys = ApiEndpoint<{
104
159
  Success: {
105
160
  data: {
106
161
  id: number;
162
+ uuid: string;
107
163
  display_name: string;
108
164
  scopes: ApiKeyScope[];
109
165
  secret: string;
@@ -123,6 +179,29 @@ export type CreateApiKey = ApiEndpoint<{
123
179
  Success: {
124
180
  data: {
125
181
  id: number;
182
+ uuid: string;
183
+ display_name: string;
184
+ scopes: ApiKeyScope[];
185
+ secret: string;
186
+ created_at: string;
187
+ };
188
+ };
189
+ Error: ApiError<'conflict' | 'resource_capped'>;
190
+ }>;
191
+ export type PostPublicApiKey = ApiEndpoint<{
192
+ Audit: AuditPolicy<'api_key', 'created', 'environment'>;
193
+ Method: 'POST';
194
+ Path: '/environments/:environmentUuid/api-keys';
195
+ Params: {
196
+ environmentUuid: string;
197
+ };
198
+ Body: {
199
+ display_name: string;
200
+ };
201
+ Success: {
202
+ data: {
203
+ id: number;
204
+ uuid: string;
126
205
  display_name: string;
127
206
  scopes: ApiKeyScope[];
128
207
  secret: string;
@@ -131,6 +210,18 @@ export type CreateApiKey = ApiEndpoint<{
131
210
  };
132
211
  Error: ApiError<'conflict' | 'resource_capped'>;
133
212
  }>;
213
+ export type DeletePublicApiKey = ApiEndpoint<{
214
+ Audit: AuditPolicy<'api_key', 'deleted', 'environment'>;
215
+ Method: 'DELETE';
216
+ Path: '/environments/:environmentUuid/api-keys/:keyUuid';
217
+ Params: {
218
+ environmentUuid: string;
219
+ keyUuid: string;
220
+ };
221
+ Success: {
222
+ success: true;
223
+ };
224
+ }>;
134
225
  export type DeleteApiKey = ApiEndpoint<{
135
226
  Audit: AuditPolicy<'api_key', 'deleted', 'environment'>;
136
227
  Method: 'DELETE';
@@ -15,6 +15,7 @@ export type PatchWebhook = ApiEndpoint<{
15
15
  on_auth_refresh_error?: boolean | undefined;
16
16
  on_sync_error?: boolean | undefined;
17
17
  on_async_action_completion?: boolean | undefined;
18
+ on_connection_deletion?: boolean | undefined;
18
19
  };
19
20
  Success: {
20
21
  success: boolean;
@@ -63,6 +63,7 @@ export interface DBExternalWebhook extends Timestamps {
63
63
  on_auth_refresh_error: boolean;
64
64
  on_sync_error: boolean;
65
65
  on_async_action_completion: boolean;
66
+ on_connection_deletion: boolean;
66
67
  }
67
68
  export interface DBAPISecret extends Timestamps {
68
69
  id: number;
@@ -77,6 +78,7 @@ export interface DBAPISecret extends Timestamps {
77
78
  export type CustomerKeyType = 'api' | 'webhook_signing';
78
79
  export interface DBCustomerKey extends Timestamps {
79
80
  id: number;
81
+ uuid: string;
80
82
  account_id: number;
81
83
  key_type: CustomerKeyType;
82
84
  display_name: string;
@@ -0,0 +1,61 @@
1
+ import type { HTTP_METHOD } from '../nangoYaml/index.js';
2
+ import type { OnEventType } from '../scripts/on-events/api.js';
3
+ import type { FunctionTriggerDefinition } from './config.js';
4
+ import type { JsonValue } from 'type-fest';
5
+ export type HttpRequest = {
6
+ method: HTTP_METHOD;
7
+ path: string;
8
+ headers: Record<string, string>;
9
+ query: Record<string, string>;
10
+ body: JsonValue;
11
+ };
12
+ export type CoalescedInfo = {
13
+ count: number;
14
+ firstSeenAt: string;
15
+ lastSeenAt: string;
16
+ };
17
+ type HttpPayload<TTrigger, TInput> = TTrigger extends {
18
+ debounce: {
19
+ take: 'all';
20
+ };
21
+ } ? TInput[] : TInput;
22
+ type TriggerBase = {
23
+ /**
24
+ * Present when the run carries connection context (invoke calls may pass one;
25
+ * HTTP/event may resolve one). Undefined for connection-less runs.
26
+ */
27
+ connection?: {
28
+ connectionId: string;
29
+ integrationId: string;
30
+ };
31
+ };
32
+ export type InvokeTrigger<TInput> = TriggerBase & {
33
+ kind: 'invoke';
34
+ input: TInput;
35
+ };
36
+ export type ScheduleTrigger = TriggerBase & {
37
+ kind: 'schedule';
38
+ input: null;
39
+ };
40
+ export type HttpTrigger<TTrigger, TInput> = TriggerBase & {
41
+ kind: 'http';
42
+ input: HttpPayload<TTrigger, TInput>;
43
+ request: HttpRequest;
44
+ subscriptions?: string[];
45
+ coalesced?: CoalescedInfo;
46
+ };
47
+ export type EventTrigger = TriggerBase & {
48
+ kind: 'event';
49
+ input: {
50
+ event: OnEventType;
51
+ };
52
+ };
53
+ export type Trigger<TTrigger extends FunctionTriggerDefinition | undefined, TInput> = TTrigger extends {
54
+ kind: 'schedule';
55
+ } ? ScheduleTrigger : TTrigger extends {
56
+ kind: 'http';
57
+ } ? HttpTrigger<TTrigger, TInput> : TTrigger extends {
58
+ kind: 'event';
59
+ } ? EventTrigger : InvokeTrigger<TInput>;
60
+ export type FunctionTrigger = Trigger<FunctionTriggerDefinition, JsonValue>;
61
+ export {};
@@ -221,6 +221,40 @@ export type PostFunctionDeploymentResult = ApiEndpoint<{
221
221
  ok: true;
222
222
  };
223
223
  }>;
224
+ export type FunctionInvocationType = 'wait' | 'no_wait';
225
+ export type FunctionInvocationErrorCode = 'function_failed' | 'server_error' | 'connection_not_found' | 'function_not_found' | 'function_disabled' | 'validation_error' | 'invalid_invocation';
226
+ type FunctionInvocationSuccess = any;
227
+ export type PostFunctionInvocation = ApiEndpoint<{
228
+ Audit: {
229
+ kind: 'no-audit';
230
+ reason: 'non-auditable';
231
+ };
232
+ Method: 'POST';
233
+ Path: '/functions/invocations';
234
+ Body: {
235
+ connection_id: string;
236
+ integration_id: string;
237
+ name: string;
238
+ input?: unknown | undefined;
239
+ invocation_type: FunctionInvocationType;
240
+ options?: Record<string, unknown> | undefined;
241
+ };
242
+ Error: ApiError<FunctionInvocationErrorCode>;
243
+ Success: FunctionInvocationSuccess;
244
+ }>;
245
+ export type GetFunctionInvocation = ApiEndpoint<{
246
+ Audit: {
247
+ kind: 'no-audit';
248
+ reason: 'non-auditable';
249
+ };
250
+ Method: 'GET';
251
+ Path: '/functions/invocations/:id';
252
+ Params: {
253
+ id: string;
254
+ };
255
+ Error: ApiError<'invalid_uri_params' | 'not_found' | 'function_failed' | 'server_error'>;
256
+ Success: FunctionInvocationSuccess;
257
+ }>;
224
258
  export interface FunctionListFilters {
225
259
  type?: FunctionType;
226
260
  search?: string;
@@ -448,3 +482,4 @@ export type PostFunctionDeploymentBundle = ApiEndpoint<{
448
482
  Error: ApiError<'functions_deployment_error' | 'concurrent_deployment' | 'integration_not_found'>;
449
483
  Success: FunctionDeploymentBundleSuccess;
450
484
  }>;
485
+ export {};
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export type * from './api.js';
3
3
  export type * from './api.endpoints.js';
4
4
  export type * from './audit-trail/api.js';
5
5
  export type * from './audit-trail/event.js';
6
+ export type * from './audit-trail/metadata.js';
6
7
  export type * from './gettingStarted/db.js';
7
8
  export type * from './gettingStarted/dto.js';
8
9
  export type * from './gettingStarted/api.js';
@@ -11,6 +12,12 @@ export type * from './logs/api.js';
11
12
  export type * from './logs/messages.js';
12
13
  export type * from './keystore/index.js';
13
14
  export type * from './action/api.js';
15
+ export type * from './agent/api.js';
16
+ export type * from './agent/connections.js';
17
+ export type * from './agent/mcp.api.js';
18
+ export type * from './agent/session.js';
19
+ export type * from './agent/toolSearch.js';
20
+ export type * from './agent/toolset.js';
14
21
  export type * from './admin/http.api.js';
15
22
  export type * from './account/api.js';
16
23
  export type * from './account/context.js';
@@ -71,8 +78,7 @@ export type * from './proxy/http.api.js';
71
78
  export type * from './dbConfig/db.js';
72
79
  export type * from './nangoYaml/index.js';
73
80
  export type * from './environment/db.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';
81
+ export type { ACCOUNT_API_KEY_SCOPES, AccountApiKeyScope, API_KEY_SCOPES, ApiKeyScope, ConcreteAccountApiKeyScope, ConcreteApiKeyScope, CustomerKeyScope, WildcardsFor } from './api-keys/scopes.js';
76
82
  export type * from './api-keys/auth.js';
77
83
  export type * from './environment/api/index.js';
78
84
  export type * from './environment/api/webhook.js';
@@ -95,9 +101,11 @@ export type * from './checkpoint/types.js';
95
101
  export type * from './checkpoint/db.js';
96
102
  export type * from './mcp/api.js';
97
103
  export type * from './mfa/api.js';
104
+ export type * from './mfa/credential.js';
98
105
  export type * from './mfa/db.js';
99
106
  export type * from './function/config.js';
100
107
  export type * from './function/db.js';
108
+ export type * from './function/trigger.js';
101
109
  export type * from './functions/api.js';
102
110
  export type * from './functions/domain.js';
103
111
  export type * from './lambda/index.js';
@@ -1,4 +1,11 @@
1
- export type EntityType = 'connect_session' | 'connection' | 'environment';
1
+ export type EntityType = 'connect_session' | 'connection' | 'environment' | 'agent_session';
2
+ export type PrivateKeyEntityRef = {
3
+ entityType: Exclude<EntityType, 'agent_session'>;
4
+ entityId: number;
5
+ } | {
6
+ entityType: 'agent_session';
7
+ entityUuid: string;
8
+ };
2
9
  export interface PrivateKey {
3
10
  readonly id: number;
4
11
  readonly displayName: string;
@@ -10,5 +17,6 @@ export interface PrivateKey {
10
17
  readonly expiresAt: Date | null;
11
18
  readonly lastAccessAt: Date | null;
12
19
  readonly entityType: EntityType;
13
- readonly entityId: number;
20
+ readonly entityId: number | null;
21
+ readonly entityUuid: string | null;
14
22
  }
@@ -20,6 +20,10 @@ export type OperationState = 'waiting' | 'running' | 'success' | 'failed' | 'tim
20
20
  /**
21
21
  * Operations
22
22
  */
23
+ export interface OperationFunction {
24
+ type: 'function';
25
+ action: 'invoke';
26
+ }
23
27
  export interface OperationSync {
24
28
  type: 'sync';
25
29
  action: 'pause' | 'unpause' | 'run' | 'request_run' | 'request_run_full' | 'cancel' | 'init' | 'create_variant' | 'delete_variant';
@@ -46,13 +50,27 @@ export interface OperationAdmin {
46
50
  }
47
51
  export interface OperationWebhook {
48
52
  type: 'webhook';
49
- action: 'incoming' | 'forward' | 'sync' | 'connection_create' | 'connection_refresh';
53
+ action: 'incoming' | 'forward' | 'sync' | 'connection_create' | 'connection_refresh' | 'connection_delete';
50
54
  }
51
55
  export interface OperationDeploy {
52
56
  type: 'deploy';
53
57
  action: 'prebuilt' | 'custom';
54
58
  }
55
- export type OperationList = OperationSync | OperationProxy | OperationAction | OperationWebhook | OperationOnEvents | OperationDeploy | OperationAuth | OperationAdmin;
59
+ export interface OperationAgentSession {
60
+ type: 'agent_session';
61
+ action: 'create';
62
+ }
63
+ export type OperationList = OperationFunction | OperationSync | OperationProxy | OperationAction | OperationWebhook | OperationOnEvents | OperationDeploy | OperationAuth | OperationAdmin | OperationAgentSession;
64
+ /**
65
+ * Who triggered an operation
66
+ */
67
+ export type OperationActor = {
68
+ kind: 'user';
69
+ id: number;
70
+ } | {
71
+ kind: 'session';
72
+ id: string;
73
+ };
56
74
  export interface MessageError {
57
75
  name: string;
58
76
  message: string;
@@ -141,7 +159,10 @@ export interface OperationRow {
141
159
  syncConfigId?: number | undefined;
142
160
  syncConfigName?: string | undefined;
143
161
  jobId?: string | undefined;
144
- userId?: number | undefined;
162
+ /**
163
+ * Who triggered this operation, i.e: a dashboard user or an agent session
164
+ */
165
+ actor?: OperationActor | undefined;
145
166
  error?: MessageError | undefined;
146
167
  request?: MessageHTTPRequest | undefined;
147
168
  response?: MessageHTTPResponse | undefined;
@@ -19,6 +19,7 @@ export type GetMeta = ApiEndpoint<{
19
19
  debugMode: boolean;
20
20
  gettingStartedClosed: boolean;
21
21
  auditTrail: boolean;
22
+ s26Pricing: boolean;
22
23
  };
23
24
  };
24
25
  }>;
package/dist/mfa/api.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import type { ApiEndpoint, ApiError } from '../api.js';
2
2
  import type { AuditPolicy } from '../audit-trail/event.js';
3
3
  import type { ApiUser } from '../user/api.js';
4
+ import type { MFACredential } from './credential.js';
4
5
  type MFAError = ApiError<'invalid_mfa_code'> | ApiError<'mfa_already_enabled'> | ApiError<'mfa_enrollment_not_found'> | ApiError<'mfa_not_enabled'>;
5
6
  export type GetMFAStatus = ApiEndpoint<{
6
7
  Audit: {
@@ -71,13 +72,7 @@ export type PostMFALoginVerification = ApiEndpoint<{
71
72
  Audit: AuditPolicy<'mfa', 'verified', 'account'>;
72
73
  Method: 'POST';
73
74
  Path: '/api/v1/account/mfa/login/verify';
74
- Body: {
75
- type: 'code';
76
- code: string;
77
- } | {
78
- type: 'recoveryCode';
79
- recoveryCode: string;
80
- };
75
+ Body: MFACredential;
81
76
  Error: ApiError<'invalid_mfa_code'> | ApiError<'mfa_login_expired'>;
82
77
  Success: {
83
78
  data: {
@@ -0,0 +1,7 @@
1
+ export type MFACredential = {
2
+ type: 'code';
3
+ code: string;
4
+ } | {
5
+ type: 'recoveryCode';
6
+ recoveryCode: string;
7
+ };
package/dist/mfa/db.d.ts CHANGED
@@ -9,6 +9,7 @@ export interface DBMFAFactor extends Timestamps {
9
9
  auth_tag: string;
10
10
  enabled_at: Date | null;
11
11
  last_accepted_counter: string | null;
12
+ clock_offset_steps: number;
12
13
  }
13
14
  export interface DBMFARecoveryCode {
14
15
  id: string;
@@ -23,7 +23,7 @@ type WithTags<T> = T & {
23
23
  };
24
24
  export type RunnerDataTransferTelemetry = WithTags<{
25
25
  type: 'data_transfer';
26
- callsite: 'proxy' | 'uncontrolled_fetch' | 'persist_records' | 'persist_logs';
26
+ callsite: 'proxy' | 'uncontrolled_fetch' | 'persist_records' | 'persist_customer_logs' | 'persist_system_logs' | 'persist_logs';
27
27
  bytesSent: number;
28
28
  bytesReceived: number;
29
29
  count: number;
@@ -3,7 +3,7 @@ type FunctionRuntime = 'runner' | 'lambda';
3
3
  export interface DBPlan extends Timestamps {
4
4
  id: number;
5
5
  account_id: number;
6
- name: 'free' | 'free-uncapped' | 'startup-deal' | 'starter-v2' | 'growth-v2' | 'enterprise' | 'enterprise-cloud-hosted' | 'starter' | 'growth' | 'starter-legacy' | 'scale-legacy' | 'growth-legacy';
6
+ name: 'free' | 'free-uncapped' | 'startup-deal' | 'pay-as-you-go' | 'starter-v2' | 'growth-v2' | 'enterprise' | 'enterprise-cloud-hosted' | 'starter' | 'growth' | 'starter-legacy' | 'scale-legacy' | 'growth-legacy';
7
7
  stripe_customer_id: string | null;
8
8
  stripe_payment_id: string | null;
9
9
  orb_customer_id: string | null;
@@ -44,6 +44,11 @@ export interface DBPlan extends Timestamps {
44
44
  * @default null
45
45
  */
46
46
  function_compute_gbms_max: number | null;
47
+ /** Limit the amount of function runtime (in "started seconds") that can be used in a month
48
+ * Set to null to remove limit
49
+ * @default null
50
+ */
51
+ function_duration_seconds_max: number | null;
47
52
  /** Limit the number of webhook forwards that can happen in a month
48
53
  * Set to null to remove limit
49
54
  * @default null
@@ -111,6 +116,16 @@ export interface DBPlan extends Timestamps {
111
116
  * @default false
112
117
  */
113
118
  has_rbac: boolean;
119
+ /**
120
+ * Record control-plane audit trail events
121
+ * @default false
122
+ */
123
+ has_audit_trail_control_plane: boolean;
124
+ /**
125
+ * Let the customer reach their audit trail, through the dashboard, the API and export
126
+ * @default false
127
+ */
128
+ has_audit_trail_access: boolean;
114
129
  /**
115
130
  * Enable or disable the ability to override the docs connect url from the connect session
116
131
  * @default false
@@ -151,6 +166,11 @@ export interface DBPlan extends Timestamps {
151
166
  * @default "runner"
152
167
  */
153
168
  on_event_function_runtime: FunctionRuntime;
169
+ /**
170
+ * Function Runtime
171
+ * @default "lambda"
172
+ */
173
+ function_runtime: FunctionRuntime;
154
174
  /**
155
175
  * Enable or disable records autopruning
156
176
  * @default true
@@ -134,6 +134,115 @@ export type GetBillingUsage = ApiEndpoint<{
134
134
  };
135
135
  };
136
136
  }>;
137
+ export type GetOverdueInvoices = ApiEndpoint<{
138
+ Audit: {
139
+ kind: 'no-audit';
140
+ reason: 'non-auditable';
141
+ };
142
+ Method: 'GET';
143
+ Path: '/api/v1/plans/billing/overdue';
144
+ Querystring: {
145
+ env: string;
146
+ };
147
+ Success: {
148
+ data: {
149
+ hasOverdue: boolean;
150
+ portalUrl: string | null;
151
+ };
152
+ };
153
+ }>;
154
+ export type GetUpcomingInvoice = ApiEndpoint<{
155
+ Audit: {
156
+ kind: 'no-audit';
157
+ reason: 'non-auditable';
158
+ };
159
+ Method: 'GET';
160
+ Path: '/api/v1/plans/billing/upcoming-invoice';
161
+ Querystring: {
162
+ env: string;
163
+ };
164
+ Success: {
165
+ data: {
166
+ amountInCents: number | null;
167
+ currency: string | null;
168
+ };
169
+ };
170
+ }>;
171
+ export type GetBillingPeriodCosts = ApiEndpoint<{
172
+ Audit: {
173
+ kind: 'no-audit';
174
+ reason: 'non-auditable';
175
+ };
176
+ Method: 'GET';
177
+ Path: '/api/v1/plans/billing/period-costs';
178
+ Querystring: {
179
+ env: string;
180
+ };
181
+ Success: {
182
+ data: {
183
+ metrics: Partial<Record<UsageMetric, number>>;
184
+ /** Metrics with a real price whose charge couldn't be read — show a dash, not $0. */
185
+ malformedMetrics: UsageMetric[];
186
+ /** False when some usage price mapped to no metric of ours — an absent metric can't safely
187
+ * read as $0, since the money might be one of theirs. */
188
+ fullyAttributed: boolean;
189
+ currency: string | null;
190
+ /** True when there's no billing period to report costs for — a free plan, no linked
191
+ * subscription, or an ended one. `metrics`/`currency` are otherwise never empty/null. */
192
+ noCosts: boolean;
193
+ };
194
+ };
195
+ }>;
196
+ export type GetSpendAlert = ApiEndpoint<{
197
+ Audit: {
198
+ kind: 'no-audit';
199
+ reason: 'non-auditable';
200
+ };
201
+ Method: 'GET';
202
+ Path: '/api/v1/plans/billing/spend-alert';
203
+ Querystring: {
204
+ env: string;
205
+ };
206
+ Success: {
207
+ data: {
208
+ /** Null when the plan gets no spend alerts, or none has been set. */
209
+ thresholdInCents: number | null;
210
+ /**
211
+ * ISO 4217. Null when there's nothing to price a threshold against — a non-spend plan,
212
+ * or no Orb subscription yet; otherwise set even when the threshold is null.
213
+ */
214
+ currency: string | null;
215
+ };
216
+ };
217
+ }>;
218
+ export type PutSpendAlert = ApiEndpoint<{
219
+ Audit: AuditPolicy<'billing', 'spend_alert_changed', 'account'>;
220
+ Method: 'PUT';
221
+ Path: '/api/v1/plans/billing/spend-alert';
222
+ Querystring: {
223
+ env: string;
224
+ };
225
+ Body: {
226
+ thresholdInCents: number;
227
+ };
228
+ Success: {
229
+ data: {
230
+ thresholdInCents: number;
231
+ currency: string | null;
232
+ };
233
+ };
234
+ }>;
235
+ export type DeleteSpendAlert = ApiEndpoint<{
236
+ Audit: AuditPolicy<'billing', 'spend_alert_removed', 'account'>;
237
+ Method: 'DELETE';
238
+ Path: '/api/v1/plans/billing/spend-alert';
239
+ Querystring: {
240
+ env: string;
241
+ };
242
+ Success: {
243
+ success: true;
244
+ };
245
+ }>;
137
246
  export type PutBillingInvoicingDetails = ApiEndpoint<{
138
247
  Audit: AuditPolicy<'billing', 'details_changed', 'account'>;
139
248
  Method: 'PUT';
@@ -220,6 +220,7 @@ export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
220
220
  recipient?: string;
221
221
  header?: Record<string, string>;
222
222
  payload?: Record<string, string>;
223
+ singleUse?: boolean;
223
224
  };
224
225
  assertion_option?: Record<string, SimplifiedJSONSchema>;
225
226
  token_expires_in_ms?: number;
@@ -72,7 +72,7 @@ export type UsageConnectionsEvent = UsageEventBase<'usage.connections', {
72
72
  export type UsageFunctionExecutionsEvent = UsageEventBase<'usage.function_executions', {
73
73
  value: number;
74
74
  properties: {
75
- type: 'sync' | 'action' | 'webhook' | 'on-event';
75
+ type: 'function' | 'sync' | 'action' | 'webhook' | 'on-event';
76
76
  success: boolean;
77
77
  functionName: string;
78
78
  runtime: FunctionRuntime | undefined;
@@ -97,7 +97,7 @@ export type UsageWebhookForwardEvent = UsageEventBase<'usage.webhook_forward', {
97
97
  success: boolean;
98
98
  };
99
99
  }>;
100
- export type DataTransferCallsite = 'credential_test_hook' | 'credential_verification_hook' | 'connection_hook' | 'webhook_forward' | 'proxy' | 'uncontrolled_fetch' | 'persist_logs' | 'persist_records' | 'get_/records' | 'get_/proxy' | 'patch_/proxy' | 'post_/proxy' | 'put_/proxy' | 'delete_/proxy' | 'unknown_/proxy';
100
+ export type DataTransferCallsite = 'credential_test_hook' | 'credential_verification_hook' | 'connection_hook' | 'webhook_forward' | 'proxy' | 'uncontrolled_fetch' | 'persist_customer_logs' | 'persist_system_logs' | 'persist_logs' | 'persist_records' | 'get_/records' | 'get_/proxy' | 'patch_/proxy' | 'post_/proxy' | 'put_/proxy' | 'delete_/proxy' | 'unknown_/proxy';
101
101
  export type UsageDataTransferEvent = UsageEventBase<'usage.data_transfer', {
102
102
  value: number;
103
103
  properties: {
@@ -8,7 +8,7 @@ export interface SdkLogger {
8
8
  level: LogLevel | 'off';
9
9
  }
10
10
  export type ConflictResolutionMode = 'IN_MEMORY' | 'DISTRIBUTED';
11
- export type ScriptType = 'sync' | 'action' | 'webhook' | 'on-event';
11
+ export type ScriptType = 'function' | 'sync' | 'action' | 'webhook' | 'on-event';
12
12
  export interface NangoProps {
13
13
  scriptType: ScriptType;
14
14
  host?: string;
@@ -44,6 +44,7 @@ export interface SharedCredentialsBodyInput {
44
44
  client_id: string;
45
45
  client_secret: string;
46
46
  scopes?: string | undefined;
47
+ app_link?: string | undefined;
47
48
  }
48
49
  export interface SharedCredentialsOutput {
49
50
  id: number;
@@ -52,6 +53,7 @@ export interface SharedCredentialsOutput {
52
53
  client_id: string;
53
54
  client_secret: string;
54
55
  scopes?: string | undefined;
56
+ app_link?: string | undefined;
55
57
  };
56
58
  created_at: string;
57
59
  updated_at: string;
@@ -5,6 +5,7 @@ export interface SharedCredentials {
5
5
  oauth_scopes?: string;
6
6
  oauth_client_secret_iv: string;
7
7
  oauth_client_secret_tag: string;
8
+ app_link?: string;
8
9
  }
9
10
  export interface DBSharedCredentials extends Timestamps {
10
11
  id: number;
@@ -1,2 +1,2 @@
1
1
  import type { SharedCredentials } from './db.js';
2
- export type SharedCredentialsInputDto = Pick<SharedCredentials, 'oauth_client_id' | 'oauth_client_secret' | 'oauth_scopes'>;
2
+ export type SharedCredentialsInputDto = Pick<SharedCredentials, 'oauth_client_id' | 'oauth_client_secret' | 'oauth_scopes' | 'app_link'>;