@nangohq/types 0.58.4 → 0.58.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.
@@ -5,7 +5,7 @@ import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, Post
5
5
  import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PostConnectionRefresh } from './connection/api/get';
6
6
  import type { SetMetadata, UpdateMetadata } from './connection/api/metadata';
7
7
  import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api';
8
- import type { PatchEnvironment, PostEnvironment } from './environment/api';
8
+ import type { DeleteEnvironment, PatchEnvironment, PostEnvironment } from './environment/api';
9
9
  import type { PatchWebhook } from './environment/api/webhook';
10
10
  import type { PostEnvironmentVariables } from './environment/variable/api';
11
11
  import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api';
@@ -18,12 +18,12 @@ import type { PostPlanExtendTrial } from './plans/http.api';
18
18
  import type { GetPublicProvider, GetPublicProviders } from './providers/api';
19
19
  import type { GetPublicRecords } from './record/api';
20
20
  import type { GetPublicScriptsConfig } from './scripts/http.api';
21
- import type { PostPublicTrigger } from './sync/api';
21
+ import type { PostPublicTrigger, PutPublicSyncConnectionFrequency } from './sync/api';
22
22
  import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api';
23
23
  import type { GetUser, PatchUser } from './user/api';
24
24
  import type { PostPublicWebhook } from './webhooks/http.api';
