@logto/cloud 0.2.5-821690c → 0.2.5-8a3dff0

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 +624 -87
  2. package/package.json +10 -10
@@ -3,22 +3,6 @@
3
3
  import { Json, JsonObject, RequestContext } from '@withtyped/server';
4
4
  import { InferModelType } from '@withtyped/server/model';
5
5
 
6
- export type WithAuthContext<Context = RequestContext> = Context & {
7
- auth: {
8
- /** The ID of the authenticated subject (`sub`). */
9
- id: string;
10
- /** The scopes that the subject has (`scope`). */
11
- scopes: string[];
12
- };
13
- };
14
- declare enum VerificationCodeType {
15
- SignIn = "SignIn",
16
- Register = "Register",
17
- ForgotPassword = "ForgotPassword",
18
- Generic = "Generic",
19
- /** @deprecated Use `Generic` type template for sending test sms/email use case */
20
- Test = "Test"
21
- }
22
6
  declare enum TemplateType {
23
7
  /** The template for sending verification code when user is signing in. */
24
8
  SignIn = "SignIn",
@@ -29,7 +13,11 @@ declare enum TemplateType {
29
13
  /** The template for sending organization invitation. */
30
14
  OrganizationInvitation = "OrganizationInvitation",
31
15
  /** The template for generic usage. */
32
- Generic = "Generic"
16
+ Generic = "Generic",
17
+ /** The template for validating user permission for sensitive operations. */
18
+ UserPermissionValidation = "UserPermissionValidation",
19
+ /** The template for binding a new identifier to an existing account. */
20
+ BindNewIdentifier = "BindNewIdentifier"
33
21
  }
34
22
  declare enum OrganizationInvitationStatus {
35
23
  Pending = "Pending",
@@ -69,6 +57,28 @@ declare enum TenantRole {
69
57
  /** Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
70
58
  Collaborator = "collaborator"
71
59
  }
60
+ declare const availableReportableUsageKeys: readonly [
61
+ "tokenLimit",
62
+ "machineToMachineLimit",
63
+ "resourcesLimit",
64
+ "enterpriseSsoLimit",
65
+ "hooksLimit",
66
+ "tenantMembersLimit",
67
+ "mfaEnabled",
68
+ "organizationsEnabled",
69
+ "organizationsLimit",
70
+ "securityFeaturesEnabled",
71
+ "userRolesLimit",
72
+ "machineToMachineRolesLimit",
73
+ "thirdPartyApplicationsLimit",
74
+ "samlApplicationsLimit"
75
+ ];
76
+ export type ReportableUsageKey = (typeof availableReportableUsageKeys)[number];
77
+ export type RealtimeReportableUsageKey = Exclude<ReportableUsageKey, "tokenLimit">;
78
+ declare enum LogtoSkuType {
79
+ Basic = "Basic",
80
+ AddOn = "AddOn"
81
+ }
72
82
  declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
73
83
  createdAt: Date;
74
84
  affiliateId: string;
@@ -82,11 +92,28 @@ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default
82
92
  id: string;
83
93
  }, "id" | "createdAt", "id" | "createdAt">;
84
94
  export type Affiliate = InferModelType<typeof Affiliates>;
95
+ declare const publicRegionNames: readonly [
96
+ "EU",
97
+ "US",
98
+ "AU",
99
+ "JP"
100
+ ];
101
+ /** The type of region names for the public cloud. */
102
+ export type PublicRegionName = (typeof publicRegionNames)[number];
103
+ export type WithAuthContext<Context = RequestContext> = Context & {
104
+ auth: {
105
+ /** The ID of the authenticated subject (`sub`). */
106
+ id: string;
107
+ /** The scopes that the subject has (`scope`). */
108
+ scopes: string[];
109
+ };
110
+ };
85
111
  export type AffiliateData = Affiliate & {
86
112
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
87
113
  };
88
114
  declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
89
115
  request: {
116
+ id?: string | undefined;
90
117
  method?: import("@withtyped/server").RequestMethod | undefined;
91
118
  headers: import("http").IncomingHttpHeaders;
92
119
  url: URL;
@@ -94,6 +121,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
94
121
  };
95
122
  }, "request"> & {
96
123
  request: Record<string, unknown> & {
124
+ id?: string | undefined;
97
125
  method?: import("@withtyped/server").RequestMethod | undefined;
98
126
  headers: import("http").IncomingHttpHeaders;
99
127
  url: URL;
@@ -102,16 +130,20 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
102
130
  body?: Json | undefined;
103
131
  bodyRaw?: Buffer | undefined;
104
132
  };
105
- }>, 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<{
133
+ }>, 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<{
106
134
  patch: {
107
135
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
108
136
  name?: string | undefined;
109
137
  }, {
110
138
  id: string;
111
139
  name: string;
140
+ createdAt: Date;
141
+ quota: {
142
+ mauLimit: number | null;
143
+ tokenLimit: number | null;
144
+ };
112
145
  usage: {
113
146
  activeUsers: number;
114
- cost: number;
115
147
  tokenUsage: number;
116
148
  };
117
149
  indicator: string;
@@ -122,11 +154,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
122
154
  planId: string;
123
155
  currentPeriodStart: Date;
124
156
  currentPeriodEnd: Date;
157
+ isEnterprisePlan: boolean;
158
+ id?: string | undefined;
159
+ upcomingInvoice?: {
160
+ subtotal: number;
161
+ subtotalExcludingTax: number | null;
162
+ total: number;
163
+ totalExcludingTax: number | null;
164
+ } | null | undefined;
125
165
  };
166
+ regionName: string;
167
+ tag: TenantTag;
126
168
  openInvoices: {
127
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
128
169
  id: string;
129
170
  createdAt: Date;
171
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
130
172
  updatedAt: Date;
131
173
  customerId: string | null;
132
174
  billingReason: string | null;
@@ -134,11 +176,11 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
134
176
  periodEnd: Date;
135
177
  amountDue: number;
136
178
  amountPaid: number;
179
+ basicSkuId: string | null;
137
180
  subscriptionId: string | null;
138
181
  hostedInvoiceUrl: string | null;
139
182
  invoicePdf: string | null;
140
183
  }[];
141
- tag: TenantTag;
142
184
  }>;
143
185
  };
144
186
  options: {};
@@ -146,9 +188,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
146
188
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
147
189
  id: string;
148
190
  name: string;
191
+ createdAt: Date;
192
+ quota: {
193
+ mauLimit: number | null;
194
+ tokenLimit: number | null;
195
+ };
149
196
  usage: {
150
197
  activeUsers: number;
151
- cost: number;
152
198
  tokenUsage: number;
153
199
  };
154
200
  indicator: string;
@@ -159,11 +205,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
159
205
  planId: string;
160
206
  currentPeriodStart: Date;
161
207
  currentPeriodEnd: Date;
208
+ isEnterprisePlan: boolean;
209
+ id?: string | undefined;
210
+ upcomingInvoice?: {
211
+ subtotal: number;
212
+ subtotalExcludingTax: number | null;
213
+ total: number;
214
+ totalExcludingTax: number | null;
215
+ } | null | undefined;
162
216
  };
