@nangohq/types 0.46.1 → 0.47.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.
@@ -8,13 +8,13 @@ import type { PostForgotPassword, PutResetPassword, PostSignin, PostSignup, GetE
8
8
  import type { DeleteInvite, GetInvite, PostInvite } from './invitations/api';
9
9
  import type { GetUser, PatchUser } from './user/api';
10
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 } from './auth/http.api';
11
+ import type { PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicUnauthenticatedAuthorization, PostPublicJwtAuthorization, PostPublicBillAuthorization, PostPublicSignatureAuthorization, PostPublicTwoStepAuthorization, PostPublicApiKeyAuthorization, PostPublicBasicAuthorization, PostPublicAppStoreAuthorization } from './auth/http.api';
12
12
  import type { GetPublicProvider, GetPublicProviders } from './providers/api';
13
- import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions } from './connect/api';
13
+ import type { DeleteConnectSession, GetConnectSession, PostConnectSessions, PostInternalConnectSessions, PostPublicConnectSessionsReconnect } from './connect/api';
14
14
  import type { DeletePublicConnection, GetConnection, GetConnections, GetConnectionsCount, GetPublicConnections, PostConnectionRefresh } from './connection/api/get';
15
15
  import type { GetMeta } from './meta/api';
16
16
  import type { PatchFlowDisable, PatchFlowEnable, PatchFlowFrequency, PostPreBuiltDeploy, PutUpgradePreBuiltFlow } from './flow/http.api';
17
- export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | GetPublicConnections | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization;
17
+ export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | PostPublicApiKeyAuthorization | PostPublicBasicAuthorization | PostPublicAppStoreAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions | PostPublicConnectSessionsReconnect | GetPublicConnections | GetConnectSession | DeleteConnectSession | PostDeployInternal | PostPublicBillAuthorization | DeletePublicConnection | PostPublicSignatureAuthorization | PostPublicTwoStepAuthorization;
18
18
  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;
19
19
  export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