25
- export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry;
26
- export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PatchOnboarding | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | PatchWebhook | PostEnvironmentVariables;
25
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTrigger | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetPublicConnection | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization | PostPublicWebhook | GetPublicRecords | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency;
26
+ export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PatchOnboarding | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | PatchWebhook | PostEnvironmentVariables;
27
27
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
28
28
  /**
29
29
  * Automatically narrow endpoints type with Method + Path
@@ -131,12 +131,7 @@ export interface TableauCredentials extends CredentialsCommon {
131
131
  }
132
132
  export interface JwtCredentials {
133
133
  type: AuthModes['Jwt'];
134
- privateKeyId?: string;
135
- issuerId?: string;
136
- privateKey: {
137
- id: string;
138
- secret: string;
139
- } | string;
134
+ [key: string]: any;
140
135
  token?: string;
141
136
  expires_at?: Date | undefined;
142
137
  }
@@ -90,14 +90,7 @@ export type PostPublicTableauAuthorization = Endpoint<{
90
90
  }>;
91
91
  export type PostPublicJwtAuthorization = Endpoint<{
92
92
  Method: 'POST';
93
- Body: {
94
- privateKeyId?: string;
95
- issuerId?: string;
96
- privateKey: {
97
- id: string;
98
- secret: string;
99
- } | string;
100
- };
93
+ Body: Record<string, any>;
101
94
  Querystring: ConnectionQueryString;
102
95
  Params: {
103
96
  providerConfigKey: string;
@@ -44,6 +44,7 @@ export interface PreBuiltFlowConfig {
44
44
  fileBody?: IncomingScriptFiles;
45
45
  endpoints: NangoSyncEndpointV2[];
46
46
  input?: NangoModel | LegacySyncModelSchema | undefined;
47
+ version?: string | null;
47
48
  }
48
49
  export interface CLIDeployFlowConfig {
49
50
  type: ScriptTypeLiteral;
@@ -53,3 +53,9 @@ export type PatchEnvironment = Endpoint<{
53
53
  };
54
54
  Error: ApiError<'conflict'>;
55
55
  }>;
56
+ export type DeleteEnvironment = Endpoint<{
57
+ Method: 'DELETE';
58
+ Path: '/api/v1/environments';
59
+ Success: never;
60
+ Error: ApiError<'cannot_delete_prod_environment'>;
61
+ }>;
@@ -1,4 +1,4 @@
1
- import type { Timestamps } from '../db';
1
+ import type { Timestamps, TimestampsAndDeletedCorrect } from '../db';
2
2
  export interface DBEnvironmentVariable extends Timestamps {
3
3
  id: number;
4
4
  name: string;
@@ -7,7 +7,7 @@ export interface DBEnvironmentVariable extends Timestamps {
7
7
  value_iv: string | null;
8
8
  value_tag: string | null;
9
9
  }
10
- export interface DBEnvironment extends Timestamps {
10
+ export interface DBEnvironment extends TimestampsAndDeletedCorrect {
11
11
  id: number;
12
12
  uuid: string;
13
13
  name: string;
@@ -4,9 +4,8 @@ import type { AuthModeType, AuthModes } from '../auth/api';
4
4
  import type { NangoSyncConfig } from '../flow';
5
5
  import type { Provider } from '../providers/provider';
6
6
  import type { Merge } from 'type-fest';
7
- export type ApiPublicIntegration = Merge<Pick<IntegrationConfig, 'created_at' | 'updated_at' | 'unique_key' | 'provider'>, ApiTimestamps> & {
7
+ export type ApiPublicIntegration = Merge<Pick<IntegrationConfig, 'created_at' | 'updated_at' | 'unique_key' | 'provider' | 'display_name'>, ApiTimestamps> & {
8
8
  logo: string;
9
- display_name: string;
10
9
  } & ApiPublicIntegrationInclude;
11
10
  export interface ApiPublicIntegrationInclude {
12
11
  webhook_url?: string | null;
@@ -72,6 +71,7 @@ export type ApiIntegrationList = ApiIntegration & {
72
71
  missingFieldsCount: number;
73
72
  connectionConfigParams?: string[];
74
73
  credentialParams?: string[];
74
+ displayName: string;
75
75
  };
76
76
  };
77
77
  export type GetIntegrations = Endpoint<{
@@ -127,6 +127,7 @@ export type PatchIntegration = Endpoint<{
127
127
  Body: {
128
128
  integrationId?: string | undefined;
129
129
  webhookSecret?: string | undefined;
130
+ displayName?: string | undefined;
130
131
  } | {
131
132
  authType: Extract<AuthModeType, 'OAUTH1' | 'OAUTH2' | 'TBA'>;
132
133
  clientId: string;
@@ -1,6 +1,6 @@
1
- import type { SetOptional } from 'type-fest';
2
1
  import type { TimestampsAndDeleted } from '../db.js';
3
2
  import type { NullablePartial } from '../utils.js';
3
+ import type { SetOptional } from 'type-fest';
4
4
  export interface IntegrationConfig extends TimestampsAndDeleted {
5
5
  id?: number | undefined;
6
6
  unique_key: string;
@@ -14,5 +14,6 @@ export interface IntegrationConfig extends TimestampsAndDeleted {
14
14
  app_link?: string | null | undefined;
15
15
  custom?: Record<string, string> | undefined | null;
16
16
  missing_fields: string[];
17
+ display_name: string | null;
17
18
  }
18
19
  export type DBCreateIntegration = SetOptional<NullablePartial<Omit<IntegrationConfig, 'created_at' | 'updated_at'>>, 'missing_fields'>;
@@ -5,7 +5,7 @@ type Concat<T extends OperationList> = T extends {
5
5
  action: string;
6
6
  } ? `${T['type']}:${T['action']}` : never;
7
7
  export type ConcatOperationList = Concat<OperationList>;
8
- export type ConcatOperationListWithGroup = OperationList[keyof OperationList] | ConcatOperationList;
8
+ export type ConcatOperationListWithGroup = OperationList['type'] | ConcatOperationList;
9
9
  export type SearchOperations = Endpoint<{
10
10
  Method: 'POST';
11
11
  Path: '/api/v1/logs/operations';
@@ -89,10 +89,22 @@ export interface MessageRow {
89
89
  message: string;
90
90
  context?: 'script' | 'proxy' | 'webhook' | 'auth' | undefined;
91
91
  parentId: string;
92
+ accountId: number;
92
93
  error?: MessageError | undefined;
93
94
  request?: MessageHTTPRequest | undefined;
94
95
  response?: MessageHTTPResponse | undefined;
95
96
  meta?: MessageMeta | null | undefined;
97
+ persistResults?: {
98
+ model: string;
99
+ added: number;
100
+ addedKeys: string[];
101
+ updated: number;
102
+ updatedKeys: string[];
103
+ unchanged: number;
104
+ unchangedKeys: string[];
105
+ deleted: number;
106
+ deleteKeys: string[];
107
+ } | undefined;
96
108
  retry?: MessageHTTPRetry | undefined;
97
109
  createdAt: string;
98
110
  endedAt?: string | undefined;
@@ -3,7 +3,7 @@ import type { MessageRowInsert } from '../logs/messages.js';
3
3
  import type { MergingStrategy, NangoRecord } from '../record/api.js';
4
4
  interface LogBody {
5
5
  activityLogId: string;
6
- log: MessageRowInsert;
6
+ log: Omit<MessageRowInsert, 'accountId'>;
7
7
  }
8
8
  export type PostLog = Endpoint<{
9
9
  Method: 'POST';
@@ -14,6 +14,12 @@ export interface DBPlan extends Timestamps {
14
14
  * @default 3
15
15
  */
