@nangohq/types 0.70.2 → 0.70.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.
@@ -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 { PostRemoteFunctionCompile, PostRemoteFunctionDeploy, PostRemoteFunctionDryrun } from './functions/api.js';
15
+ import type { GetIntegrationFunctions, 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 | 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 | 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;
33
33
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
34
34
  /**
35
35
  * Automatically narrow endpoints type with Method + Path
@@ -1,5 +1,8 @@
1
1
  import type { ApiError, Endpoint } from '../api.js';
2
- export type FunctionType = 'action' | 'sync';
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';
3
6
  export type FunctionErrorCode = 'invalid_request' | 'integration_not_found' | 'compilation_error' | 'dryrun_error' | 'deployment_error' | 'connection_not_found' | 'function_disabled' | 'timeout' | 'validation_error';
4
7
  export interface ProxyCall {
5
8
  method: string;
@@ -78,3 +81,75 @@ export type PostRemoteFunctionDeploy = Endpoint<{
78
81
  output: string;
79
82
  };
80
83
  }>;
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
+ export type GetIntegrationFunctions = Endpoint<{
122
+ Method: 'GET';
123
+ Path: '/api/v1/integrations/:providerConfigKey/functions';
124
+ Querystring: {
125
+ env: string;
126
+ type?: FunctionType;
127
+ page?: number;
128
+ limit?: number;
129
+ };
130
+ Params: {
131
+ providerConfigKey: string;
132
+ };
133
+ Success: {
134
+ data: NangoFunctionDeployed[];
135
+ pagination: {
136
+ total: number;
137
+ page: number;
138
+ limit: number;
139
+ };
140
+ };
141
+ }>;
142
+ export type GetProviderTemplates = Endpoint<{
143
+ Method: 'GET';
144
+ Path: '/api/v1/providers/:providerConfigKey/templates';
145
+ Querystring: {
146
+ env: string;
147
+ };
148
+ Params: {
149
+ providerConfigKey: string;
150
+ };
151
+ Success: {
152
+ data: (NangoSyncFunction | NangoActionFunction)[];
153
+ };
154
+ }>;
155
+ export {};
@@ -19,11 +19,7 @@ export interface DBSyncConfig extends TimestampsAndDeleted {
19
19
  type: ScriptTypeLiteral;
20
20
  auto_start: boolean;
21
21
  attributes: object;
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;
22
+ source: FunctionSource;
27
23
  metadata: NangoConfigMetadata;
28
24
  input: string | null;
29
25
  /** @deprecated **/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.70.2",
3
+ "version": "0.70.3",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",