@logto/cloud 0.2.5-5e334eb → 0.2.5-631f4a7

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 +272 -169
  2. package/package.json +4 -4
@@ -3,21 +3,22 @@
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"
6
+ declare const availableReportableUsageKeys: readonly [
7
+ "tokenLimit",
8
+ "machineToMachineLimit",
9
+ "resourcesLimit",
10
+ "enterpriseSsoLimit",
11
+ "hooksLimit",
12
+ "tenantMembersLimit",
13
+ "mfaEnabled",
14
+ "organizationsEnabled",
15
+ "organizationsLimit"
16
+ ];
17
+ export type ReportableUsageKey = (typeof availableReportableUsageKeys)[number];
18
+ export type RealtimeReportableUsageKey = Exclude<ReportableUsageKey, "tokenLimit">;
19
+ declare enum LogtoSkuType {
20
+ Basic = "Basic",
21
+ AddOn = "AddOn"
21
22
  }
22
23
  declare enum TemplateType {
23
24
  /** The template for sending verification code when user is signing in. */
@@ -29,7 +30,11 @@ declare enum TemplateType {
29
30
  /** The template for sending organization invitation. */
30
31
  OrganizationInvitation = "OrganizationInvitation",
31
32
  /** The template for generic usage. */
32
- Generic = "Generic"
33
+ Generic = "Generic",
34
+ /** The template for validating user permission for sensitive operations. */
35
+ UserPermissionValidation = "UserPermissionValidation",
36
+ /** The template for binding a new identifier to an existing account. */
37
+ BindNewIdentifier = "BindNewIdentifier"
33
38
  }
34
39
  declare enum OrganizationInvitationStatus {
35
40
  Pending = "Pending",
@@ -69,23 +74,6 @@ declare enum TenantRole {
69
74
  /** Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
70
75
  Collaborator = "collaborator"
71
76
  }
72
- declare const availableReportableUsageKeys: readonly [
73
- "tokenLimit",
74
- "machineToMachineLimit",
75
- "resourcesLimit",
76
- "enterpriseSsoLimit",
77
- "hooksLimit",
78
- "tenantMembersLimit",
79
- "mfaEnabled",
80
- "organizationsEnabled",
81
- "organizationsLimit"
82
- ];
83
- export type ReportableUsageKey = (typeof availableReportableUsageKeys)[number];
84
- export type RealtimeReportableUsageKey = Exclude<ReportableUsageKey, "tokenLimit">;
85
- declare enum LogtoSkuType {
86
- Basic = "Basic",
87
- AddOn = "AddOn"
88
- }
89
77
  declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
90
78
  createdAt: Date;
91
79
  affiliateId: string;
@@ -99,11 +87,22 @@ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default
99
87
  id: string;
100
88
  }, "id" | "createdAt", "id" | "createdAt">;
101
89
  export type Affiliate = InferModelType<typeof Affiliates>;
102
- declare enum RegionName {
103
- EU = "EU",
104
- US = "US",
105
- AU = "AU"
106
- }
90
+ declare const publicRegionNames: readonly [
91
+ "EU",
92
+ "US",
93
+ "AU",
94
+ "JP"
95
+ ];
96
+ /** The type of region names for the public cloud. */
97
+ export type PublicRegionName = (typeof publicRegionNames)[number];
98
+ export type WithAuthContext<Context = RequestContext> = Context & {
99
+ auth: {
100
+ /** The ID of the authenticated subject (`sub`). */
101
+ id: string;
102
+ /** The scopes that the subject has (`scope`). */
103
+ scopes: string[];
104
+ };
105
+ };
107
106
  export type AffiliateData = Affiliate & {
108
107
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
109
108
  };
@@ -126,18 +125,18 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
126
125
  body?: Json | undefined;
127
126
  bodyRaw?: Buffer | undefined;
128
127
  };
129
- }>, 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<{
128
+ }>, 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<{
130
129
  patch: {
131
130
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
132
131
  name?: string | undefined;
133
132
  }, {
134
133
  id: string;
135
134
  name: string;
135
+ createdAt: Date;
136
136
  quota: {
137
137
  mauLimit: number | null;
138
138
  tokenLimit: number | null;
139
139
  };
140
- createdAt: Date;
141
140
  usage: {
142
141
  activeUsers: number;
143
142
  tokenUsage: number;
@@ -158,14 +157,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
158
157
  total: number;
159
158
  totalExcludingTax: number | null;
160
159
  } | null | undefined;
161
- isAddOnAvailable?: boolean | undefined;
162
160
  };
163
- regionName: RegionName;
161
+ regionName: string;
164
162
  tag: TenantTag;
165
163
  openInvoices: {
166
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
167
164
  id: string;
168
165
  createdAt: Date;
166
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
169
167
  updatedAt: Date;
170
168
  customerId: string | null;
171
169
  billingReason: string | null;
@@ -173,6 +171,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
173
171
  periodEnd: Date;
174
172
  amountDue: number;
175
173
  amountPaid: number;
174
+ basicSkuId: string | null;
176
175
  subscriptionId: string | null;
177
176
  hostedInvoiceUrl: string | null;
178
177
  invoicePdf: string | null;
@@ -184,11 +183,11 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
184
183
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
185
184
  id: string;
186
185
  name: string;
186
+ createdAt: Date;
187
187
  quota: {
188
188
  mauLimit: number | null;
189
189
  tokenLimit: number | null;
190
190
  };
191
- createdAt: Date;
192
191
  usage: {
193
192
  activeUsers: number;
194
193
  tokenUsage: number;
@@ -209,14 +208,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
209
208
  total: number;
210
209
  totalExcludingTax: number | null;
211
210
  } | null | undefined;
212
- isAddOnAvailable?: boolean | undefined;
213
211
  };
214
- regionName: RegionName;
212
+ regionName: string;
215
213
  tag: TenantTag;
216
214
  openInvoices: {
217
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
218
215
  id: string;
219
216
  createdAt: Date;
217
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
220
218
  updatedAt: Date;
221
219
  customerId: string | null;
222
220
  billingReason: string | null;
@@ -224,6 +222,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
224
222
  periodEnd: Date;
225
223
  amountDue: number;
226
224
  amountPaid: number;
225
+ basicSkuId: string | null;
227
226
  subscriptionId: string | null;
228
227
  hostedInvoiceUrl: string | null;
229
228
  invoicePdf: string | null;
@@ -232,17 +231,18 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
232
231
  };
233
232
  post: {
234
233
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
234
+ id?: string | undefined;
235
235
  name?: string | undefined;
236
236
  tag?: TenantTag | undefined;
237
- regionName?: RegionName | undefined;
237
+ regionName?: string | undefined;
238
238
  }, {
239
239
  id: string;
240
240
  name: string;
241
+ createdAt: Date;
241
242
  quota: {
242
243
  mauLimit: number | null;
243
244
  tokenLimit: number | null;
244
245
  };
245
- createdAt: Date;
246
246
  usage: {
247
247
  activeUsers: number;
248
248
  tokenUsage: number;
@@ -263,14 +263,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
263
263
  total: number;
264
264
  totalExcludingTax: number | null;
265
265
  } | null | undefined;
266
- isAddOnAvailable?: boolean | undefined;
267
266
  };
268
- regionName: RegionName;
267
+ regionName: string;
269
268
  tag: TenantTag;
270
269
  openInvoices: {
271
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
272
270
  id: string;
273
271
  createdAt: Date;
272
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
274
273
  updatedAt: Date;
275
274
  customerId: string | null;
276
275
  billingReason: string | null;
@@ -278,6 +277,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
278
277
  periodEnd: Date;
279
278
  amountDue: number;
280
279
  amountPaid: number;
280
+ basicSkuId: string | null;
281
281
  subscriptionId: string | null;
282
282
  hostedInvoiceUrl: string | null;
283
283
  invoicePdf: string | null;
@@ -296,6 +296,32 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
296
296
  get: {
297
297
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
298
298
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
299
+ quota: {
300
+ auditLogsRetentionDays: number | null;
301
+ mauLimit: number | null;
302
+ applicationsLimit: number | null;
303
+ thirdPartyApplicationsLimit: number | null;
304
+ scopesPerResourceLimit: number | null;
305
+ socialConnectorsLimit: number | null;
306
+ userRolesLimit: number | null;
307
+ machineToMachineRolesLimit: number | null;
308
+ scopesPerRoleLimit: number | null;
309
+ hooksLimit: number | null;
310
+ customJwtEnabled: boolean;
311
+ subjectTokenEnabled: boolean;
312
+ bringYourUiEnabled: boolean;
313
+ tokenLimit: number | null;
314
+ machineToMachineLimit: number | null;
315
+ resourcesLimit: number | null;
316
+ enterpriseSsoLimit: number | null;
317
+ tenantMembersLimit: number | null;
318
+ mfaEnabled: boolean;
319
+ organizationsEnabled: boolean;
320
+ organizationsLimit: number | null;
321
+ idpInitiatedSsoEnabled: boolean;
322
+ samlApplicationsLimit: number | null;
323
+ captchaEnabled: boolean;
324
+ };
299
325
  planId: string;
300
326
  currentPeriodStart: Date;
301
327
  currentPeriodEnd: Date;
@@ -307,83 +333,103 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
307
333
  total: number;
308
334
  totalExcludingTax: number | null;
309
335
  } | null | undefined;
310
- isAddOnAvailable?: boolean | undefined;
311
336
  }>;
312
337
  } & {
313
338
  "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
314
339
  usage: {
315
340
  applicationsLimit: number;
316
- machineToMachineLimit: number;
317
- resourcesLimit: number;
341
+ thirdPartyApplicationsLimit: number;
318
342
  scopesPerResourceLimit: number;
319
343
  socialConnectorsLimit: number;
344
+ userRolesLimit: number;
320
345
  machineToMachineRolesLimit: number;
321
346
  scopesPerRoleLimit: number;
322
347
  hooksLimit: number;
323
- mfaEnabled: boolean;
324
- organizationsEnabled: boolean;
325
- thirdPartyApplicationsLimit: number;
326
- tenantMembersLimit: number;
327
348
  customJwtEnabled: boolean;
328
349
  subjectTokenEnabled: boolean;
329
350
  bringYourUiEnabled: boolean;
330
- userRolesLimit: number;
351
+ machineToMachineLimit: number;
352
+ resourcesLimit: number;
331
353
  enterpriseSsoLimit: number;
354
+ tenantMembersLimit: number;
355
+ mfaEnabled: boolean;
356
+ organizationsEnabled: boolean;
332
357
  organizationsLimit: number;
333
358
  idpInitiatedSsoEnabled: boolean;
359
+ samlApplicationsLimit: number;
360
+ captchaEnabled: boolean;
334
361
  };
335
362
  resources: Record<string, number>;
336
363
  roles: Record<string, number>;
337
364
  quota: {
365
+ auditLogsRetentionDays: number | null;
338
366
  mauLimit: number | null;
339
- tokenLimit: number | null;
340
367
  applicationsLimit: number | null;
341
- machineToMachineLimit: number | null;
342
- resourcesLimit: number | null;
368
+ thirdPartyApplicationsLimit: number | null;
343
369
  scopesPerResourceLimit: number | null;
344
370
  socialConnectorsLimit: number | null;
371
+ userRolesLimit: number | null;
345
372
  machineToMachineRolesLimit: number | null;
346
373
  scopesPerRoleLimit: number | null;
347
374
  hooksLimit: number | null;
348
- auditLogsRetentionDays: number | null;
349
- mfaEnabled: boolean;
350
- organizationsEnabled: boolean;
351
- thirdPartyApplicationsLimit: number | null;
352
- tenantMembersLimit: number | null;
353
375
  customJwtEnabled: boolean;
354
376
  subjectTokenEnabled: boolean;
355
377
  bringYourUiEnabled: boolean;
356
- userRolesLimit: number | null;
378
+ tokenLimit: number | null;
379
+ machineToMachineLimit: number | null;
380
+ resourcesLimit: number | null;
357
381
  enterpriseSsoLimit: number | null;
382
+ tenantMembersLimit: number | null;
383
+ mfaEnabled: boolean;
384
+ organizationsEnabled: boolean;
358
385
  organizationsLimit: number | null;
359
386
  idpInitiatedSsoEnabled: boolean;
387
+ samlApplicationsLimit: number | null;
388
+ captchaEnabled: boolean;
360
389
  };
361
390
  basicQuota: {
391
+ auditLogsRetentionDays: number | null;
362
392
  mauLimit: number | null;
363
- tokenLimit: number | null;
364
393
  applicationsLimit: number | null;
365
- machineToMachineLimit: number | null;
366
- resourcesLimit: number | null;
394
+ thirdPartyApplicationsLimit: number | null;
367
395
  scopesPerResourceLimit: number | null;
368
396
  socialConnectorsLimit: number | null;
397
+ userRolesLimit: number | null;
369
398
  machineToMachineRolesLimit: number | null;
370
399
  scopesPerRoleLimit: number | null;
371
400
  hooksLimit: number | null;
372
- auditLogsRetentionDays: number | null;
373
- mfaEnabled: boolean;
374
- organizationsEnabled: boolean;
375
- thirdPartyApplicationsLimit: number | null;
376
- tenantMembersLimit: number | null;
377
401
  customJwtEnabled: boolean;
378
402
  subjectTokenEnabled: boolean;
379
403
  bringYourUiEnabled: boolean;
380
- userRolesLimit: number | null;
404
+ tokenLimit: number | null;
405
+ machineToMachineLimit: number | null;
406
+ resourcesLimit: number | null;
381
407
  enterpriseSsoLimit: number | null;
408
+ tenantMembersLimit: number | null;
409
+ mfaEnabled: boolean;
410
+ organizationsEnabled: boolean;
382
411
  organizationsLimit: number | null;
383
412
  idpInitiatedSsoEnabled: boolean;
413
+ samlApplicationsLimit: number | null;
414
+ captchaEnabled: boolean;
384
415
  };
385
416
  }>;
386
- } & {
417
+ };
418
+ post: {
419
+ "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
420
+ usageKey: RealtimeReportableUsageKey;
421
+ }, {
422
+ message: string;
423
+ }>;
424
+ };
425
+ put: {};
426
+ delete: {};
427
+ copy: {};
428
+ head: {};
429
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
430
+ patch: {};
431
+ options: {};
432
+ get: {
387
433
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
388
434
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
389
435
  planId: string;
@@ -397,80 +443,85 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
397
443
  total: number;
398
444
  totalExcludingTax: number | null;
399
445
  } | null | undefined;