16
16
  connection_with_scripts_max: number | null;
17
+ /**
18
+ * Limit the number of total non-deleted connections
19
+ * Set to null to remove limit
20
+ * @default null
21
+ */
22
+ connections_max: number | null;
17
23
  /**
18
24
  * Limit the number of environments that can be created
19
25
  * @default 2
@@ -35,4 +41,9 @@ export interface DBPlan extends Timestamps {
35
41
  * @default false
36
42
  */
37
43
  has_otel: boolean;
44
+ /**
45
+ * Change the applied rate limit for the public API
46
+ * @default "m"
47
+ */
48
+ api_rate_limit_size: 's' | 'm' | 'l' | 'xl' | '2xl' | '3xl' | '4xl';
38
49
  }
@@ -4,7 +4,7 @@ import type { Endpoint } from '../api';
4
4
  export type ApiPlan = ReplaceInObject<DBPlan, Date, string>;
5
5
  export type PostPlanExtendTrial = Endpoint<{
6
6
  Method: 'POST';
7
- Path: '/api/v1/plan/trial/extension';
7
+ Path: '/api/v1/plans/trial/extension';
8
8
  Querystring: {
9
9
  env: string;
10
10
  };
@@ -14,3 +14,23 @@ export type PostPlanExtendTrial = Endpoint<{
14
14
  };
15
15
  };
16
16
  }>;
17
+ export interface PlanDefinition {
18
+ code: string;
19
+ title: string;
20
+ description: string;
21
+ canUpgrade: boolean;
22
+ canDowngrade: false;
23
+ cta?: string;
24
+ hidden?: boolean;
25
+ flags: Omit<Partial<DBPlan>, 'id' | 'account_id'>;
26
+ }
27
+ export type GetPlans = Endpoint<{
28
+ Method: 'GET';
29
+ Path: '/api/v1/plans';
30
+ Querystring: {
31
+ env: string;
32
+ };
33
+ Success: {
34
+ data: PlanDefinition[];
35
+ };
36
+ }>;
@@ -1,6 +1,6 @@
1
- import type { RetryHeaderConfig, CursorPagination, LinkPagination, OffsetPagination } from '../proxy/api.js';
2
- import type { AuthModeType, OAuthAuthorizationMethodType, OAuthBodyFormatType } from '../auth/api.js';
3
1
  import type { EndpointMethod } from '../api.js';
2
+ import type { AuthModeType, OAuthAuthorizationMethodType, OAuthBodyFormatType } from '../auth/api.js';
3
+ import type { CursorPagination, LinkPagination, OffsetPagination, RetryHeaderConfig } from '../proxy/api.js';
4
4
  export interface TokenUrlObject {
5
5
  OAUTH1?: string;
6
6
  OAUTH2?: string;
@@ -53,6 +53,7 @@ export interface BaseProvider {
53
53
  endpoints: string[];
54
54
  base_url_override?: string;
55
55
  headers?: Record<string, string>;
56
+ data?: unknown;
56
57
  };
57
58
  };
