@nangohq/types 0.42.1 → 0.42.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.
@@ -110,3 +110,30 @@ export type PutResetPassword = Endpoint<{
110
110
  success: true;
111
111
  };
112
112
  }>;
113
+ export type PostManagedSignup = Endpoint<{
114
+ Method: 'POST';
115
+ Path: '/api/v1/account/managed/signup';
116
+ Body: {
117
+ provider: 'GoogleOAuth';
118
+ token?: string | undefined;
119
+ };
120
+ Success: {
121
+ data: {
122
+ url: string;
123
+ };
124
+ };
125
+ }>;
126
+ export type GetManagedCallback = Endpoint<{
127
+ Method: 'GET';
128
+ Path: '/api/v1/login/callback';
129
+ Querystring: {
130
+ code: string;
131
+ state?: string | undefined;
132
+ };
133
+ Error: ApiError<'error_creating_user'> | ApiError<'user_already_exists'> | ApiError<'error_creating_account'>;
134
+ Success: {
135
+ data: {
136
+ url: string;
137
+ };
138
+ };
139
+ }>;
@@ -1,5 +1,5 @@
1
1
  import type { EndpointMethod } from './api';
2
- import type { GetOperation, SearchFilters, SearchMessages, SearchOperations } from './logs/api';
2
+ import type { GetOperation, PostInsights, SearchFilters, SearchMessages, SearchOperations } from './logs/api';
3
3
  import type { GetOnboardingStatus } from './onboarding/api';
4
4
  import type { SetMetadata, UpdateMetadata } from './connection/api/metadata';
5
5
  import type { PostDeploy, PostDeployConfirmation } from './deploy/api';
@@ -7,7 +7,8 @@ import type { DeleteTeamUser, GetTeam, PutTeam } from './team/api';
7
7
  import type { PostForgotPassword, PutResetPassword, PostSignin, PostSignup } from './account/api';
8
8
  import type { DeleteInvite, PostInvite } from './invitations/api';
9
9
  import type { GetUser, PatchUser } from './user/api';
10
- export type APIEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus | SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation;
10
+ import type { GetListIntegrations } from './integration/api';
11
+ export type APIEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus | SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | GetListIntegrations;
11
12
  /**
12
13
  * Automatically narrow endpoints type with Method + Path
13
14
  */
@@ -1,4 +1,3 @@
1
- import type { BaseConnection } from '../connection/db.js';
2
1
  export interface AuthModes {
3
2
  OAuth1: 'OAUTH1';
4
3
  OAuth2: 'OAUTH2';
@@ -10,6 +9,7 @@ export interface AuthModes {
10
9
  App: 'APP';
11
10
  None: 'NONE';
12
11
  TBA: 'TBA';
12
+ Tableau: 'TABLEAU';
13
13
  }
14
14
  export type AuthModeType = AuthModes[keyof AuthModes];
15
15
  export interface AuthOperation {
@@ -104,10 +104,17 @@ export interface TbaCredentials {
104
104
  client_secret?: string;
105
105
  };
106
106
  }
107
+ export interface TableauCredentials extends CredentialsCommon {
108
+ type: AuthModes['Tableau'];
109
+ pat_name: string;
110
+ pat_secret: string;
111
+ content_url?: string;
112
+ token?: string;
113
+ expires_at?: Date | undefined;
114
+ }
107
115
  export type UnauthCredentials = Record<string, never>;
108
116
  export type RefreshTokenResponse = AuthorizationTokenResponse;
109
117
  export interface AuthorizationTokenResponse extends Omit<OAuth2Credentials, 'type' | 'raw'> {
110
118
  expires_in?: number;
111
119
  }
112
- export type ImportedCredentials = (OAuth2Credentials & Partial<Pick<AuthorizationTokenResponse, 'expires_in'>> & Partial<Pick<BaseConnection, 'metadata' | 'connection_config'>>) | OAuth1Credentials;
113
- export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials;
120
+ export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | TableauCredentials;
@@ -22,3 +22,24 @@ export type TbaAuthorization = Endpoint<{
22
22
  connectionId: string;
23
23
  };
24
24
  }>;
25
+ export type TableauAuthorization = Endpoint<{
26
+ Method: 'POST';
27
+ Body: {
28
+ pat_name: string;
29
+ pat_secret: string;
30
+ content_url?: string;
31
+ };
32
+ QueryParams: {
33
+ connectionId: string;
34
+ connectionConfig: ConnectionConfig;
35
+ };
36
+ Params: {
37
+ providerConfigKey: string;
38
+ };
39
+ Path: '/auth/tableau';
40
+ Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
41
+ Success: {
42
+ providerConfigKey: string;
43
+ connectionId: string;
44
+ };
45
+ }>;
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ export type * from './user/api.js';
11
11
  export type * from './user/db.js';
12
12
  export type * from './connection/api/metadata.js';
13
13
  export type * from './connection/db.js';
14
+ export type * from './meta/api.js';
14
15
  export type * from './invitations/api.js';
15
16
  export type * from './invitations/db.js';
16
17
  export type * from './team/api.js';
@@ -21,6 +22,7 @@ export type * from './scripts/post-connection/db.js';
21
22
  export type * from './scripts/syncs/api.js';
