@nangohq/types 0.70.0 → 0.70.2

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.
@@ -84,7 +84,7 @@ export type PostSignin = Endpoint<{
84
84
  email: string;
85
85
  password: string;
86
86
  };
87
- Error: ApiError<'email_not_verified'> | ApiError<'unauthorized'>;
87
+ Error: ApiError<'email_not_verified'> | ApiError<'user_suspended'> | ApiError<'unauthorized'>;
88
88
  Success: {
89
89
  user: ApiUser;
90
90
  };
@@ -0,0 +1,3 @@
1
+ export declare const API_KEY_SCOPES: readonly ["environment:*", "environment:integrations:list", "environment:integrations:list_credentials", "environment:integrations:read", "environment:integrations:read_credentials", "environment:integrations:write", "environment:integrations:*", "environment:connections:list", "environment:connections:list_credentials", "environment:connections:read", "environment:connections:read_credentials", "environment:connections:write", "environment:connections:*", "environment:connect_sessions:write", "environment:syncs:read", "environment:syncs:execute", "environment:syncs:manage", "environment:syncs:*", "environment:deploy", "environment:records:read", "environment:records:write", "environment:records:*", "environment:actions:execute", "environment:actions:*", "environment:proxy", "environment:config:read", "environment:config:*", "environment:mcp"];
2
+ export type ApiKeyScope = (typeof API_KEY_SCOPES)[number];
3
+ export declare const ALL_SCOPES: string[];
@@ -8,13 +8,13 @@ import type { GetConnectUISettings, PutConnectUISettings } from './connectUISett
8
8
  import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PatchPublicConnection, PostConnectionRefresh, PostPublicConnection } from './connection/api/get.js';
9
9
  import type { SetMetadata, UpdateMetadata } from './connection/api/metadata.js';
10
10
  import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api.js';
11
- import type { DeleteEnvironment, GetEnvironment, GetEnvironments, PatchEnvironment, PostEnvironment } from './environment/api/index.js';
11
+ import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, GetEnvironment, GetEnvironments, ListApiKeys, PatchApiKey, PatchEnvironment, PostEnvironment } from './environment/api/index.js';
12
12
  import type { PatchWebhook } from './environment/api/webhook.js';
13
13
  import type { PostEnvironmentVariables } from './environment/variable/api.js';
14
14
  import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api.js';
15
15
  import type { PostRemoteFunctionCompile, PostRemoteFunctionDeploy, PostRemoteFunctionDryrun } from './functions/api.js';
16
16
  import type { GetGettingStarted, PatchGettingStarted } from './gettingStarted/api.js';
17
- import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetIntegrationFlows, GetPublicIntegration, GetPublicListIntegrations, PatchIntegration, PatchPublicIntegration, PostIntegration, PostPublicIntegration } from './integration/api.js';
17
+ import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetIntegrationFlows, GetPublicFunctionCode, GetPublicIntegration, GetPublicListIntegrations, PatchIntegration, PatchPublicIntegration, PostIntegration, PostPublicIntegration, PostPublicQuickstartIntegration } from './integration/api.js';
18
18
  import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api.js';
19
19
  import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api.js';
20
20
  import type { GetMeta } from './meta/api.js';