217
+ regionName: string;
218
+ tag: TenantTag;
163
219
  openInvoices: {
164
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
165
220
  id: string;
166
221
  createdAt: Date;
222
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
167
223
  updatedAt: Date;
168
224
  customerId: string | null;
169
225
  billingReason: string | null;
@@ -171,23 +227,29 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
171
227
  periodEnd: Date;
172
228
  amountDue: number;
173
229
  amountPaid: number;
230
+ basicSkuId: string | null;
174
231
  subscriptionId: string | null;
175
232
  hostedInvoiceUrl: string | null;
176
233
  invoicePdf: string | null;
177
234
  }[];
178
- tag: TenantTag;
179
235
  }[]>;
180
236
  };
181
237
  post: {
182
238
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
239
+ id?: string | undefined;
183
240
  name?: string | undefined;
184
241
  tag?: TenantTag | undefined;
242
+ regionName?: string | undefined;
185
243
  }, {
186
244
  id: string;
187
245
  name: string;
246
+ createdAt: Date;
247
+ quota: {
248
+ mauLimit: number | null;
249
+ tokenLimit: number | null;
250
+ };
188
251
  usage: {
189
252
  activeUsers: number;
190
- cost: number;
191
253
  tokenUsage: number;
192
254
  };
193
255
  indicator: string;
@@ -198,11 +260,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
198
260
  planId: string;
199
261
  currentPeriodStart: Date;
200
262
  currentPeriodEnd: Date;
263
+ isEnterprisePlan: boolean;
264
+ id?: string | undefined;
265
+ upcomingInvoice?: {
266
+ subtotal: number;
267
+ subtotalExcludingTax: number | null;
268
+ total: number;
269
+ totalExcludingTax: number | null;
270
+ } | null | undefined;
201
271
  };
272
+ regionName: string;
273
+ tag: TenantTag;
202
274
  openInvoices: {
203
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
204
275
  id: string;
205
276
  createdAt: Date;
277
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
206
278
  updatedAt: Date;
207
279
  customerId: string | null;
208
280
  billingReason: string | null;
@@ -210,11 +282,11 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
210
282
  periodEnd: Date;
211
283
  amountDue: number;
212
284
  amountPaid: number;
285
+ basicSkuId: string | null;
213
286
  subscriptionId: string | null;
214
287
  hostedInvoiceUrl: string | null;
215
288
  invoicePdf: string | null;
216
289
  }[];
217
- tag: TenantTag;
218
290
  }>;
219
291
  };
220
292
  put: {};
@@ -229,23 +301,291 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
229
301
  get: {
230
302
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
231
303
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
304
+ quota: {
305
+ auditLogsRetentionDays: number | null;
306
+ mauLimit: number | null;
307
+ applicationsLimit: number | null;
308
+ thirdPartyApplicationsLimit: number | null;
309
+ scopesPerResourceLimit: number | null;
310
+ socialConnectorsLimit: number | null;
311
+ userRolesLimit: number | null;
312
+ machineToMachineRolesLimit: number | null;
313
+ scopesPerRoleLimit: number | null;
314
+ hooksLimit: number | null;
315
+ customJwtEnabled: boolean;
316
+ subjectTokenEnabled: boolean;
317
+ bringYourUiEnabled: boolean;
318
+ collectUserProfileEnabled: boolean;
319
+ tokenLimit: number | null;
320
+ machineToMachineLimit: number | null;
321
+ resourcesLimit: number | null;
322
+ enterpriseSsoLimit: number | null;
323
+ tenantMembersLimit: number | null;
324
+ mfaEnabled: boolean;
325
+ organizationsEnabled: boolean;
326
+ organizationsLimit: number | null;
327
+ securityFeaturesEnabled: boolean;
328
+ idpInitiatedSsoEnabled: boolean;
329
+ samlApplicationsLimit: number | null;
330
+ };
232
331
  planId: string;
233
332
  currentPeriodStart: Date;
234
333
  currentPeriodEnd: Date;
334
+ isEnterprisePlan: boolean;
335
+ id?: string | undefined;
336
+ upcomingInvoice?: {
337
+ subtotal: number;
338
+ subtotalExcludingTax: number | null;
339
+ total: number;
340
+ totalExcludingTax: number | null;
341
+ } | null | undefined;
235
342
  }>;