400
- isAddOnAvailable?: boolean | undefined;
401
446
  }>;
402
447
  } & {
403
448
  "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
404
449
  usage: {
405
450
  applicationsLimit: number;
406
- machineToMachineLimit: number;
407
- resourcesLimit: number;
451
+ thirdPartyApplicationsLimit: number;
408
452
  scopesPerResourceLimit: number;
409
453
  socialConnectorsLimit: number;
454
+ userRolesLimit: number;
410
455
  machineToMachineRolesLimit: number;
411
456
  scopesPerRoleLimit: number;
412
457
  hooksLimit: number;
413
- mfaEnabled: boolean;
414
- organizationsEnabled: boolean;
415
- thirdPartyApplicationsLimit: number;
416
- tenantMembersLimit: number;
417
458
  customJwtEnabled: boolean;
418
459
  subjectTokenEnabled: boolean;
419
460
  bringYourUiEnabled: boolean;
420
- userRolesLimit: number;
461
+ machineToMachineLimit: number;
462
+ resourcesLimit: number;
421
463
  enterpriseSsoLimit: number;
464
+ tenantMembersLimit: number;
465
+ mfaEnabled: boolean;
466
+ organizationsEnabled: boolean;
422
467
  organizationsLimit: number;
423
468
  idpInitiatedSsoEnabled: boolean;
469
+ samlApplicationsLimit: number;
470
+ captchaEnabled: boolean;
424
471
  };
425
472
  resources: Record<string, number>;
426
473
  roles: Record<string, number>;
427
474
  quota: {
475
+ auditLogsRetentionDays: number | null;
428
476
  mauLimit: number | null;
429
- tokenLimit: number | null;
430
477
  applicationsLimit: number | null;
431
- machineToMachineLimit: number | null;
432
- resourcesLimit: number | null;
478
+ thirdPartyApplicationsLimit: number | null;
433
479
  scopesPerResourceLimit: number | null;
434
480
  socialConnectorsLimit: number | null;
481
+ userRolesLimit: number | null;
435
482
  machineToMachineRolesLimit: number | null;
436
483
  scopesPerRoleLimit: number | null;
437
484
  hooksLimit: number | null;
438
- auditLogsRetentionDays: number | null;
439
- mfaEnabled: boolean;
440
- organizationsEnabled: boolean;
441
- thirdPartyApplicationsLimit: number | null;
442
- tenantMembersLimit: number | null;
443
485
  customJwtEnabled: boolean;
444
486
  subjectTokenEnabled: boolean;
445
487
  bringYourUiEnabled: boolean;
446
- userRolesLimit: number | null;
488
+ tokenLimit: number | null;
489
+ machineToMachineLimit: number | null;
490
+ resourcesLimit: number | null;
447
491
  enterpriseSsoLimit: number | null;
492
+ tenantMembersLimit: number | null;
493
+ mfaEnabled: boolean;
494
+ organizationsEnabled: boolean;
448
495
  organizationsLimit: number | null;
449
496
  idpInitiatedSsoEnabled: boolean;
497
+ samlApplicationsLimit: number | null;
498
+ captchaEnabled: boolean;
450
499
  };
451
500
  basicQuota: {
501
+ auditLogsRetentionDays: number | null;
452
502
  mauLimit: number | null;
453
- tokenLimit: number | null;
454
503
  applicationsLimit: number | null;
455
- machineToMachineLimit: number | null;
456
- resourcesLimit: number | null;
504
+ thirdPartyApplicationsLimit: number | null;
457
505
  scopesPerResourceLimit: number | null;
458
506
  socialConnectorsLimit: number | null;
507
+ userRolesLimit: number | null;
459
508
  machineToMachineRolesLimit: number | null;
460
509
  scopesPerRoleLimit: number | null;
461
510
  hooksLimit: number | null;
462
- auditLogsRetentionDays: number | null;
463
- mfaEnabled: boolean;
464
- organizationsEnabled: boolean;
465
- thirdPartyApplicationsLimit: number | null;
466
- tenantMembersLimit: number | null;
467
511
  customJwtEnabled: boolean;
468
512
  subjectTokenEnabled: boolean;
469
513
  bringYourUiEnabled: boolean;
470
- userRolesLimit: number | null;
514
+ tokenLimit: number | null;
515
+ machineToMachineLimit: number | null;
516
+ resourcesLimit: number | null;
471
517
  enterpriseSsoLimit: number | null;
518
+ tenantMembersLimit: number | null;
519
+ mfaEnabled: boolean;
520
+ organizationsEnabled: boolean;
472
521
  organizationsLimit: number | null;
473
522
  idpInitiatedSsoEnabled: boolean;
523
+ samlApplicationsLimit: number | null;
524
+ captchaEnabled: boolean;
474
525
  };
475
526
  }>;