20
20
  /**
@@ -9,7 +9,54 @@ export type ConnectionQueryString = {
9
9
  } | {
10
10
  connect_session_token: string;
11
11
  });
12
- type AuthErrors = ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'> | ApiError<'integration_not_allowed'>;
12
+ export interface ConnectionResponse {
13
+ providerConfigKey: string;
14
+ connectionId: string;
15
+ }
16
+ type AuthErrors = ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'> | ApiError<'integration_not_allowed'> | ApiError<'invalid_connection'> | ApiError<'connection_test_failed'>;
17
+ export type PostPublicApiKeyAuthorization = Endpoint<{
18
+ Method: 'POST';
19
+ Body: {
20
+ apiKey: string;
21
+ };
22
+ Querystring: ConnectionQueryString;
23
+ Params: {
24
+ providerConfigKey: string;
25
+ };
26
+ Path: '/api-auth/api-key/:providerConfigKey';
27
+ Error: AuthErrors;
28
+ Success: ConnectionResponse;
29
+ }>;
30
+ export type PostPublicAppStoreAuthorization = Endpoint<{
31
+ Method: 'POST';
32
+ Body: {
33
+ privateKeyId: string;
34
+ privateKey: string;
35
+ issuerId: string;
36
+ scope?: string | undefined;
37
+ };
38
+ Querystring: ConnectionQueryString;
39
+ Params: {
40
+ providerConfigKey: string;
41
+ };
42
+ Path: '/app-store-auth/:providerConfigKey';
43
+ Error: AuthErrors;
44
+ Success: ConnectionResponse;
45
+ }>;
46
+ export type PostPublicBasicAuthorization = Endpoint<{
47
+ Method: 'POST';
48
+ Body: {
49
+ username: string;
50
+ password: string;
51
+ };
52
+ Querystring: ConnectionQueryString;
53
+ Params: {
54
+ providerConfigKey: string;
55
+ };
56
+ Path: '/api-auth/basic/:providerConfigKey';
57
+ Error: AuthErrors;
58
+ Success: ConnectionResponse;
59
+ }>;
13
60
  export type PostPublicTbaAuthorization = Endpoint<{
14
61
  Method: 'POST';
15
62
  Body: {
@@ -24,10 +71,7 @@ export type PostPublicTbaAuthorization = Endpoint<{
24
71
  };
25
72
  Path: '/auth/tba/:providerConfigKey';
26
73
  Error: AuthErrors;
27
- Success: {
28
- providerConfigKey: string;
29
- connectionId: string;
30
- };
74
+ Success: ConnectionResponse;
31
75
  }>;
32
76
  export type PostPublicTableauAuthorization = Endpoint<{
33
77
  Method: 'POST';
@@ -42,10 +86,7 @@ export type PostPublicTableauAuthorization = Endpoint<{
42
86
  };
43
87
  Path: '/auth/tableau/:providerConfigKey';
44
88
  Error: AuthErrors;
45
- Success: {
46
- providerConfigKey: string;
47
- connectionId: string;
48
- };
89
+ Success: ConnectionResponse;
49
90
  }>;
50
91
  export type PostPublicJwtAuthorization = Endpoint<{
51
92
  Method: 'POST';
@@ -63,10 +104,7 @@ export type PostPublicJwtAuthorization = Endpoint<{
63
104
  };
64
105
  Path: '/auth/jwt/:providerConfigKey';
65
106
  Error: AuthErrors;
66
- Success: {
67
- providerConfigKey: string;
68
- connectionId: string;
69
- };
107
+ Success: ConnectionResponse;
70
108
  }>;
71
109
  export type PostPublicUnauthenticatedAuthorization = Endpoint<{
72
110
  Method: 'POST';
@@ -76,10 +114,7 @@ export type PostPublicUnauthenticatedAuthorization = Endpoint<{
76
114
  };
77
115
  Path: '/auth/unauthenticated/:providerConfigKey';
78
116
  Error: AuthErrors;
79
- Success: {
80
- providerConfigKey: string;
81
- connectionId: string;
82
- };
117
+ Success: ConnectionResponse;
83
118
  }>;
84
119
  export type PostPublicBillAuthorization = Endpoint<{
85
120
  Method: 'POST';
@@ -95,10 +130,7 @@ export type PostPublicBillAuthorization = Endpoint<{
95
130
  };
96
131
  Path: '/auth/bill/:providerConfigKey';
97
132
  Error: AuthErrors;
98
- Success: {
99
- providerConfigKey: string;
100
- connectionId: string;
101
- };
133
+ Success: ConnectionResponse;
102
134
  }>;
103
135
  export type PostPublicTwoStepAuthorization = Endpoint<{
104
136
  Method: 'POST';
@@ -109,10 +141,7 @@ export type PostPublicTwoStepAuthorization = Endpoint<{
109
141
  };
110
142
  Path: '/auth/two-step/:providerConfigKey';
111
143
  Error: AuthErrors;
112
- Success: {
113
- providerConfigKey: string;
114
- connectionId: string;
115
- };
144
+ Success: ConnectionResponse;
116
145
  }>;
117
146
  export type PostPublicSignatureAuthorization = Endpoint<{
118
147
  Method: 'POST';
@@ -126,9 +155,6 @@ export type PostPublicSignatureAuthorization = Endpoint<{
126
155
  };
127
156
  Path: '/auth/signature-based/:providerConfigKey';
128
157
  Error: AuthErrors;
129
- Success: {
130
- providerConfigKey: string;
131
- connectionId: string;
132
- };
158
+ Success: ConnectionResponse;
133
159
  }>;
134
160
  export {};
@@ -1,5 +1,5 @@
1
1
  import type { Endpoint } from '../api.js';
2
- export interface ConnectSessionPayload {
2
+ export interface ConnectSessionInput {
3
3
  allowed_integrations?: string[] | undefined;
4
4
  integrations_config_defaults?: Record<string, {
5
5
  user_scopes?: string | undefined;
@@ -10,7 +10,7 @@ export interface ConnectSessionPayload {
10
10
  }> | undefined;
11
11
  end_user: {
12
12
  id: string;
13
- email: string;
13
+ email?: string | undefined;
14
14
  display_name?: string | undefined;
15
15
  };
16
16
  organization?: {
@@ -18,10 +18,30 @@ export interface ConnectSessionPayload {
18
18
  display_name?: string | undefined;
19
19
  } | undefined;
20
20
  }
21
+ export type ConnectSessionOutput = ConnectSessionInput & {
22
+ isReconnecting?: boolean;
23
+ };
21
24
  export type PostConnectSessions = Endpoint<{
22
25
  Method: 'POST';
23
26
  Path: '/connect/sessions';
24
- Body: ConnectSessionPayload;
27
+ Body: ConnectSessionInput;
28
+ Success: {
29
+ data: {
30
+ token: string;
31
+ expires_at: string;
32
+ };
33
+ };
34
+ }>;
35
+ export type PostPublicConnectSessionsReconnect = Endpoint<{
36
+ Method: 'POST';
37
+ Path: '/connect/sessions/reconnect';
38
+ Body: {
39
+ connection_id: string;
40
+ integration_id: string;
41
+ integrations_config_defaults?: ConnectSessionInput['integrations_config_defaults'];
42
+ end_user?: ConnectSessionInput['end_user'] | undefined;
43
+ organization?: ConnectSessionInput['organization'];
44
+ };
25
45
  Success: {
26
46
  data: {
27
47
  token: string;
@@ -33,7 +53,7 @@ export type GetConnectSession = Endpoint<{
33
53
  Method: 'GET';
34
54
  Path: '/connect/session';
35
55
  Success: {
36
- data: ConnectSessionPayload;
56
+ data: ConnectSessionOutput;
37
57
  };
38
58
  }>;
39
59
  export type DeleteConnectSession = Endpoint<{
@@ -45,5 +65,5 @@ export type PostInternalConnectSessions = Endpoint<{
45
65
  Method: 'POST';
46
66
  Path: '/api/v1/connect/sessions';
47
67
  Success: PostConnectSessions['Success'];
48
- Body: Pick<ConnectSessionPayload, 'allowed_integrations' | 'end_user' | 'organization'>;
68
+ Body: Pick<ConnectSessionInput, 'allowed_integrations' | 'end_user' | 'organization'>;
49
69
  }>;
@@ -3,8 +3,9 @@ export interface ConnectSession {
3
3
  readonly endUserId: number;
4
4
  readonly accountId: number;
5
5
  readonly environmentId: number;
6
- readonly allowedIntegrations?: string[] | null;
7
- readonly integrationsConfigDefaults?: Record<string, {
6
+ readonly connectionId: number | null;
7
+ readonly allowedIntegrations: string[] | null;
8
+ readonly integrationsConfigDefaults: Record<string, {
8
9
  /** Only used by Slack */
