@nangohq/types 0.66.2 → 0.67.1

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.
@@ -11,3 +11,30 @@ export type GetAsyncActionResult = Endpoint<{
11
11
  };
12
12
  Success: Record<string, any>;
13
13
  }>;
14
+ export type PostPublicTriggerAction = Endpoint<{
15
+ Method: 'POST';
16
+ Path: '/action/trigger';
17
+ Body: {
18
+ action_name: string;
19
+ input: unknown;
20
+ };
21
+ Headers: {
22
+ 'provider-config-key': string;
23
+ 'connection-id': string;
24
+ 'x-async'?: boolean;
25
+ 'x-max-retries'?: number;
26
+ };
27
+ Success: any;
28
+ }>;
29
+ export type GetPublicV1 = Endpoint<{
30
+ Method: 'GET';
31
+ Path: `/v1/:path`;
32
+ Params: any;
33
+ Body: any;
34
+ Querystring: any;
35
+ Headers: {
36
+ 'provider-config-key': string;
37
+ 'connection-id': string;
38
+ };
39
+ Success: any;
40
+ }>;
@@ -1,10 +1,11 @@
1
1
  import type { GetEmailByExpiredToken, GetEmailByUuid, GetManagedCallback, PostForgotPassword, PostLogout, PostManagedSignup, PostSignin, PostSignup, PutResetPassword } from './account/api.js';
2
- import type { GetAsyncActionResult } from './action/api.js';
2
+ import type { GetAsyncActionResult, GetPublicV1, PostPublicTriggerAction } from './action/api.js';
3
3
  import type { PostImpersonate } from './admin/http.api.js';
4
4
  import type { EndpointMethod } from './api.js';
5
5
  import type { PostPublicApiKeyAuthorization, PostPublicAppStoreAuthorization, PostPublicBasicAuthorization, PostPublicBillAuthorization, PostPublicJwtAuthorization, PostPublicOauthOutboundAuthorization, PostPublicSignatureAuthorization, PostPublicTbaAuthorization, PostPublicTwoStepAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api.js';
6
6
  import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect, PostPublicConnectTelemetry } from './connect/api.js';
7
- import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PostConnectionRefresh } from './connection/api/get.js';
7
+ import type { GetConnectUISettings, PutConnectUISettings } from './connectUISettings/api.js';
8
+ import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnection, GetPublicConnections, PostConnectionRefresh, PostPublicConnection } from './connection/api/get.js';
8
9
  import type { SetMetadata, UpdateMetadata } from './connection/api/metadata.js';
9
10
  import type { PostDeploy, PostDeployConfirmation, PostDeployInternal } from './deploy/api.js';
10
11
  import type { DeleteEnvironment, PatchEnvironment, PostEnvironment } from './environment/api/index.js';