476
527
  } & {
@@ -478,12 +529,51 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
478
529
  mauLimit: number;
479
530
  tokenLimit: number;
480
531
  }>;
532
+ } & {
533
+ "/tenants/:tenantId/subscription/add-on-skus": import("@withtyped/server").PathGuard<"/:tenantId/subscription/add-on-skus", unknown, unknown, {
534
+ tokenLimit?: {
535
+ id: string;
536
+ name: string | null;
537
+ createdAt: Date;
538
+ defaultPriceId: string | null;
539
+ unitPrice: number | null;
540
+ type: LogtoSkuType;
541
+ quota: {
542
+ auditLogsRetentionDays?: number | null | undefined;
543
+ mauLimit?: number | null | undefined;
544
+ applicationsLimit?: number | null | undefined;
545
+ thirdPartyApplicationsLimit?: number | null | undefined;
546
+ scopesPerResourceLimit?: number | null | undefined;
547
+ socialConnectorsLimit?: number | null | undefined;
548
+ userRolesLimit?: number | null | undefined;
549
+ machineToMachineRolesLimit?: number | null | undefined;
550
+ scopesPerRoleLimit?: number | null | undefined;
551
+ hooksLimit?: number | null | undefined;
552
+ customJwtEnabled?: boolean | undefined;
553
+ subjectTokenEnabled?: boolean | undefined;
554
+ bringYourUiEnabled?: boolean | undefined;
555
+ tokenLimit?: number | null | undefined;
556
+ machineToMachineLimit?: number | null | undefined;
557
+ resourcesLimit?: number | null | undefined;
558
+ enterpriseSsoLimit?: number | null | undefined;
559
+ tenantMembersLimit?: number | null | undefined;
560
+ mfaEnabled?: boolean | undefined;
561
+ organizationsEnabled?: boolean | undefined;
562
+ organizationsLimit?: number | null | undefined;
563
+ idpInitiatedSsoEnabled?: boolean | undefined;
564
+ samlApplicationsLimit?: number | null | undefined;
565
+ captchaEnabled?: boolean | undefined;
566
+ };
567
+ updatedAt: Date;
568
+ productId: string | null;
569
+ } | undefined;
570
+ }>;
481
571
  } & {
482
572
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
483
573
  invoices: {
484
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
485
574
  id: string;
486
575
  createdAt: Date;
576
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
487
577
  updatedAt: Date;
488
578
  customerId: string | null;
489
579
  billingReason: string | null;
@@ -491,6 +581,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
491
581
  periodEnd: Date;
492
582
  amountDue: number;
493
583
  amountPaid: number;
584
+ basicSkuId: string | null;
494
585
  subscriptionId: string | null;
495
586
  hostedInvoiceUrl: string | null;
496
587
  invoicePdf: string | null;
@@ -502,37 +593,39 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
502
593
  "/tenants/:tenantId/available-skus": import("@withtyped/server").PathGuard<"/:tenantId/available-skus", {
503
594
  type?: LogtoSkuType | undefined;
504
595
  }, unknown, {
505
- type: LogtoSkuType;
506
596
  id: string;
507
597
  name: string | null;
598
+ createdAt: Date;
599
+ defaultPriceId: string | null;
600
+ unitPrice: number | null;
601
+ type: LogtoSkuType;
508
602
  quota: {
603
+ auditLogsRetentionDays?: number | null | undefined;
509
604
  mauLimit?: number | null | undefined;
510
- tokenLimit?: number | null | undefined;
511
605
  applicationsLimit?: number | null | undefined;
512
- machineToMachineLimit?: number | null | undefined;
513
- resourcesLimit?: number | null | undefined;
606
+ thirdPartyApplicationsLimit?: number | null | undefined;
514
607
  scopesPerResourceLimit?: number | null | undefined;
515
608
  socialConnectorsLimit?: number | null | undefined;
609
+ userRolesLimit?: number | null | undefined;
516
610
  machineToMachineRolesLimit?: number | null | undefined;
517
611
  scopesPerRoleLimit?: number | null | undefined;
518
612
  hooksLimit?: number | null | undefined;
519
- auditLogsRetentionDays?: number | null | undefined;
520
- mfaEnabled?: boolean | undefined;
521
- organizationsEnabled?: boolean | undefined;
522
- thirdPartyApplicationsLimit?: number | null | undefined;
523
- tenantMembersLimit?: number | null | undefined;
524
613
  customJwtEnabled?: boolean | undefined;
525
614
  subjectTokenEnabled?: boolean | undefined;
526
615
  bringYourUiEnabled?: boolean | undefined;
527
- userRolesLimit?: number | null | undefined;
616
+ tokenLimit?: number | null | undefined;
617
+ machineToMachineLimit?: number | null | undefined;
618
+ resourcesLimit?: number | null | undefined;
528
619
  enterpriseSsoLimit?: number | null | undefined;
620
+ tenantMembersLimit?: number | null | undefined;
621
+ mfaEnabled?: boolean | undefined;
622
+ organizationsEnabled?: boolean | undefined;
529
623
  organizationsLimit?: number | null | undefined;
530
624
  idpInitiatedSsoEnabled?: boolean | undefined;
625
+ samlApplicationsLimit?: number | null | undefined;
626
+ captchaEnabled?: boolean | undefined;
531
627
  };
532
- createdAt: Date;
533
628
  updatedAt: Date;
534
- defaultPriceId: string | null;
535
- unitPrice: number | null;
536
629
  productId: string | null;
537
630
  }[]>;
538
631
  } & {
@@ -541,12 +634,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
541
634
  }>;
542
635
  };