@@ -28,8 +28,8 @@ import type { GetPublicSyncStatus, PostPublicSyncPause, PostPublicSyncStart, Pos
28
28
  import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api.js';
29
29
  import type { GetUser, PatchUser } from './user/api.js';
30
30
  import type { PostPublicWebhook } from './webhooks/http.api.js';
31
- export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostRemoteFunctionCompile | PostRemoteFunctionDryrun | PostRemoteFunctionDeploy | AllPublicProxy;
32
- export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | PutBillingInvoicingDetails | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PatchTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | GetManagedEmailVerification | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedEmailVerification | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | GetEnvironment | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider | PostInternalTriggerFunction;
31
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | PatchPublicPruneRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PostPublicQuickstartIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicConnection | PatchPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction | PostRemoteFunctionCompile | PostRemoteFunctionDryrun | PostRemoteFunctionDeploy | GetPublicFunctionCode | AllPublicProxy;
32
+ export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | PutBillingInvoicingDetails | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PatchTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | GetManagedEmailVerification | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedEmailVerification | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | GetEnvironment | ListApiKeys | CreateApiKey | DeleteApiKey | PatchApiKey | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider | PostInternalTriggerFunction;
33
33
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
34
34
  /**
35
35
  * Automatically narrow endpoints type with Method + Path
@@ -29,6 +29,7 @@ export type OAuthBodyFormatType = OAuthBodyFormat[keyof OAuthBodyFormat];
29
29
  export interface OAuthBodyFormat {
30
30
  FORM: 'form';
31
31
  JSON: 'json';
32
+ QUERY: 'query';
32
33
  }
33
34
  export interface ConnectionUpsertResponse {
34
35
  connection: DBConnection;
@@ -24,9 +24,16 @@ export interface BillingClient {
24
24
  applyPendingChanges: (opts: {
25
25
  pendingChangeId: string;
26
26
  /**
27
- * format: dollar.cent = 0.00
27
+ * Stripe PaymentIntent ID, used to cross-reference the payment in Orb.
28
28
  */
29
- amount: string;
29
+ paymentExternalId: string;
30
+ /**
31
+ * Amount collected via Stripe in dollars (e.g. "25.00"). Orb uses this
32
+ * to credit the customer the difference vs. the actual invoice amount,
33
+ * so overcharges (e.g. when falling back to the base fee) are corrected
34
+ * automatically. No credit is issued if the amounts match exactly.
35
+ */
36
+ amountCollected: string;
30
37
  }) => Promise<Result<BillingSubscription>>;