58
59
  authorization_url?: string;
@@ -106,18 +107,40 @@ export interface ProviderOAuth1 extends BaseProvider {
106
107
  }
107
108
  export interface ProviderJwt extends BaseProvider {
108
109
  auth_mode: 'JWT';
110
+ signature: {
111
+ protocol: 'RSA' | 'HMAC';
112
+ };
109
113
  token: {
114
+ signing_key: string;
110
115
  expires_in_ms: number;
111
- headers: {
116
+ header: {
112
117
  alg: string;
118
+ typ?: string;
113
119
  };
114
120
  payload: {
115
- aud: string;
121
+ aud?: string;
122
+ iss?: string;
123
+ sub?: string;
116
124
  };
117
125
  };
118
126
  }
127
+ export interface ProviderAppleAppStore extends BaseProvider {
128
+ auth_mode: 'APP_STORE';
129
+ token_url: string;
130
+ }
131
+ export interface ProviderTableau extends BaseProvider {
132
+ auth_mode: 'TABLEAU';
133
+ }
134
+ export interface ProviderBill extends BaseProvider {
135
+ auth_mode: 'BILL';
136
+ }
137
+ export interface ProviderGithubApp extends BaseProvider {
138
+ auth_mode: 'APP';
139
+ token_url: string;
140
+ }
119
141
  export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
120
142
  auth_mode: 'TWO_STEP';
143
+ token_request_method?: 'GET';
121
144
  token_headers?: Record<string, string>;
122
145
  token_response: {
123
146
  token: string;
@@ -129,6 +152,7 @@ export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
129
152
  token_params?: Record<string, string>;
130
153
  token_headers?: Record<string, string>;
131
154
  token_url: string;
155
+ token_request_method?: 'GET';
132
156
  }[];
133
157
  token_expires_in_ms?: number;
134
158
  proxy_header_authorization?: string;
@@ -146,6 +170,6 @@ export interface ProviderSignature extends BaseProvider {
146
170
  export interface ProviderApiKey extends BaseProvider {
147
171
  auth_mode: 'API_KEY';
148
172
  }
149
- export type Provider = BaseProvider | ProviderOAuth1 | ProviderOAuth2 | ProviderJwt | ProviderTwoStep | ProviderSignature | ProviderApiKey;
173
+ export type Provider = BaseProvider | ProviderOAuth1 | ProviderOAuth2 | ProviderJwt | ProviderTwoStep | ProviderSignature | ProviderApiKey | ProviderTableau | ProviderBill | ProviderGithubApp | ProviderAppleAppStore;
150
174
  export type RefreshableProvider = ProviderTwoStep | ProviderJwt | ProviderSignature | ProviderOAuth2;
151
175
  export type TestableProvider = ProviderApiKey;
@@ -55,3 +55,18 @@ export type DeleteSyncVariant = Endpoint<{
55
55
  success: boolean;
56
56
  };
57
57
  }>;
58
+ export type PutPublicSyncConnectionFrequency = Endpoint<{
59
+ Method: 'PUT';
60
+ Path: '/sync/update-connection-frequency';
61
+ Body: {
62
+ sync_name: string;
63
+ sync_variant?: string | undefined;
64
+ provider_config_key: string;
65
+ connection_id: string;
66
+ frequency: string | null;
67
+ };
68
+ Success: {
69
+ frequency: string;
70
+ };
71
+ Error: ApiError<'unknown_connection' | 'unknown_sync'>;
72
+ }>;
package/dist/web/env.d.ts CHANGED
@@ -17,5 +17,6 @@ export interface WindowEnv {
17
17
  managedAuth: boolean;
18
18
  gettingStarted: boolean;
19
19
  slack: boolean;
20
+ plan: boolean;
20
21
  };
21
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.58.4",
3
+ "version": "0.58.6",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",