236
343
  } & {
344
+ "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
345
+ usage: {
346
+ applicationsLimit: number;
347
+ thirdPartyApplicationsLimit: number;
348
+ scopesPerResourceLimit: number;
349
+ socialConnectorsLimit: number;
350
+ userRolesLimit: number;
351
+ machineToMachineRolesLimit: number;
352
+ scopesPerRoleLimit: number;
353
+ hooksLimit: number;
354
+ customJwtEnabled: boolean;
355
+ subjectTokenEnabled: boolean;
356
+ bringYourUiEnabled: boolean;
357
+ collectUserProfileEnabled: boolean;
358
+ machineToMachineLimit: number;
359
+ resourcesLimit: number;
360
+ enterpriseSsoLimit: number;
361
+ tenantMembersLimit: number;
362
+ mfaEnabled: boolean;
363
+ organizationsEnabled: boolean;
364
+ organizationsLimit: number;
365
+ securityFeaturesEnabled: boolean;
366
+ idpInitiatedSsoEnabled: boolean;
367
+ samlApplicationsLimit: number;
368
+ };
369
+ resources: Record<string, number>;
370
+ roles: Record<string, number>;
371
+ quota: {
372
+ auditLogsRetentionDays: number | null;
373
+ mauLimit: number | null;
374
+ applicationsLimit: number | null;
375
+ thirdPartyApplicationsLimit: number | null;
376
+ scopesPerResourceLimit: number | null;
377
+ socialConnectorsLimit: number | null;
378
+ userRolesLimit: number | null;
379
+ machineToMachineRolesLimit: number | null;
380
+ scopesPerRoleLimit: number | null;
381
+ hooksLimit: number | null;
382
+ customJwtEnabled: boolean;
383
+ subjectTokenEnabled: boolean;
384
+ bringYourUiEnabled: boolean;
385
+ collectUserProfileEnabled: boolean;
386
+ tokenLimit: number | null;
387
+ machineToMachineLimit: number | null;
388
+ resourcesLimit: number | null;
389
+ enterpriseSsoLimit: number | null;
390
+ tenantMembersLimit: number | null;
391
+ mfaEnabled: boolean;
392
+ organizationsEnabled: boolean;
393
+ organizationsLimit: number | null;
394
+ securityFeaturesEnabled: boolean;
395
+ idpInitiatedSsoEnabled: boolean;
396
+ samlApplicationsLimit: number | null;
397
+ };
398
+ basicQuota: {
399
+ auditLogsRetentionDays: number | null;
400
+ mauLimit: number | null;
401
+ applicationsLimit: number | null;
402
+ thirdPartyApplicationsLimit: number | null;
403
+ scopesPerResourceLimit: number | null;
404
+ socialConnectorsLimit: number | null;
405
+ userRolesLimit: number | null;
406
+ machineToMachineRolesLimit: number | null;
407
+ scopesPerRoleLimit: number | null;
408
+ hooksLimit: number | null;
409
+ customJwtEnabled: boolean;
410
+ subjectTokenEnabled: boolean;
411
+ bringYourUiEnabled: boolean;
412
+ collectUserProfileEnabled: boolean;
413
+ tokenLimit: number | null;
414
+ machineToMachineLimit: number | null;
415
+ resourcesLimit: number | null;
416
+ enterpriseSsoLimit: number | null;
417
+ tenantMembersLimit: number | null;
418
+ mfaEnabled: boolean;
419
+ organizationsEnabled: boolean;
420
+ organizationsLimit: number | null;
421
+ securityFeaturesEnabled: boolean;
422
+ idpInitiatedSsoEnabled: boolean;
423
+ samlApplicationsLimit: number | null;
424
+ };
425
+ }>;
426
+ };
427
+ post: {
428
+ "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
429
+ usageKey: RealtimeReportableUsageKey;
430
+ }, {
431
+ message: string;
432
+ }>;
433
+ };
434
+ put: {};
435
+ delete: {};
436
+ copy: {};
437
+ head: {};
438
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
439
+ patch: {};
440
+ options: {};
441
+ get: {
237
442
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
238
443
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
239
444
  planId: string;
240
445
  currentPeriodStart: Date;
241
446
  currentPeriodEnd: Date;
447
+ isEnterprisePlan: boolean;
448
+ id?: string | undefined;
449
+ upcomingInvoice?: {
450
+ subtotal: number;
451
+ subtotalExcludingTax: number | null;
452
+ total: number;
453
+ totalExcludingTax: number | null;
454
+ } | null | undefined;
242
455
  }>;