543
636
  post: {
544
- "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
545
- usageKey: RealtimeReportableUsageKey;
546
- }, {
547
- message: string;
548
- }>;
549
- } & {
550
637
  "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
551
638
  callbackUrl?: string | undefined;
552
639
  }, {
@@ -572,11 +659,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
572
659
  post: {
573
660
  "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
574
661
  data: {
575
- type: TemplateType | VerificationCodeType;
662
+ type: TemplateType;
576
663
  payload: {
577
- code?: string | undefined;
578
664
  link?: string | undefined;
579
- } & Record<string, string> & {
665
+ code?: string | undefined;
666
+ locale?: string | undefined;
667
+ } & {
668
+ [k: string]: unknown;
669
+ } & {
580
670
  senderName?: string | undefined;
581
671
  companyInformation?: string | undefined;
582
672
  appLogo?: string | undefined;
@@ -587,27 +677,30 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
587
677
  } & {
588
678
  "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
589
679
  data: {
590
- type: TemplateType | VerificationCodeType;
680
+ type: TemplateType;
591
681
  to: string;
592
682
  payload: {
593
683
  code?: string | undefined;
594
684
  link?: string | undefined;
595
- } & Record<string, string>;
685
+ locale?: string | undefined;
686
+ } & {
687
+ [k: string]: unknown;
688
+ };
596
689
  };
597
690
  }, unknown>;
598
691
  } & {
599
692
  "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
600
693
  isTest?: string | undefined;
601
694
  }, {
695
+ token: Record<string, Json>;
602
696
  context: Record<string, Json>;
603
697
  script: string;
604
698
  tokenType: LogtoJwtTokenKeyType.AccessToken;
605
- token: Record<string, Json>;
606
699
  environmentVariables?: Record<string, string> | undefined;
607
700
  } | {
701
+ token: Record<string, Json>;
608
702
  script: string;
609
703
  tokenType: LogtoJwtTokenKeyType.ClientCredentials;
610
- token: Record<string, Json>;
611
704
  environmentVariables?: Record<string, string> | undefined;
612
705
  }, Record<string, unknown>>;
613
706
  };
