@logto/cloud 0.2.5-a3e852f → 0.2.5-a6cff75

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 (2) hide show
  1. package/lib/routes/index.d.ts +700 -73
  2. package/package.json +15 -19
@@ -1,98 +1,390 @@
1
- // Generated by dts-bundle-generator v8.0.1
1
+ // Generated by dts-bundle-generator v9.3.1
2
2
 
3
- import { RequestContext } from '@withtyped/server';
3
+ import { Json, JsonObject, RequestContext } from '@withtyped/server';
4
4
  import { InferModelType } from '@withtyped/server/model';
5
5
 
6
6
  export type WithAuthContext<Context = RequestContext> = Context & {
7
7
  auth: {
8
+ /** The ID of the authenticated subject (`sub`). */
8
9
  id: string;
10
+ /** The scopes that the subject has (`scope`). */
9
11
  scopes: string[];
10
12
  };
11
13
  };
12
- declare enum TenantTag {
13
- Development = "development",
14
- Staging = "staging",
15
- Production = "production"
16
- }
17
14
  declare enum VerificationCodeType {
18
15
  SignIn = "SignIn",
19
16
  Register = "Register",
20
17
  ForgotPassword = "ForgotPassword",
21
- /** @deprecated */
22
- Continue = "Continue",
23
18
  Generic = "Generic",
24
19
  /** @deprecated Use `Generic` type template for sending test sms/email use case */
25
20
  Test = "Test"
26
21
  }
