@nangohq/types 0.42.18 → 0.42.19
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.endpoints.d.ts +2 -2
- package/dist/auth/api.d.ts +24 -1
- package/dist/auth/http.api.d.ts +48 -0
- package/dist/connection/api/get.d.ts +2 -2
- package/dist/connection/db.d.ts +1 -0
- package/dist/integration/api.d.ts +1 -0
- package/dist/logs/messages.d.ts +1 -1
- package/dist/providers/provider.d.ts +12 -1
- package/dist/proxy/api.d.ts +2 -0
- package/package.json +1 -1
package/dist/api.endpoints.d.ts
CHANGED
|
@@ -8,10 +8,10 @@ import type { PostForgotPassword, PutResetPassword, PostSignin, PostSignup } fro
|
|
|
8
8
|
import type { DeleteInvite, PostInvite } from './invitations/api';
|
|
9
9
|
import type { GetUser, PatchUser } from './user/api';
|
|
10
10
|
import type { DeletePublicIntegration, GetPublicIntegration, GetPublicListIntegrations, GetPublicListIntegrationsLegacy } from './integration/api';
|
|
11
|
-
import type { PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicUnauthenticatedAuthorization } from './auth/http.api';
|
|
11
|
+
import type { PostPublicTableauAuthorization, PostPublicTbaAuthorization, PostPublicUnauthenticatedAuthorization, PostPublicJwtAuthorization } from './auth/http.api';
|
|
12
12
|
import type { GetPublicProvider, GetPublicProviders } from './providers/api';
|
|
13
13
|
import type { PostConnectSessions, PostInternalConnectSessions } from './connect/api';
|
|
14
|
-
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicUnauthenticatedAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions;
|
|
14
|
+
export type PublicApiEndpoints = SetMetadata | UpdateMetadata | PostDeploy | PostDeployConfirmation | PostPublicTbaAuthorization | PostPublicTableauAuthorization | PostPublicJwtAuthorization | PostPublicUnauthenticatedAuthorization | GetPublicProviders | GetPublicProvider | GetPublicListIntegrationsLegacy | GetPublicListIntegrations | GetPublicIntegration | DeletePublicIntegration | PostConnectSessions;
|
|
15
15
|
export type PrivateApiEndpoints = PostSignup | PostSignin | GetTeam | PutTeam | GetUser | PatchUser | PostInvite | DeleteInvite | DeleteTeamUser | PostInsights | PostForgotPassword | PutResetPassword | SearchOperations | GetOperation | SearchMessages | SearchFilters | GetOnboardingStatus | PostInternalConnectSessions;
|
|
16
16
|
export type APIEndpoints = PrivateApiEndpoints | PublicApiEndpoints;
|
|
17
17
|
/**
|
package/dist/auth/api.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface AuthModes {
|
|
|
10
10
|
None: 'NONE';
|
|
11
11
|
TBA: 'TBA';
|
|
12
12
|
Tableau: 'TABLEAU';
|
|
13
|
+
Jwt: 'JWT';
|
|
14
|
+
Bill: 'BILL';
|
|
13
15
|
}
|
|
14
16
|
export type AuthModeType = AuthModes[keyof AuthModes];
|
|
15
17
|
export interface AuthOperation {
|
|
@@ -104,6 +106,16 @@ export interface TbaCredentials {
|
|
|
104
106
|
client_secret?: string;
|
|
105
107
|
};
|
|
106
108
|
}
|
|
109
|
+
export interface BillCredentials extends CredentialsCommon {
|
|
110
|
+
type: AuthModes['Bill'];
|
|
111
|
+
username: string;
|
|
112
|
+
password: string;
|
|
113
|
+
organization_id: string;
|
|
114
|
+
dev_key: string;
|
|
115
|
+
session_id?: string;
|
|
116
|
+
user_id?: string;
|
|
117
|
+
expires_at?: Date | undefined;
|
|
118
|
+
}
|
|
107
119
|
export interface TableauCredentials extends CredentialsCommon {
|
|
108
120
|
type: AuthModes['Tableau'];
|
|
109
121
|
pat_name: string;
|
|
@@ -112,9 +124,20 @@ export interface TableauCredentials extends CredentialsCommon {
|
|
|
112
124
|
token?: string;
|
|
113
125
|
expires_at?: Date | undefined;
|
|
114
126
|
}
|
|
127
|
+
export interface JwtCredentials {
|
|
128
|
+
type: AuthModes['Jwt'];
|
|
129
|
+
privateKeyId?: string;
|
|
130
|
+
issuerId?: string;
|
|
131
|
+
privateKey: {
|
|
132
|
+
id: string;
|
|
133
|
+
secret: string;
|
|
134
|
+
} | string;
|
|
135
|
+
token?: string;
|
|
136
|
+
expires_at?: Date | undefined;
|
|
137
|
+
}
|
|
115
138
|
export type UnauthCredentials = Record<string, never>;
|
|
116
139
|
export type RefreshTokenResponse = AuthorizationTokenResponse;
|
|
117
140
|
export interface AuthorizationTokenResponse extends Omit<OAuth2Credentials, 'type' | 'raw'> {
|
|
118
141
|
expires_in?: number;
|
|
119
142
|
}
|
|
120
|
-
export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | TableauCredentials;
|
|
143
|
+
export type AllAuthCredentials = OAuth1Credentials | OAuth2Credentials | OAuth2ClientCredentials | BasicApiCredentials | ApiKeyCredentials | AppCredentials | AppStoreCredentials | UnauthCredentials | CustomCredentials | TbaCredentials | TableauCredentials | JwtCredentials | BillCredentials;
|
package/dist/auth/http.api.d.ts
CHANGED
|
@@ -44,6 +44,31 @@ export type PostPublicTableauAuthorization = Endpoint<{
|
|
|
44
44
|
connectionId: string;
|
|
45
45
|
};
|
|
46
46
|
}>;
|
|
47
|
+
export type PostPublicJwtAuthorization = Endpoint<{
|
|
48
|
+
Method: 'POST';
|
|
49
|
+
Body: {
|
|
50
|
+
privateKeyId?: string;
|
|
51
|
+
issuerId?: string;
|
|
52
|
+
privateKey: {
|
|
53
|
+
id: string;
|
|
54
|
+
secret: string;
|
|
55
|
+
} | string;
|
|
56
|
+
};
|
|
57
|
+
Querystring: {
|
|
58
|
+
connection_id?: string | undefined;
|
|
59
|
+
params?: Record<string, any> | undefined;
|
|
60
|
+
hmac?: string | undefined;
|
|
61
|
+
};
|
|
62
|
+
Params: {
|
|
63
|
+
providerConfigKey: string;
|
|
64
|
+
};
|
|
65
|
+
Path: '/auth/jwt';
|
|
66
|
+
Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
|
|
67
|
+
Success: {
|
|
68
|
+
providerConfigKey: string;
|
|
69
|
+
connectionId: string;
|
|
70
|
+
};
|
|
71
|
+
}>;
|
|
47
72
|
export type PostPublicUnauthenticatedAuthorization = Endpoint<{
|
|
48
73
|
Method: 'POST';
|
|
49
74
|
Querystring: {
|
|
@@ -60,3 +85,26 @@ export type PostPublicUnauthenticatedAuthorization = Endpoint<{
|
|
|
60
85
|
connectionId: string;
|
|
61
86
|
};
|
|
62
87
|
}>;
|
|
88
|
+
export type PostPublicBillAuthorization = Endpoint<{
|
|
89
|
+
Method: 'POST';
|
|
90
|
+
Body: {
|
|
91
|
+
username: string;
|
|
92
|
+
password: string;
|
|
93
|
+
organization_id: string;
|
|
94
|
+
dev_key: string;
|
|
95
|
+
};
|
|
96
|
+
Querystring: {
|
|
97
|
+
connection_id?: string | undefined;
|
|
98
|
+
params?: Record<string, any> | undefined;
|
|
99
|
+
hmac?: string | undefined;
|
|
100
|
+
};
|
|
101
|
+
Params: {
|
|
102
|
+
providerConfigKey: string;
|
|
103
|
+
};
|
|
104
|
+
Path: '/auth/bill';
|
|
105
|
+
Error: ApiError<'invalid_body'> | ApiError<'invalid_query_params'> | ApiError<'unknown_provider_config'> | ApiError<'unknown_provider_template'> | ApiError<'invalid_auth_mode'> | ApiError<'invalid_credentials'>;
|
|
106
|
+
Success: {
|
|
107
|
+
providerConfigKey: string;
|
|
108
|
+
connectionId: string;
|
|
109
|
+
};
|
|
110
|
+
}>;
|
|
@@ -11,7 +11,7 @@ export type GetConnection = Endpoint<{
|
|
|
11
11
|
provider_config_key: string;
|
|
12
12
|
force_refresh?: 'true' | 'false';
|
|
13
13
|
};
|
|
14
|
-
Path: '/api/v1/
|
|
14
|
+
Path: '/api/v1/connections/:connectionId';
|
|
15
15
|
Error: ApiError<'unknown_connection'> | ApiError<'missing_provider_config'> | ApiError<'unknown_provider'> | ApiError<'missing_connection'> | ApiError<'unknown_provider_config'>;
|
|
16
16
|
Success: {
|
|
17
17
|
provider: string | null;
|
|
@@ -35,7 +35,7 @@ export type DeletePublicConnection = Endpoint<{
|
|
|
35
35
|
}>;
|
|
36
36
|
export type DeleteConnection = Endpoint<{
|
|
37
37
|
Method: 'DELETE';
|
|
38
|
-
Path: '/
|
|
38
|
+
Path: '/api/v1/connections/:connectionId';
|
|
39
39
|
Params: {
|
|
40
40
|
connectionId: string;
|
|
41
41
|
};
|
package/dist/connection/db.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ export type ConnectionConfig = Record<string, any>;
|
|
|
7
7
|
export interface BaseConnection extends TimestampsAndDeleted {
|
|
8
8
|
id?: number;
|
|
9
9
|
config_id?: number;
|
|
10
|
+
end_user_id: number | null;
|
|
10
11
|
provider_config_key: string;
|
|
11
12
|
connection_id: string;
|
|
12
13
|
connection_config: ConnectionConfig;
|
package/dist/logs/messages.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export interface OperationAction {
|
|
|
39
39
|
}
|
|
40
40
|
export interface OperationAuth {
|
|
41
41
|
type: 'auth';
|
|
42
|
-
action: 'create_connection' | 'refresh_token' | 'post_connection';
|
|
42
|
+
action: 'create_connection' | 'refresh_token' | 'post_connection' | 'connection_test';
|
|
43
43
|
}
|
|
44
44
|
export interface OperationAdmin {
|
|
45
45
|
type: 'admin';
|
|
@@ -97,4 +97,15 @@ export interface ProviderOAuth1 extends BaseProvider {
|
|
|
97
97
|
token_http_method?: 'GET' | 'PUT' | 'POST';
|
|
98
98
|
signature_method: 'HMAC-SHA1' | 'RSA-SHA1' | 'PLAINTEXT';
|
|
99
99
|
}
|
|
100
|
-
export
|
|
100
|
+
export interface ProviderJwt extends BaseProvider {
|
|
101
|
+
token: {
|
|
102
|
+
expires_in_ms: number;
|
|
103
|
+
headers: {
|
|
104
|
+
alg: string;
|
|
105
|
+
};
|
|
106
|
+
payload: {
|
|
107
|
+
aud: string;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export type Provider = BaseProvider | ProviderOAuth1 | ProviderOAuth2 | ProviderJwt;
|
package/dist/proxy/api.d.ts
CHANGED
|
@@ -59,7 +59,9 @@ export interface LinkPagination extends Pagination {
|
|
|
59
59
|
link_rel_in_response_header?: string;
|
|
60
60
|
link_path_in_response_body?: string;
|
|
61
61
|
}
|
|
62
|
+
export type OffsetCalculationMethod = 'per-page' | 'by-response-size';
|
|
62
63
|
export interface OffsetPagination extends Pagination {
|
|
63
64
|
offset_name_in_request: string;
|
|
64
65
|
offset_start_value?: number;
|
|
66
|
+
offset_calculation_method?: OffsetCalculationMethod;
|
|
65
67
|
}
|