9
10
  user_scopes?: string | undefined;
10
11
  connectionConfig: {
@@ -74,7 +74,7 @@ export type GetConnection = Endpoint<{
74
74
  Error: ApiError<'unknown_provider_config'>;
75
75
  Success: {
76
76
  data: {
77
- provider: string | null;
77
+ provider: string;
78
78
  connection: ApiConnectionFull;
79
79
  endUser: ApiEndUser | null;
80
80
  errorLog: ActiveLog | null;
@@ -3,7 +3,7 @@ export interface EndUser {
3
3
  readonly endUserId: string;
4
4
  readonly accountId: number;
5
5
  readonly environmentId: number;
6
- readonly email: string;
6
+ readonly email: string | null;
7
7
  readonly displayName?: string | null;
8
8
  readonly organization?: {
9
9
  readonly organizationId: string;
@@ -17,7 +17,7 @@ export interface DBEndUser {
17
17
  readonly end_user_id: string;
18
18
  readonly account_id: number;
19
19
  readonly environment_id: number;
20
- readonly email: string;
20
+ readonly email: string | null;
21
21
  readonly display_name: string | null;
22
22
  readonly organization_id: string | null;
23
23
  readonly organization_display_name: string | null;
@@ -28,7 +28,7 @@ export type DBInsertEndUser = Omit<DBEndUser, 'id' | 'created_at' | 'updated_at'
28
28
  export interface ApiEndUser {
29
29
  id: string;
30
30
  displayName: string | null;
31
- email: string;
31
+ email: string | null;
32
32
  organization: {
33
33
  id: string;
34
34
  displayName: string | null;
@@ -0,0 +1,14 @@
1
+ import type { Endpoint, ApiError } from '../api.js';
2
+ import type { CommitHash, Deployment } from './index.js';
3
+ export type PostRollout = Endpoint<{
4
+ Method: 'POST';
5
+ Path: '/fleet/:fleetId/rollout';
6
+ Body: {
7
+ commitHash: CommitHash;
8
+ };
9
+ Params: {
10
+ fleetId: string;
11
+ };
12
+ Success: Deployment;
13
+ Error: ApiError<'forbidden'> | ApiError<'rollout_failed'>;
14
+ }>;
@@ -0,0 +1,16 @@
1
+ export type CommitHash = string & {
2
+ readonly length: 40;
3
+ };
4
+ export interface Deployment {
5
+ readonly id: number;
6
+ readonly commitId: CommitHash;
7
+ readonly createdAt: Date;
8
+ readonly supersededAt: Date | null;
9
+ }
10
+ export type RoutingId = string;
11
+ export interface NodeConfig {
12
+ readonly image: string;
13
+ readonly cpuMilli: number;
14
+ readonly memoryMb: number;
15
+ readonly storageMb: number;
16
+ }
package/dist/index.d.ts CHANGED
@@ -50,3 +50,5 @@ export type * from './webhooks/api.js';
50
50
  export type * from './flow/http.api.js';
51
51
  export type * from './utils.js';
52
52
  export type * from './web/env.js';
53
+ export type * from './fleet/api.js';
54
+ export type * from './fleet/index.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nangohq/types",
3
- "version": "0.46.1",
3
+ "version": "0.47.1",
4
4
  "description": "Types used in Nango applications",
5
5
  "type": "module",
6
6
  "typings": "dist/index.d.ts",