@nangohq/types 0.57.6 → 0.58.0

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.
@@ -87,6 +87,11 @@ export type PostSignin = Endpoint<{
87
87
  user: ApiUser;
88
88
  };
89
89
  }>;
90
+ export type PostLogout = Endpoint<{
91
+ Method: 'POST';
92
+ Path: '/api/v1/account/logout';
93
+ Success: never;
94
+ }>;
90
95
  export type PostForgotPassword = Endpoint<{
91
96
  Method: 'PUT';
92
97
  Path: '/api/v1/account/forgot-password';
@@ -1,27 +1,28 @@
1
+ import type { GetEmailByExpiredToken, GetEmailByUuid, GetManagedCallback, PostForgotPassword, PostLogout, PostManagedSignup, PostSignin, PostSignup, PutResetPassword } from './account/api';
1
2
  import type { EndpointMethod } from './api';
2
- import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api';
3
- import type { PatchOnboarding } from './onboarding/api';
4
- import type { SetMetadata, UpdateMetadata } from './connection/api/metadata';
5
- import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api';
6
- import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api';
7
- import type { PostForgotPassword, PutResetPassword, PostSignin, PostSignup, GetEmailByExpiredToken, GetEmailByUuid, GetManagedCallback, PostManagedSignup } from './account/api';
8
- import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api';
9
- import type { GetUser, PatchUser } from './user/api';
10
- import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetIntegrationFlows, GetPublicIntegration, GetPublicListIntegrations, GetPublicListIntegrationsLegacy, PatchIntegration, PostIntegration } from './integration/api';
11
- import type { PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicUnauthenticatedAuthorization, PostPublicJwtAuthorization, PostPublicBillAuthorization, PostPublicSignatureAuthorization, PostPublicTwoStepAuthorization, PostPublicApiKeyAuthorization, PostPublicBasicAuthorization, PostPublicAppStoreAuthorization } from './auth/http.api';
12
- import type { GetPublicProvider, GetPublicProviders } from './providers/api';
3
+ import type { PostPublicApiKeyAuthorization, PostPublicAppStoreAuthorization, PostPublicBasicAuthorization, PostPublicBillAuthorization, PostPublicJwtAuthorization, PostPublicSignatureAuthorization, PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicTwoStepAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api';
13
4
  import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect, PostPublicConnectTelemetry } from './connect/api';
14
5
  import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PostConnectionRefresh } from './connection/api/get';
15
- import type { GetMeta } from './meta/api';
16
- import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api';
17
- import type { PostPublicWebhook } from './webhooks/http.api';
6
+ import type { SetMetadata, UpdateMetadata } from './connection/api/metadata';
7
+ import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api';
18
8
  import type { PatchEnvironment, PostEnvironment } from './environment/api';
19
9
  import type { PatchWebhook } from './environment/api/webhook';
20
10
  import type { PostEnvironmentVariables } from './environment/variable/api';
11
+ import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api';
12
+ import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetIntegrationFlows, GetPublicIntegration, GetPublicListIntegrations, GetPublicListIntegrationsLegacy, PatchIntegration, PostIntegration } from './integration/api';
13
+ import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api';
14
+ import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api';
15
+ import type { GetMeta } from './meta/api';
16
+ import type { PatchOnboarding } from './onboarding/api';
17
+ import type { GetPublicProvider, GetPublicProviders } from './providers/api';
21
18
  import type { GetPublicRecords } from './record/api';
22
19
  import type { GetPublicScriptsConfig } from './scripts/http.api';