@@ -635,37 +728,39 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
635
728
  "/skus": import("@withtyped/server").PathGuard<"/", {
636
729
  type?: LogtoSkuType | undefined;
637
730
  }, unknown, {
638
- type: LogtoSkuType;
639
731
  id: string;
640
732
  name: string | null;
733
+ createdAt: Date;
734
+ defaultPriceId: string | null;
735
+ unitPrice: number | null;
736
+ type: LogtoSkuType;
641
737
  quota: {
738
+ auditLogsRetentionDays?: number | null | undefined;
642
739
  mauLimit?: number | null | undefined;
643
- tokenLimit?: number | null | undefined;
644
740
  applicationsLimit?: number | null | undefined;
645
- machineToMachineLimit?: number | null | undefined;
646
- resourcesLimit?: number | null | undefined;
741
+ thirdPartyApplicationsLimit?: number | null | undefined;
647
742
  scopesPerResourceLimit?: number | null | undefined;
648
743
  socialConnectorsLimit?: number | null | undefined;
744
+ userRolesLimit?: number | null | undefined;
649
745
  machineToMachineRolesLimit?: number | null | undefined;
650
746
  scopesPerRoleLimit?: number | null | undefined;
651
747
  hooksLimit?: number | null | undefined;
652
- auditLogsRetentionDays?: number | null | undefined;
653
- mfaEnabled?: boolean | undefined;
654
- organizationsEnabled?: boolean | undefined;
655
- thirdPartyApplicationsLimit?: number | null | undefined;
656
- tenantMembersLimit?: number | null | undefined;
657
748
  customJwtEnabled?: boolean | undefined;
658
749
  subjectTokenEnabled?: boolean | undefined;
659
750
  bringYourUiEnabled?: boolean | undefined;
660
- userRolesLimit?: number | null | undefined;
751
+ tokenLimit?: number | null | undefined;
752
+ machineToMachineLimit?: number | null | undefined;
753
+ resourcesLimit?: number | null | undefined;
661
754
  enterpriseSsoLimit?: number | null | undefined;
755
+ tenantMembersLimit?: number | null | undefined;
756
+ mfaEnabled?: boolean | undefined;
757
+ organizationsEnabled?: boolean | undefined;
662
758
  organizationsLimit?: number | null | undefined;
663
759
  idpInitiatedSsoEnabled?: boolean | undefined;
760
+ samlApplicationsLimit?: number | null | undefined;
761
+ captchaEnabled?: boolean | undefined;
664
762
  };
665
- createdAt: Date;
666
763
  updatedAt: Date;
667
- defaultPriceId: string | null;
668
- unitPrice: number | null;
669
764
  productId: string | null;
670
765
  }[]>;
