@nangohq/types 0.70.4 → 0.70.5

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.
@@ -1,3 +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"];
1
+ export declare const API_KEY_SCOPES: readonly ["environment:*", "environment:integrations:list", "environment:integrations:list_credentials", "environment:integrations:list_functions", "environment:integrations:read", "environment:integrations:read_credentials", "environment:integrations:create", "environment:integrations:update", "environment:integrations:delete", "environment:integrations:*", "environment:connections:list", "environment:connections:list_credentials", "environment:connections:read", "environment:connections:read_credentials", "environment:connections:create", "environment:connections:update", "environment:connections:delete", "environment:connections:*", "environment:connect_sessions:write", "environment:syncs:read", "environment:syncs:execute", "environment:syncs:update", "environment:syncs:variant:create", "environment:syncs:variant:delete", "environment:syncs:*", "environment:deploy", "environment:dryrun", "environment:records:read", "environment:records:write", "environment:records:*", "environment:actions:execute", "environment:actions:*", "environment:proxy", "environment:variables:read", "environment:mcp"];
2
2
  export type ApiKeyScope = (typeof API_KEY_SCOPES)[number];
3
3
  export declare const ALL_SCOPES: string[];
@@ -12,7 +12,7 @@ import type { CreateApiKey, DeleteApiKey, DeleteEnvironment, GetEnvironment, Get
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
- import type { GetIntegrationFunctions, GetProviderTemplates, PostRemoteFunctionCompile, PostRemoteFunctionDeploy, PostRemoteFunctionDryrun } from './functions/api.js';
15
+ import type { GetIntegrationFunction, GetIntegrationFunctions, GetIntegrationTemplates, GetProviderTemplates, PostRemoteFunctionCompile, PostRemoteFunctionDeploy, PostRemoteFunctionDryrun } from './functions/api.js';
16
16
  import type { GetGettingStarted, PatchGettingStarted } from './gettingStarted/api.js';
17
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';
@@ -29,7 +29,7 @@ import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api
29
29
  import type { GetUser, PatchUser } from './user/api.js';
30
30
  import type { PostPublicWebhook } from './webhooks/http.api.js';
31
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 | GetIntegrationFunctions | GetProviderTemplates | 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;
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 | GetIntegrationFunction | GetIntegrationFunctions | GetIntegrationTemplates | GetProviderTemplates | 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
@@ -85,6 +85,9 @@ export interface DBCustomerKey extends Timestamps {
85
85
  iv: string;
86
86
  tag: string;
87
87
  hashed: string;
88
+ sandbox_signing_secret: string | null;
89
+ sandbox_signing_secret_iv: string | null;
90
+ sandbox_signing_secret_tag: string | null;
88
91
  last_used_at: Date | null;
89
92
  deleted_at: Date | null;
90
93
  }
@@ -1,8 +1,5 @@
1
1
  import type { ApiError, Endpoint } from '../api.js';
2
- import type { OnEventType } from '../scripts/on-events/api.js';
3
- import type { FunctionSource } from '../syncConfigs/db.js';
4
- import type { JSONSchema7 } from 'json-schema';
5
- export type FunctionType = 'action' | 'sync' | 'on-event';
2
+ import type { DeployedNangoFunction, FunctionType, NangoActionFunction, NangoFunctionTemplate, NangoSyncFunction } from './domain.js';
6
3
  export type FunctionErrorCode = 'invalid_request' | 'integration_not_found' | 'compilation_error' | 'dryrun_error' | 'deployment_error' | 'connection_not_found' | 'function_disabled' | 'timeout' | 'validation_error';
7
4
  export interface ProxyCall {
8
5
  method: string;
@@ -81,49 +78,13 @@ export type PostRemoteFunctionDeploy = Endpoint<{
81
78
  output: string;
82
79
  };
83
80
  }>;
84
- interface NangoFunctionBase {
85
- name: string;
86
- description?: string;
87
- scopes?: string[];
88
- }
89
- export interface NangoSyncFunction extends NangoFunctionBase {
90
- type: 'sync';
91
- input?: string;
92
- returns: string[];
93
- json_schema: JSONSchema7 | null;
94
- /** Cron expression. */
95
- runs: string | null;
96
- auto_start: boolean;
97
- track_deletes: boolean;
98
- }
99
- export interface NangoActionFunction extends NangoFunctionBase {
100
- type: 'action';
101
- input?: string;
102
- returns: string[];
103
- json_schema: JSONSchema7 | null;
104
- }
105
- export interface NangoOnEventFunction extends NangoFunctionBase {
106
- type: 'on-event';
107
- event: OnEventType;
108
- }
109
- export type NangoFunction = NangoSyncFunction | NangoActionFunction | NangoOnEventFunction;
110
- interface DeployedMeta {
111
- id: number;
112
- enabled: boolean;
113
- /** ISO-8601 timestamp. */
114
- last_deployed: string;
115
- source: FunctionSource;
116
- }
117
- export type NangoSyncFunctionDeployed = NangoSyncFunction & DeployedMeta;
118
- export type NangoActionFunctionDeployed = NangoActionFunction & DeployedMeta;
119
- export type NangoOnEventFunctionDeployed = NangoOnEventFunction & DeployedMeta;
120
- export type NangoFunctionDeployed = NangoSyncFunctionDeployed | NangoActionFunctionDeployed | NangoOnEventFunctionDeployed;
121
81
  export type GetIntegrationFunctions = Endpoint<{
122
82
  Method: 'GET';
123
83
  Path: '/api/v1/integrations/:providerConfigKey/functions';
124
84
  Querystring: {
125
85
  env: string;
126
86
  type?: FunctionType;
87
+ search?: string;
127
88
  page?: number;
128
89
  limit?: number;
129
90
  };
@@ -131,7 +92,7 @@ export type GetIntegrationFunctions = Endpoint<{
131
92
  providerConfigKey: string;
132
93
  };
133
94
  Success: {
134
- data: NangoFunctionDeployed[];
95
+ data: DeployedNangoFunction[];
135
96
  pagination: {
136
97
  total: number;
137
98
  page: number;
@@ -139,6 +100,21 @@ export type GetIntegrationFunctions = Endpoint<{
139
100
  };
140
101
  };
141
102
  }>;
103
+ export type GetIntegrationFunction = Endpoint<{
104
+ Method: 'GET';
105
+ Path: '/api/v1/integrations/:providerConfigKey/functions/:functionName';
106
+ Querystring: {
107
+ env: string;
108
+ type?: FunctionType;
109
+ };
110
+ Params: {
111
+ providerConfigKey: string;
112
+ functionName: string;
113
+ };
114
+ Success: {
115
+ data: DeployedNangoFunction;
116
+ };
117
+ }>;
142
118
  export type GetProviderTemplates = Endpoint<{
143
119
  Method: 'GET';
144
120
  Path: '/api/v1/providers/:providerConfigKey/templates';
@@ -152,4 +128,16 @@ export type GetProviderTemplates = Endpoint<{
152
128
  data: (NangoSyncFunction | NangoActionFunction)[];
153
129
  };
154
130
  }>;
155
- export {};
131
+ export type GetIntegrationTemplates = Endpoint<{
132
+ Method: 'GET';
133
+ Path: '/api/v1/integrations/:providerConfigKey/templates';
134
+ Querystring: {
135
+ env: string;
136
+ };
137
+ Params: {
138
+ providerConfigKey: string;
139
+ };
140
+ Success: {
141
+ data: NangoFunctionTemplate[];
142
+ };
143
+ }>;
@@ -0,0 +1,45 @@
1
+ import type { OnEventType } from '../scripts/on-events/api.js';
2
+ import type { FunctionSource } from '../syncConfigs/db.js';
3
+ import type { JSONSchema7 } from 'json-schema';
4
+ export type FunctionType = 'action' | 'sync' | 'on-event';
5
+ interface NangoFunctionBase {
6
+ name: string;
7
+ description?: string;
8
+ scopes?: string[];
9
+ }
10
+ export interface NangoSyncFunction extends NangoFunctionBase {
11
+ type: 'sync';
12
+ input?: string;
13
+ returns: string[];
14
+ json_schema: JSONSchema7 | null;
15
+ /** Schedule expression such as `every day`. */
16
+ runs: string | null;
17
+ auto_start: boolean;
18
+ track_deletes: boolean;
19
+ }
20
+ export interface NangoActionFunction extends NangoFunctionBase {
21
+ type: 'action';
22
+ input?: string;
23
+ returns: string[];
24
+ json_schema: JSONSchema7 | null;
25
+ }
26
+ export interface NangoOnEventFunction extends NangoFunctionBase {
27
+ type: 'on-event';
28
+ event: OnEventType;
29
+ }
30
+ export type NangoFunction = NangoSyncFunction | NangoActionFunction | NangoOnEventFunction;
31
+ export interface DeployedMeta {
32
+ id: number;
33
+ enabled: boolean;
34
+ /** ISO-8601 timestamp. */
35
+ last_deployed: string;
36
+ source: FunctionSource;
37
+ }
38
+ export type DeployedNangoSyncFunction = NangoSyncFunction & DeployedMeta;
39
+ export type DeployedNangoActionFunction = NangoActionFunction & DeployedMeta;
40
+ export type DeployedNangoOnEventFunction = NangoOnEventFunction & DeployedMeta;
41
+ export type DeployedNangoFunction = DeployedNangoSyncFunction | DeployedNangoActionFunction | DeployedNangoOnEventFunction;
42
+ export type NangoFunctionTemplate = (NangoSyncFunction | NangoActionFunction) & {
43
+ deployed?: DeployedMeta;
44
+ };
45
+ export {};
package/dist/index.d.ts CHANGED
@@ -88,6 +88,7 @@ export type * from './checkpoint/types.js';
88
88
  export type * from './checkpoint/db.js';
89
89
  export type * from './mcp/api.js';
90
90
  export type * from './functions/api.js';
91
+ export type * from './functions/domain.js';
91
92
  export type * from './lambda/index.js';
92
93
  export type * from './authz/types.js';
93
94
  export type * from './pubsub/events.js';
@@ -21,6 +21,13 @@ export interface ApiPublicIntegrationInclude {
21
21
  app_id: string | null;
22
22
  private_key: string | null;
23
23
  app_link: string | null;
24
+ } | {
25
+ type: AuthModes['Custom'];
26
+ client_id: string | null;
27
+ client_secret: string | null;
28
+ app_id: string | null;
29
+ app_link: string | null;
30
+ private_key: string | null;
24
31
  } | null;
25
32
  }
26
33
  export type GetPublicListIntegrations = Endpoint<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.70.4",
3
+ "version": "0.70.5",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",