456
+ } & {
457
+ "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
458
+ usage: {
459
+ applicationsLimit: number;
460
+ thirdPartyApplicationsLimit: number;
461
+ scopesPerResourceLimit: number;
462
+ socialConnectorsLimit: number;
463
+ userRolesLimit: number;
464
+ machineToMachineRolesLimit: number;
465
+ scopesPerRoleLimit: number;
466
+ hooksLimit: number;
467
+ customJwtEnabled: boolean;
468
+ subjectTokenEnabled: boolean;
469
+ bringYourUiEnabled: boolean;
470
+ collectUserProfileEnabled: boolean;
471
+ machineToMachineLimit: number;
472
+ resourcesLimit: number;
473
+ enterpriseSsoLimit: number;
474
+ tenantMembersLimit: number;
475
+ mfaEnabled: boolean;
476
+ organizationsEnabled: boolean;
477
+ organizationsLimit: number;
478
+ securityFeaturesEnabled: boolean;
479
+ idpInitiatedSsoEnabled: boolean;
480
+ samlApplicationsLimit: number;
481
+ };
482
+ resources: Record<string, number>;
483
+ roles: Record<string, number>;
484
+ quota: {
485
+ auditLogsRetentionDays: number | null;
486
+ mauLimit: number | null;
487
+ applicationsLimit: number | null;
488
+ thirdPartyApplicationsLimit: number | null;
489
+ scopesPerResourceLimit: number | null;
490
+ socialConnectorsLimit: number | null;
491
+ userRolesLimit: number | null;
492
+ machineToMachineRolesLimit: number | null;
493
+ scopesPerRoleLimit: number | null;
494
+ hooksLimit: number | null;
495
+ customJwtEnabled: boolean;
496
+ subjectTokenEnabled: boolean;
497
+ bringYourUiEnabled: boolean;
498
+ collectUserProfileEnabled: boolean;
499
+ tokenLimit: number | null;
500
+ machineToMachineLimit: number | null;
501
+ resourcesLimit: number | null;
502
+ enterpriseSsoLimit: number | null;
503
+ tenantMembersLimit: number | null;
504
+ mfaEnabled: boolean;
505
+ organizationsEnabled: boolean;
506
+ organizationsLimit: number | null;
507
+ securityFeaturesEnabled: boolean;
508
+ idpInitiatedSsoEnabled: boolean;
509
+ samlApplicationsLimit: number | null;
510
+ };
511
+ basicQuota: {
512
+ auditLogsRetentionDays: number | null;
513
+ mauLimit: number | null;
514
+ applicationsLimit: number | null;
515
+ thirdPartyApplicationsLimit: number | null;
516
+ scopesPerResourceLimit: number | null;
517
+ socialConnectorsLimit: number | null;
518
+ userRolesLimit: number | null;
519
+ machineToMachineRolesLimit: number | null;
520
+ scopesPerRoleLimit: number | null;
521
+ hooksLimit: number | null;
522
+ customJwtEnabled: boolean;
523
+ subjectTokenEnabled: boolean;
524
+ bringYourUiEnabled: boolean;
525
+ collectUserProfileEnabled: boolean;
526
+ tokenLimit: number | null;
527
+ machineToMachineLimit: number | null;
528
+ resourcesLimit: number | null;
529
+ enterpriseSsoLimit: number | null;
530
+ tenantMembersLimit: number | null;
531
+ mfaEnabled: boolean;
532
+ organizationsEnabled: boolean;
533
+ organizationsLimit: number | null;
534
+ securityFeaturesEnabled: boolean;
535
+ idpInitiatedSsoEnabled: boolean;
536
+ samlApplicationsLimit: number | null;
537
+ };
538
+ }>;
539
+ } & {
540
+ "/tenants/:tenantId/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/periodic-usage", unknown, unknown, {
541
+ mauLimit: number;
542
+ tokenLimit: number;
543
+ }>;
544
+ } & {
545
+ "/tenants/:tenantId/subscription/add-on-skus": import("@withtyped/server").PathGuard<"/:tenantId/subscription/add-on-skus", unknown, unknown, Partial<Record<"tokenLimit" | "machineToMachineLimit" | "resourcesLimit" | "enterpriseSsoLimit" | "hooksLimit" | "tenantMembersLimit" | "mfaEnabled" | "organizationsEnabled" | "organizationsLimit" | "securityFeaturesEnabled" | "userRolesLimit" | "machineToMachineRolesLimit" | "thirdPartyApplicationsLimit" | "samlApplicationsLimit", {
546
+ id: string;
547
+ name: string | null;
548
+ createdAt: Date;
549
+ defaultPriceId: string | null;
550
+ unitPrice: number | null;
551
+ type: LogtoSkuType;
552
+ quota: {
553
+ auditLogsRetentionDays?: number | null | undefined;
554
+ mauLimit?: number | null | undefined;
555
+ applicationsLimit?: number | null | undefined;
556
+ thirdPartyApplicationsLimit?: number | null | undefined;
557
+ scopesPerResourceLimit?: number | null | undefined;
558
+ socialConnectorsLimit?: number | null | undefined;
559
+ userRolesLimit?: number | null | undefined;
560
+ machineToMachineRolesLimit?: number | null | undefined;
561
+ scopesPerRoleLimit?: number | null | undefined;
562
+ hooksLimit?: number | null | undefined;
563
+ customJwtEnabled?: boolean | undefined;
564
+ subjectTokenEnabled?: boolean | undefined;
565
+ bringYourUiEnabled?: boolean | undefined;
566
+ collectUserProfileEnabled?: boolean | undefined;
567
+ tokenLimit?: number | null | undefined;
568
+ machineToMachineLimit?: number | null | undefined;
569
+ resourcesLimit?: number | null | undefined;
570
+ enterpriseSsoLimit?: number | null | undefined;
571
+ tenantMembersLimit?: number | null | undefined;
572
+ mfaEnabled?: boolean | undefined;
573
+ organizationsEnabled?: boolean | undefined;
574
+ organizationsLimit?: number | null | undefined;
575
+ securityFeaturesEnabled?: boolean | undefined;
576
+ idpInitiatedSsoEnabled?: boolean | undefined;
577
+ samlApplicationsLimit?: number | null | undefined;
578
+ };
579
+ isDefault: boolean;
580
+ updatedAt: Date;
581
+ productId: string | null;
582
+ }>>>;
243
583
  } & {
244
584
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
245
585
  invoices: {
246
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
247
586
  id: string;
248
587
  createdAt: Date;
588
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
249
589
  updatedAt: Date;
250
590
  customerId: string | null;
251
591
  billingReason: string | null;
@@ -253,22 +593,59 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
253
593
  periodEnd: Date;
254
594
  amountDue: number;
255
595
  amountPaid: number;
596
+ basicSkuId: string | null;
256
597
  subscriptionId: string | null;
257
598
  hostedInvoiceUrl: string | null;
258
599
  invoicePdf: string | null;
259
600
  planName: string | null;
601
+ skuId?: string | null | undefined;
260
602
  }[];
261
603
  }>;
