@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.
Files changed (131) hide show
  1. package/changelog.md +16 -0
  2. package/dist_ts/00_commitinfo_data.d.ts +8 -0
  3. package/dist_ts/00_commitinfo_data.js +9 -0
  4. package/dist_ts/data/abusewindow.d.ts +13 -0
  5. package/dist_ts/data/abusewindow.js +2 -0
  6. package/dist_ts/data/activity.d.ts +16 -0
  7. package/dist_ts/data/activity.js +2 -0
  8. package/dist_ts/data/alert.d.ts +31 -0
  9. package/dist_ts/data/alert.js +2 -0
  10. package/dist_ts/data/alertrule.d.ts +19 -0
  11. package/dist_ts/data/alertrule.js +2 -0
  12. package/dist_ts/data/app.d.ts +86 -0
  13. package/dist_ts/data/app.js +2 -0
  14. package/dist_ts/data/appconnection.d.ts +16 -0
  15. package/dist_ts/data/appconnection.js +2 -0
  16. package/dist_ts/data/billingplan.d.ts +43 -0
  17. package/dist_ts/data/billingplan.js +2 -0
  18. package/dist_ts/data/device.d.ts +3 -0
  19. package/dist_ts/data/device.js +2 -0
  20. package/dist_ts/data/emailactiontoken.d.ts +11 -0
  21. package/dist_ts/data/emailactiontoken.js +2 -0
  22. package/dist_ts/data/index.d.ts +21 -0
  23. package/dist_ts/data/index.js +22 -0
  24. package/dist_ts/data/jwt.d.ts +38 -0
  25. package/dist_ts/data/jwt.js +2 -0
  26. package/dist_ts/data/loginsession.d.ts +38 -0
  27. package/dist_ts/data/loginsession.js +2 -0
  28. package/dist_ts/data/oidc.d.ts +248 -0
  29. package/dist_ts/data/oidc.js +5 -0
  30. package/dist_ts/data/organization.d.ts +11 -0
  31. package/dist_ts/data/organization.js +4 -0
  32. package/dist_ts/data/paddlecheckoutdata.d.ts +316 -0
  33. package/dist_ts/data/paddlecheckoutdata.js +2 -0
  34. package/dist_ts/data/passportchallenge.d.ts +68 -0
  35. package/dist_ts/data/passportchallenge.js +2 -0
  36. package/dist_ts/data/passportdevice.d.ts +34 -0
  37. package/dist_ts/data/passportdevice.js +2 -0
  38. package/dist_ts/data/passportnonce.d.ts +9 -0
  39. package/dist_ts/data/passportnonce.js +2 -0
  40. package/dist_ts/data/property.d.ts +10 -0
  41. package/dist_ts/data/property.js +3 -0
  42. package/dist_ts/data/registrationsession.d.ts +25 -0
  43. package/dist_ts/data/registrationsession.js +2 -0
  44. package/dist_ts/data/role.d.ts +28 -0
  45. package/dist_ts/data/role.js +2 -0
  46. package/dist_ts/data/user.d.ts +32 -0
  47. package/dist_ts/data/user.js +3 -0
  48. package/dist_ts/data/userinvitation.d.ts +45 -0
  49. package/dist_ts/data/userinvitation.js +2 -0
  50. package/dist_ts/index.d.ts +4 -0
  51. package/dist_ts/index.js +6 -0
  52. package/dist_ts/plugins.d.ts +4 -0
  53. package/dist_ts/plugins.js +7 -0
  54. package/dist_ts/request/admin.d.ts +100 -0
  55. package/dist_ts/request/admin.js +3 -0
  56. package/dist_ts/request/alert.d.ts +78 -0
  57. package/dist_ts/request/alert.js +3 -0
  58. package/dist_ts/request/apitoken.d.ts +1 -0
  59. package/dist_ts/request/apitoken.js +2 -0
  60. package/dist_ts/request/app.d.ts +48 -0
  61. package/dist_ts/request/app.js +3 -0
  62. package/dist_ts/request/authorization.d.ts +57 -0
  63. package/dist_ts/request/authorization.js +4 -0
  64. package/dist_ts/request/billingplan.d.ts +40 -0
  65. package/dist_ts/request/billingplan.js +3 -0
  66. package/dist_ts/request/index.d.ts +14 -0
  67. package/dist_ts/request/index.js +15 -0
  68. package/dist_ts/request/jwt.d.ts +63 -0
  69. package/dist_ts/request/jwt.js +3 -0
  70. package/dist_ts/request/login.d.ts +126 -0
  71. package/dist_ts/request/login.js +3 -0
  72. package/dist_ts/request/organization.d.ts +96 -0
  73. package/dist_ts/request/organization.js +3 -0
  74. package/dist_ts/request/passport.d.ts +169 -0
  75. package/dist_ts/request/passport.js +3 -0
  76. package/dist_ts/request/plan.d.ts +12 -0
  77. package/dist_ts/request/plan.js +3 -0
  78. package/dist_ts/request/registration.d.ts +65 -0
  79. package/dist_ts/request/registration.js +3 -0
  80. package/dist_ts/request/user.d.ts +101 -0
  81. package/dist_ts/request/user.js +3 -0
  82. package/dist_ts/request/userinvitation.d.ts +193 -0
  83. package/dist_ts/request/userinvitation.js +3 -0
  84. package/dist_ts/tags/index.d.ts +7 -0
  85. package/dist_ts/tags/index.js +2 -0
  86. package/license +21 -0
  87. package/package.json +57 -0
  88. package/readme.md +101 -0
  89. package/ts/00_commitinfo_data.ts +8 -0
  90. package/ts/data/abusewindow.ts +13 -0
  91. package/ts/data/activity.ts +36 -0
  92. package/ts/data/alert.ts +35 -0
  93. package/ts/data/alertrule.ts +22 -0
  94. package/ts/data/app.ts +99 -0
  95. package/ts/data/appconnection.ts +18 -0
  96. package/ts/data/billingplan.ts +47 -0
  97. package/ts/data/device.ts +3 -0
  98. package/ts/data/emailactiontoken.ts +12 -0
  99. package/ts/data/index.ts +21 -0
  100. package/ts/data/jwt.ts +43 -0
  101. package/ts/data/loginsession.ts +38 -0
  102. package/ts/data/oidc.ts +281 -0
  103. package/ts/data/organization.ts +14 -0
  104. package/ts/data/paddlecheckoutdata.ts +316 -0
  105. package/ts/data/passportchallenge.ts +80 -0
  106. package/ts/data/passportdevice.ts +46 -0
  107. package/ts/data/passportnonce.ts +9 -0
  108. package/ts/data/property.ts +12 -0
  109. package/ts/data/registrationsession.ts +31 -0
  110. package/ts/data/role.ts +33 -0
  111. package/ts/data/user.ts +36 -0
  112. package/ts/data/userinvitation.ts +58 -0
  113. package/ts/index.ts +6 -0
  114. package/ts/plugins.ts +9 -0
  115. package/ts/readme.md +133 -0
  116. package/ts/request/admin.ts +130 -0
  117. package/ts/request/alert.ts +113 -0
  118. package/ts/request/apitoken.ts +1 -0
  119. package/ts/request/app.ts +71 -0
  120. package/ts/request/authorization.ts +72 -0
  121. package/ts/request/billingplan.ts +55 -0
  122. package/ts/request/index.ts +14 -0
  123. package/ts/request/jwt.ts +79 -0
  124. package/ts/request/login.ts +181 -0
  125. package/ts/request/organization.ts +131 -0
  126. package/ts/request/passport.ts +227 -0
  127. package/ts/request/plan.ts +17 -0
  128. package/ts/request/registration.ts +90 -0
  129. package/ts/request/user.ts +142 -0
  130. package/ts/request/userinvitation.ts +248 -0
  131. package/ts/tags/index.ts +12 -0