31
38
  cancelPendingChanges: (opts: {
32
39
  pendingChangeId: string;
@@ -2,6 +2,7 @@ import type { ApiError, Endpoint } from '../api.js';
2
2
  import type { CLIDeployFlowConfig, OnEventScriptsByProvider } from './incomingFlow.js';
3
3
  import type { SyncDeploymentResult } from './index.js';
4
4
  import type { OnEventType } from '../scripts/on-events/api.js';
5
+ import type { FunctionSource } from '../syncConfigs/db.js';
5
6
  import type { JSONSchema7 } from 'json-schema';
6
7
  export type PostDeployConfirmation = Endpoint<{
7
8
  Method: 'POST';
@@ -31,6 +32,7 @@ export type PostDeploy = Endpoint<{
31
32
  /** @deprecated Use CLIDeployFlowConfig.models_json_schema */
32
33
  jsonSchema?: JSONSchema7 | undefined;
33
34
  sdkVersion?: string | undefined;
35
+ source?: FunctionSource | undefined;
34
36
  };
35
37
  Success: SyncDeploymentResult[];
36
38
  }>;
@@ -34,7 +34,6 @@ export interface PreBuiltAction {
34
34
  metadata?: NangoConfigMetadata | undefined;
35
35
  providerConfigKey: string;
36
36
  provider: string;
37
- is_public: boolean;
38
37
  public_route: string;
39
38
  name: string;
40
39
  syncName?: string;
@@ -54,7 +53,6 @@ export interface PreBuiltSync {
54
53
  track_deletes: boolean;
55
54
  providerConfigKey: string;
56
55
  provider: string;
57
- is_public: boolean;
58
56
  public_route: string;
59
57
  name: string;
60
58
  syncName?: string;
@@ -1,3 +1,4 @@
1
+ import type { ApiKeyScope } from '../../api-keys/scopes.js';
1
2
  import type { ApiError, ApiTimestamps, Endpoint } from '../../api.js';
2
3
  import type { ApiPlan } from '../../plans/http.api.js';
3
4
  import type { DBEnvironment, DBExternalWebhook } from '../db.js';
@@ -37,6 +38,8 @@ export type GetEnvironment = Endpoint<{
37
38
  name: string;
38
39
  email: string;
39
40
  slack_notifications_channel: string | null;
41
+ webhook_signing_key: string | null;
42
+ managed_secret_key: string | null;
40
43
  };
41
44
  };
42
45
  }>;
@@ -75,3 +78,60 @@ export type GetPublicEnvironmentVariables = Endpoint<{
75
78
  value: string;
76
79
  }[];
77
80
  }>;
81
+ export type ListApiKeys = Endpoint<{
82
+ Method: 'GET';
83
+ Path: '/api/v1/environment/api-keys';
84
+ Success: {
85
+ data: {
86
+ id: number;
87
+ display_name: string;
88
+ scopes: ApiKeyScope[];
89
+ secret: string;
90
+ last_used_at: string | null;
91
+ created_at: string;
92
+ }[];
93
+ };
94
+ }>;
95
+ export type CreateApiKey = Endpoint<{
96
+ Method: 'POST';
97
+ Path: '/api/v1/environment/api-keys';
98
+ Body: {
99
+ display_name: string;
100
+ scopes?: ApiKeyScope[];
101
+ };
102
+ Success: {
103
+ data: {
104
+ id: number;
105
+ display_name: string;
106
+ scopes: ApiKeyScope[];
107
+ secret: string;
108
+ created_at: string;
109
+ };
110
+ };
111
+ Error: ApiError<'conflict' | 'resource_capped'>;
112
+ }>;
113
+ export type DeleteApiKey = Endpoint<{
114
+ Method: 'DELETE';
115
+ Path: '/api/v1/environment/api-keys/:keyId';
116
+ Params: {
117
+ keyId: number;
118
+ };
119
+ Success: {
120
+ success: true;
121
+ };
122
+ }>;
123
+ export type PatchApiKey = Endpoint<{
124
+ Method: 'PATCH';
125
+ Path: '/api/v1/environment/api-keys/:keyId';
126
+ Params: {
127
+ keyId: number;
128
+ };
129
+ Body: {
130
+ scopes?: ApiKeyScope[];
131
+ display_name?: string;
132
+ };
133
+ Success: {
134
+ success: true;
135
+ };
136
+ Error: ApiError<'conflict' | 'not_found'>;
137
+ }>;
@@ -74,3 +74,23 @@ export interface DBAPISecret extends Timestamps {
74
74
  hashed: string;
75
75
  is_default: boolean;
76
76
  }
77
+ export type CustomerKeyType = 'api' | 'webhook_signing';
78
+ export interface DBCustomerKey extends Timestamps {
79
+ id: number;
80
+ account_id: number;
81
+ key_type: CustomerKeyType;
82
+ display_name: string;
83
+ scopes: string[] | null;
84
+ secret: string;
85
+ iv: string;
86
+ tag: string;
87
+ hashed: string;
88
+ last_used_at: Date | null;
89
+ deleted_at: Date | null;
90
+ }
91
+ export type CustomerKeyEntityType = 'environment' | 'account';
92
+ export interface DBCustomerKeyRelation {
93
+ customer_key_id: number;
94
+ entity_type: CustomerKeyEntityType;
95
+ entity_id: number;
96
+ }
@@ -1,6 +1,6 @@
1
1
  import type { LegacySyncModelSchema, NangoConfigMetadata } from '../deploy/incomingFlow.js';
2
2
  import type { NangoModel, NangoSyncEndpointV2, ScriptTypeLiteral, SyncTypeLiteral } from '../nangoYaml/index.js';
3
- import type { Feature } from '../syncConfigs/db.js';
3
+ import type { Feature, FunctionSource } from '../syncConfigs/db.js';
4
4
  import type { JSONSchema7 } from 'json-schema';
5
5
  export interface NangoSyncConfig {
6
6
  name: string;
@@ -14,8 +14,7 @@ export interface NangoSyncConfig {
14
14
  track_deletes?: boolean;
15
15
  returns: string[];
16
16
  endpoints: NangoSyncEndpointV2[];
17
- is_public?: boolean | null;
18
- pre_built?: boolean | null;
17
+ source?: FunctionSource | undefined;
19
18
  version?: string | null;
20
19
  last_deployed?: string | null;
21
20
  id?: number;
@@ -53,7 +53,7 @@ export type PostRemoteFunctionDryrun = Endpoint<{
53
53
  function_type: FunctionType;
54
54
  execution_timeout_at: string;
55
55
  duration_ms: number;
56
- output: string;
56
+ result?: unknown;
57
57
  };
58
58
  }>;
59
59
  export type PostRemoteFunctionDeploy = Endpoint<{
@@ -70,6 +70,11 @@ export type PostRemoteFunctionDeploy = Endpoint<{
70
70
  integration_id: string;
71
71
  function_name: string;
72
72
  function_type: FunctionType;
73
+ deployed: boolean;
74
+ deployed_functions: {
75
+ name: string;
76
+ version: string;
77
+ }[];
73
78
  output: string;
74
79
  };
75
80
  }>;
package/dist/index.d.ts CHANGED
@@ -66,12 +66,15 @@ export type * from './proxy/http.api.js';
66
66
  export type * from './dbConfig/db.js';
67
67
  export type * from './nangoYaml/index.js';
68
68
  export type * from './environment/db.js';
69
+ export { ALL_SCOPES, API_KEY_SCOPES } from './api-keys/scopes.js';
70
+ export type { ApiKeyScope } from './api-keys/scopes.js';
69
71
  export type * from './environment/api/index.js';
70
72
  export type * from './environment/api/webhook.js';
71
73
  export type * from './environment/api/otlp.js';
72
74
  export type * from './environment/variable/index.js';
73
75
  export type * from './environment/variable/api.js';
74
76
  export type * from './webhooks/api.js';
77
+ export type * from './webhooks/dispatch.js';
75
78
  export type * from './webhooks/http.api.js';
76
79
  export type * from './flow/http.api.js';
77
80
  export type * from './flow/index.js';
@@ -1,7 +1,8 @@
1
- import type { ApiTimestamps, Endpoint } from '../api.js';
1
+ import type { ApiError, ApiTimestamps, Endpoint } from '../api.js';
2
2
  import type { IntegrationConfig } from './db.js';
3
3
  import type { AuthModeType, AuthModes } from '../auth/api.js';
4
4
  import type { NangoSyncConfig } from '../flow/index.js';
5
+ import type { ScriptTypeLiteral } from '../nangoYaml/index.js';
5
6
  import type { Provider } from '../providers/provider.js';
6
7
  import type { Merge } from 'type-fest';
7
8
  export type ApiPublicIntegration = Merge<Pick<IntegrationConfig, 'created_at' | 'updated_at' | 'unique_key' | 'provider' | 'display_name' | 'forward_webhooks'>, ApiTimestamps> & {
@@ -46,6 +47,19 @@ export type PostPublicIntegration = Endpoint<{
46
47
  data: ApiPublicIntegration;
47
48
  };
48
49
  }>;
50
+ export type PostPublicQuickstartIntegration = Endpoint<{
51
+ Method: 'POST';
52
+ Path: '/integrations/quickstart';
53
+ Body: {
54
+ provider: string;
55
+ unique_key: string;
56
+ display_name?: string | undefined;
57
+ forward_webhooks?: boolean | undefined;
58
+ };
59
+ Success: {
60
+ data: ApiPublicIntegration;
61
+ };
62
+ }>;
49
63
  export type GetPublicIntegration = Endpoint<{
50
64
  Method: 'GET';
51
65
  Path: '/integrations/:uniqueKey';
@@ -85,6 +99,27 @@ export type DeletePublicIntegration = Endpoint<{
85
99
  success: true;
86
100
  };
87
101
  }>;
102
+ export type GetPublicFunctionCode = Endpoint<{
103
+ Method: 'GET';
104
+ Path: '/integrations/:uniqueKey/functions/:name/code';
105
+ Params: {
106
+ uniqueKey: string;
107
+ name: string;
108
+ };
109
+ Querystring: {
110
+ type?: ScriptTypeLiteral | undefined;
111
+ };
112
+ Success: {
113
+ type: ScriptTypeLiteral;
114
+ code: string;
115
+ };
116
+ Error: ApiError<'not_found'> | ApiError<'ambiguous_function', undefined, {
117
+ matches: {
118
+ type: ScriptTypeLiteral;
119
+ name: string;
120
+ }[];
121
+ }>;
122
+ }>;
88
123
  export type ApiIntegration = Omit<Merge<IntegrationConfig, ApiTimestamps>, 'oauth_client_secret_iv' | 'oauth_client_secret_tag'>;
89
124
  export type ApiIntegrationList = ApiIntegration & {
90
125
  meta: {
@@ -22,7 +22,7 @@ export type OperationState = 'waiting' | 'running' | 'success' | 'failed' | 'tim
22
22
  */
23
23
  export interface OperationSync {
24
24
  type: 'sync';
25
- action: 'pause' | 'unpause' | 'run' | 'request_run' | 'request_run_full' | 'cancel' | 'init';
25
+ action: 'pause' | 'unpause' | 'run' | 'request_run' | 'request_run_full' | 'cancel' | 'init' | 'create_variant' | 'delete_variant';
26
26
  }
27
27
  export interface OperationProxy {
28
28
  type: 'proxy';
@@ -28,6 +28,10 @@ export interface DeleteRecordsSuccess {
28
28
  export interface DeleteOutdatedRecordsSuccess {
29
29
  deletedKeys: string[];
30
30
  }
31
+ export interface DeleteHardAllRecordsSuccess {
32
+ deletedCount: number;
33
+ hasMore: boolean;
34
+ }
31
35
  export interface GetCursorSuccess {
32
36
  cursor?: string;
33
37
  }
@@ -102,7 +102,7 @@ export interface DBPlan extends Timestamps {
102
102
  has_webhooks_forward: boolean;
103
103
  /**
104
104
  * Enable role-based access control (non-administrator roles)
105
- * When false, all users/invites must be 'administrator'
105
+ * When false, all users/invites must use the default user role
106
106
  * @default false
107
107
  */
108
108
  has_rbac: boolean;
@@ -166,5 +166,10 @@ export interface DBPlan extends Timestamps {
166
166
  * @default null
167
167
  */
168
168
  fleet_node_routing_override: string | null;
169
+ /**
170
+ * Enable or disable tenant isolation for functions executions
171
+ * @default false
172
+ */
173
+ lambda_tenant_isolation: boolean;
169
174
  }
170
175
  export {};
@@ -13,7 +13,12 @@ interface EventBase<TSubject extends string, TType extends string, TPayload exte
13
13
  createdAt: Date;
14
14
  }
15
15
  type EnforceEventBase<T extends EventBase<any, any, any>> = T;
16
- export type Event = EnforceEventBase<UserCreatedEvent | UsageEvent | TeamUpdatedEvent>;
16
+ export type LambdaKeepWarmInvokeEvent = EventBase<'lambda_keep_warm', 'lambda_keep_warm.invoke', {
17
+ accountId: number;
18
+ environmentId: number;
19
+ provisionedConcurrency: number;
20
+ }>;
21
+ export type Event = EnforceEventBase<UserCreatedEvent | UsageEvent | TeamUpdatedEvent | LambdaKeepWarmInvokeEvent>;
17
22
  export type UserCreatedEvent = EventBase<'user', 'user.created', {
18
23
  userId: DBUser['id'];
19
24
  teamId: DBTeam['id'];
@@ -40,6 +45,7 @@ export type UsageRecordsEvent = UsageEventBase<'usage.records', {
40
45
  properties: {
41
46
  syncId: string;
42
47
  model: string;
48
+ batchId?: string;
43
49
  };
44
50
  }>;
45
51
  export type UsageMarEvent = UsageEventBase<'usage.monthly_active_records', {
@@ -57,6 +63,9 @@ export type UsageActionsEvent = UsageEventBase<'usage.actions', {
57
63
  }>;
58
64
  export type UsageConnectionsEvent = UsageEventBase<'usage.connections', {
59
65
  value: number;
66
+ properties: {
67
+ batchId?: string;
68
+ };
60
69
  }>;
61
70
  export type UsageFunctionExecutionsEvent = UsageEventBase<'usage.function_executions', {
62
71
  value: number;
@@ -26,6 +26,7 @@ export interface NangoProps {
26
26
  nangoConnectionId: number;
27
27
  syncJobId?: number | undefined;
28
28
  track_deletes?: boolean;
29
+ emptyCache?: boolean;
29
30
  attributes?: object | undefined;
30
31
  abortSignal?: AbortSignal;
31
32
  syncConfig: DBSyncConfig;
@@ -3,6 +3,7 @@ import type { LegacySyncModelSchema, NangoConfigMetadata } from '../deploy/incom
3
3
  import type { NangoModel, ScriptTypeLiteral, SyncTypeLiteral } from '../nangoYaml/index.js';
4
4
  import type { JSONSchema7 } from 'json-schema';
5
5
  export type Feature = 'checkpoints';
6
+ export type FunctionSource = 'catalog' | 'standalone' | 'repo';
6
7
  export interface DBSyncConfig extends TimestampsAndDeleted {
7
8
  id: number;
8
9
  sync_name: string;
@@ -18,8 +19,11 @@ export interface DBSyncConfig extends TimestampsAndDeleted {
18
19
  type: ScriptTypeLiteral;
19
20
  auto_start: boolean;
20
21
  attributes: object;
21
- pre_built: boolean;
22
- is_public: boolean;
22
+ source?: FunctionSource | undefined;
23
+ /** @deprecated use `source`. Dual-written during the rollout so old readers still classify catalog rows correctly. */
24
+ pre_built?: boolean | undefined;
25
+ /** @deprecated use `source`. Dual-written during the rollout so old readers still classify catalog rows correctly. */
26
+ is_public?: boolean | undefined;
23
27
  metadata: NangoConfigMetadata;
24
28
  input: string | null;
25
29
  /** @deprecated **/
@@ -0,0 +1,34 @@
1
+ import type { JsonValue } from 'type-fest';
2
+ /**
3
+ * SQS message envelope for the webhook task-dispatch queue.
4
+ *
5
+ * The server produces one of these per (syncConfig × webhook subscription × connection)
6
+ * triple resulting from an inbound provider webhook. The jobs consumer parses these and
7
+ * calls the orchestrator to schedule the actual webhook task using `taskName` as the
8
+ * idempotency key.
9
+ */
10
+ export interface WebhookDispatchMessage {
11
+ version: 1;
12
+ kind: 'webhook';
13
+ /**
14
+ * Deterministic scheduler task name; used by the orchestrator as the
15
+ * idempotency key so duplicate SQS deliveries resolve to the same task.
16
+ */
17
+ taskName: string;
18
+ createdAt: string;
19
+ accountId: number;
20
+ integrationId: number;
21
+ provider: string;
22
+ parentSyncName: string;
23
+ /** Webhook subscription name matched on the inbound payload; passed to executeWebhook as args.webhookName. */
24
+ webhookName: string;
25
+ /** Activity log id created before enqueue; reused so redelivery of this published message keeps the same taskName. */
26
+ activityLogId: string;
27
+ connection: {
28
+ id: number;
29
+ connection_id: string;
30
+ provider_config_key: string;
31
+ environment_id: number;
32
+ };
33
+ payload: JsonValue;
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.70.0",
3
+ "version": "0.70.2",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",
@@ -12,7 +12,7 @@
12
12
  "directory": "packages/utils"
13
13
  },
14
14
  "dependencies": {
15
- "axios": "1.15.0",
15
+ "axios": "1.15.2",
16
16
  "json-schema": "0.4.0",
17
17
  "type-fest": "4.41.0"
18
18
  },