604
+ } & {
605
+ "/tenants/:tenantId/available-skus": import("@withtyped/server").PathGuard<"/:tenantId/available-skus", {
606
+ type?: LogtoSkuType | undefined;
607
+ }, unknown, {
608
+ id: string;
609
+ name: string | null;
610
+ createdAt: Date;
611
+ defaultPriceId: string | null;
612
+ unitPrice: number | null;
613
+ type: LogtoSkuType;
614
+ quota: {
615
+ auditLogsRetentionDays?: number | null | undefined;
616
+ mauLimit?: number | null | undefined;
617
+ applicationsLimit?: number | null | undefined;
618
+ thirdPartyApplicationsLimit?: number | null | undefined;
619
+ scopesPerResourceLimit?: number | null | undefined;
620
+ socialConnectorsLimit?: number | null | undefined;
621
+ userRolesLimit?: number | null | undefined;
622
+ machineToMachineRolesLimit?: number | null | undefined;
623
+ scopesPerRoleLimit?: number | null | undefined;
624
+ hooksLimit?: number | null | undefined;
625
+ customJwtEnabled?: boolean | undefined;
626
+ subjectTokenEnabled?: boolean | undefined;
627
+ bringYourUiEnabled?: boolean | undefined;
628
+ collectUserProfileEnabled?: boolean | undefined;
629
+ tokenLimit?: number | null | undefined;
630
+ machineToMachineLimit?: number | null | undefined;
631
+ resourcesLimit?: number | null | undefined;
632
+ enterpriseSsoLimit?: number | null | undefined;
633
+ tenantMembersLimit?: number | null | undefined;
634
+ mfaEnabled?: boolean | undefined;
635
+ organizationsEnabled?: boolean | undefined;
636
+ organizationsLimit?: number | null | undefined;
637
+ securityFeaturesEnabled?: boolean | undefined;
638
+ idpInitiatedSsoEnabled?: boolean | undefined;
639
+ samlApplicationsLimit?: number | null | undefined;
640
+ };
641
+ isDefault: boolean;
642
+ updatedAt: Date;
643
+ productId: string | null;
644
+ }[]>;
262
645
  } & {
263
646
  "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
264
647
  hostedInvoiceUrl: string;
265
648
  }>;
266
- } & {
267
- "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
268
- activeUsers: number;
269
- cost: number;
270
- tokenUsage: number;
271
- }>;
272
649
  };
