@nangohq/types 0.42.1 → 0.42.2

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,7 @@ 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
+ export type APIEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus | SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation;
11
11
  /**
12
12
  * Automatically narrow endpoints type with Method + Path
13
13
  */
@@ -10,6 +10,7 @@ export interface AuthModes {
10
10
  App: 'APP';
11
11
  None: 'NONE';
12
12
  TBA: 'TBA';
13
+ Tableau: 'TABLEAU';
13
14
  }
14
15
  export type AuthModeType = AuthModes[keyof AuthModes];
15
16
  export interface AuthOperation {
@@ -104,10 +105,18 @@ export interface TbaCredentials {
104
105
  client_secret?: string;
105
106
  };
106
107
  }
108
+ export interface TableauCredentials extends CredentialsCommon {
109
+ type: AuthModes['Tableau'];
110
+ pat_name: string;
111
+ pat_secret: string;
112
+ content_url?: string;
113
+ token?: string;
114
+ expires_at?: Date | undefined;
115
+ }
107
116
  export type UnauthCredentials = Record<string, never>;
108
117
  export type RefreshTokenResponse = AuthorizationTokenResponse;
109
118
  export interface AuthorizationTokenResponse extends Omit<OAuth2Credentials, 'type' | 'raw'> {
110
119
  expires_in?: number;
111
120
  }
112
121
  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;
122
+ 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';
@@ -34,3 +35,4 @@ export type * from './environment/api/webhook.js';
34
35
  export type * from './webhooks/api.js';
35
36
  export type * from './flow/http.api.js';
36
37
  export type * from './utils.js';
38
+ export type * from './web/env.js';
@@ -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
+ }>;
@@ -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
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.42.1",
3
+ "version": "0.42.2",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",