23
- export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | 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;
24
- export type PrivateApiEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | 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;
20
+ import type { PostPublicTrigger } from './sync/api';
21
+ import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api';
22
+ import type { GetUser, PatchUser } from './user/api';
23
+ import type { PostPublicWebhook } from './webhooks/http.api';
24
+ 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;
25
+ export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | 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
26
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
26
27
  /**
27
28
  * Automatically narrow endpoints type with Method + Path
@@ -1,12 +1,16 @@
1
+ import type { AllAuthCredentials, AuthModeType, AuthOperationType } from '../auth/api.js';
1
2
  import type { TimestampsAndDeletedCorrect } from '../db.js';
2
- import type { AuthModeType, AuthOperationType, AllAuthCredentials } from '../auth/api.js';
3
+ import type { EndUser } from '../endUser/index.js';
3
4
  import type { DBEnvironment } from '../environment/db.js';
4
5
  import type { DBTeam } from '../team/db.js';
5
- import type { Merge, Simplify } from 'type-fest';
6
- import type { EndUser } from '../endUser/index.js';
7
6
  import type { ReplaceInObject } from '../utils.js';
7
+ import type { Merge, Simplify } from 'type-fest';
8
8
  export type Metadata = Record<string, unknown>;
9
- export type ConnectionConfig = Record<string, any>;
9
+ export interface ConnectionConfig {
10
+ [key: string]: any;
11
+ oauth_scopes?: string;
12
+ authorization_params?: Record<string, string>;
13
+ }
10
14
  export interface DBConnection extends TimestampsAndDeletedCorrect {
11
15
  id: number;
12
16
  config_id: number;
@@ -87,7 +87,7 @@ export interface MessageRow {
87
87
  level: LogLevel;
88
88
  type: MessageType;
89
89
  message: string;
90
- context?: 'script' | 'proxy' | 'webhook' | undefined;
90
+ context?: 'script' | 'proxy' | 'webhook' | 'auth' | undefined;
91
91
  parentId: string;
92
92
  error?: MessageError | undefined;
93
93
  request?: MessageHTTPRequest | undefined;
@@ -1,6 +1,7 @@
1
1
  import type { DBConnectionDecrypted } from '../connection/db.js';
2
2
  import type { HTTP_METHOD } from '../nangoYaml/index.js';
3
3
  import type { Provider } from '../providers/provider.js';
4
+ import type { AxiosResponse } from 'axios';
4
5
  export interface ProxyFile {
5
6
  fieldname: string;
6
7
  originalname: string;
@@ -57,6 +58,10 @@ export interface PaginationBase {
57
58
  response_path?: string;
58
59
  limit_name_in_request: string;
59
60
  in_body?: boolean;
61
+ on_page?: (paginationState: {
62
+ nextPageParam?: string | number | undefined;
63
+ response: AxiosResponse;
64
+ }) => Promise<void>;
60
65
  }
61
66
  export type Pagination = CursorPagination | LinkPagination | OffsetPagination;
62
67
  export interface CursorPagination extends PaginationBase {
@@ -1,7 +1,24 @@
1
1
  import type { Endpoint } from '../api';
2
2
  import type { StandardNangoConfig } from '../flow';
3
+ export interface OpenAIFunction {
4
+ name: string;
5
+ description: string;
6
+ parameters: {
7
+ type: string;
8
+ properties: Record<string, {
9
+ type: string;
10
+ description: string;
11
+ }>;
12
+ required: string[];
13
+ };
14
+ }
3
15
  export type GetPublicScriptsConfig = Endpoint<{
4
16
  Method: 'GET';
5
17
  Path: `/scripts/config`;
6
- Success: StandardNangoConfig[];
18
+ Query: {
19
+ format?: 'nango' | 'openai';
20
+ };
21
+ Success: StandardNangoConfig[] | {
22
+ data: OpenAIFunction[];
23
+ };
7
24
  }>;
@@ -1,4 +1,26 @@
1
1
  import type { ApiError, Endpoint } from '../api.js';
2
+ export type PostPublicTrigger = Endpoint<{
3
+ Method: 'POST';
4
+ Path: '/sync/trigger';
5
+ Body: {
6
+ syncs: (string | {
7
+ name: string;
8
+ variant: string;
9
+ })[];
10
+ sync_mode?: 'incremental' | 'full_refresh' | 'full_refresh_and_clear_cache' | undefined;
11
+ provider_config_key?: string | undefined;
12
+ connection_id?: string | undefined;
13
+ full_resync?: boolean | undefined;
14
+ };
15
+ Headers: {
16
+ 'provider-config-key'?: string | undefined;
17
+ 'connection-id'?: string | undefined;
18
+ };
19
+ Success: {
20
+ success: boolean;
21
+ };
22
+ Error: ApiError<'missing_provider_config_key'>;
23
+ }>;
2
24
  export type PostSyncVariant = Endpoint<{
3
25
  Method: 'POST';
4
26
  Path: '/sync/:name/variant/:variant';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.57.6",
3
+ "version": "0.58.0",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",