671
766
  };
@@ -682,45 +777,52 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
682
777
  mfaEnabled?: boolean | undefined;
683
778
  organizationsEnabled?: boolean | undefined;
684
779
  organizationsLimit?: number | null | undefined;
780
+ auditLogsRetentionDays?: number | null | undefined;
685
781
  mauLimit?: number | null | undefined;
686
782
  applicationsLimit?: number | null | undefined;
783
+ thirdPartyApplicationsLimit?: number | null | undefined;
687
784
  scopesPerResourceLimit?: number | null | undefined;
688
785
  socialConnectorsLimit?: number | null | undefined;
786
+ userRolesLimit?: number | null | undefined;
689
787
  machineToMachineRolesLimit?: number | null | undefined;
690
788
  scopesPerRoleLimit?: number | null | undefined;
691
- auditLogsRetentionDays?: number | null | undefined;
692
- thirdPartyApplicationsLimit?: number | null | undefined;
693
789
  customJwtEnabled?: boolean | undefined;
694
790
  subjectTokenEnabled?: boolean | undefined;
695
791
  bringYourUiEnabled?: boolean | undefined;
696
- userRolesLimit?: number | null | undefined;
697
792
  idpInitiatedSsoEnabled?: boolean | undefined;
793
+ samlApplicationsLimit?: number | null | undefined;
794
+ captchaEnabled?: boolean | undefined;
698
795
  };
