@idp.global/interfaces 1.0.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.
- package/changelog.md +16 -0
- package/dist_ts/00_commitinfo_data.d.ts +8 -0
- package/dist_ts/00_commitinfo_data.js +9 -0
- package/dist_ts/data/abusewindow.d.ts +13 -0
- package/dist_ts/data/abusewindow.js +2 -0
- package/dist_ts/data/activity.d.ts +16 -0
- package/dist_ts/data/activity.js +2 -0
- package/dist_ts/data/alert.d.ts +31 -0
- package/dist_ts/data/alert.js +2 -0
- package/dist_ts/data/alertrule.d.ts +19 -0
- package/dist_ts/data/alertrule.js +2 -0
- package/dist_ts/data/app.d.ts +86 -0
- package/dist_ts/data/app.js +2 -0
- package/dist_ts/data/appconnection.d.ts +16 -0
- package/dist_ts/data/appconnection.js +2 -0
- package/dist_ts/data/billingplan.d.ts +43 -0
- package/dist_ts/data/billingplan.js +2 -0
- package/dist_ts/data/device.d.ts +3 -0
- package/dist_ts/data/device.js +2 -0
- package/dist_ts/data/emailactiontoken.d.ts +11 -0
- package/dist_ts/data/emailactiontoken.js +2 -0
- package/dist_ts/data/index.d.ts +21 -0
- package/dist_ts/data/index.js +22 -0
- package/dist_ts/data/jwt.d.ts +38 -0
- package/dist_ts/data/jwt.js +2 -0
- package/dist_ts/data/loginsession.d.ts +38 -0
- package/dist_ts/data/loginsession.js +2 -0
- package/dist_ts/data/oidc.d.ts +248 -0
- package/dist_ts/data/oidc.js +5 -0
- package/dist_ts/data/organization.d.ts +11 -0
- package/dist_ts/data/organization.js +4 -0
- package/dist_ts/data/paddlecheckoutdata.d.ts +316 -0
- package/dist_ts/data/paddlecheckoutdata.js +2 -0
- package/dist_ts/data/passportchallenge.d.ts +68 -0
- package/dist_ts/data/passportchallenge.js +2 -0
- package/dist_ts/data/passportdevice.d.ts +34 -0
- package/dist_ts/data/passportdevice.js +2 -0
- package/dist_ts/data/passportnonce.d.ts +9 -0
- package/dist_ts/data/passportnonce.js +2 -0
- package/dist_ts/data/property.d.ts +10 -0
- package/dist_ts/data/property.js +3 -0
- package/dist_ts/data/registrationsession.d.ts +25 -0
- package/dist_ts/data/registrationsession.js +2 -0
- package/dist_ts/data/role.d.ts +28 -0
- package/dist_ts/data/role.js +2 -0
- package/dist_ts/data/user.d.ts +32 -0
- package/dist_ts/data/user.js +3 -0
- package/dist_ts/data/userinvitation.d.ts +45 -0
- package/dist_ts/data/userinvitation.js +2 -0
- package/dist_ts/index.d.ts +4 -0
- package/dist_ts/index.js +6 -0
- package/dist_ts/plugins.d.ts +4 -0
- package/dist_ts/plugins.js +7 -0
- package/dist_ts/request/admin.d.ts +100 -0
- package/dist_ts/request/admin.js +3 -0
- package/dist_ts/request/alert.d.ts +78 -0
- package/dist_ts/request/alert.js +3 -0
- package/dist_ts/request/apitoken.d.ts +1 -0
- package/dist_ts/request/apitoken.js +2 -0
- package/dist_ts/request/app.d.ts +48 -0
- package/dist_ts/request/app.js +3 -0
- package/dist_ts/request/authorization.d.ts +57 -0
- package/dist_ts/request/authorization.js +4 -0
- package/dist_ts/request/billingplan.d.ts +40 -0
- package/dist_ts/request/billingplan.js +3 -0
- package/dist_ts/request/index.d.ts +14 -0
- package/dist_ts/request/index.js +15 -0
- package/dist_ts/request/jwt.d.ts +63 -0
- package/dist_ts/request/jwt.js +3 -0
- package/dist_ts/request/login.d.ts +126 -0
- package/dist_ts/request/login.js +3 -0
- package/dist_ts/request/organization.d.ts +96 -0
- package/dist_ts/request/organization.js +3 -0
- package/dist_ts/request/passport.d.ts +169 -0
- package/dist_ts/request/passport.js +3 -0
- package/dist_ts/request/plan.d.ts +12 -0
- package/dist_ts/request/plan.js +3 -0
- package/dist_ts/request/registration.d.ts +65 -0
- package/dist_ts/request/registration.js +3 -0
- package/dist_ts/request/user.d.ts +101 -0
- package/dist_ts/request/user.js +3 -0
- package/dist_ts/request/userinvitation.d.ts +193 -0
- package/dist_ts/request/userinvitation.js +3 -0
- package/dist_ts/tags/index.d.ts +7 -0
- package/dist_ts/tags/index.js +2 -0
- package/license +21 -0
- package/package.json +57 -0
- package/readme.md +101 -0
- package/ts/00_commitinfo_data.ts +8 -0
- package/ts/data/abusewindow.ts +13 -0
- package/ts/data/activity.ts +36 -0
- package/ts/data/alert.ts +35 -0
- package/ts/data/alertrule.ts +22 -0
- package/ts/data/app.ts +99 -0
- package/ts/data/appconnection.ts +18 -0
- package/ts/data/billingplan.ts +47 -0
- package/ts/data/device.ts +3 -0
- package/ts/data/emailactiontoken.ts +12 -0
- package/ts/data/index.ts +21 -0
- package/ts/data/jwt.ts +43 -0
- package/ts/data/loginsession.ts +38 -0
- package/ts/data/oidc.ts +281 -0
- package/ts/data/organization.ts +14 -0
- package/ts/data/paddlecheckoutdata.ts +316 -0
- package/ts/data/passportchallenge.ts +80 -0
- package/ts/data/passportdevice.ts +46 -0
- package/ts/data/passportnonce.ts +9 -0
- package/ts/data/property.ts +12 -0
- package/ts/data/registrationsession.ts +31 -0
- package/ts/data/role.ts +33 -0
- package/ts/data/user.ts +36 -0
- package/ts/data/userinvitation.ts +58 -0
- package/ts/index.ts +6 -0
- package/ts/plugins.ts +9 -0
- package/ts/readme.md +133 -0
- package/ts/request/admin.ts +130 -0
- package/ts/request/alert.ts +113 -0
- package/ts/request/apitoken.ts +1 -0
- package/ts/request/app.ts +71 -0
- package/ts/request/authorization.ts +72 -0
- package/ts/request/billingplan.ts +55 -0
- package/ts/request/index.ts +14 -0
- package/ts/request/jwt.ts +79 -0
- package/ts/request/login.ts +181 -0
- package/ts/request/organization.ts +131 -0
- package/ts/request/passport.ts +227 -0
- package/ts/request/plan.ts +17 -0
- package/ts/request/registration.ts +90 -0
- package/ts/request/user.ts +142 -0
- package/ts/request/userinvitation.ts +248 -0
- package/ts/tags/index.ts +12 -0
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OIDC (OpenID Connect) data interfaces for third-party client support
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Supported OIDC scopes
|
|
6
|
+
*/
|
|
7
|
+
export type TOidcScope = 'openid' | 'profile' | 'email' | 'organizations' | 'roles';
|
|
8
|
+
/**
|
|
9
|
+
* Authorization code for OAuth 2.0 authorization code flow
|
|
10
|
+
*/
|
|
11
|
+
export interface IAuthorizationCode {
|
|
12
|
+
id: string;
|
|
13
|
+
data: {
|
|
14
|
+
/** Hashed authorization code string */
|
|
15
|
+
codeHash: string;
|
|
16
|
+
/** OAuth client ID */
|
|
17
|
+
clientId: string;
|
|
18
|
+
/** User ID who authorized */
|
|
19
|
+
userId: string;
|
|
20
|
+
/** Scopes granted */
|
|
21
|
+
scopes: TOidcScope[];
|
|
22
|
+
/** Redirect URI used in authorization request */
|
|
23
|
+
redirectUri: string;
|
|
24
|
+
/** PKCE code challenge (S256 hashed) */
|
|
25
|
+
codeChallenge?: string;
|
|
26
|
+
/** PKCE code challenge method */
|
|
27
|
+
codeChallengeMethod?: 'S256';
|
|
28
|
+
/** Nonce from authorization request (for ID token) */
|
|
29
|
+
nonce?: string;
|
|
30
|
+
/** Expiration timestamp (10 minutes from creation) */
|
|
31
|
+
expiresAt: number;
|
|
32
|
+
/** Creation timestamp */
|
|
33
|
+
issuedAt: number;
|
|
34
|
+
/** Whether the code has been used (single-use) */
|
|
35
|
+
used: boolean;
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* OIDC Access Token (opaque or JWT)
|
|
40
|
+
*/
|
|
41
|
+
export interface IOidcAccessToken {
|
|
42
|
+
id: string;
|
|
43
|
+
data: {
|
|
44
|
+
/** The access token string hash for storage */
|
|
45
|
+
tokenHash: string;
|
|
46
|
+
/** OAuth client ID */
|
|
47
|
+
clientId: string;
|
|
48
|
+
/** User ID */
|
|
49
|
+
userId: string;
|
|
50
|
+
/** Granted scopes */
|
|
51
|
+
scopes: TOidcScope[];
|
|
52
|
+
/** Expiration timestamp */
|
|
53
|
+
expiresAt: number;
|
|
54
|
+
/** Creation timestamp */
|
|
55
|
+
issuedAt: number;
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* OIDC Refresh Token
|
|
60
|
+
*/
|
|
61
|
+
export interface IOidcRefreshToken {
|
|
62
|
+
id: string;
|
|
63
|
+
data: {
|
|
64
|
+
/** The refresh token string hash for storage */
|
|
65
|
+
tokenHash: string;
|
|
66
|
+
/** OAuth client ID */
|
|
67
|
+
clientId: string;
|
|
68
|
+
/** User ID */
|
|
69
|
+
userId: string;
|
|
70
|
+
/** Granted scopes */
|
|
71
|
+
scopes: TOidcScope[];
|
|
72
|
+
/** Expiration timestamp */
|
|
73
|
+
expiresAt: number;
|
|
74
|
+
/** Creation timestamp */
|
|
75
|
+
issuedAt: number;
|
|
76
|
+
/** Whether the token has been revoked */
|
|
77
|
+
revoked: boolean;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* User consent record for an OAuth client
|
|
82
|
+
*/
|
|
83
|
+
export interface IUserConsent {
|
|
84
|
+
id: string;
|
|
85
|
+
data: {
|
|
86
|
+
/** User who gave consent */
|
|
87
|
+
userId: string;
|
|
88
|
+
/** OAuth client ID */
|
|
89
|
+
clientId: string;
|
|
90
|
+
/** Scopes the user consented to */
|
|
91
|
+
scopes: TOidcScope[];
|
|
92
|
+
/** When consent was granted */
|
|
93
|
+
grantedAt: number;
|
|
94
|
+
/** When consent was last updated */
|
|
95
|
+
updatedAt: number;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* OIDC Discovery Document (OpenID Provider Configuration)
|
|
100
|
+
*/
|
|
101
|
+
export interface IOidcDiscoveryDocument {
|
|
102
|
+
issuer: string;
|
|
103
|
+
authorization_endpoint: string;
|
|
104
|
+
token_endpoint: string;
|
|
105
|
+
userinfo_endpoint: string;
|
|
106
|
+
jwks_uri: string;
|
|
107
|
+
revocation_endpoint: string;
|
|
108
|
+
scopes_supported: TOidcScope[];
|
|
109
|
+
response_types_supported: string[];
|
|
110
|
+
grant_types_supported: string[];
|
|
111
|
+
subject_types_supported: string[];
|
|
112
|
+
id_token_signing_alg_values_supported: string[];
|
|
113
|
+
token_endpoint_auth_methods_supported: string[];
|
|
114
|
+
code_challenge_methods_supported: string[];
|
|
115
|
+
claims_supported: string[];
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* JSON Web Key Set (JWKS) response
|
|
119
|
+
*/
|
|
120
|
+
export interface IJwks {
|
|
121
|
+
keys: IJwk[];
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* JSON Web Key (RSA public key)
|
|
125
|
+
*/
|
|
126
|
+
export interface IJwk {
|
|
127
|
+
kty: 'RSA';
|
|
128
|
+
use: 'sig';
|
|
129
|
+
alg: 'RS256';
|
|
130
|
+
kid: string;
|
|
131
|
+
n: string;
|
|
132
|
+
e: string;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* ID Token claims (JWT payload)
|
|
136
|
+
*/
|
|
137
|
+
export interface IIdTokenClaims {
|
|
138
|
+
/** Issuer (idp.global URL) */
|
|
139
|
+
iss: string;
|
|
140
|
+
/** Subject (user ID) */
|
|
141
|
+
sub: string;
|
|
142
|
+
/** Audience (client ID) */
|
|
143
|
+
aud: string;
|
|
144
|
+
/** Expiration time (Unix timestamp) */
|
|
145
|
+
exp: number;
|
|
146
|
+
/** Issued at (Unix timestamp) */
|
|
147
|
+
iat: number;
|
|
148
|
+
/** Authentication time (Unix timestamp) */
|
|
149
|
+
auth_time?: number;
|
|
150
|
+
/** Nonce (if provided in authorization request) */
|
|
151
|
+
nonce?: string;
|
|
152
|
+
/** Access token hash (for hybrid flows) */
|
|
153
|
+
at_hash?: string;
|
|
154
|
+
name?: string;
|
|
155
|
+
preferred_username?: string;
|
|
156
|
+
picture?: string;
|
|
157
|
+
email?: string;
|
|
158
|
+
email_verified?: boolean;
|
|
159
|
+
organizations?: IOrganizationClaim[];
|
|
160
|
+
roles?: string[];
|
|
161
|
+
app_roles?: string[];
|
|
162
|
+
app_permissions?: string[];
|
|
163
|
+
app_scopes?: string[];
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Organization claim in ID token / userinfo
|
|
167
|
+
*/
|
|
168
|
+
export interface IOrganizationClaim {
|
|
169
|
+
id: string;
|
|
170
|
+
name: string;
|
|
171
|
+
slug: string;
|
|
172
|
+
roles: string[];
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* UserInfo endpoint response
|
|
176
|
+
*/
|
|
177
|
+
export interface IUserInfoResponse {
|
|
178
|
+
/** Subject (user ID) - always included */
|
|
179
|
+
sub: string;
|
|
180
|
+
name?: string;
|
|
181
|
+
preferred_username?: string;
|
|
182
|
+
picture?: string;
|
|
183
|
+
email?: string;
|
|
184
|
+
email_verified?: boolean;
|
|
185
|
+
organizations?: IOrganizationClaim[];
|
|
186
|
+
roles?: string[];
|
|
187
|
+
app_roles?: string[];
|
|
188
|
+
app_permissions?: string[];
|
|
189
|
+
app_scopes?: string[];
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Token endpoint response
|
|
193
|
+
*/
|
|
194
|
+
export interface ITokenResponse {
|
|
195
|
+
access_token: string;
|
|
196
|
+
token_type: 'Bearer';
|
|
197
|
+
expires_in: number;
|
|
198
|
+
refresh_token?: string;
|
|
199
|
+
id_token?: string;
|
|
200
|
+
scope: string;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Token endpoint error response
|
|
204
|
+
*/
|
|
205
|
+
export interface ITokenErrorResponse {
|
|
206
|
+
error: 'invalid_request' | 'invalid_client' | 'invalid_grant' | 'unauthorized_client' | 'unsupported_grant_type' | 'invalid_scope';
|
|
207
|
+
error_description?: string;
|
|
208
|
+
error_uri?: string;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Authorization request parameters
|
|
212
|
+
*/
|
|
213
|
+
export interface IAuthorizationRequest {
|
|
214
|
+
client_id: string;
|
|
215
|
+
redirect_uri: string;
|
|
216
|
+
response_type: 'code';
|
|
217
|
+
scope: string;
|
|
218
|
+
state: string;
|
|
219
|
+
code_challenge?: string;
|
|
220
|
+
code_challenge_method?: 'S256';
|
|
221
|
+
nonce?: string;
|
|
222
|
+
prompt?: 'none' | 'login' | 'consent';
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Token request for authorization_code grant
|
|
226
|
+
*/
|
|
227
|
+
export interface ITokenRequestAuthCode {
|
|
228
|
+
grant_type: 'authorization_code';
|
|
229
|
+
code: string;
|
|
230
|
+
redirect_uri: string;
|
|
231
|
+
client_id: string;
|
|
232
|
+
client_secret?: string;
|
|
233
|
+
code_verifier?: string;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Token request for refresh_token grant
|
|
237
|
+
*/
|
|
238
|
+
export interface ITokenRequestRefresh {
|
|
239
|
+
grant_type: 'refresh_token';
|
|
240
|
+
refresh_token: string;
|
|
241
|
+
client_id: string;
|
|
242
|
+
client_secret?: string;
|
|
243
|
+
scope?: string;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Union type for token requests
|
|
247
|
+
*/
|
|
248
|
+
export type ITokenRequest = ITokenRequestAuthCode | ITokenRequestRefresh;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OIDC (OpenID Connect) data interfaces for third-party client support
|
|
3
|
+
*/
|
|
4
|
+
export {};
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib2lkYy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3RzL2RhdGEvb2lkYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRyJ9
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as plugins from '../plugins.js';
|
|
2
|
+
import {} from './billingplan.js';
|
|
3
|
+
import {} from './role.js';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JnYW5pemF0aW9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvZGF0YS9vcmdhbml6YXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLE9BQU8sTUFBTSxlQUFlLENBQUM7QUFDekMsT0FBTyxFQUFxQixNQUFNLGtCQUFrQixDQUFDO0FBQ3JELE9BQU8sRUFBdUMsTUFBTSxXQUFXLENBQUMifQ==
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
export interface IPaddleCheckoutData<TPassthrough = null> {
|
|
2
|
+
checkout: {
|
|
3
|
+
created_at: string;
|
|
4
|
+
completed: boolean;
|
|
5
|
+
id: string;
|
|
6
|
+
coupon: {
|
|
7
|
+
coupon_code?: string;
|
|
8
|
+
};
|
|
9
|
+
passthrough?: TPassthrough;
|
|
10
|
+
prices: {
|
|
11
|
+
customer: {
|
|
12
|
+
currency: string;
|
|
13
|
+
unit: string;
|
|
14
|
+
unit_tax: string;
|
|
15
|
+
total: string;
|
|
16
|
+
total_tax: string;
|
|
17
|
+
items: Array<{
|
|
18
|
+
checkout_product_id: number;
|
|
19
|
+
product_id: number;
|
|
20
|
+
name: string;
|
|
21
|
+
custom_message: string;
|
|
22
|
+
quantity: number;
|
|
23
|
+
allow_quantity: false;
|
|
24
|
+
icon_url: string;
|
|
25
|
+
min_quantity: number;
|
|
26
|
+
max_quantity: number;
|
|
27
|
+
currency: string;
|
|
28
|
+
unit_price: {
|
|
29
|
+
net: number;
|
|
30
|
+
gross: number;
|
|
31
|
+
net_discount: number;
|
|
32
|
+
gross_discount: number;
|
|
33
|
+
net_after_discount: number;
|
|
34
|
+
gross_after_discount: number;
|
|
35
|
+
tax: number;
|
|
36
|
+
tax_after_discount: number;
|
|
37
|
+
};
|
|
38
|
+
line_price: {
|
|
39
|
+
net: number;
|
|
40
|
+
gross: number;
|
|
41
|
+
net_discount: number;
|
|
42
|
+
gross_discount: number;
|
|
43
|
+
net_after_discount: number;
|
|
44
|
+
gross_after_discount: number;
|
|
45
|
+
tax: number;
|
|
46
|
+
tax_after_discount: number;
|
|
47
|
+
};
|
|
48
|
+
discounts: [];
|
|
49
|
+
/**
|
|
50
|
+
* factorised, not percentage, so looks like 0.19 for Germany.
|
|
51
|
+
*/
|
|
52
|
+
tax_rate: number;
|
|
53
|
+
recurring: {
|
|
54
|
+
period: string;
|
|
55
|
+
interval: number;
|
|
56
|
+
trial_days: number;
|
|
57
|
+
currency: string;
|
|
58
|
+
unit_price: {
|
|
59
|
+
net: number;
|
|
60
|
+
gross: number;
|
|
61
|
+
net_discount: number;
|
|
62
|
+
gross_discount: number;
|
|
63
|
+
net_after_discount: number;
|
|
64
|
+
gross_after_discount: number;
|
|
65
|
+
tax: number;
|
|
66
|
+
tax_after_discount: number;
|
|
67
|
+
};
|
|
68
|
+
line_price: {
|
|
69
|
+
net: number;
|
|
70
|
+
gross: number;
|
|
71
|
+
net_discount: number;
|
|
72
|
+
gross_discount: number;
|
|
73
|
+
net_after_discount: number;
|
|
74
|
+
gross_after_discount: number;
|
|
75
|
+
tax: number;
|
|
76
|
+
tax_after_discount: number;
|
|
77
|
+
};
|
|
78
|
+
discounts: [];
|
|
79
|
+
tax_rate: number;
|
|
80
|
+
};
|
|
81
|
+
}>;
|
|
82
|
+
};
|
|
83
|
+
vendor: {
|
|
84
|
+
currency: string;
|
|
85
|
+
unit: string;
|
|
86
|
+
unit_tax: string;
|
|
87
|
+
total: string;
|
|
88
|
+
total_tax: string;
|
|
89
|
+
items: [
|
|
90
|
+
{
|
|
91
|
+
checkout_product_id: number;
|
|
92
|
+
product_id: number;
|
|
93
|
+
name: string;
|
|
94
|
+
custom_message: string;
|
|
95
|
+
quantity: number;
|
|
96
|
+
allow_quantity: false;
|
|
97
|
+
icon_url: string;
|
|
98
|
+
min_quantity: number;
|
|
99
|
+
max_quantity: number;
|
|
100
|
+
currency: string;
|
|
101
|
+
unit_price: {
|
|
102
|
+
net: number;
|
|
103
|
+
gross: number;
|
|
104
|
+
net_discount: number;
|
|
105
|
+
gross_discount: number;
|
|
106
|
+
net_after_discount: number;
|
|
107
|
+
gross_after_discount: number;
|
|
108
|
+
tax: number;
|
|
109
|
+
tax_after_discount: number;
|
|
110
|
+
};
|
|
111
|
+
line_price: {
|
|
112
|
+
net: number;
|
|
113
|
+
gross: number;
|
|
114
|
+
net_discount: number;
|
|
115
|
+
gross_discount: number;
|
|
116
|
+
net_after_discount: number;
|
|
117
|
+
gross_after_discount: number;
|
|
118
|
+
tax: number;
|
|
119
|
+
tax_after_discount: number;
|
|
120
|
+
};
|
|
121
|
+
discounts: [];
|
|
122
|
+
tax_rate: number;
|
|
123
|
+
recurring: {
|
|
124
|
+
period: string;
|
|
125
|
+
interval: number;
|
|
126
|
+
trial_days: number;
|
|
127
|
+
currency: string;
|
|
128
|
+
unit_price: {
|
|
129
|
+
net: number;
|
|
130
|
+
gross: number;
|
|
131
|
+
net_discount: number;
|
|
132
|
+
gross_discount: number;
|
|
133
|
+
net_after_discount: number;
|
|
134
|
+
gross_after_discount: number;
|
|
135
|
+
tax: number;
|
|
136
|
+
tax_after_discount: number;
|
|
137
|
+
};
|
|
138
|
+
line_price: {
|
|
139
|
+
net: number;
|
|
140
|
+
gross: number;
|
|
141
|
+
net_discount: number;
|
|
142
|
+
gross_discount: number;
|
|
143
|
+
net_after_discount: number;
|
|
144
|
+
gross_after_discount: number;
|
|
145
|
+
tax: number;
|
|
146
|
+
tax_after_discount: number;
|
|
147
|
+
};
|
|
148
|
+
discounts: [];
|
|
149
|
+
tax_rate: number;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
];
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
redirect_url: null;
|
|
156
|
+
test_variant: 'newCheckout';
|
|
157
|
+
recurring_prices: {
|
|
158
|
+
customer: {
|
|
159
|
+
currency: string;
|
|
160
|
+
unit: string;
|
|
161
|
+
unit_tax: string;
|
|
162
|
+
total: string;
|
|
163
|
+
total_tax: string;
|
|
164
|
+
items: [
|
|
165
|
+
{
|
|
166
|
+
checkout_product_id: number;
|
|
167
|
+
product_id: number;
|
|
168
|
+
name: string;
|
|
169
|
+
custom_message: string;
|
|
170
|
+
quantity: number;
|
|
171
|
+
allow_quantity: false;
|
|
172
|
+
icon_url: string;
|
|
173
|
+
min_quantity: number;
|
|
174
|
+
max_quantity: number;
|
|
175
|
+
currency: string;
|
|
176
|
+
unit_price: {
|
|
177
|
+
net: number;
|
|
178
|
+
gross: number;
|
|
179
|
+
net_discount: number;
|
|
180
|
+
gross_discount: number;
|
|
181
|
+
net_after_discount: number;
|
|
182
|
+
gross_after_discount: number;
|
|
183
|
+
tax: number;
|
|
184
|
+
tax_after_discount: number;
|
|
185
|
+
};
|
|
186
|
+
line_price: {
|
|
187
|
+
net: number;
|
|
188
|
+
gross: number;
|
|
189
|
+
net_discount: number;
|
|
190
|
+
gross_discount: number;
|
|
191
|
+
net_after_discount: number;
|
|
192
|
+
gross_after_discount: number;
|
|
193
|
+
tax: number;
|
|
194
|
+
tax_after_discount: number;
|
|
195
|
+
};
|
|
196
|
+
discounts: [];
|
|
197
|
+
tax_rate: number;
|
|
198
|
+
recurring: {
|
|
199
|
+
period: string;
|
|
200
|
+
interval: number;
|
|
201
|
+
trial_days: number;
|
|
202
|
+
currency: string;
|
|
203
|
+
unit_price: {
|
|
204
|
+
net: number;
|
|
205
|
+
gross: number;
|
|
206
|
+
net_discount: number;
|
|
207
|
+
gross_discount: number;
|
|
208
|
+
net_after_discount: number;
|
|
209
|
+
gross_after_discount: number;
|
|
210
|
+
tax: number;
|
|
211
|
+
tax_after_discount: number;
|
|
212
|
+
};
|
|
213
|
+
line_price: {
|
|
214
|
+
net: number;
|
|
215
|
+
gross: number;
|
|
216
|
+
net_discount: number;
|
|
217
|
+
gross_discount: number;
|
|
218
|
+
net_after_discount: number;
|
|
219
|
+
gross_after_discount: number;
|
|
220
|
+
tax: number;
|
|
221
|
+
tax_after_discount: number;
|
|
222
|
+
};
|
|
223
|
+
discounts: [];
|
|
224
|
+
tax_rate: number;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
];
|
|
228
|
+
};
|
|
229
|
+
interval: {
|
|
230
|
+
length: number;
|
|
231
|
+
type: string;
|
|
232
|
+
};
|
|
233
|
+
vendor: {
|
|
234
|
+
currency: string;
|
|
235
|
+
unit: string;
|
|
236
|
+
unit_tax: string;
|
|
237
|
+
total: string;
|
|
238
|
+
total_tax: string;
|
|
239
|
+
items: [
|
|
240
|
+
{
|
|
241
|
+
checkout_product_id: number;
|
|
242
|
+
product_id: number;
|
|
243
|
+
name: string;
|
|
244
|
+
custom_message: string;
|
|
245
|
+
quantity: number;
|
|
246
|
+
allow_quantity: false;
|
|
247
|
+
icon_url: string;
|
|
248
|
+
min_quantity: number;
|
|
249
|
+
max_quantity: number;
|
|
250
|
+
currency: string;
|
|
251
|
+
unit_price: {
|
|
252
|
+
net: number;
|
|
253
|
+
gross: number;
|
|
254
|
+
net_discount: number;
|
|
255
|
+
gross_discount: number;
|
|
256
|
+
net_after_discount: number;
|
|
257
|
+
gross_after_discount: number;
|
|
258
|
+
tax: number;
|
|
259
|
+
tax_after_discount: number;
|
|
260
|
+
};
|
|
261
|
+
line_price: {
|
|
262
|
+
net: number;
|
|
263
|
+
gross: number;
|
|
264
|
+
net_discount: number;
|
|
265
|
+
gross_discount: number;
|
|
266
|
+
net_after_discount: number;
|
|
267
|
+
gross_after_discount: number;
|
|
268
|
+
tax: number;
|
|
269
|
+
tax_after_discount: number;
|
|
270
|
+
};
|
|
271
|
+
discounts: [];
|
|
272
|
+
tax_rate: number;
|
|
273
|
+
recurring: {
|
|
274
|
+
period: string;
|
|
275
|
+
interval: number;
|
|
276
|
+
trial_days: number;
|
|
277
|
+
currency: string;
|
|
278
|
+
unit_price: {
|
|
279
|
+
net: number;
|
|
280
|
+
gross: number;
|
|
281
|
+
net_discount: number;
|
|
282
|
+
gross_discount: number;
|
|
283
|
+
net_after_discount: number;
|
|
284
|
+
gross_after_discount: number;
|
|
285
|
+
tax: number;
|
|
286
|
+
tax_after_discount: number;
|
|
287
|
+
};
|
|
288
|
+
line_price: {
|
|
289
|
+
net: number;
|
|
290
|
+
gross: number;
|
|
291
|
+
net_discount: number;
|
|
292
|
+
gross_discount: number;
|
|
293
|
+
net_after_discount: number;
|
|
294
|
+
gross_after_discount: number;
|
|
295
|
+
tax: number;
|
|
296
|
+
tax_after_discount: number;
|
|
297
|
+
};
|
|
298
|
+
discounts: [];
|
|
299
|
+
tax_rate: number;
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
];
|
|
303
|
+
};
|
|
304
|
+
};
|
|
305
|
+
};
|
|
306
|
+
product: {
|
|
307
|
+
quantity: number;
|
|
308
|
+
id: number;
|
|
309
|
+
name: string;
|
|
310
|
+
};
|
|
311
|
+
user: {
|
|
312
|
+
id: string;
|
|
313
|
+
email: string;
|
|
314
|
+
country: string;
|
|
315
|
+
};
|
|
316
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { IPassportCapabilities } from './passportdevice.js';
|
|
2
|
+
export type TPassportChallengeType = 'device_enrollment' | 'authentication' | 'step_up' | 'physical_access';
|
|
3
|
+
export type TPassportChallengeStatus = 'pending' | 'approved' | 'expired' | 'rejected';
|
|
4
|
+
export type TPassportChallengeDeliveryStatus = 'pending' | 'sent' | 'failed' | 'seen';
|
|
5
|
+
export type TPassportSignatureFormat = 'raw' | 'der';
|
|
6
|
+
export interface IPassportLocationEvidence {
|
|
7
|
+
latitude: number;
|
|
8
|
+
longitude: number;
|
|
9
|
+
accuracyMeters: number;
|
|
10
|
+
capturedAt: number;
|
|
11
|
+
}
|
|
12
|
+
export interface IPassportNfcEvidence {
|
|
13
|
+
tagId?: string;
|
|
14
|
+
readerId?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface IPassportLocationPolicy {
|
|
17
|
+
mode: 'geofence';
|
|
18
|
+
label?: string;
|
|
19
|
+
latitude: number;
|
|
20
|
+
longitude: number;
|
|
21
|
+
radiusMeters: number;
|
|
22
|
+
maxAccuracyMeters?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface IPassportChallenge {
|
|
25
|
+
id: string;
|
|
26
|
+
data: {
|
|
27
|
+
userId: string;
|
|
28
|
+
deviceId?: string | null;
|
|
29
|
+
type: TPassportChallengeType;
|
|
30
|
+
status: TPassportChallengeStatus;
|
|
31
|
+
tokenHash?: string | null;
|
|
32
|
+
challenge: string;
|
|
33
|
+
metadata: {
|
|
34
|
+
originHost?: string;
|
|
35
|
+
audience?: string;
|
|
36
|
+
notificationTitle?: string;
|
|
37
|
+
deviceLabel?: string;
|
|
38
|
+
requireLocation: boolean;
|
|
39
|
+
requireNfc: boolean;
|
|
40
|
+
locationPolicy?: IPassportLocationPolicy;
|
|
41
|
+
requestedCapabilities?: Partial<IPassportCapabilities>;
|
|
42
|
+
};
|
|
43
|
+
evidence?: {
|
|
44
|
+
signatureFormat?: TPassportSignatureFormat;
|
|
45
|
+
location?: IPassportLocationEvidence;
|
|
46
|
+
locationEvaluation?: {
|
|
47
|
+
matched: boolean;
|
|
48
|
+
distanceMeters?: number;
|
|
49
|
+
accuracyAccepted?: boolean;
|
|
50
|
+
evaluatedAt: number;
|
|
51
|
+
reason?: string;
|
|
52
|
+
};
|
|
53
|
+
nfc?: IPassportNfcEvidence;
|
|
54
|
+
};
|
|
55
|
+
notification?: {
|
|
56
|
+
hintId: string;
|
|
57
|
+
status: TPassportChallengeDeliveryStatus;
|
|
58
|
+
attemptCount: number;
|
|
59
|
+
createdAt: number;
|
|
60
|
+
deliveredAt?: number | null;
|
|
61
|
+
seenAt?: number | null;
|
|
62
|
+
lastError?: string | null;
|
|
63
|
+
};
|
|
64
|
+
createdAt: number;
|
|
65
|
+
expiresAt: number;
|
|
66
|
+
completedAt?: number | null;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type TPassportDevicePlatform = 'ios' | 'ipados' | 'macos' | 'watchos' | 'android' | 'web' | 'unknown';
|
|
2
|
+
export type TPassportDeviceStatus = 'active' | 'revoked';
|
|
3
|
+
export type TPassportPushProvider = 'apns';
|
|
4
|
+
export type TPassportPushEnvironment = 'development' | 'production';
|
|
5
|
+
export interface IPassportCapabilities {
|
|
6
|
+
gps: boolean;
|
|
7
|
+
nfc: boolean;
|
|
8
|
+
push: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface IPassportDevice {
|
|
11
|
+
id: string;
|
|
12
|
+
data: {
|
|
13
|
+
userId: string;
|
|
14
|
+
label: string;
|
|
15
|
+
platform: TPassportDevicePlatform;
|
|
16
|
+
status: TPassportDeviceStatus;
|
|
17
|
+
publicKeyAlgorithm: 'p256';
|
|
18
|
+
publicKeyX963Base64: string;
|
|
19
|
+
capabilities: IPassportCapabilities;
|
|
20
|
+
pushRegistration?: {
|
|
21
|
+
provider: TPassportPushProvider;
|
|
22
|
+
token: string;
|
|
23
|
+
topic: string;
|
|
24
|
+
environment: TPassportPushEnvironment;
|
|
25
|
+
registeredAt: number;
|
|
26
|
+
lastDeliveredAt?: number;
|
|
27
|
+
lastError?: string;
|
|
28
|
+
};
|
|
29
|
+
appVersion?: string;
|
|
30
|
+
createdAt: number;
|
|
31
|
+
lastSeenAt?: number;
|
|
32
|
+
lastChallengeAt?: number;
|
|
33
|
+
};
|
|
34
|
+
}
|