@nangohq/types 0.69.46 → 0.69.48

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.
@@ -24,11 +24,11 @@ import type { GetPublicRecords, PatchPublicPruneRecords } from './record/api.js'
24
24
  import type { GetPublicScriptsConfig } from './scripts/http.api.js';
25
25
  import type { GetSharedCredentialsProvider, GetSharedCredentialsProviders, PatchSharedCredentialsProvider, PostSharedCredentialsProvider } from './sharedCredentials/api.js';
26
26
  import type { GetPublicSyncStatus, PostPublicSyncPause, PostPublicSyncStart, PostPublicTrigger, PutPublicSyncConnectionFrequency } from './sync/api.js';
27
- import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api.js';
27
+ import type { DeleteTeamUser, GetTeam, PatchTeamUser, PutTeam } from './team/api.js';
28
28
  import type { GetUser, PatchUser } from './user/api.js';
29
29
  import type { PostPublicWebhook } from './webhooks/http.api.js';
30
30
  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 | AllPublicProxy;
31
- export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | PostInternalConnectSessions | GetIntegrationFlows | DeleteIntegration | PatchIntegration | GetIntegration | PostIntegration | GetConnections | GetConnectionsCount | GetConnection | GetInvite | GetMeta | GetEmailByExpiredToken | GetEmailByUuid | GetManagedCallback | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | GetEnvironment | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider;
31
+ export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | PostPlanChange | 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 | PatchFlowDisable | PatchFlowEnable | PatchFlowFrequency | PutUpgradePreBuiltFlow | PostConnectionRefresh | PostManagedSignup | PostPreBuiltDeploy | PostEnvironment | PatchEnvironment | DeleteEnvironment | GetEnvironments | GetEnvironment | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings | GetProviders | GetProvider;
32
32
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
33
33
  /**
34
34
  * Automatically narrow endpoints type with Method + Path
@@ -0,0 +1,12 @@
1
+ import type { Role } from '../user/db.js';
2
+ export type Action = 'create' | 'read' | 'update' | 'delete' | '*';
3
+ export type Resource = 'team' | 'team_member' | 'invite' | 'connect_ui_settings' | 'billing' | 'plan' | 'environment' | 'environment_production_flag' | 'environment_key' | 'environment_variable' | 'webhook' | 'integration' | 'connection' | 'flow' | 'sync_command' | 'secret_key' | 'connection_credential' | 'log' | '*';
4
+ export type Scope = 'production' | 'non-production' | 'global';
5
+ export interface Permission {
6
+ action: Action;
7
+ resource: Resource;
8
+ scope: Scope;
9
+ }
10
+ export interface PermissionEvaluator {
11
+ evaluate(role: Role, permission: Permission): Promise<boolean>;
12
+ }
@@ -15,6 +15,7 @@ export type ApiConnectionSimple = Pick<Merge<DBConnection, ApiTimestamps>, 'id'
15
15
  }[];
16
16
  endUser: ApiEndUser | null;
17
17
  tags: Tags;
18
+ pausedSyncs: string[];
18
19
  };
19
20
  export type GetConnections = Endpoint<{
20
21
  Method: 'GET';
@@ -106,3 +106,15 @@ export type PatchFlowFrequency = Endpoint<{
106
106
  };
107
107
  };
108
108
  }>;
109
+ export type GetFlowDownload = Endpoint<{
110
+ Method: 'GET';
111
+ Path: '/api/v1/flows/:id/download';
112
+ Querystring: {
113
+ env: string;
114
+ };
115
+ Params: {
116
+ id: number;
117
+ };
118
+ Success: never;
119
+ Error: ApiError<'failed_to_download_flow'>;
120
+ }>;
package/dist/index.d.ts CHANGED
@@ -38,7 +38,6 @@ export type * from './scripts/on-events/db.js';
38
38
  export type * from './scripts/on-events/api.js';
39
39
  export type * from './scripts/syncs/api.js';
40
40
  export type * from './scripts/http.api.js';
41
- export type * from './apiStatus/api.js';
42
41
  export type * from './slackNotifications/db.js';
43
42
  export type * from './notification/active-logs/db.js';
44
43
  export type * from './connection/api/get.js';
@@ -85,3 +84,5 @@ export type * from './jobs/api.js';
85
84
  export type * from './checkpoint/types.js';
86
85
  export type * from './checkpoint/db.js';
87
86
  export type * from './mcp/api.js';
87
+ export type * from './lambda/index.js';
88
+ export type * from './authz/types.js';
@@ -115,6 +115,10 @@ export interface OAuthAuthBody {
115
115
  clientSecret?: string | undefined;
116
116
  scopes?: string | undefined;
117
117
  }
118
+ export interface OAuth2CCAuthBody {
119
+ authType: Extract<AuthModeType, 'OAUTH2_CC'>;
120
+ scopes?: string | undefined;
121
+ }
118
122
  export interface AppAuthBody {
119
123
  authType: Extract<AuthModeType, 'APP'>;
120
124
  appId?: string | undefined;
@@ -147,7 +151,7 @@ export interface InstallPluginAuthBody {
147
151
  username?: string | undefined;
148
152
  password?: string | undefined;
149
153
  }
150
- export type IntegrationAuthBody = OAuthAuthBody | AppAuthBody | CustomAuthBody | MCPOAuth2AuthBody | MCPOAuth2GenericAuthBody | InstallPluginAuthBody;
154
+ export type IntegrationAuthBody = OAuthAuthBody | OAuth2CCAuthBody | AppAuthBody | CustomAuthBody | MCPOAuth2AuthBody | MCPOAuth2GenericAuthBody | InstallPluginAuthBody;
151
155
  export type PostIntegration = Endpoint<{
152
156
  Method: 'POST';
153
157
  Path: '/api/v1/integrations';
@@ -1,6 +1,7 @@
1
1
  import type { ApiError, Endpoint } from '../api.js';
2
2
  import type { ApiInvitation, ApiTeam } from '../team/api.js';
3
3
  import type { ApiUser } from '../user/api.js';
4
+ import type { Role } from '../user/db.js';
4
5
  export type PostInvite = Endpoint<{
5
6
  Method: 'POST';
6
7
  Path: '/api/v1/invite';
@@ -9,6 +10,7 @@ export type PostInvite = Endpoint<{
9
10
  };
10
11
  Body: {
11
12
  emails: string[];
13
+ role?: Role;
12
14
  };
13
15
  Success: {
14
16
  data: {
@@ -0,0 +1,4 @@
1
+ export type LambdaRequestType = 'readiness_check';
2
+ export interface LambdaReadinessCheck {
3
+ type: LambdaRequestType;
4
+ }
@@ -46,6 +46,7 @@ export interface BaseProvider {
46
46
  query?: Record<string, string>;
47
47
  retry?: RetryHeaderConfig;
48
48
  decompress?: boolean;
49
+ forward_headers_on_redirect?: boolean;
49
50
  paginate?: LinkPagination | CursorPagination | OffsetPagination;
50
51
  verification?: {
51
52
  method: EndpointMethod;
@@ -132,6 +133,7 @@ export interface ProviderJwt extends BaseProvider {
132
133
  auth_mode: 'JWT';
133
134
  signature: {
134
135
  protocol: 'RSA' | 'HMAC';
136
+ hmac_secret_encoding?: 'hex' | 'utf8';
135
137
  };
136
138
  token: {
137
139
  signing_key: string;
@@ -196,6 +198,7 @@ export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
196
198
  token_request_method?: 'GET';
197
199
  }[];
198
200
  assertion?: {
201
+ type?: 'saml' | 'jwt';
199
202
  key?: string;
200
203
  issuer?: string;
201
204
  lifetimeInSeconds?: number;
@@ -203,6 +206,8 @@ export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
203
206
  attributes?: Record<string, string | number | boolean | (string | number | boolean)[]>;
204
207
  sessionIndex?: string;
205
208
  recipient?: string;
209
+ header?: Record<string, string>;
210
+ payload?: Record<string, string>;
206
211
  };
207
212
  assertion_option?: Record<string, SimplifiedJSONSchema>;
208
213
  token_expires_in_ms?: number;
@@ -26,6 +26,7 @@ export interface BaseProxyConfiguration {
26
26
  responseType?: ResponseType | undefined;
27
27
  retryHeader?: RetryHeaderConfig;
28
28
  retryOn?: number[] | null;
29
+ forwardHeadersOnRedirect?: boolean;
29
30
  }
30
31
  export interface UserProvidedProxyConfiguration extends BaseProxyConfiguration {
31
32
  decompress?: boolean | string;
@@ -12,6 +12,7 @@ export type AllPublicProxy = Endpoint<{
12
12
  'base-url-override'?: string | undefined;
13
13
  decompress?: string | undefined;
14
14
  'retry-on'?: string | undefined;
15
+ 'forward-headers-on-redirect'?: string | undefined;
15
16
  'nango-activity-log-id'?: string | undefined;
16
17
  'nango-is-sync'?: string | undefined;
17
18
  'nango-is-dry-run'?: string | undefined;
@@ -1,6 +1,7 @@
1
1
  import type { TelemetryBag } from './sdk.js';
2
2
  import type { CheckpointRange } from '../checkpoint/types.js';
3
3
  import type { DBPlan } from '../plans/db.js';
4
+ import type { Feature } from '../syncConfigs/db.js';
4
5
  export interface RunnerOutputError {
5
6
  type: string;
6
7
  payload: Record<string, unknown> | unknown[];
@@ -23,4 +24,5 @@ export interface RunnerFlags {
23
24
  }
24
25
  export interface RoutingContext {
25
26
  plan: DBPlan | null;
27
+ features: Feature[];
26
28
  }
@@ -24,7 +24,7 @@ export type PostPublicTrigger = Endpoint<{
24
24
  Success: {
25
25
  success: boolean;
26
26
  };
27
- Error: ApiError<'missing_provider_config_key'>;
27
+ Error: ApiError<'missing_provider_config_key' | 'unknown_provider_config' | 'unknown_connection' | 'no_syncs_found'>;
28
28
  }>;
29
29
  export type PostSyncVariant = Endpoint<{
30
30
  Method: 'POST';
@@ -89,6 +89,7 @@ export type PostPublicSyncPause = Endpoint<{
89
89
  Success: {
90
90
  success: boolean;
91
91
  };
92
+ Error: ApiError<'no_syncs_found' | 'unknown_connection' | 'unknown_provider_config'>;
92
93
  }>;
93
94
  export type PostPublicSyncStart = Endpoint<{
94
95
  Method: 'POST';
@@ -104,6 +105,7 @@ export type PostPublicSyncStart = Endpoint<{
104
105
  Success: {
105
106
  success: boolean;
106
107
  };
108
+ Error: ApiError<'no_syncs_found' | 'unknown_connection' | 'unknown_provider_config'>;
107
109
  }>;
108
110
  export type GetPublicSyncStatus = Endpoint<{
109
111
  Method: 'GET';
@@ -2,6 +2,7 @@ import type { ApiError, ApiTimestamps, Endpoint } from '../api.js';
2
2
  import type { DBTeam } from './db.js';
3
3
  import type { DBInvitation } from '../invitations/db.js';
4
4
  import type { ApiUser } from '../user/api.js';
5
+ import type { Role } from '../user/db.js';
5
6
  import type { Merge } from 'type-fest';
6
7
  export type GetTeam = Endpoint<{
7
8
  Method: 'GET';
@@ -49,3 +50,22 @@ export type DeleteTeamUser = Endpoint<{
49
50
  };
50
51
  };
51
52
  }>;
53
+ export type PatchTeamUser = Endpoint<{
54
+ Method: 'PATCH';
55
+ Path: '/api/v1/team/users/:id';
56
+ Querystring: {
57
+ env: string;
58
+ };
59
+ Params: {
60
+ id: number;
61
+ };
62
+ Body: {
63
+ role: Role;
64
+ };
65
+ Error: ApiError<'user_not_found'> | ApiError<'forbidden_self_demotion'>;
66
+ Success: {
67
+ data: {
68
+ success: true;
69
+ };
70
+ };
71
+ }>;
@@ -34,6 +34,7 @@ export interface ApiUser {
34
34
  email: string;
35
35
  name: string;
36
36
  uuid: string;
37
+ role: Role;
37
38
  gettingStartedClosed: boolean;
38
39
  }
39
40
  export type AllowedPermissions = Partial<Record<string, Partial<Record<'production' | 'non-production' | 'global', ('create' | 'read' | 'update' | 'delete' | '*')[]>>>>;
package/dist/web/env.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  export interface WindowEnv {
2
2
  apiUrl: string;
3
- apiDownWatchPublicKey: string;
4
3
  publicUrl: string;
5
4
  connectUrl: string;
6
5
  gitHash: string | undefined;
@@ -21,5 +20,6 @@ export interface WindowEnv {
21
20
  gettingStarted: boolean;
22
21
  slack: boolean;
23
22
  plan: boolean;
23
+ authRoles: boolean;
24
24
  };
25
25
  }
@@ -1,6 +1,7 @@
1
1
  import type { AsyncActionResponse } from '../action/api.js';
2
2
  import type { ErrorPayload, SyncErrorPayload } from '../api.js';
3
3
  import type { AuthModeType, AuthOperationType } from '../auth/api.js';
4
+ import type { CheckpointRange } from '../checkpoint/types.js';
4
5
  import type { SyncResult } from '../sync/index.js';
5
6
  export type WebhookTypes = 'sync' | 'auth' | 'forward' | 'async_action';
6
7
  export interface NangoWebhookBase {
@@ -15,6 +16,7 @@ export interface NangoSyncWebhookBodyBase extends NangoWebhookBase {
15
16
  syncName: string;
16
17
  syncVariant: string;
17
18
  model: string;
19
+ checkpoints?: CheckpointRange | undefined;
18
20
  /** @deprecated **/
19
21
  syncType: 'INCREMENTAL' | 'INITIAL' | 'WEBHOOK';
20
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.69.46",
3
+ "version": "0.69.48",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",
@@ -1,15 +0,0 @@
1
- import type { Endpoint } from '../api.js';
2
- export type GetApiStatus = Endpoint<{
3
- Method: 'GET';
4
- Path: '/api/v1/api-status/:service';
5
- Params: {
6
- service: string;
7
- };
8
- Success: {
9
- data: ApiStatusResponse;
10
- };
11
- }>;
12
- export type ApiStatus = 'operational' | 'degraded_performance' | 'major_outage' | 'unknown';
13
- export interface ApiStatusResponse {
14
- status: ApiStatus;
15
- }