27
- declare const AffiliateProperties: import("@withtyped/server/model").default<"affiliate_properties", {
22
+ declare enum TemplateType {
23
+ /** The template for sending verification code when user is signing in. */
24
+ SignIn = "SignIn",
25
+ /** The template for sending verification code when user is registering. */
26
+ Register = "Register",
27
+ /** The template for sending verification code when user is resetting password. */
28
+ ForgotPassword = "ForgotPassword",
29
+ /** The template for sending organization invitation. */
30
+ OrganizationInvitation = "OrganizationInvitation",
31
+ /** The template for generic usage. */
32
+ Generic = "Generic"
33
+ }
34
+ declare enum OrganizationInvitationStatus {
35
+ Pending = "Pending",
36
+ Accepted = "Accepted",
37
+ Expired = "Expired",
38
+ Revoked = "Revoked"
39
+ }
40
+ /** The scopes (permissions) defined by the organization template. */
41
+ export type OrganizationScope = {
42
+ tenantId: string;
43
+ /** The globally unique identifier of the organization scope. */
44
+ id: string;
45
+ /** The organization scope's name, unique within the organization template. */
46
+ name: string;
47
+ /** A brief description of the organization scope. */
48
+ description: string | null;
49
+ };
50
+ declare enum LogtoJwtTokenKeyType {
51
+ AccessToken = "access-token",
52
+ ClientCredentials = "client-credentials"
53
+ }
54
+ /**
55
+ * The simplified organization role entity that is returned in the `roles` field
56
+ * of the organization.
57
+ */
58
+ export type OrganizationRoleEntity = {
59
+ id: string;
60
+ name: string;
61
+ };
62
+ declare enum TenantTag {
63
+ Development = "development",
64
+ Production = "production"
65
+ }
66
+ declare enum TenantRole {
67
+ /** Admin of the tenant, who has all permissions. */
68
+ Admin = "admin",
69
+ /** Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
70
+ Collaborator = "collaborator"
71
+ }
72
+ declare enum LogtoSkuType {
73
+ Basic = "Basic",
74
+ AddOn = "AddOn"
75
+ }
76
+ declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
28
77
  createdAt: Date;
29
78
  affiliateId: string;
30
79
  type: "hostname" | "query";
31
80
  value: string;
32
81
  }, "createdAt", "createdAt">;
33
82
  export type AffiliateProperty = InferModelType<typeof AffiliateProperties>;
34
- declare const Affiliates: import("@withtyped/server/model").default<"affiliates", {
35
- id: string;
36
- createdAt: Date;
83
+ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default<"affiliates", {
37
84
  name: string;
38
- }, "createdAt" | "id", "createdAt" | "id">;
85
+ createdAt: Date;
86
+ id: string;
87
+ }, "id" | "createdAt", "id" | "createdAt">;
39
88
  export type Affiliate = InferModelType<typeof Affiliates>;
89
+ declare enum RegionName {
90
+ EU = "EU",
91
+ US = "US"
92
+ }
40
93
  export type AffiliateData = Affiliate & {
41
94
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
42
95
  };
43
- declare const router: import("@withtyped/server").Router<WithAuthContext, import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
44
- options: {};
96
+ declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
97
+ request: {
98
+ id?: string | undefined;
99
+ method?: import("@withtyped/server").RequestMethod | undefined;
100
+ headers: import("http").IncomingHttpHeaders;
101
+ url: URL;
102
+ body?: unknown;
103
+ };
104
+ }, "request"> & {
105
+ request: Record<string, unknown> & {
106
+ id?: string | undefined;
107
+ method?: import("@withtyped/server").RequestMethod | undefined;
108
+ headers: import("http").IncomingHttpHeaders;
109
+ url: URL;
110
+ body?: unknown;
111
+ } & {
112
+ body?: Json | undefined;
113
+ bodyRaw?: Buffer | undefined;
114
+ };
115
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
45
116
  patch: {
46
117
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
47
118
  name?: string | undefined;
48
- tag?: TenantTag | undefined;
49
119
  }, {
50
120
  id: string;
51
121
  name: string;
122
+ quota: {
123
+ mauLimit: number | null;
124
+ };
125
+ createdAt: Date;
126
+ usage: {
127
+ activeUsers: number;
128
+ };
52
129
  indicator: string;
53
130
  isSuspended: boolean;
54
131
  planId: string;
132
+ subscription: {
133
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
134
+ planId: string;
135
+ currentPeriodStart: Date;
136
+ currentPeriodEnd: Date;
137
+ id?: string | undefined;
138
+ upcomingInvoice?: {
139
+ subtotal: number;
140
+ subtotalExcludingTax: number | null;
141
+ total: number;
142
+ totalExcludingTax: number | null;
143
+ } | null | undefined;
144
+ isAddOnAvailable?: boolean | undefined;
145
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
146
+ };
147
+ regionName: RegionName;
55
148
  tag: TenantTag;
149
+ openInvoices: {
150
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
151
+ id: string;
152
+ createdAt: Date;
153
+ updatedAt: Date;
154
+ customerId: string | null;
155
+ billingReason: string | null;
156
+ periodStart: Date;
157
+ periodEnd: Date;
158
+ amountDue: number;
159
+ amountPaid: number;
160
+ subscriptionId: string | null;
161
+ hostedInvoiceUrl: string | null;
162
+ invoicePdf: string | null;
163
+ }[];
56
164
  }>;
57
165
  };
166
+ options: {};
58
167
  get: {
59
168
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
60
169
  id: string;
61
170
  name: string;
171
+ quota: {
172
+ mauLimit: number | null;
173
+ };
174
+ createdAt: Date;
175
+ usage: {
176
+ activeUsers: number;
177
+ };
62
178
  indicator: string;
63
179
  isSuspended: boolean;
64
180
  planId: string;
181
+ subscription: {
182
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
183
+ planId: string;
184
+ currentPeriodStart: Date;
185
+ currentPeriodEnd: Date;
186
+ id?: string | undefined;
187
+ upcomingInvoice?: {
188
+ subtotal: number;
189
+ subtotalExcludingTax: number | null;
190
+ total: number;
191
+ totalExcludingTax: number | null;
192
+ } | null | undefined;
193
+ isAddOnAvailable?: boolean | undefined;
194
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
195
+ };
196
+ regionName: RegionName;
65
197
  tag: TenantTag;
198
+ openInvoices: {
199
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
200
+ id: string;
201
+ createdAt: Date;
202
+ updatedAt: Date;
203
+ customerId: string | null;
204
+ billingReason: string | null;
205
+ periodStart: Date;
206
+ periodEnd: Date;
207
+ amountDue: number;
208
+ amountPaid: number;
209
+ subscriptionId: string | null;
210
+ hostedInvoiceUrl: string | null;
211
+ invoicePdf: string | null;
212
+ }[];
66
213
  }[]>;
67
214
  };
68
215
  post: {
69
216
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
70
217
  name?: string | undefined;
71
218
  tag?: TenantTag | undefined;
219
+ regionName?: RegionName | undefined;
72
220
  }, {
73
221
  id: string;
74
222
  name: string;
223
+ quota: {
224
+ mauLimit: number | null;
225
+ };
226
+ createdAt: Date;
227
+ usage: {
228
+ activeUsers: number;
229
+ };
75
230
  indicator: string;
76
231
  isSuspended: boolean;
77
232
  planId: string;
233
+ subscription: {
234
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
235
+ planId: string;
236
+ currentPeriodStart: Date;
237
+ currentPeriodEnd: Date;
238
+ id?: string | undefined;
239
+ upcomingInvoice?: {
240
+ subtotal: number;
241
+ subtotalExcludingTax: number | null;
242
+ total: number;
243
+ totalExcludingTax: number | null;
244
+ } | null | undefined;
245
+ isAddOnAvailable?: boolean | undefined;
246
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
247
+ };
248
+ regionName: RegionName;
78
249
  tag: TenantTag;
250
+ openInvoices: {
251
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
252
+ id: string;
253
+ createdAt: Date;
254
+ updatedAt: Date;
255
+ customerId: string | null;
256
+ billingReason: string | null;
257
+ periodStart: Date;
258
+ periodEnd: Date;
259
+ amountDue: number;
260
+ amountPaid: number;
261
+ subscriptionId: string | null;
262
+ hostedInvoiceUrl: string | null;
263
+ invoicePdf: string | null;
264
+ }[];
79
265
  }>;
80
266
  };
81
267
  put: {};
82
- head: {};
83
268
  delete: {
84
269
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
85
270
  };
86
271
  copy: {};
272
+ head: {};
87
273
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
88
- options: {};
89
274
  patch: {};
275
+ options: {};
90
276
  get: {
91
277
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
92
278
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
93
279
  planId: string;
94
280
  currentPeriodStart: Date;
95
281
  currentPeriodEnd: Date;
282
+ id?: string | undefined;
283
+ upcomingInvoice?: {
284
+ subtotal: number;
285
+ subtotalExcludingTax: number | null;
286
+ total: number;
287
+ totalExcludingTax: number | null;
288
+ } | null | undefined;
289
+ isAddOnAvailable?: boolean | undefined;
290
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
291
+ }>;
292
+ } & {
293
+ "/tenants/my/subscription/quota": import("@withtyped/server").PathGuard<"/my/subscription/quota", unknown, unknown, {
294
+ mauLimit: number | null;
295
+ tokenLimit: number | null;
296
+ applicationsLimit: number | null;
297
+ machineToMachineLimit: number | null;
298
+ resourcesLimit: number | null;
299
+ scopesPerResourceLimit: number | null;
300
+ socialConnectorsLimit: number | null;
301
+ machineToMachineRolesLimit: number | null;
302
+ scopesPerRoleLimit: number | null;
303
+ hooksLimit: number | null;
304
+ auditLogsRetentionDays: number | null;
305
+ mfaEnabled: boolean;
306
+ organizationsEnabled: boolean;
307
+ thirdPartyApplicationsLimit: number | null;
308
+ tenantMembersLimit: number | null;
309
+ customJwtEnabled: boolean;
310
+ subjectTokenEnabled: boolean;
311
+ bringYourUiEnabled: boolean;
312
+ userRolesLimit: number | null;
313
+ enterpriseSsoLimit: number | null;
314
+ }>;
315
+ } & {
316
+ "/tenants/my/subscription/usage": import("@withtyped/server").PathGuard<"/my/subscription/usage", unknown, unknown, {
317
+ mauLimit: number;
318
+ tokenLimit: number;
319
+ applicationsLimit: number;
320
+ machineToMachineLimit: number;
321
+ resourcesLimit: number;
322
+ scopesPerResourceLimit: number;
323
+ socialConnectorsLimit: number;
324
+ machineToMachineRolesLimit: number;
325
+ scopesPerRoleLimit: number;
326
+ hooksLimit: number;
327
+ mfaEnabled: boolean;
328
+ organizationsEnabled: boolean;
329
+ thirdPartyApplicationsLimit: number;
330
+ tenantMembersLimit: number;
331
+ customJwtEnabled: boolean;
332
+ subjectTokenEnabled: boolean;
333
+ bringYourUiEnabled: boolean;
334
+ userRolesLimit: number;
335
+ enterpriseSsoLimit: number;
336
+ }>;
337
+ } & {
338
+ "/tenants/my/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/my/subscription/usage/:entityName/scopes", {
339
+ entityId?: string | undefined;
340
+ }, unknown, Record<string, number>>;
341
+ } & {
342
+ "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
343
+ usage: {
344
+ mauLimit: number;
345
+ tokenLimit: number;
346
+ applicationsLimit: number;
347
+ machineToMachineLimit: number;
348
+ resourcesLimit: number;
349
+ scopesPerResourceLimit: number;
350
+ socialConnectorsLimit: number;
351
+ machineToMachineRolesLimit: number;
352
+ scopesPerRoleLimit: number;
353
+ hooksLimit: number;
354
+ mfaEnabled: boolean;
355
+ organizationsEnabled: boolean;
356
+ thirdPartyApplicationsLimit: number;
357
+ tenantMembersLimit: number;
358
+ customJwtEnabled: boolean;
359
+ subjectTokenEnabled: boolean;
360
+ bringYourUiEnabled: boolean;
361
+ userRolesLimit: number;
362
+ enterpriseSsoLimit: number;
363
+ };
364
+ resources: Record<string, number>;
365
+ roles: Record<string, number>;
366
+ quota: {
367
+ mauLimit: number | null;
368
+ tokenLimit: number | null;
369
+ applicationsLimit: number | null;
370
+ machineToMachineLimit: number | null;
371
+ resourcesLimit: number | null;
372
+ scopesPerResourceLimit: number | null;
373
+ socialConnectorsLimit: number | null;
374
+ machineToMachineRolesLimit: number | null;
375
+ scopesPerRoleLimit: number | null;
376
+ hooksLimit: number | null;
377
+ auditLogsRetentionDays: number | null;
378
+ mfaEnabled: boolean;
379
+ organizationsEnabled: boolean;
380
+ thirdPartyApplicationsLimit: number | null;
381
+ tenantMembersLimit: number | null;
382
+ customJwtEnabled: boolean;
383
+ subjectTokenEnabled: boolean;
384
+ bringYourUiEnabled: boolean;
385
+ userRolesLimit: number | null;
386
+ enterpriseSsoLimit: number | null;
387
+ };
96
388
  }>;
97
389
  } & {
98
390
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
@@ -100,13 +392,119 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
100
392
  planId: string;
101
393
  currentPeriodStart: Date;
102
394
  currentPeriodEnd: Date;
395
+ id?: string | undefined;
396
+ upcomingInvoice?: {
397
+ subtotal: number;
398
+ subtotalExcludingTax: number | null;
399
+ total: number;
400
+ totalExcludingTax: number | null;
401
+ } | null | undefined;
402
+ isAddOnAvailable?: boolean | undefined;
403
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
404
+ }>;
405
+ } & {
406
+ "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
407
+ mauLimit: number | null;
408
+ tokenLimit: number | null;
409
+ applicationsLimit: number | null;
410
+ machineToMachineLimit: number | null;
411
+ resourcesLimit: number | null;
412
+ scopesPerResourceLimit: number | null;
413
+ socialConnectorsLimit: number | null;
414
+ machineToMachineRolesLimit: number | null;
415
+ scopesPerRoleLimit: number | null;
416
+ hooksLimit: number | null;
417
+ auditLogsRetentionDays: number | null;
418
+ mfaEnabled: boolean;
419
+ organizationsEnabled: boolean;
420
+ thirdPartyApplicationsLimit: number | null;
421
+ tenantMembersLimit: number | null;
422
+ customJwtEnabled: boolean;
423
+ subjectTokenEnabled: boolean;
424
+ bringYourUiEnabled: boolean;
425
+ userRolesLimit: number | null;
426
+ enterpriseSsoLimit: number | null;
427
+ }>;
428
+ } & {
429
+ "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
430
+ mauLimit: number;
431
+ tokenLimit: number;
432
+ applicationsLimit: number;
433
+ machineToMachineLimit: number;
434
+ resourcesLimit: number;
435
+ scopesPerResourceLimit: number;
436
+ socialConnectorsLimit: number;
437
+ machineToMachineRolesLimit: number;
438
+ scopesPerRoleLimit: number;
439
+ hooksLimit: number;
440
+ mfaEnabled: boolean;
441
+ organizationsEnabled: boolean;
442
+ thirdPartyApplicationsLimit: number;
443
+ tenantMembersLimit: number;
444
+ customJwtEnabled: boolean;
445
+ subjectTokenEnabled: boolean;
446
+ bringYourUiEnabled: boolean;
447
+ userRolesLimit: number;
448
+ enterpriseSsoLimit: number;
449
+ }>;
450
+ } & {
451
+ "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
452
+ entityId?: string | undefined;
453
+ }, unknown, Record<string, number>>;
454
+ } & {
455
+ "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
456
+ usage: {
457
+ mauLimit: number;
458
+ tokenLimit: number;
459
+ applicationsLimit: number;
460
+ machineToMachineLimit: number;
461
+ resourcesLimit: number;
462
+ scopesPerResourceLimit: number;
463
+ socialConnectorsLimit: number;
464
+ machineToMachineRolesLimit: number;
465
+ scopesPerRoleLimit: number;
466
+ hooksLimit: number;
467
+ mfaEnabled: boolean;
468
+ organizationsEnabled: boolean;
469
+ thirdPartyApplicationsLimit: number;
470
+ tenantMembersLimit: number;
471
+ customJwtEnabled: boolean;
472
+ subjectTokenEnabled: boolean;
473
+ bringYourUiEnabled: boolean;
474
+ userRolesLimit: number;
475
+ enterpriseSsoLimit: number;
476
+ };
477
+ resources: Record<string, number>;
478
+ roles: Record<string, number>;
479
+ quota: {
480
+ mauLimit: number | null;
481
+ tokenLimit: number | null;
482
+ applicationsLimit: number | null;
483
+ machineToMachineLimit: number | null;
484
+ resourcesLimit: number | null;
485
+ scopesPerResourceLimit: number | null;
486
+ socialConnectorsLimit: number | null;
487
+ machineToMachineRolesLimit: number | null;
488
+ scopesPerRoleLimit: number | null;
489
+ hooksLimit: number | null;
490
+ auditLogsRetentionDays: number | null;
491
+ mfaEnabled: boolean;
492
+ organizationsEnabled: boolean;
493
+ thirdPartyApplicationsLimit: number | null;
494
+ tenantMembersLimit: number | null;
495
+ customJwtEnabled: boolean;
496
+ subjectTokenEnabled: boolean;
497
+ bringYourUiEnabled: boolean;
498
+ userRolesLimit: number | null;
499
+ enterpriseSsoLimit: number | null;
500
+ };
103
501
  }>;
104
502
  } & {
105
503
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
106
504
  invoices: {
107
505
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
108
- createdAt: Date;
109
506
  id: string;
507
+ createdAt: Date;
110
508
  updatedAt: Date;
111
509
  customerId: string | null;
112
510
  billingReason: string | null;
@@ -118,15 +516,21 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
118
516
  hostedInvoiceUrl: string | null;
119
517
  invoicePdf: string | null;
120
518
  planName: string | null;
519
+ skuId?: string | null | undefined;
121
520
  }[];
122
521
  }>;
123
522
  } & {
124
- "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
125
- activeUsers: number;
126
- cost: number;
523
+ "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
524
+ hostedInvoiceUrl: string;
127
525
  }>;
128
526
  };
129
527
  post: {
528
+ "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
529
+ usageKey: "tokenLimit" | "machineToMachineLimit" | "resourcesLimit" | "enterpriseSsoLimit" | "hooksLimit" | "tenantMembersLimit" | "mfaEnabled" | "organizationsEnabled";
530
+ }, {
531
+ message: string;
532
+ }>;
533
+ } & {
130
534
  "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
131
535
  callbackUrl?: string | undefined;
132
536
  }, {
@@ -134,14 +538,14 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
134
538
  }>;
135
539
  };
136
540
  put: {};
137
- head: {};
138
541
  delete: {
139
542
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
140
543
  };
141
544
  copy: {};
545
+ head: {};
142
546
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
143
- options: {};
144
547
  patch: {};
548
+ options: {};
145
549
  get: {
146
550
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
147
551
  from?: string | undefined;
@@ -152,44 +556,74 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
152
556
  post: {
153
557
  "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
154
558
  data: {
155
- type: VerificationCodeType;
156
- to: string;
559
+ type: TemplateType | VerificationCodeType;
157
560
  payload: {
561
+ code?: string | undefined;
562
+ link?: string | undefined;
563
+ } & Record<string, string> & {
158
564
  senderName?: string | undefined;
159
565
  companyInformation?: string | undefined;
160
566
  appLogo?: string | undefined;
161
- code: string;
162
567
  };
568
+ to: string;
163
569
  };
164
570
  }, unknown>;
165
571
  } & {
166
572
  "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
167
573
  data: {
168
- type: VerificationCodeType;
574
+ type: TemplateType | VerificationCodeType;
169
575
  to: string;
170
576
  payload: {
171
- senderName?: string | undefined;
172
- companyInformation?: string | undefined;
173
- appLogo?: string | undefined;
174
- code: string;
175
- };
577
+ code?: string | undefined;
578
+ link?: string | undefined;
579
+ } & Record<string, string>;
176
580
  };
177
581
  }, unknown>;
582
+ } & {
583
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
584
+ isTest?: string | undefined;
585
+ }, {
586
+ context: Record<string, Json>;
587
+ script: string;
588
+ tokenType: LogtoJwtTokenKeyType.AccessToken;
589
+ token: Record<string, Json>;
590
+ environmentVariables?: Record<string, string> | undefined;
591
+ } | {
592
+ script: string;
593
+ tokenType: LogtoJwtTokenKeyType.ClientCredentials;
594
+ token: Record<string, Json>;
595
+ environmentVariables?: Record<string, string> | undefined;
596
+ }, Record<string, unknown>>;
597
+ };
598
+ put: {
599
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
600
+ "jwt.accessToken"?: {
601
+ production?: string | undefined;
602
+ test?: string | undefined;
603
+ } | undefined;
604
+ "jwt.clientCredentials"?: {
605
+ production?: string | undefined;
606
+ test?: string | undefined;
607
+ } | undefined;
608
+ }, unknown>;
609
+ };
610
+ delete: {
611
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
178
612
  };
179
- put: {};
180
- head: {};
181
- delete: {};
182
613
  copy: {};
614
+ head: {};
183
615
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
184
- options: {};
185
616
  patch: {};
617
+ options: {};
186
618
  get: {
187
619
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
188
- createdAt: Date;
189
620
  id: string;
621
+ createdAt: Date;
190
622
  name: string;
623
+ updatedAt: Date;
191
624
  quota: {
192
625
  mauLimit: number | null;
626
+ tokenLimit: number | null;
193
627
  applicationsLimit: number | null;
194
628
  machineToMachineLimit: number | null;
195
629
  resourcesLimit: number | null;
@@ -200,81 +634,117 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
200
634
  socialConnectorsLimit: number | null;
201
635
  standardConnectorsLimit: number | null;
202
636
  rolesLimit: number | null;
637
+ machineToMachineRolesLimit: number | null;
203
638
  scopesPerRoleLimit: number | null;
204
639
  hooksLimit: number | null;
205
640
  auditLogsRetentionDays: number | null;
641
+ mfaEnabled: boolean;
642
+ organizationsEnabled: boolean;
643
+ ssoEnabled: boolean;
644
+ thirdPartyApplicationsLimit: number | null;
645
+ tenantMembersLimit: number | null;
646
+ customJwtEnabled: boolean;
647
+ subjectTokenEnabled: boolean;
648
+ bringYourUiEnabled: boolean;
206
649
  };
207
650
  stripeProducts: {
208
- description?: string | undefined;
209
651
  type: "flat" | "tier1" | "tier2" | "tier3";
210
652
  id: string;
211
653
  name: string;
212
654
  price: {
213
- quantity?: 1 | undefined;
214
- unitAmount?: number | null | undefined;
215
655
  id: string;
216
656
  unitAmountDecimal: string;
657
+ quantity?: 1 | undefined;
658
+ unitAmount?: number | null | undefined;
217
659
  };
660
+ description?: string | undefined;
218
661
  }[];
219
- updatedAt: Date;
220
662
  }[]>;
221
663
  };
222
664
  post: {};
223
665
  put: {};
224
- head: {};
225
666
  delete: {};
226
667
  copy: {};
668
+ head: {};
227
669
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
228
- options: {};
229
670
  patch: {};
671
+ options: {};
230
672
  get: {
231
- "/my/tenant": import("@withtyped/server").PathGuard<"/tenant", unknown, unknown, {
232
- name: string;
673
+ "/skus": import("@withtyped/server").PathGuard<"/", {
674
+ type?: LogtoSkuType | undefined;
675
+ }, unknown, {
676
+ type: LogtoSkuType;
233
677
  id: string;
234
- indicator: string;
235
- isSuspended: boolean;
236
- tag: TenantTag;
237
- }>;
678
+ name: string | null;
679
+ quota: {
680
+ mauLimit?: number | null | undefined;
681
+ tokenLimit?: number | null | undefined;
682
+ applicationsLimit?: number | null | undefined;
683
+ machineToMachineLimit?: number | null | undefined;
684
+ resourcesLimit?: number | null | undefined;
685
+ scopesPerResourceLimit?: number | null | undefined;
686
+ socialConnectorsLimit?: number | null | undefined;
687
+ machineToMachineRolesLimit?: number | null | undefined;
688
+ scopesPerRoleLimit?: number | null | undefined;
689
+ hooksLimit?: number | null | undefined;
690
+ auditLogsRetentionDays?: number | null | undefined;
691
+ mfaEnabled?: boolean | undefined;
692
+ organizationsEnabled?: boolean | undefined;
693
+ thirdPartyApplicationsLimit?: number | null | undefined;
694
+ tenantMembersLimit?: number | null | undefined;
695
+ customJwtEnabled?: boolean | undefined;
696
+ subjectTokenEnabled?: boolean | undefined;
697
+ bringYourUiEnabled?: boolean | undefined;
698
+ userRolesLimit?: number | null | undefined;
699
+ enterpriseSsoLimit?: number | null | undefined;
700
+ };
701
+ createdAt: Date;
702
+ updatedAt: Date;
703
+ unitPrice: number | null;
704
+ }[]>;
238
705
  };
239
706
  post: {};
240
707
  put: {};
241
- head: {};
242
708
  delete: {};
243
709
  copy: {};
710
+ head: {};
244
711
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
245
- options: {};
246
712
  patch: {};
713
+ options: {};
247
714
  get: {
248
715
  "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
249
- status: "open" | "complete" | "expired";
250
- createdAt: Date;
251
716
  id: string;
717
+ createdAt: Date;
252
718
  userId: string;
253
- updatedAt: Date;
719
+ status: "open" | "complete" | "expired";
254
720
  tenantId: string | null;
721
+ updatedAt: Date;
255
722
  planId: string;
723
+ skuId: string | null;
256
724
  }>;
257
725
  };
258
726
  post: {
259
727
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
728
+ planId: string;
729
+ successCallbackUrl: string;
260
730
  tenantId?: string | undefined;
261
- tenantTag?: TenantTag | undefined;
731
+ skuId?: string | undefined;
262
732
  tenantName?: string | undefined;
733
+ tenantTag?: TenantTag | undefined;
734
+ tenantRegionName?: RegionName | undefined;
263
735
  cancelCallbackUrl?: string | undefined;
264
- planId: string;
265
- successCallbackUrl: string;
266
736
  }, {
267
- redirectUri?: string | null | undefined;
268
737
  sessionId: string;
738
+ redirectUri?: string | null | undefined;
269
739
  }>;
270
740
  };
271
741
  put: {};
272
- head: {};
273
742
  delete: {};
274
743
  copy: {};
744
+ head: {};
275
745
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
276
- options: {};
277
746
  patch: {};
747
+ options: {};
278
748
  get: {
279
749
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
280
750
  };
@@ -282,57 +752,214 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
282
752
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
283
753
  name: string;
284
754
  }, {
285
- createdAt: Date;
286
755
  id: string;
756
+ createdAt: Date;
287
757
  name: string;
288
758
  }>;
289
759
  } & {
290
760
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
291
- value: string;
292
761
  type: "hostname" | "query";
293
- }, {
294
762
  value: string;
295
- type: "hostname" | "query";
763
+ }, {
296
764
  createdAt: Date;
297
765
  affiliateId: string;
766
+ type: "hostname" | "query";
767
+ value: string;
298
768
  }>;
299
769
  };
300
770
  put: {};
301
- head: {};
302
771
  delete: {
303
772
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
304
- value: string;
305
773
  type: "hostname" | "query";
774
+ value: string;
306
775
  }, unknown>;
307
776
  };
308
777
  copy: {};
778
+ head: {};
309
779
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
310
- options: {};
311
780
  patch: {};
781
+ options: {};
312
782
  get: {};
313
783
  post: {
314
784
  "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
315
- hostname?: string | undefined;
316
- query?: string | undefined;
317
785
  createdAt: string;
318
786
  userId: string;
787
+ hostname?: string | undefined;
788
+ query?: string | undefined;
319
789
  }, {
320
- createdAt: Date;
321
790
  id: string;
791
+ createdAt: Date;
322
792
  affiliateId: string | null;
323
793
  userId: string;
324
794
  createdVia: {
795
+ createdAt: string;
325
796
  hostname?: string | undefined;
326
797
  query?: string | undefined;
327
- createdAt: string;
328
798
  };
329
799
  }>;
330
800
  };
331
801
  put: {};
802
+ delete: {};
803
+ copy: {};
332
804
  head: {};
805
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
806
+ patch: {
807
+ "/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
808
+ status: OrganizationInvitationStatus.Accepted;
809
+ }, unknown>;
810
+ };
811
+ options: {};
812
+ get: {
813
+ "/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
814
+ id: string;
815
+ createdAt: number;
816
+ status: OrganizationInvitationStatus;
817
+ tenantId: string;
818
+ updatedAt: number;
819
+ inviterId: string | null;
820
+ invitee: string;
821
+ acceptedUserId: string | null;
822
+ organizationId: string;
823
+ expiresAt: number;
824
+ organizationRoles: OrganizationRoleEntity[];
825
+ } & {
826
+ tenantName: string;
827
+ tenantTag: TenantTag;
828
+ })[]>;
829
+ } & {
830
+ "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
831
+ id: string;
832
+ createdAt: number;
833
+ status: OrganizationInvitationStatus;
834
+ tenantId: string;
835
+ updatedAt: number;
836
+ inviterId: string | null;
837
+ invitee: string;
838
+ acceptedUserId: string | null;
839
+ organizationId: string;
840
+ expiresAt: number;
841
+ organizationRoles: OrganizationRoleEntity[];
842
+ }>;
843
+ };
844
+ post: {};
845
+ put: {};
333
846
  delete: {};
334
847
  copy: {};
848
+ head: {};
849
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
850
+ patch: {};
851
+ options: {};
852
+ get: {};
853
+ post: {};
854
+ put: {};
855
+ delete: {
856
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
857
+ };
858
+ copy: {};
859
+ head: {};
335
860
  }, "/api">>, "/api">;
861
+ export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
862
+ request: {
863
+ id?: string | undefined;
864
+ method?: import("@withtyped/server").RequestMethod | undefined;
865
+ headers: import("http").IncomingHttpHeaders;
866
+ url: URL;
867
+ body?: unknown;
868
+ };
869
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
870
+ patch: {
871
+ "/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
872
+ status: OrganizationInvitationStatus.Revoked;
873
+ }, {
874
+ id: string;
875
+ createdAt: number;
876
+ status: OrganizationInvitationStatus;
877
+ tenantId: string;
878
+ updatedAt: number;
879
+ inviterId: string | null;
880
+ invitee: string;
881
+ acceptedUserId: string | null;
882
+ organizationId: string;
883
+ expiresAt: number;
884
+ organizationRoles: OrganizationRoleEntity[];
885
+ }>;
886
+ };
887
+ options: {};
888
+ get: {
889
+ "/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
890
+ id: string;
891
+ name: string | null;
892
+ username: string | null;
893
+ primaryEmail: string | null;
894
+ primaryPhone: string | null;
895
+ avatar: string | null;
896
+ organizationRoles: OrganizationRoleEntity[];
897
+ }[]>;
898
+ } & {
899
+ "/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
900
+ } & {
901
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
902
+ id: string;
903
+ createdAt: number;
904
+ status: OrganizationInvitationStatus;
905
+ tenantId: string;
906
+ updatedAt: number;
907
+ inviterId: string | null;
908
+ invitee: string;
909
+ acceptedUserId: string | null;
910
+ organizationId: string;
911
+ expiresAt: number;
912
+ organizationRoles: OrganizationRoleEntity[];
913
+ } & {
914
+ inviterName?: string | undefined;
915
+ })[]>;
916
+ };
917
+ post: {
918
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
919
+ invitee: string | string[];
920
+ roleName: TenantRole;
921
+ expiresAt?: number | undefined;
922
+ }, {
923
+ id: string;
924
+ createdAt: number;
925
+ status: OrganizationInvitationStatus;
926
+ tenantId: string;
927
+ updatedAt: number;
928
+ inviterId: string | null;
929
+ invitee: string;
930
+ acceptedUserId: string | null;
931
+ organizationId: string;
932
+ expiresAt: number;
933
+ organizationRoles: OrganizationRoleEntity[];
934
+ } | {
935
+ id: string;
936
+ createdAt: number;
937
+ status: OrganizationInvitationStatus;
938
+ tenantId: string;
939
+ updatedAt: number;
940
+ inviterId: string | null;
941
+ invitee: string;
942
+ acceptedUserId: string | null;
943
+ organizationId: string;
944
+ expiresAt: number;
945
+ organizationRoles: OrganizationRoleEntity[];
946
+ }[]>;
947
+ } & {
948
+ "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
949
+ };
950
+ put: {
951
+ "/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
952
+ roleName: TenantRole;
953
+ }, unknown>;
954
+ };
955
+ delete: {
956
+ "/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
957
+ } & {
958
+ "/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
959
+ };
960
+ copy: {};
961
+ head: {};
962
+ }, "/api/tenants">>, "/api/tenants">;
336
963
 
337
964
  export {
338
965
  router as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-a3e852f",
3
+ "version": "0.2.5-a6cff75",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -16,25 +16,24 @@
16
16
  "#src/*": "./build/*"
17
17
  },
18
18
  "devDependencies": {
19
- "@silverhand/eslint-config": "4.0.1",
20
- "@silverhand/jest-config": "4.0.0",
21
- "@silverhand/ts-config": "4.0.0",
19
+ "@silverhand/eslint-config": "6.0.1",
20
+ "@silverhand/ts-config": "6.0.0",
22
21
  "@types/accepts": "^1.3.5",
23
22
  "@types/http-proxy": "^1.17.9",
24
- "@types/jest": "^29.4.0",
25
23
  "@types/mime-types": "^2.1.1",
26
- "@types/node": "^18.11.18",
24
+ "@types/node": "^20.0.0",
27
25
  "@types/yargs": "^17.0.24",
28
- "dts-bundle-generator": "^8.0.1",
29
- "eslint": "^8.44.0",
30
- "jest": "^29.5.0",
31
- "lint-staged": "^14.0.0",
26
+ "dts-bundle-generator": "^9.3.1",
27
+ "eslint": "^8.57.0",
28
+ "lint-staged": "^15.0.0",
32
29
  "nodemon": "^3.0.0",
33
30
  "prettier": "^3.0.0",
34
- "typescript": "^5.0.0"
31
+ "typescript": "^5.3.3",
32
+ "vite-tsconfig-paths": "^4.3.1",
33
+ "vitest": "^2.0.0"
35
34
  },
36
35
  "engines": {
37
- "node": "^18.12.0"
36
+ "node": "^20.9.0"
38
37
  },
39
38
  "eslintConfig": {
40
39
  "extends": "@silverhand",
@@ -50,22 +49,19 @@
50
49
  "access": "public"
51
50
  },
52
51
  "dependencies": {
53
- "@silverhand/essentials": "^2.8.2",
54
- "@withtyped/server": "^0.12.7"
52
+ "@silverhand/essentials": "^2.9.1",
53
+ "@withtyped/server": "^0.13.6"
55
54
  },
56
55
  "scripts": {
57
56
  "precommit": "lint-staged",
58
57
  "build": "rm -rf build/ && tsc -p tsconfig.build.json && pnpm build:lib",
59
58
  "//": "It is not used to build the service itself.",
60
- "build:lib": "rm -rf lib/ && dts-bundle-generator src/routes/index.ts --project tsconfig.build.json -o lib/routes/index.d.ts",
61
- "build:test": "rm -rf build/ && tsc -p tsconfig.test.json --sourcemap",
59
+ "build:lib": "rm -rf lib/ && dts-bundle-generator src/routes/index.ts --project tsconfig.build.lib.json -o lib/routes/index.d.ts",
62
60
  "lint": "eslint --ext .ts src",
63
61
  "lint:report": "pnpm lint --format json --output-file report.json",
64
62
  "dev": "rm -rf build/ && nodemon",
65
63
  "start": "NODE_ENV=production node .",
66
- "test:only": "NODE_OPTIONS=\"--experimental-vm-modules --max_old_space_size=4096\" jest --logHeapUsage",
67
- "test": "pnpm build:test && pnpm test:only && pnpm build:lib && pnpm test:types",
68
- "test:ci": "pnpm test:only --coverage --silent",
64
+ "test": "vitest && pnpm build:lib && pnpm test:types",
69
65
  "test:types": "tsc -p tsconfig.test.types.json",
70
66
  "cli": "node ./build/cli/index.js"
71
67
  }