@@ -16,18 +17,17 @@ import type { DeleteIntegration, DeletePublicIntegration, GetIntegration, GetInt
16
17
  import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api.js';
17
18
  import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api.js';
18
19
  import type { GetMeta } from './meta/api.js';
19
- import type { PatchOnboarding } from './onboarding/api.js';
20
20
  import type { PostPlanExtendTrial } from './plans/http.api.js';
21
21
  import type { GetPublicProvider, GetPublicProviders } from './providers/api.js';
22
22
  import type { GetPublicRecords } from './record/api.js';
23
23
  import type { GetPublicScriptsConfig } from './scripts/http.api.js';
24
24
  import type { GetSharedCredentialsProvider, GetSharedCredentialsProviders, PatchSharedCredentialsProvider, PostSharedCredentialsProvider } from './sharedCredentials/api.js';
25
- import type { PostPublicTrigger, PutPublicSyncConnectionFrequency } from './sync/api.js';
25
+ import type { GetPublicSyncStatus, PostPublicSyncPause, PostPublicSyncStart, PostPublicTrigger, PutPublicSyncConnectionFrequency } from './sync/api.js';
26
26
  import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api.js';
27
27
  import type { GetUser, PatchUser } from './user/api.js';
28
28
  import type { PostPublicWebhook } from './webhooks/http.api.js';
29
- 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 | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization;
30
- 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 | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted;
29
+ 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 | GetPublicScriptsConfig | PostPublicConnectTelemetry | PutPublicSyncConnectionFrequency | PostPublicIntegration | PatchPublicIntegration | GetAsyncActionResult | PostPublicOauthOutboundAuthorization | PostPublicConnection | PostPublicSyncStart | PostPublicSyncPause | GetPublicSyncStatus | GetPublicV1 | PostPublicTriggerAction;
30
+ export type PrivateApiEndpoints = PostSignup | PostSignin | PostLogout | GetTeam | PutTeam | PostPlanExtendTrial | 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 | PatchWebhook | PostEnvironmentVariables | PostImpersonate | GetSharedCredentialsProviders | GetSharedCredentialsProvider | PostSharedCredentialsProvider | PatchSharedCredentialsProvider | GetGettingStarted | PatchGettingStarted | GetConnectUISettings | PutConnectUISettings;
31
31
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
32
32
  /**
33
33
  * Automatically narrow endpoints type with Method + Path
@@ -1,3 +1,4 @@
1
+ import type { DBConnection } from '../connection/db.js';
1
2
  export interface AuthModes {
2
3
  OAuth1: 'OAUTH1';
3
4
  OAuth2: 'OAUTH2';
@@ -15,13 +16,7 @@ export interface AuthModes {
15
16
  Signature: 'SIGNATURE';
16
17
  }
17
18
  export type AuthModeType = AuthModes[keyof AuthModes];
18
- export interface AuthOperation {
19
- CREATION: 'creation';
20
- OVERRIDE: 'override';
21
- REFRESH: 'refresh';
22
- UNKNOWN: 'unknown';
23
- }
24
- export type AuthOperationType = AuthOperation[keyof AuthOperation];
19
+ export type AuthOperationType = 'creation' | 'override' | 'refresh' | 'unknown';
25
20
  export interface OAuthAuthorizationMethod {
26
21
  BODY: 'body';
27
22
  HEADER: 'header';
@@ -33,8 +28,8 @@ export interface OAuthBodyFormat {
33
28
  JSON: 'json';
34
29
  }
35
30
  export interface ConnectionUpsertResponse {
36
- id: number;
37
- operation: AuthOperation;
31
+ connection: DBConnection;
32
+ operation: AuthOperationType;
38
33
  }
39
34
  export interface OAuth1RequestTokenResult {
40
35
  request_token: string;
@@ -75,12 +70,12 @@ export interface AppStoreCredentials {
75
70
  export interface OAuth2Credentials extends CredentialsCommon {
76
71
  type: AuthModes['OAuth2'];
77
72
  access_token: string;
78
- refresh_token?: string;
73
+ refresh_token?: string | undefined;
79
74
  expires_at?: Date | undefined;
80
75
  config_override?: {
81
- client_id?: string;
82
- client_secret?: string;
83
- };
76
+ client_id?: string | undefined;
77
+ client_secret?: string | undefined;
78
+ } | undefined;
84
79
  }
85
80
  export interface CustomCredentials extends CredentialsCommon {
86
81
  type: AuthModes['Custom'];
@@ -108,10 +103,10 @@ export interface TbaCredentials {
108
103
  type: AuthModes['TBA'];
109
104
  token_id: string;
110
105
  token_secret: string;
111
- config_override: {
112
- client_id?: string;
113
- client_secret?: string;
114
- };
106
+ config_override?: {
107
+ client_id?: string | undefined;
108
+ client_secret?: string | undefined;
109
+ } | undefined;
115
110
  }
116
111
  export interface BillCredentials extends CredentialsCommon {
117
112
  type: AuthModes['Bill'];
@@ -4,6 +4,7 @@ import type { DBUser } from '../user/db.js';
4
4
  export interface BillingClient {
5
5
  ingest: (events: BillingIngestEvent[]) => Promise<void>;
6
6
  upsertCustomer: (team: DBTeam, user: DBUser) => Promise<Result<BillingCustomer>>;
7
+ updateCustomer: (customerId: string, name: string) => Promise<Result<void>>;
7
8
  linkStripeToCustomer(teamId: number, customerId: string): Promise<Result<void>>;
8
9
  getCustomer: (accountId: number) => Promise<Result<BillingCustomer>>;
9
10
  getSubscription: (accountId: number) => Promise<Result<BillingSubscription | null>>;
@@ -1,4 +1,5 @@
1
1
  import type { Endpoint } from '../api.js';
2
+ import type { ConnectUISettings } from '../connectUISettings/dto.js';
2
3
  export interface ConnectSessionInput {
3
4
  allowed_integrations?: string[] | undefined;
4
5
  integrations_config_defaults?: Record<string, {
@@ -9,12 +10,7 @@ export interface ConnectSessionInput {
9
10
  oauth_scopes_override?: string | undefined;
10
11
  } | undefined;
11
12
  }> | undefined;
12
- end_user: {
13
- id: string;
14
- email?: string | undefined;
15
- display_name?: string | undefined;
16
- tags?: Record<string, string> | undefined;
17
- };
13
+ end_user: EndUserInput;
18
14
  organization?: {
19
15
  id: string;
20
16
  display_name?: string | undefined;
@@ -23,8 +19,15 @@ export interface ConnectSessionInput {
23
19
  docs_connect?: string | undefined;
24
20
  }> | undefined;
25
21
  }
22
+ export interface EndUserInput {
23
+ id: string;
24
+ email?: string | undefined;
25
+ display_name?: string | undefined;
26
+ tags?: Record<string, string> | undefined;
27
+ }
26
28
  export type ConnectSessionOutput = ConnectSessionInput & {
27
29
  isReconnecting?: boolean;
30
+ connectUISettings: ConnectUISettings;
28
31
  };
29
32
  export type PostConnectSessions = Endpoint<{
30
33
  Method: 'POST';
@@ -0,0 +1,25 @@
1
+ import type { ApiError, Endpoint } from '../api.js';
2
+ import type { ConnectUISettings } from './dto.js';
3
+ export type GetConnectUISettings = Endpoint<{
4
+ Method: 'GET';
5
+ Path: '/api/v1/connect-ui-settings';
6
+ Querystring: {
7
+ env: string;
8
+ };
9
+ Success: {
10
+ data: ConnectUISettings;
11
+ };
12
+ Error: ApiError<'failed_to_get_connect_ui_settings'>;
13
+ }>;
14
+ export type PutConnectUISettings = Endpoint<{
15
+ Method: 'PUT';
16
+ Path: '/api/v1/connect-ui-settings';
17
+ Querystring: {
18
+ env: string;
19
+ };
20
+ Body: ConnectUISettings;
21
+ Success: {
22
+ data: ConnectUISettings;
23
+ };
24
+ Error: ApiError<'failed_to_update_connect_ui_settings'>;
25
+ }>;
@@ -0,0 +1,9 @@
1
+ import type { ConnectUIThemeSettings } from './dto.js';
2
+ export interface DBConnectUISettings {
3
+ id: number;
4
+ environment_id: number;
5
+ theme: ConnectUIThemeSettings;
6
+ show_watermark: boolean;
7
+ created_at: Date;
8
+ updated_at: Date;
9
+ }
@@ -0,0 +1,16 @@
1
+ export interface ConnectUISettings {
2
+ theme: ConnectUIThemeSettings;
3
+ showWatermark: boolean;
4
+ }
5
+ export interface ConnectUIThemeSettings {
6
+ light: ConnectUIColorPalette;
7
+ dark: ConnectUIColorPalette;
8
+ }
9
+ export interface ConnectUIColorPalette {
10
+ background: string;
11
+ foreground: string;
12
+ primary: string;
13
+ primaryForeground: string;
14
+ textPrimary: string;
15
+ textMuted: string;
16
+ }
@@ -1,9 +1,10 @@
1
1
  import type { ApiError, ApiTimestamps, Endpoint } from '../../api.js';
2
- import type { AllAuthCredentials } from '../../auth/api.js';
2
+ import type { AllAuthCredentials, ApiKeyCredentials, BasicApiCredentials, OAuth1Credentials, OAuth2ClientCredentials, OAuth2Credentials, TbaCredentials } from '../../auth/api.js';
3
+ import type { EndUserInput } from '../../connect/api.js';
3
4
  import type { ApiEndUser } from '../../endUser/index.js';
4
5
  import type { ActiveLog } from '../../notification/active-logs/db.js';
5
6
  import type { ReplaceInObject } from '../../utils.js';
6
- import type { DBConnection, DBConnectionDecrypted } from '../db.js';
7
+ import type { ConnectionConfig, DBConnection, DBConnectionDecrypted } from '../db.js';
7
8
  import type { Merge } from 'type-fest';
8
9
  export type ApiConnectionSimple = Pick<Merge<DBConnection, ApiTimestamps>, 'id' | 'connection_id' | 'provider_config_key' | 'created_at' | 'updated_at'> & {
9
10
  provider: string;
@@ -66,6 +67,25 @@ export type GetPublicConnections = Endpoint<{
66
67
  connections: ApiPublicConnection[];
67
68
  };
68
69
  }>;
70
+ export type PostPublicConnection = Endpoint<{
71
+ Method: 'POST';
72
+ Path: '/connections';
73
+ Body: {
74
+ connection_id?: string | undefined;
75
+ provider_config_key: string;
76
+ metadata?: Record<string, unknown> | undefined;
77
+ connection_config?: ConnectionConfig | undefined;
78
+ credentials: Omit<OAuth2Credentials, 'raw'> | Omit<OAuth2ClientCredentials, 'raw'> | Omit<OAuth1Credentials, 'raw'> | Omit<ApiKeyCredentials, 'raw'> | Omit<BasicApiCredentials, 'raw'> | Omit<TbaCredentials, 'raw'> | {
79
+ type: 'APP';
80
+ app_id: string;
81
+ installation_id: string;
82
+ } | {
83
+ type: 'NONE';
84
+ };
85
+ end_user?: EndUserInput | undefined;
86
+ };
87
+ Success: ApiPublicConnectionFull;
88
+ }>;
69
89
  export type ApiConnectionFull = Omit<ReplaceInObject<DBConnectionDecrypted, Date, string>, 'credentials_iv' | 'end_user_id' | 'credentials_tag' | 'deleted' | 'deleted_at'>;
70
90
  export type GetConnection = Endpoint<{
71
91
  Method: 'GET';
@@ -115,6 +135,23 @@ export type GetPublicConnection = Endpoint<{
115
135
  Error: ApiError<'unknown_provider_config' | 'invalid_credentials'>;
116
136
  Success: ApiPublicConnectionFull;
117
137
  }>;
138
+ export type PatchPublicConnection = Endpoint<{
139
+ Method: 'PATCH';
140
+ Path: '/connections/:connectionId';
141
+ Params: {
142
+ connectionId: string;
143
+ };
144
+ Querystring: {
145
+ provider_config_key: string;
146
+ };
147
+ Body: {
148
+ end_user?: EndUserInput | undefined;
149
+ };
150
+ Success: {
151
+ success: boolean;
152
+ };
153
+ Error: ApiError<'unknown_provider_config'>;
154
+ }>;
118
155
  export type PostConnectionRefresh = Endpoint<{
119
156
  Method: 'POST';
120
157
  Params: {
@@ -8,8 +8,9 @@ import type { Merge, Simplify } from 'type-fest';
8
8
  export type Metadata = Record<string, unknown>;
9
9
  export interface ConnectionConfig {
10
10
  [key: string]: any;
11
- oauth_scopes?: string;
12
- authorization_params?: Record<string, string>;
11
+ oauth_scopes_override?: string[] | undefined;
12
+ oauth_scopes?: string | undefined;
13
+ authorization_params?: Record<string, string> | undefined;
13
14
  }
14
15
  export interface DBConnection extends TimestampsAndDeletedCorrect {
15
16
  id: number;
@@ -31,6 +31,7 @@ export interface ApiEndUser {
31
31
  id: string;
32
32
  display_name: string | null;
33
33
  email: string | null;
34
+ tags: Record<string, string> | null;
34
35
  organization: {
35
36
  id: string;
36
37
  display_name: string | null;
@@ -59,3 +59,11 @@ export type DeleteEnvironment = Endpoint<{
59
59
  Success: never;
60
60
  Error: ApiError<'cannot_delete_prod_environment'>;
61
61
  }>;
62
+ export type GetPublicEnvironmentVariables = Endpoint<{
63
+ Method: 'GET';
64
+ Path: '/api/v1/environment-variables';
65
+ Success: {
66
+ name: string;
67
+ value: string;
68
+ }[];
69
+ }>;
package/dist/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  export type * from './db.js';
2
2
  export type * from './api.js';
3
3
  export type * from './api.endpoints.js';
4
- export type * from './onboarding/db.js';
5
- export type * from './onboarding/api.js';
6
4
  export type * from './gettingStarted/db.js';
7
5
  export type * from './gettingStarted/dto.js';
8
6
  export type * from './gettingStarted/api.js';
@@ -17,6 +15,9 @@ export type * from './user/api.js';
17
15
  export type * from './user/db.js';
18
16
  export type * from './connection/api/metadata.js';
19
17
  export type * from './connection/db.js';
18
+ export type * from './connectUISettings/dto.js';
19
+ export type * from './connectUISettings/db.js';
20
+ export type * from './connectUISettings/api.js';
20
21
  export type * from './meta/api.js';
21
22
  export type * from './invitations/api.js';
22
23
  export type * from './invitations/db.js';
@@ -42,6 +43,8 @@ export type * from './slackNotifications/db.js';
42
43
  export type * from './notification/active-logs/db.js';
43
44
  export type * from './connection/api/get.js';
44
45
  export type * from './sync/api.js';
46
+ export type * from './sync/db.js';
47
+ export type * from './sync/index.js';
45
48
  export type * from './integration/api.js';
46
49
  export type * from './integration/db.js';
47
50
  export type * from './providers/provider.js';
@@ -14,6 +14,7 @@ export interface ApiPublicIntegrationInclude {
14
14
  client_id: string | null;
15
15
  client_secret: string | null;
16
16
  scopes: string | null;
17
+ webhook_secret: string | null;
17
18
  } | {
18
19
  type: AuthModes['App'];
19
20
  app_id: string | null;
@@ -214,6 +215,7 @@ export type ApiPublicIntegrationCredentials = {
214
215
  client_id: string;
215
216
  client_secret: string;
216
217
  scopes?: string | undefined;
218
+ webhook_secret?: string | undefined;
217
219
  } | {
218
220
  type: Extract<AuthModeType, 'APP'>;
219
221
  app_id: string;
@@ -13,7 +13,7 @@ export type GetMeta = Endpoint<{
13
13
  version: string;
14
14
  baseUrl: string;
15
15
  debugMode: boolean;
16
- onboardingComplete: boolean;
16
+ gettingStartedClosed: boolean;
17
17
  };
18
18
  };
19
19
  }>;
@@ -76,4 +76,14 @@ export interface DBPlan extends Timestamps {
76
76
  * @default false
77
77
  */
78
78
  can_override_docs_connect_url: boolean;
79
+ /**
80
+ * Enable or disable the ability to customize the connect UI theme
81
+ * @default false
82
+ */
83
+ can_customize_connect_ui_theme: boolean;
84
+ /**
85
+ * Enable or disable the ability to disable the connect UI watermark
86
+ * @default false
87
+ */
88
+ can_disable_connect_ui_watermark: boolean;
79
89
  }