@@ -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,80 @@
1
+ import type { IPassportCapabilities } from './passportdevice.js';
2
+
3
+ export type TPassportChallengeType =
4
+ | 'device_enrollment'
5
+ | 'authentication'
6
+ | 'step_up'
7
+ | 'physical_access';
8
+
9
+ export type TPassportChallengeStatus = 'pending' | 'approved' | 'expired' | 'rejected';
10
+
11
+ export type TPassportChallengeDeliveryStatus = 'pending' | 'sent' | 'failed' | 'seen';
12
+
13
+ export type TPassportSignatureFormat = 'raw' | 'der';
14
+
15
+ export interface IPassportLocationEvidence {
16
+ latitude: number;
17
+ longitude: number;
18
+ accuracyMeters: number;
19
+ capturedAt: number;
20
+ }
21
+
22
+ export interface IPassportNfcEvidence {
23
+ tagId?: string;
24
+ readerId?: string;
25
+ }
26
+
27
+ export interface IPassportLocationPolicy {
28
+ mode: 'geofence';
29
+ label?: string;
30
+ latitude: number;
31
+ longitude: number;
32
+ radiusMeters: number;
33
+ maxAccuracyMeters?: number;
34
+ }
35
+
36
+ export interface IPassportChallenge {
37
+ id: string;
38
+ data: {
39
+ userId: string;
40
+ deviceId?: string | null;
41
+ type: TPassportChallengeType;
42
+ status: TPassportChallengeStatus;
43
+ tokenHash?: string | null;
44
+ challenge: string;
45
+ metadata: {
46
+ originHost?: string;
47
+ audience?: string;
48
+ notificationTitle?: string;
49
+ deviceLabel?: string;
50
+ requireLocation: boolean;
51
+ requireNfc: boolean;
52
+ locationPolicy?: IPassportLocationPolicy;
53
+ requestedCapabilities?: Partial<IPassportCapabilities>;
54
+ };
55
+ evidence?: {
56
+ signatureFormat?: TPassportSignatureFormat;
57
+ location?: IPassportLocationEvidence;
58
+ locationEvaluation?: {
59
+ matched: boolean;
60
+ distanceMeters?: number;
61
+ accuracyAccepted?: boolean;
62
+ evaluatedAt: number;
63
+ reason?: string;
64
+ };
65
+ nfc?: IPassportNfcEvidence;
66
+ };
67
+ notification?: {
68
+ hintId: string;
69
+ status: TPassportChallengeDeliveryStatus;
70
+ attemptCount: number;
71
+ createdAt: number;
72
+ deliveredAt?: number | null;
73
+ seenAt?: number | null;
74
+ lastError?: string | null;
75
+ };
76
+ createdAt: number;
77
+ expiresAt: number;
78
+ completedAt?: number | null;
79
+ };
80
+ }
@@ -0,0 +1,46 @@
1
+ export type TPassportDevicePlatform =
2
+ | 'ios'
3
+ | 'ipados'
4
+ | 'macos'
5
+ | 'watchos'
6
+ | 'android'
7
+ | 'web'
8
+ | 'unknown';
9
+
10
+ export type TPassportDeviceStatus = 'active' | 'revoked';
11
+
12
+ export type TPassportPushProvider = 'apns';
13
+
14
+ export type TPassportPushEnvironment = 'development' | 'production';
15
+
16
+ export interface IPassportCapabilities {
17
+ gps: boolean;
18
+ nfc: boolean;
19
+ push: boolean;
20
+ }
21
+
22
+ export interface IPassportDevice {
23
+ id: string;
24
+ data: {
25
+ userId: string;
26
+ label: string;
27
+ platform: TPassportDevicePlatform;
28
+ status: TPassportDeviceStatus;
29
+ publicKeyAlgorithm: 'p256';
30
+ publicKeyX963Base64: string;
31
+ capabilities: IPassportCapabilities;
32
+ pushRegistration?: {
33
+ provider: TPassportPushProvider;
34
+ token: string;
35
+ topic: string;
36
+ environment: TPassportPushEnvironment;
37
+ registeredAt: number;
38
+ lastDeliveredAt?: number;
39
+ lastError?: string;
40
+ };
41
+ appVersion?: string;
42
+ createdAt: number;
43
+ lastSeenAt?: number;
44
+ lastChallengeAt?: number;
45
+ };
46
+ }
@@ -0,0 +1,9 @@
1
+ export interface IPassportNonce {
2
+ id: string;
3
+ data: {
4
+ deviceId: string;
5
+ nonceHash: string;
6
+ createdAt: number;
7
+ expiresAt: number;
8
+ };
9
+ }
@@ -0,0 +1,12 @@
1
+ import * as plugins from '../plugins.js';
2
+ import { type IRole } from './role.js';
3
+
4
+ export interface ISubOrgProperty {
5
+ name: string;
6
+ domain: string;
7
+ roles: IRole[];
8
+ /**
9
+ * contains the ids of all the apps that show the property
10
+ */
11
+ attributedAppIds: string[];
12
+ }
@@ -0,0 +1,31 @@
1
+ export type TRegistrationSessionStatus =
2
+ | 'announced'
3
+ | 'emailValidated'
4
+ | 'mobileVerified'
5
+ | 'registered'
6
+ | 'failed';
7
+
8
+ export interface IRegistrationSession {
9
+ id: string;
10
+ data: {
11
+ emailAddress: string;
12
+ hashedEmailToken: string;
13
+ smsCodeHash?: string | null;
14
+ smsvalidationCounter: number;
15
+ status: TRegistrationSessionStatus;
16
+ validUntil: number;
17
+ createdAt: number;
18
+ collectedData: {
19
+ userData: {
20
+ username?: string | null;
21
+ connectedOrgs: string[];
22
+ email?: string | null;
23
+ name?: string | null;
24
+ status?: 'new' | 'active' | 'deleted' | 'suspended' | null;
25
+ mobileNumber?: string | null;
26
+ password?: string | null;
27
+ passwordHash?: string | null;
28
+ };
29
+ };
30
+ };
31
+ }
@@ -0,0 +1,33 @@
1
+ import * as plugins from '../plugins.js';
2
+
3
+ /** Standard role types available in all organizations */
4
+ export type TStandardRole = 'owner' | 'admin' | 'editor' | 'guest' | 'viewer' | 'outlaw';
5
+
6
+ export interface IOrgRoleDefinition {
7
+ key: string;
8
+ name: string;
9
+ description?: string;
10
+ createdAt: number;
11
+ updatedAt: number;
12
+ }
13
+
14
+ export interface IAppRoleMapping {
15
+ orgRoleKey: string;
16
+ appRoles: string[];
17
+ permissions: string[];
18
+ scopes: string[];
19
+ }
20
+
21
+ /**
22
+ * A role describes a user's permissions within an organization.
23
+ * Users can have multiple roles (e.g., ['owner', 'billing-admin']).
24
+ */
25
+ export interface IRole {
26
+ id: string;
27
+ data: {
28
+ userId: string;
29
+ organizationId: string;
30
+ /** Array of roles - supports standard roles and custom role names */
31
+ roles: string[];
32
+ };
33
+ }
@@ -0,0 +1,36 @@
1
+ import * as plugins from '../plugins.js';
2
+ import { type IRole } from './role.js';
3
+
4
+ export interface IUser {
5
+ id: string;
6
+ data: {
7
+ name: string;
8
+ username: string;
9
+ email: string;
10
+
11
+ /**
12
+ * mobile number used for verification
13
+ */
14
+ mobileNumber?: string;
15
+ /**
16
+ * only used during initial password setting
17
+ */
18
+ password?: string;
19
+ /**
20
+ * used for validation of passwords
21
+ */
22
+ passwordHash?: string;
23
+ status: 'new' | 'active' | 'deleted' | 'suspended';
24
+ /**
25
+ * a quick ref for which organizations might have roles for this user
26
+ * speeds up lookup
27
+ */
28
+ connectedOrgs: string[];
29
+ /**
30
+ * Platform-level admin flag
31
+ * Users with this flag can access the global admin panel
32
+ * to manage global apps, view platform stats, etc.
33
+ */
34
+ isGlobalAdmin?: boolean;
35
+ };
36
+ }
@@ -0,0 +1,58 @@
1
+ import * as plugins from '../plugins.js';
2
+
3
+ /**
4
+ * A UserInvitation represents an invitation to join an organization.
5
+ * Key characteristics:
6
+ * - Unique by email (multiple orgs can share the same invitation)
7
+ * - Converts to real User on registration or folds into existing user
8
+ * - Auto-expires after 90 days
9
+ */
10
+ export interface IUserInvitation {
11
+ id: string;
12
+ data: {
13
+ /** The invited email address - unique key for sharing across orgs */
14
+ email: string;
15
+
16
+ /** Secure token for invitation link validation */
17
+ token: string;
18
+
19
+ /** Current status of the invitation */
20
+ status: 'pending' | 'accepted' | 'expired' | 'cancelled';
21
+
22
+ /** When the invitation was first created */
23
+ createdAt: number;
24
+
25
+ /** When the invitation expires (createdAt + 90 days) */
26
+ expiresAt: number;
27
+
28
+ /**
29
+ * Organizations that have invited this email.
30
+ * Multiple orgs can link to the same invitation.
31
+ */
32
+ organizationRefs: IOrganizationInvitationRef[];
33
+
34
+ /** When the invitation was accepted (user registered/folded) */
35
+ acceptedAt?: number;
36
+
37
+ /** The User ID after conversion (when accepted) */
38
+ convertedToUserId?: string;
39
+ };
40
+ }
41
+
42
+ /**
43
+ * Represents one organization's invitation to the user.
44
+ * Stored as part of IUserInvitation.organizationRefs array.
45
+ */
46
+ export interface IOrganizationInvitationRef {
47
+ /** The organization that sent this invitation */
48
+ organizationId: string;
49
+
50
+ /** The user who sent the invitation */
51
+ invitedByUserId: string;
52
+
53
+ /** When this org invited the user */
54
+ invitedAt: number;
55
+
56
+ /** Roles to assign when the invitation is accepted */
57
+ roles: string[];
58
+ }
package/ts/index.ts ADDED
@@ -0,0 +1,6 @@
1
+ // requests
2
+ import * as request from './request/index.js';
3
+ import * as data from './data/index.js';
4
+ import * as tags from './tags/index.js';
5
+
6
+ export { request, data, tags };
package/ts/plugins.ts ADDED
@@ -0,0 +1,9 @@
1
+ // @apiglobal scope
2
+ import * as typedRequestInterfaces from '@api.global/typedrequest-interfaces';
3
+
4
+ export { typedRequestInterfaces };
5
+
6
+ // @tsclass scope
7
+ import * as tsclass from '@tsclass/tsclass';
8
+
9
+ export { tsclass };