699
796
  } | {
700
797
  type: LogtoSkuType.Basic;
701
798
  quota: {
799
+ auditLogsRetentionDays: number | null;
702
800
  mauLimit: number | null;
703
- tokenLimit: number | null;
704
801
  applicationsLimit: number | null;
705
- machineToMachineLimit: number | null;
706
- resourcesLimit: number | null;
802
+ thirdPartyApplicationsLimit: number | null;
707
803
  scopesPerResourceLimit: number | null;
708
804
  socialConnectorsLimit: number | null;
805
+ userRolesLimit: number | null;
709
806
  machineToMachineRolesLimit: number | null;
710
807
  scopesPerRoleLimit: number | null;
711
808
  hooksLimit: number | null;
712
- auditLogsRetentionDays: number | null;
713
- mfaEnabled: boolean;
714
- organizationsEnabled: boolean;
715
- thirdPartyApplicationsLimit: number | null;
716
- tenantMembersLimit: number | null;
717
809
  customJwtEnabled: boolean;
718
810
  subjectTokenEnabled: boolean;
719
811
  bringYourUiEnabled: boolean;
720
- userRolesLimit: number | null;
812
+ tokenLimit: number | null;
813
+ machineToMachineLimit: number | null;
814
+ resourcesLimit: number | null;
721
815
  enterpriseSsoLimit: number | null;
816
+ tenantMembersLimit: number | null;
817
+ mfaEnabled: boolean;
818
+ organizationsEnabled: boolean;
722
819
  organizationsLimit: number | null;
723
820
  idpInitiatedSsoEnabled: boolean;
821
+ samlApplicationsLimit: number | null;
822
+ captchaEnabled: boolean;
823
+ };
824
+ addOnRelations: {
825
+ tokenLimit: string;
724
826
  };
725
827
  }, {
726
828
  id: string;
@@ -728,28 +830,30 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
728
830
  type: LogtoSkuType;
729
831
  updatedAt: Date;
730
832
  quota: {
833
+ auditLogsRetentionDays?: number | null | undefined;
731
834
  mauLimit?: number | null | undefined;
732
- tokenLimit?: number | null | undefined;
733
835
  applicationsLimit?: number | null | undefined;
734
- machineToMachineLimit?: number | null | undefined;
735
- resourcesLimit?: number | null | undefined;
836
+ thirdPartyApplicationsLimit?: number | null | undefined;
736
837
  scopesPerResourceLimit?: number | null | undefined;
737
838
  socialConnectorsLimit?: number | null | undefined;
839
+ userRolesLimit?: number | null | undefined;
738
840
  machineToMachineRolesLimit?: number | null | undefined;
739
841
  scopesPerRoleLimit?: number | null | undefined;
740
842
  hooksLimit?: number | null | undefined;
741
- auditLogsRetentionDays?: number | null | undefined;
742
- mfaEnabled?: boolean | undefined;
743
- organizationsEnabled?: boolean | undefined;
744
- thirdPartyApplicationsLimit?: number | null | undefined;
745
- tenantMembersLimit?: number | null | undefined;
746
843
  customJwtEnabled?: boolean | undefined;
747
844
  subjectTokenEnabled?: boolean | undefined;
748
845
  bringYourUiEnabled?: boolean | undefined;
749
- userRolesLimit?: number | null | undefined;
846
+ tokenLimit?: number | null | undefined;
847
+ machineToMachineLimit?: number | null | undefined;
848
+ resourcesLimit?: number | null | undefined;
750
849
  enterpriseSsoLimit?: number | null | undefined;
850
+ tenantMembersLimit?: number | null | undefined;
851
+ mfaEnabled?: boolean | undefined;
852
+ organizationsEnabled?: boolean | undefined;
751
853
  organizationsLimit?: number | null | undefined;
752
854
  idpInitiatedSsoEnabled?: boolean | undefined;
855
+ samlApplicationsLimit?: number | null | undefined;
856
+ captchaEnabled?: boolean | undefined;
753
857
  };
754
858
  }>;
755
859
  } & {
@@ -779,19 +883,18 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
779
883
  status: "open" | "complete" | "expired";
780
884
  tenantId: string | null;
781
885
  updatedAt: Date;
782
- planId: string | null;
783
886
  skuId: string | null;
887
+ planId: string | null;
784
888
  }>;
785
889
  };
786
890
  post: {
787
891
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
788
892
  successCallbackUrl: string;
789
893
  tenantId?: string | undefined;
790
- planId?: string | undefined;
791
894
  skuId?: string | undefined;
792
895
  tenantName?: string | undefined;
793
896
  tenantTag?: TenantTag | undefined;
794
- tenantRegionName?: RegionName | undefined;
897
+ tenantRegionName?: string | undefined;
795
898
  cancelCallbackUrl?: string | undefined;
796
899
  }, {
797
900
  sessionId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-5e334eb",
3
+ "version": "0.2.5-631f4a7",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -21,7 +21,7 @@
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
27
  "eslint": "^8.57.0",
@@ -30,10 +30,10 @@
30
30
  "prettier": "^3.0.0",
31
31
  "typescript": "^5.3.3",
32
32
  "vite-tsconfig-paths": "^5.0.0",
33
- "vitest": "^2.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",