@@ -155,8 +155,8 @@ export interface ProviderTwoStep extends Omit<BaseProvider, 'body_format'> {
155
155
  token_headers?: Record<string, string>;
156
156
  token_response: {
157
157
  token: string;
158
- token_expiration: string;
159
- token_expiration_strategy: 'expireAt' | 'expireIn';
158
+ token_expiration?: string;
159
+ token_expiration_strategy?: 'expireAt' | 'expireIn';
160
160
  };
161
161
  additional_steps?: {
162
162
  body_format?: 'json' | 'form';
@@ -1,6 +1 @@
1
- export interface SyncResult {
2
- added: number;
3
- updated: number;
4
- deleted: number;
5
- }
6
1
  export type SyncOperationType = 'INCREMENTAL' | 'FULL' | 'WEBHOOK';
@@ -1,3 +1,4 @@
1
+ import type { ReportedSyncJobStatus } from './index.js';
1
2
  import type { ApiError, Endpoint } from '../api.js';
2
3
  export type PostPublicTrigger = Endpoint<{
3
4
  Method: 'POST';
@@ -70,3 +71,45 @@ export type PutPublicSyncConnectionFrequency = Endpoint<{
70
71
  };
71
72
  Error: ApiError<'unknown_connection' | 'unknown_sync'>;
72
73
  }>;
74
+ export type PostPublicSyncPause = Endpoint<{
75
+ Method: 'POST';
76
+ Path: '/sync/pause';
77
+ Body: {
78
+ syncs: (string | {
79
+ name: string;
80
+ variant: string;
81
+ })[];
82
+ provider_config_key: string;
83
+ connection_id?: string | undefined;
84
+ };
85
+ Success: {
86
+ success: boolean;
87
+ };
88
+ }>;
89
+ export type PostPublicSyncStart = Endpoint<{
90
+ Method: 'POST';
91
+ Path: '/sync/start';
92
+ Body: {
93
+ syncs: (string | {
94
+ name: string;
95
+ variant: string;
96
+ })[];
97
+ provider_config_key: string;
98
+ connection_id?: string | undefined;
99
+ };
100
+ Success: {
101
+ success: boolean;
102
+ };
103
+ }>;
104
+ export type GetPublicSyncStatus = Endpoint<{
105
+ Method: 'GET';
106
+ Path: '/sync/status';
107
+ Querystring: {
108
+ syncs: string;
109
+ provider_config_key: string;
110
+ connection_id?: string | undefined;
111
+ };
112
+ Success: {
113
+ syncs: ReportedSyncJobStatus[];
114
+ };
115
+ }>;
@@ -0,0 +1,11 @@
1
+ import type { TimestampsAndDeletedCorrect } from '../db.js';
2
+ export interface DBSync extends TimestampsAndDeletedCorrect {
3
+ id: string;
4
+ nango_connection_id: number;
5
+ name: string;
6
+ variant: string;
7
+ last_sync_date: Date | null;
8
+ frequency: string | null;
9
+ last_fetched_at: Date | null;
10
+ sync_config_id: number;
11
+ }
@@ -0,0 +1,23 @@
1
+ export type SyncStatus = 'RUNNING' | 'PAUSED' | 'STOPPED' | 'SUCCESS' | 'ERROR';
2
+ export type SyncJobsType = 'INCREMENTAL' | 'FULL' | 'WEBHOOK' | 'ON_EVENT_SCRIPT' | 'ACTION';
3
+ export interface SyncResult {
4
+ added: number;
5
+ updated: number;
6
+ deleted: number;
7
+ }
8
+ export type SyncResultByModel = Record<string, SyncResult>;
9
+ export interface ReportedSyncJobStatus {
10
+ id?: string;
11
+ type: SyncJobsType | 'INITIAL';
12
+ name?: string;
13
+ variant?: string;
14
+ connection_id?: string;
15
+ status: SyncStatus;
16
+ latestResult?: SyncResultByModel | undefined;
17
+ jobStatus?: SyncStatus;
18
+ frequency: string | null;
19
+ finishedAt: Date | undefined;
20
+ nextScheduledSyncAt: Date | null;
21
+ latestExecutionStatus: SyncStatus | undefined;
22
+ recordCount: Record<string, number>;
23
+ }
@@ -10,7 +10,8 @@ export type PatchUser = Endpoint<{
10
10
  Method: 'PATCH';
11
11
  Path: `/api/v1/user`;
12
12
  Body: {
13
- name: string;
13
+ name?: string | undefined;
14
+ gettingStartedClosed?: boolean | undefined;
14
15
  };
15
16
  Success: {
16
17
  data: ApiUser;
@@ -22,6 +23,7 @@ export interface ApiUser {
22
23
  email: string;
23
24
  name: string;
24
25
  uuid: string;
26
+ gettingStartedClosed: boolean;
25
27
  }
26
28
  export type PutUserPassword = Endpoint<{
27
29
  Method: 'PUT';
package/dist/user/db.d.ts CHANGED
@@ -13,4 +13,5 @@ export interface DBUser extends Timestamps {
13
13
  email_verification_token: string | null;
14
14
  email_verification_token_expires_at: Date | null;
15
15
  uuid: string;
16
+ getting_started_closed: boolean;
16
17
  }
package/dist/web/env.d.ts CHANGED
@@ -7,8 +7,6 @@ export interface WindowEnv {
7
7
  publicPosthogKey: string;
8
8
  publicPosthogHost: string;
9
9
  publicLogoDevKey: string;
10
- publicKoalaApiUrl: string;
11
- publicKoalaCdnUrl: string;
12
10
  publicStripeKey: string;
13
11
  isCloud: boolean;
14
12
  features: {
@@ -1,7 +1,7 @@
1
1
  import type { AsyncActionResponse } from '../action/api.js';
2
2
  import type { ErrorPayload } from '../api.js';
3
3
  import type { AuthModeType, AuthOperationType } from '../auth/api.js';
4
- import type { SyncResult } from '../scripts/syncs/api.js';
4
+ import type { SyncResult } from '../sync/index.js';
5
5
  export type WebhookTypes = 'sync' | 'auth' | 'forward' | 'async_action';
6
6
  export interface NangoWebhookBase {
7
7
  from: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.66.2",
3
+ "version": "0.67.1",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",
@@ -1,13 +0,0 @@
1
- import type { Endpoint } from '../api.js';
2
- export type PatchOnboarding = Endpoint<{
3
- Method: 'PATCH';
4
- Path: '/api/v1/onboarding';
5
- Querystring: {
6
- env: string;
7
- };
8
- Success: {
9
- data: {
10
- success: boolean;
11
- };
12
- };
13
- }>;
@@ -1,10 +0,0 @@
1
- import type { Timestamps } from '../db.js';
2
- /**
3
- * Onboarding row in database
4
- */
5
- export interface DBOnboarding extends Timestamps {
6
- id: number;
7
- user_id: number;
8
- progress: number;
9
- complete: boolean;
10
- }