273
650
  post: {
274
651
  "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
@@ -296,11 +673,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
296
673
  post: {
297
674
  "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
298
675
  data: {
299
- type: TemplateType | VerificationCodeType;
676
+ type: TemplateType;
300
677
  payload: {
301
- code?: string | undefined;
302
678
  link?: string | undefined;
303
- } & Record<string, string> & {
679
+ code?: string | undefined;
680
+ locale?: string | undefined;
681
+ } & {
682
+ [k: string]: unknown;
683
+ } & {
304
684
  senderName?: string | undefined;
305
685
  companyInformation?: string | undefined;
306
686
  appLogo?: string | undefined;
@@ -311,37 +691,42 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
311
691
  } & {
312
692
  "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
313
693
  data: {
314
- type: TemplateType | VerificationCodeType;
694
+ type: TemplateType;
315
695
  to: string;
316
696
  payload: {
317
697
  code?: string | undefined;
318
698
  link?: string | undefined;
319
- } & Record<string, string>;
699
+ locale?: string | undefined;
700
+ } & {
701
+ [k: string]: unknown;
702
+ };
320
703
  };
321
704
  }, unknown>;
322
705
  } & {
323
- "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", unknown, {
324
- script: string;
325
- tokenType: LogtoJwtTokenKeyType.AccessToken;
706
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
707
+ isTest?: string | undefined;
708
+ }, {
326
709
  token: Record<string, Json>;
327
710
  context: Record<string, Json>;
711
+ tokenType: LogtoJwtTokenKeyType.AccessToken;
712
+ script: string;
328
713
  environmentVariables?: Record<string, string> | undefined;
329
714
  } | {
330
- script: string;
331
- tokenType: LogtoJwtTokenKeyType.ClientCredentials;
332
715
  token: Record<string, Json>;
716
+ tokenType: LogtoJwtTokenKeyType.ClientCredentials;
717
+ script: string;
333
718
  environmentVariables?: Record<string, string> | undefined;
334
719
  }, Record<string, unknown>>;
335
720
  };
336
721
  put: {
337
722
  "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
338
- production?: {
339
- "jwt.accessToken"?: string | undefined;
340
- "jwt.clientCredentials"?: string | undefined;
723
+ "jwt.accessToken"?: {
724
+ production?: string | undefined;
725
+ test?: string | undefined;
341
726
  } | undefined;
342
- test?: {
343
- "jwt.accessToken"?: string | undefined;
344
- "jwt.clientCredentials"?: string | undefined;
727
+ "jwt.clientCredentials"?: {
728
+ production?: string | undefined;
729
+ test?: string | undefined;
345
730
  } | undefined;
346
731
  }, unknown>;
347
732
  };
@@ -354,52 +739,178 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
354
739
  patch: {};
355
740
  options: {};
356
741
  get: {
357
- "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
742
+ "/skus": import("@withtyped/server").PathGuard<"/", {
743
+ type?: LogtoSkuType | undefined;
744
+ }, unknown, {
358
745
  id: string;
746
+ name: string | null;
359
747
  createdAt: Date;
360
- name: string;
748
+ defaultPriceId: string | null;
749
+ unitPrice: number | null;
750
+ type: LogtoSkuType;
751
+ quota: {
752
+ auditLogsRetentionDays?: number | null | undefined;
753
+ mauLimit?: number | null | undefined;
754
+ applicationsLimit?: number | null | undefined;
755
+ thirdPartyApplicationsLimit?: number | null | undefined;
756
+ scopesPerResourceLimit?: number | null | undefined;
757
+ socialConnectorsLimit?: number | null | undefined;
758
+ userRolesLimit?: number | null | undefined;
759
+ machineToMachineRolesLimit?: number | null | undefined;
760
+ scopesPerRoleLimit?: number | null | undefined;
761
+ hooksLimit?: number | null | undefined;
762
+ customJwtEnabled?: boolean | undefined;
763
+ subjectTokenEnabled?: boolean | undefined;
764
+ bringYourUiEnabled?: boolean | undefined;
765
+ collectUserProfileEnabled?: boolean | undefined;
766
+ tokenLimit?: number | null | undefined;
767
+ machineToMachineLimit?: number | null | undefined;
768
+ resourcesLimit?: number | null | undefined;
769
+ enterpriseSsoLimit?: number | null | undefined;
770
+ tenantMembersLimit?: number | null | undefined;
771
+ mfaEnabled?: boolean | undefined;
772
+ organizationsEnabled?: boolean | undefined;
773
+ organizationsLimit?: number | null | undefined;
774
+ securityFeaturesEnabled?: boolean | undefined;
775
+ idpInitiatedSsoEnabled?: boolean | undefined;
776
+ samlApplicationsLimit?: number | null | undefined;
777
+ };
778
+ isDefault: boolean;
361
779
  updatedAt: Date;
362
- stripeProducts: {
363
- type: "flat" | "tier1" | "tier2" | "tier3";
364
- id: string;
365
- name: string;
366
- price: {
367
- id: string;
368
- unitAmountDecimal: string;
369
- quantity?: 1 | undefined;
370
- unitAmount?: number | null | undefined;
371
- };
372
- description?: string | undefined;
373
- }[];
780
+ productId: string | null;
781
+ }[]>;
782
+ };
783
+ post: {
784
+ "/skus": import("@withtyped/server").PathGuard<"/", unknown, {
785
+ type: LogtoSkuType.AddOn;
786
+ quota: {
787
+ tokenLimit?: number | null | undefined;
788
+ machineToMachineLimit?: number | null | undefined;
789
+ resourcesLimit?: number | null | undefined;
790
+ enterpriseSsoLimit?: number | null | undefined;
791
+ hooksLimit?: number | null | undefined;
792
+ tenantMembersLimit?: number | null | undefined;
793
+ mfaEnabled?: boolean | undefined;
794
+ organizationsEnabled?: boolean | undefined;
795
+ organizationsLimit?: number | null | undefined;
796
+ securityFeaturesEnabled?: boolean | undefined;
797
+ userRolesLimit?: number | null | undefined;
798
+ machineToMachineRolesLimit?: number | null | undefined;
799
+ thirdPartyApplicationsLimit?: number | null | undefined;
800
+ samlApplicationsLimit?: number | null | undefined;
801
+ auditLogsRetentionDays?: number | null | undefined;
802
+ mauLimit?: number | null | undefined;
803
+ applicationsLimit?: number | null | undefined;
804
+ scopesPerResourceLimit?: number | null | undefined;
805
+ socialConnectorsLimit?: number | null | undefined;
806
+ scopesPerRoleLimit?: number | null | undefined;
807
+ customJwtEnabled?: boolean | undefined;
808
+ subjectTokenEnabled?: boolean | undefined;
809
+ bringYourUiEnabled?: boolean | undefined;
810
+ collectUserProfileEnabled?: boolean | undefined;
811
+ idpInitiatedSsoEnabled?: boolean | undefined;
812
+ };
813
+ isDefault?: boolean | undefined;
814
+ } | {
815
+ type: LogtoSkuType.Basic;
374
816
  quota: {
817
+ auditLogsRetentionDays: number | null;
375
818
  mauLimit: number | null;
376
- tokenLimit: number | null;
377
819
  applicationsLimit: number | null;
378
- machineToMachineLimit: number | null;
379
- resourcesLimit: number | null;
820
+ thirdPartyApplicationsLimit: number | null;
380
821
  scopesPerResourceLimit: number | null;
381
- customDomainEnabled: boolean;
382
- omniSignInEnabled: boolean;
383
- builtInEmailConnectorEnabled: boolean;
384
822
  socialConnectorsLimit: number | null;
385
- standardConnectorsLimit: number | null;
386
- rolesLimit: number | null;
823
+ userRolesLimit: number | null;
387
824
  machineToMachineRolesLimit: number | null;
388
825
  scopesPerRoleLimit: number | null;
389
826
  hooksLimit: number | null;
390
- auditLogsRetentionDays: number | null;
827
+ customJwtEnabled: boolean;
828
+ subjectTokenEnabled: boolean;
829
+ bringYourUiEnabled: boolean;
830
+ collectUserProfileEnabled: boolean;
831
+ tokenLimit: number | null;
832
+ machineToMachineLimit: number | null;
833
+ resourcesLimit: number | null;
834
+ enterpriseSsoLimit: number | null;
835
+ tenantMembersLimit: number | null;
391
836
  mfaEnabled: boolean;
392
837
  organizationsEnabled: boolean;
393
- ssoEnabled: boolean;
394
- thirdPartyApplicationsLimit: number | null;
395
- tenantMembersLimit: number | null;
396
- customJwtEnabled: boolean;
838
+ organizationsLimit: number | null;
839
+ securityFeaturesEnabled: boolean;
840
+ idpInitiatedSsoEnabled: boolean;
841
+ samlApplicationsLimit: number | null;
397
842
  };
398
- }[]>;
843
+ addOnRelations: {
844
+ tokenLimit?: string | undefined;
845
+ machineToMachineLimit?: string | undefined;
846
+ resourcesLimit?: string | undefined;
847
+ enterpriseSsoLimit?: string | undefined;
848
+ tenantMembersLimit?: string | undefined;
849
+ mfaEnabled?: string | undefined;
850
+ organizationsLimit?: string | undefined;
851
+ securityFeaturesEnabled?: string | undefined;
852
+ };
853
+ isDefault?: boolean | undefined;
854
+ }, {
855
+ id: string;
856
+ createdAt: Date;
857
+ type: LogtoSkuType;
858
+ isDefault: boolean;
859
+ updatedAt: Date;
860
+ quota: {
861
+ auditLogsRetentionDays?: number | null | undefined;
862
+ mauLimit?: number | null | undefined;
863
+ applicationsLimit?: number | null | undefined;
864
+ thirdPartyApplicationsLimit?: number | null | undefined;
865
+ scopesPerResourceLimit?: number | null | undefined;
866
+ socialConnectorsLimit?: number | null | undefined;
867
+ userRolesLimit?: number | null | undefined;
868
+ machineToMachineRolesLimit?: number | null | undefined;
869
+ scopesPerRoleLimit?: number | null | undefined;
870
+ hooksLimit?: number | null | undefined;
871
+ customJwtEnabled?: boolean | undefined;
872
+ subjectTokenEnabled?: boolean | undefined;
873
+ bringYourUiEnabled?: boolean | undefined;
874
+ collectUserProfileEnabled?: boolean | undefined;
875
+ tokenLimit?: number | null | undefined;
876
+ machineToMachineLimit?: number | null | undefined;
877
+ resourcesLimit?: number | null | undefined;
878
+ enterpriseSsoLimit?: number | null | undefined;
879
+ tenantMembersLimit?: number | null | undefined;
880
+ mfaEnabled?: boolean | undefined;
881
+ organizationsEnabled?: boolean | undefined;
882
+ organizationsLimit?: number | null | undefined;
883
+ securityFeaturesEnabled?: boolean | undefined;
884
+ idpInitiatedSsoEnabled?: boolean | undefined;
885
+ samlApplicationsLimit?: number | null | undefined;
886
+ };
887
+ }>;
888
+ } & {
889
+ "/skus/:skuId/products": import("@withtyped/server").PathGuard<"/:skuId/products", {
890
+ isOneTime?: string | undefined;
891
+ }, {
892
+ name: string;
893
+ unitPrice: number;
894
+ }, {
895
+ productId: string;
896
+ }>;
897
+ } & {
898
+ "/skus/basic-sku-usage-add-on-relations": import("@withtyped/server").PathGuard<"/basic-sku-usage-add-on-relations", unknown, {
899
+ basicSkuId: string;
900
+ usageKey: "tokenLimit" | "machineToMachineLimit" | "resourcesLimit" | "enterpriseSsoLimit" | "hooksLimit" | "tenantMembersLimit" | "mfaEnabled" | "organizationsEnabled" | "organizationsLimit" | "securityFeaturesEnabled" | "userRolesLimit" | "machineToMachineRolesLimit" | "thirdPartyApplicationsLimit" | "samlApplicationsLimit";
901
+ addOnSkuId: string;
902
+ }, {
903
+ basicSkuId: string;
904
+ usageKey: "tokenLimit" | "machineToMachineLimit" | "resourcesLimit" | "enterpriseSsoLimit" | "hooksLimit" | "tenantMembersLimit" | "mfaEnabled" | "organizationsEnabled" | "organizationsLimit" | "securityFeaturesEnabled" | "userRolesLimit" | "machineToMachineRolesLimit" | "thirdPartyApplicationsLimit" | "samlApplicationsLimit";
905
+ addOnSkuId: string;
906
+ }>;
399
907
  };
400
- post: {};
401
908
  put: {};
402
- delete: {};
909
+ delete: {
910
+ "/skus/:skuId": import("@withtyped/server").PathGuard<"/:skuId", unknown, unknown, unknown>;
911
+ } & {
912
+ "/skus/basic-sku-usage-add-on-relations/:basicSkuId/:usageKey": import("@withtyped/server").PathGuard<"/basic-sku-usage-add-on-relations/:basicSkuId/:usageKey", unknown, unknown, unknown>;
913
+ };
403
914
  copy: {};
404
915
  head: {};
405
916
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
@@ -413,17 +924,19 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
413
924
  status: "open" | "complete" | "expired";
414
925
  tenantId: string | null;
415
926
  updatedAt: Date;
416
- planId: string;
927
+ skuId: string | null;
928
+ planId: string | null;
417
929
  }>;
