@nangohq/types 0.46.0 → 0.47.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.
- package/dist/api.d.ts +1 -1
- package/dist/api.endpoints.d.ts +3 -3
- package/dist/auth/http.api.d.ts +55 -29
- package/dist/connect/api.d.ts +30 -6
- package/dist/connect/session.d.ts +9 -3
- package/dist/fleet/api.d.ts +14 -0
- package/dist/fleet/index.d.ts +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/integration/api.d.ts +8 -1
- package/dist/proxy/api.d.ts +2 -0
- package/dist/utils.d.ts +5 -0
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export interface ValidationError {
|
|
|
11
11
|
message: string;
|
|
12
12
|
path: (string | number)[];
|
|
13
13
|
}
|
|
14
|
-
export type ResDefaultErrors = ApiError<'not_found'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_body', ValidationError[]> | ApiError<'invalid_uri_params', ValidationError[]> | ApiError<'feature_disabled'> | ApiError<'generic_error_support', undefined, string> | ApiError<'server_error'> | ApiError<'resource_capped'> | ApiError<'missing_auth_header'> | ApiError<'malformed_auth_header'> | ApiError<'unknown_account'> | ApiError<'unknown_connect_session_token'> | ApiError<'invalid_cli_version'> | ApiError<'invalid_permissions'>;
|
|
14
|
+
export type ResDefaultErrors = ApiError<'not_found'> | ApiError<'invalid_query_params', ValidationError[]> | ApiError<'invalid_body', ValidationError[]> | ApiError<'invalid_uri_params', ValidationError[]> | ApiError<'feature_disabled'> | ApiError<'generic_error_support', undefined, string> | ApiError<'server_error'> | ApiError<'resource_capped'> | ApiError<'missing_auth_header'> | ApiError<'malformed_auth_header'> | ApiError<'unknown_account'> | ApiError<'unknown_connect_session_token'> | ApiError<'invalid_cli_version'> | ApiError<'invalid_permissions'> | ApiError<'invalid_connect_session_token_format'>;
|
|
15
15
|
export type EndpointMethod = 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE';
|
|
16
16
|
/**
|
|
17
17
|
* API Request/Response type
|
package/dist/api.endpoints.d.ts
CHANGED
|
@@ -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
|
/**
|
package/dist/auth/http.api.d.ts
CHANGED
|
@@ -9,7 +9,54 @@ export type ConnectionQueryString = {
|
|
|
9
9
|
} | {
|
|
10
10
|
connect_session_token: string;
|
|
11
11
|
});
|
|
12
|
-
|
|
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 {};
|
package/dist/connect/api.d.ts
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { Endpoint } from '../api.js';
|
|
2
|
-
export interface
|
|
2
|
+
export interface ConnectSessionInput {
|
|
3
3
|
allowed_integrations?: string[] | undefined;
|
|
4
4
|
integrations_config_defaults?: Record<string, {
|
|
5
|
-
|
|
5
|
+
user_scopes?: string | undefined;
|
|
6
|
+
connection_config: {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
oauth_scopes_override?: string | undefined;
|
|
9
|
+
};
|
|
6
10
|
}> | undefined;
|
|
7
11
|
end_user: {
|
|
8
12
|
id: string;
|
|
@@ -14,14 +18,34 @@ export interface ConnectSessionPayload {
|
|
|
14
18
|
display_name?: string | undefined;
|
|
15
19
|
} | undefined;
|
|
16
20
|
}
|
|
21
|
+
export type ConnectSessionOutput = ConnectSessionInput & {
|
|
22
|
+
isReconnecting?: boolean;
|
|
23
|
+
};
|
|
17
24
|
export type PostConnectSessions = Endpoint<{
|
|
18
25
|
Method: 'POST';
|
|
19
26
|
Path: '/connect/sessions';
|
|
20
|
-
Body:
|
|
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
|
+
};
|
|
21
45
|
Success: {
|
|
22
46
|
data: {
|
|
23
47
|
token: string;
|
|
24
|
-
expires_at:
|
|
48
|
+
expires_at: string;
|
|
25
49
|
};
|
|
26
50
|
};
|
|
27
51
|
}>;
|
|
@@ -29,7 +53,7 @@ export type GetConnectSession = Endpoint<{
|
|
|
29
53
|
Method: 'GET';
|
|
30
54
|
Path: '/connect/session';
|
|
31
55
|
Success: {
|
|
32
|
-
data:
|
|
56
|
+
data: ConnectSessionOutput;
|
|
33
57
|
};
|
|
34
58
|
}>;
|
|
35
59
|
export type DeleteConnectSession = Endpoint<{
|
|
@@ -41,5 +65,5 @@ export type PostInternalConnectSessions = Endpoint<{
|
|
|
41
65
|
Method: 'POST';
|
|
42
66
|
Path: '/api/v1/connect/sessions';
|
|
43
67
|
Success: PostConnectSessions['Success'];
|
|
44
|
-
Body: Pick<
|
|
68
|
+
Body: Pick<ConnectSessionInput, 'allowed_integrations' | 'end_user' | 'organization'>;
|
|
45
69
|
}>;
|
|
@@ -3,9 +3,15 @@ export interface ConnectSession {
|
|
|
3
3
|
readonly endUserId: number;
|
|
4
4
|
readonly accountId: number;
|
|
5
5
|
readonly environmentId: number;
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
8
|
-
|
|
6
|
+
readonly connectionId: number | null;
|
|
7
|
+
readonly allowedIntegrations: string[] | null;
|
|
8
|
+
readonly integrationsConfigDefaults: Record<string, {
|
|
9
|
+
/** Only used by Slack */
|
|
10
|
+
user_scopes?: string | undefined;
|
|
11
|
+
connectionConfig: {
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
oauth_scopes_override?: string | undefined;
|
|
14
|
+
};
|
|
9
15
|
}> | null;
|
|
10
16
|
readonly createdAt: Date;
|
|
11
17
|
readonly updatedAt: Date | 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
|
+
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -65,6 +65,14 @@ export type DeletePublicIntegration = Endpoint<{
|
|
|
65
65
|
success: true;
|
|
66
66
|
};
|
|
67
67
|
}>;
|
|
68
|
+
export type ApiIntegration = Omit<Merge<IntegrationConfig, ApiTimestamps>, 'oauth_client_secret_iv' | 'oauth_client_secret_tag'>;
|
|
69
|
+
export type GetIntegrations = Endpoint<{
|
|
70
|
+
Method: 'GET';
|
|
71
|
+
Path: '/api/v1/integrations';
|
|
72
|
+
Success: {
|
|
73
|
+
data: ApiIntegration[];
|
|
74
|
+
};
|
|
75
|
+
}>;
|
|
68
76
|
export type PostIntegration = Endpoint<{
|
|
69
77
|
Method: 'POST';
|
|
70
78
|
Path: '/api/v1/integrations';
|
|
@@ -78,7 +86,6 @@ export type PostIntegration = Endpoint<{
|
|
|
78
86
|
data: ApiIntegration;
|
|
79
87
|
};
|
|
80
88
|
}>;
|
|
81
|
-
export type ApiIntegration = Omit<Merge<IntegrationConfig, ApiTimestamps>, 'oauth_client_secret_iv' | 'oauth_client_secret_tag'>;
|
|
82
89
|
export type GetIntegration = Endpoint<{
|
|
83
90
|
Method: 'GET';
|
|
84
91
|
Path: '/api/v1/integrations/:providerConfigKey';
|
package/dist/proxy/api.d.ts
CHANGED
package/dist/utils.d.ts
CHANGED
|
@@ -13,4 +13,9 @@ export type PickFromUnion<T, U extends T> = ValidateSelection<T, U>;
|
|
|
13
13
|
export type NullablePartial<TBase, TNullableKey extends keyof TBase = {
|
|
14
14
|
[K in keyof TBase]: null extends TBase[K] ? K : never;
|
|
15
15
|
}[keyof TBase]> = Partial<Pick<TBase, TNullableKey>> & Pick<TBase, Exclude<keyof TBase, TNullableKey>>;
|
|
16
|
+
export type Jsonable = string | number | boolean | null | undefined | readonly Jsonable[] | {
|
|
17
|
+
readonly [key: string]: Jsonable;
|
|
18
|
+
} | {
|
|
19
|
+
toJSON(): Jsonable;
|
|
20
|
+
};
|
|
16
21
|
export {};
|