22
23
  export type * from './notification/active-logs/db.js';
23
24
  export type * from './connection/api/get.js';
25
+ export type * from './integration/api.js';
24
26
  export type * from './integration/db.js';
25
27
  export type * from './integration/template.js';
26
28
  export type * from './auth/api.js';
@@ -34,3 +36,4 @@ export type * from './environment/api/webhook.js';
34
36
  export type * from './webhooks/api.js';
35
37
  export type * from './flow/http.api.js';
36
38
  export type * from './utils.js';
39
+ export type * from './web/env.js';
@@ -0,0 +1,11 @@
1
+ import type { Endpoint } from '../api';
2
+ export type GetListIntegrations = Endpoint<{
3
+ Method: 'GET';
4
+ Path: '/config';
5
+ Success: {
6
+ configs: {
7
+ provider: string;
8
+ unique_key: string;
9
+ }[];
10
+ };
11
+ }>;
@@ -60,6 +60,7 @@ export interface TemplateOAuth2 extends Template {
60
60
  authorization_method?: OAuthAuthorizationMethodType;
61
61
  body_format?: OAuthBodyFormatType;
62
62
  refresh_url?: string;
63
+ expires_in_unit?: 'milliseconds';
63
64
  token_request_auth_method?: 'basic' | 'custom';
64
65
  }
65
66
  export interface TemplateOAuth1 extends Template {
@@ -92,4 +92,25 @@ export type SearchFilters = Endpoint<{
92
92
  };
93
93
  }>;
94
94
  export type SearchFiltersData = SearchMessages['Success']['data'][0];
95
+ export type PostInsights = Endpoint<{
96
+ Method: 'POST';
97
+ Path: '/api/v1/logs/insights';
98
+ Querystring: {
99
+ env: string;
100
+ };
101
+ Body: {
102
+ type: 'action' | 'sync' | 'proxy' | 'webhook_external';
103
+ };
104
+ Success: {
105
+ data: {
106
+ histogram: InsightsHistogramEntry[];
107
+ };
108
+ };
109
+ }>;
110
+ export interface InsightsHistogramEntry {
111
+ key: string;
112
+ total: number;
113
+ success: number;
114
+ failure: number;
115
+ }
95
116
  export {};
@@ -0,0 +1,19 @@
1
+ import type { ApiError, Endpoint } from '../api';
2
+ import type { DBEnvironment } from '../environment/db';
3
+ export type GetMeta = Endpoint<{
4
+ Method: 'GET';
5
+ Path: '/api/v1/meta';
6
+ Querystring: {
7
+ env: string;
8
+ };
9
+ Error: ApiError<'user_not_found'>;
10
+ Success: {
11
+ data: {
12
+ environments: Pick<DBEnvironment, 'name'>[];
13
+ version: string;
14
+ baseUrl: string;
15
+ debugMode: boolean;
16
+ onboardingComplete: boolean;
17
+ };
18
+ };
19
+ }>;
@@ -3,4 +3,4 @@ export interface SyncResult {
3
3
  updated: number;
4
4
  deleted: number;
5
5
  }
6
- export type SyncType = 'INCREMENTAL' | 'INITIAL';
6
+ export type SyncType = 'INCREMENTAL' | 'FULL';
@@ -42,7 +42,7 @@ export type DeleteTeamUser = Endpoint<{
42
42
  Params: {
43
43
  id: number;
44
44
  };
45
- Error: ApiError<'user_not_found'>;
45
+ Error: ApiError<'user_not_found'> | ApiError<'forbidden_self_delete'>;
46
46
  Success: {
47
47
  data: {
48
48
  success: true;
@@ -0,0 +1,15 @@
1
+ export interface WindowEnv {
2
+ apiUrl: string;
3
+ publicUrl: string;
4
+ publicSentryKey: string;
5
+ publicPosthogKey: string;
6
+ publicPosthogPost: string;
7
+ isCloud: boolean;
8
+ features: {
9
+ logs: boolean;
10
+ scripts: boolean;
11
+ auth: boolean;
12
+ managedAuth: boolean;
13
+ interactiveDemo: boolean;
14
+ };
15
+ }
@@ -1,5 +1,5 @@
1
1
  import type { AuthOperationType, AuthModeType } from '../auth/api.js';
2
- import type { SyncResult, SyncType } from '../scripts/syncs/api.js';
2
+ import type { SyncResult } from '../scripts/syncs/api.js';
3
3
  import type { ErrorPayload } from '../api.js';
4
4
  export type WebhookTypes = 'sync' | 'auth' | 'forward';
5
5
  export interface NangoWebhookBase {
@@ -13,7 +13,7 @@ export interface NangoSyncWebhookBodyBase extends NangoWebhookBase {
13
13
  providerConfigKey: string;
14
14
  syncName: string;
15
15
  model: string;
16
- syncType: SyncType;
16
+ syncType: 'INCREMENTAL' | 'INITIAL';
17
17
  }
18
18
  export interface NangoSyncWebhookBodySuccess extends NangoSyncWebhookBodyBase {
19
19
  success: true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.42.1",
3
+ "version": "0.42.3",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",