418
930
  };
419
931
  post: {
420
932
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
421
- planId: string;
422
933
  successCallbackUrl: string;
423
934
  tenantId?: string | undefined;
424
- cancelCallbackUrl?: string | undefined;
425
- tenantTag?: TenantTag | undefined;
935
+ skuId?: string | undefined;
426
936
  tenantName?: string | undefined;
937
+ tenantTag?: TenantTag | undefined;
938
+ tenantRegionName?: string | undefined;
939
+ cancelCallbackUrl?: string | undefined;
427
940
  }, {
428
941
  sessionId: string;
429
942
  redirectUri?: string | null | undefined;
@@ -514,8 +1027,8 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
514
1027
  expiresAt: number;
515
1028
  organizationRoles: OrganizationRoleEntity[];
516
1029
  } & {
517
- tenantTag: TenantTag;
518
1030
  tenantName: string;
1031
+ tenantTag: TenantTag;
519
1032
  })[]>;
520
1033
  } & {
521
1034
  "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
@@ -537,9 +1050,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
537
1050
  delete: {};
538
1051
  copy: {};
539
1052
  head: {};
1053
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
1054
+ patch: {};
1055
+ options: {};
1056
+ get: {};
1057
+ post: {};
1058
+ put: {};
1059
+ delete: {
1060
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
1061
+ };
1062
+ copy: {};
1063
+ head: {};
540
1064
  }, "/api">>, "/api">;
541
1065
  export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
542
1066
  request: {
1067
+ id?: string | undefined;
543
1068
  method?: import("@withtyped/server").RequestMethod | undefined;
544
1069
  headers: import("http").IncomingHttpHeaders;
545
1070
  url: URL;
@@ -595,7 +1120,7 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
595
1120
  };
596
1121
  post: {
597
1122
  "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
598
- invitee: string;
1123
+ invitee: string | string[];
599
1124
  roleName: TenantRole;
600
1125
  expiresAt?: number | undefined;
601
1126
  }, {
@@ -610,7 +1135,19 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
610
1135
  organizationId: string;
611
1136
  expiresAt: number;
612
1137
  organizationRoles: OrganizationRoleEntity[];
613
- }>;
1138
+ } | {
1139
+ id: string;
1140
+ createdAt: number;
1141
+ status: OrganizationInvitationStatus;
1142
+ tenantId: string;
1143
+ updatedAt: number;
1144
+ inviterId: string | null;
1145
+ invitee: string;
1146
+ acceptedUserId: string | null;
1147
+ organizationId: string;
1148
+ expiresAt: number;
1149
+ organizationRoles: OrganizationRoleEntity[];
1150
+ }[]>;
614
1151
  } & {
615
1152
  "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
616
1153
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-821690c",
3
+ "version": "0.2.5-8a3dff0",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -16,24 +16,24 @@
16
16
  "#src/*": "./build/*"
17
17
  },
18
18
  "devDependencies": {
19
- "@silverhand/eslint-config": "5.0.0",
20
- "@silverhand/ts-config": "5.0.0",
19
+ "@silverhand/eslint-config": "6.0.1",
20
+ "@silverhand/ts-config": "6.0.0",
21
21
  "@types/accepts": "^1.3.5",
22
22
  "@types/http-proxy": "^1.17.9",
23
23
  "@types/mime-types": "^2.1.1",
24
- "@types/node": "^20.0.0",
24
+ "@types/node": "^22.14.0",
25
25
  "@types/yargs": "^17.0.24",
26
26
  "dts-bundle-generator": "^9.3.1",
27
- "eslint": "^8.44.0",
27
+ "eslint": "^8.57.0",
28
28
  "lint-staged": "^15.0.0",
29
29
  "nodemon": "^3.0.0",
30
30
  "prettier": "^3.0.0",
31
31
  "typescript": "^5.3.3",
32
- "vite-tsconfig-paths": "^4.3.1",
33
- "vitest": "^1.0.0"
32
+ "vite-tsconfig-paths": "^5.0.0",
33
+ "vitest": "^3.1.1"
34
34
  },
35
35
  "engines": {
36
- "node": "^20.9.0"
36
+ "node": "^22.14.0"
37
37
  },
38
38
  "eslintConfig": {
39
39
  "extends": "@silverhand",
@@ -49,8 +49,8 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@silverhand/essentials": "^2.9.0",
53
- "@withtyped/server": "^0.13.3"
52
+ "@silverhand/essentials": "^2.9.2",
53
+ "@withtyped/server": "^0.14.0"
54
54
  },
55
55
  "scripts": {
56
56
  "precommit": "lint-staged",