@logto/cloud 0.2.5-a6cff75 → 0.2.5-aac51e9

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 +352 -215
  2. package/package.json +5 -5
@@ -16,6 +16,8 @@ declare enum VerificationCodeType {
16
16
  Register = "Register",
17
17
  ForgotPassword = "ForgotPassword",
18
18
  Generic = "Generic",
19
+ UserPermissionValidation = "UserPermissionValidation",
20
+ BindNewIdentifier = "BindNewIdentifier",
19
21
  /** @deprecated Use `Generic` type template for sending test sms/email use case */
20
22
  Test = "Test"
21
23
  }
@@ -29,7 +31,11 @@ declare enum TemplateType {
29
31
  /** The template for sending organization invitation. */
30
32
  OrganizationInvitation = "OrganizationInvitation",
31
33
  /** The template for generic usage. */
32
- Generic = "Generic"
34
+ Generic = "Generic",
35
+ /** The template for validating user permission for sensitive operations. */
36
+ UserPermissionValidation = "UserPermissionValidation",
37
+ /** The template for binding a new identifier to an existing account. */
38
+ BindNewIdentifier = "BindNewIdentifier"
33
39
  }
34
40
  declare enum OrganizationInvitationStatus {
35
41
  Pending = "Pending",
@@ -69,6 +75,19 @@ declare enum TenantRole {
69
75
  /** Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
70
76
  Collaborator = "collaborator"
71
77
  }
78
+ declare const availableReportableUsageKeys: readonly [
79
+ "tokenLimit",
80
+ "machineToMachineLimit",
81
+ "resourcesLimit",
82
+ "enterpriseSsoLimit",
83
+ "hooksLimit",
84
+ "tenantMembersLimit",
85
+ "mfaEnabled",
86
+ "organizationsEnabled",
87
+ "organizationsLimit"
88
+ ];
89
+ export type ReportableUsageKey = (typeof availableReportableUsageKeys)[number];
90
+ export type RealtimeReportableUsageKey = Exclude<ReportableUsageKey, "tokenLimit">;
72
91
  declare enum LogtoSkuType {
73
92
  Basic = "Basic",
74
93
  AddOn = "AddOn"
@@ -88,7 +107,8 @@ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default
88
107
  export type Affiliate = InferModelType<typeof Affiliates>;
89
108
  declare enum RegionName {
90
109
  EU = "EU",
91
- US = "US"
110
+ US = "US",
111
+ AU = "AU"
92
112
  }
93
113
  export type AffiliateData = Affiliate & {
94
114
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
@@ -119,12 +139,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
119
139
  }, {
120
140
  id: string;
121
141
  name: string;
142
+ createdAt: Date;
122
143
  quota: {
123
144
  mauLimit: number | null;
145
+ tokenLimit: number | null;
124
146
  };
125
- createdAt: Date;
126
147
  usage: {
127
148
  activeUsers: number;
149
+ tokenUsage: number;
128
150
  };
129
151
  indicator: string;
130
152
  isSuspended: boolean;
@@ -134,6 +156,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
134
156
  planId: string;
135
157
  currentPeriodStart: Date;
136
158
  currentPeriodEnd: Date;
159
+ isEnterprisePlan: boolean;
137
160
  id?: string | undefined;
138
161
  upcomingInvoice?: {
139
162
  subtotal: number;
@@ -141,15 +164,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
141
164
  total: number;
142
165
  totalExcludingTax: number | null;
143
166
  } | null | undefined;
144
- isAddOnAvailable?: boolean | undefined;
145
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
146
167
  };
147
168
  regionName: RegionName;
148
169
  tag: TenantTag;
149
170
  openInvoices: {
150
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
151
171
  id: string;
152
172
  createdAt: Date;
173
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
153
174
  updatedAt: Date;
154
175
  customerId: string | null;
155
176
  billingReason: string | null;
@@ -157,6 +178,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
157
178
  periodEnd: Date;
158
179
  amountDue: number;
159
180
  amountPaid: number;
181
+ basicSkuId: string | null;
160
182
  subscriptionId: string | null;
161
183
  hostedInvoiceUrl: string | null;
162
184
  invoicePdf: string | null;
@@ -168,12 +190,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
168
190
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
169
191
  id: string;
170
192
  name: string;
193
+ createdAt: Date;
171
194
  quota: {
172
195
  mauLimit: number | null;
196
+ tokenLimit: number | null;
173
197
  };
174
- createdAt: Date;
175
198
  usage: {
176
199
  activeUsers: number;
200
+ tokenUsage: number;
177
201
  };
178
202
  indicator: string;
179
203
  isSuspended: boolean;
@@ -183,6 +207,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
183
207
  planId: string;
184
208
  currentPeriodStart: Date;
185
209
  currentPeriodEnd: Date;
210
+ isEnterprisePlan: boolean;
186
211
  id?: string | undefined;
187
212
  upcomingInvoice?: {
188
213
  subtotal: number;
@@ -190,15 +215,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
190
215
  total: number;
191
216
  totalExcludingTax: number | null;
192
217
  } | null | undefined;
193
- isAddOnAvailable?: boolean | undefined;
194
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
195
218
  };
196
219
  regionName: RegionName;
197
220
  tag: TenantTag;
198
221
  openInvoices: {
199
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
200
222
  id: string;
201
223
  createdAt: Date;
224
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
202
225
  updatedAt: Date;
203
226
  customerId: string | null;
204
227
  billingReason: string | null;
@@ -206,6 +229,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
206
229
  periodEnd: Date;
207
230
  amountDue: number;
208
231
  amountPaid: number;
232
+ basicSkuId: string | null;
209
233
  subscriptionId: string | null;
210
234
  hostedInvoiceUrl: string | null;
211
235
  invoicePdf: string | null;
@@ -220,12 +244,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
220
244
  }, {
221
245
  id: string;
222
246
  name: string;
247
+ createdAt: Date;
223
248
  quota: {
224
249
  mauLimit: number | null;
250
+ tokenLimit: number | null;
225
251
  };
226
- createdAt: Date;
227
252
  usage: {
228
253
  activeUsers: number;
254
+ tokenUsage: number;
229
255
  };
230
256
  indicator: string;
231
257
  isSuspended: boolean;
@@ -235,6 +261,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
235
261
  planId: string;
236
262
  currentPeriodStart: Date;
237
263
  currentPeriodEnd: Date;
264
+ isEnterprisePlan: boolean;
238
265
  id?: string | undefined;
239
266
  upcomingInvoice?: {
240
267
  subtotal: number;
@@ -242,15 +269,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
242
269
  total: number;
243
270
  totalExcludingTax: number | null;
244
271
  } | null | undefined;
245
- isAddOnAvailable?: boolean | undefined;
246
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
247
272
  };
248
273
  regionName: RegionName;
249
274
  tag: TenantTag;
250
275
  openInvoices: {
251
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
252
276
  id: string;
253
277
  createdAt: Date;
278
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
254
279
  updatedAt: Date;
255
280
  customerId: string | null;
256
281
  billingReason: string | null;
@@ -258,6 +283,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
258
283
  periodEnd: Date;
259
284
  amountDue: number;
260
285
  amountPaid: number;
286
+ basicSkuId: string | null;
261
287
  subscriptionId: string | null;
262
288
  hostedInvoiceUrl: string | null;
263
289
  invoicePdf: string | null;
@@ -276,9 +302,34 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
276
302
  get: {
277
303
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
278
304
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
305
+ quota: {
306
+ auditLogsRetentionDays: number | null;
307
+ mauLimit: number | null;
308
+ applicationsLimit: number | null;
309
+ thirdPartyApplicationsLimit: number | null;
310
+ scopesPerResourceLimit: number | null;
311
+ socialConnectorsLimit: number | null;
312
+ userRolesLimit: number | null;
313
+ machineToMachineRolesLimit: number | null;
314
+ scopesPerRoleLimit: number | null;
315
+ hooksLimit: number | null;
316
+ customJwtEnabled: boolean;
317
+ subjectTokenEnabled: boolean;
318
+ bringYourUiEnabled: 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
+ idpInitiatedSsoEnabled: boolean;
328
+ };
279
329
  planId: string;
280
330
  currentPeriodStart: Date;
281
331
  currentPeriodEnd: Date;
332
+ isEnterprisePlan: boolean;
282
333
  id?: string | undefined;
283
334
  upcomingInvoice?: {
284
335
  subtotal: number;
@@ -286,112 +337,103 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
286
337
  total: number;
287
338
  totalExcludingTax: number | null;
288
339
  } | 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
340
  }>;
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
341
  } & {
342
342
  "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
343
343
  usage: {
344
- mauLimit: number;
345
- tokenLimit: number;
346
344
  applicationsLimit: number;
347
- machineToMachineLimit: number;
348
- resourcesLimit: number;
345
+ thirdPartyApplicationsLimit: number;
349
346
  scopesPerResourceLimit: number;
350
347
  socialConnectorsLimit: number;
348
+ userRolesLimit: number;
351
349
  machineToMachineRolesLimit: number;
352
350
  scopesPerRoleLimit: number;
353
351
  hooksLimit: number;
354
- mfaEnabled: boolean;
355
- organizationsEnabled: boolean;
356
- thirdPartyApplicationsLimit: number;
357
- tenantMembersLimit: number;
358
352
  customJwtEnabled: boolean;
359
353
  subjectTokenEnabled: boolean;
360
354
  bringYourUiEnabled: boolean;
361
- userRolesLimit: number;
355
+ machineToMachineLimit: number;
356
+ resourcesLimit: number;
362
357
  enterpriseSsoLimit: number;
358
+ tenantMembersLimit: number;
359
+ mfaEnabled: boolean;
360
+ organizationsEnabled: boolean;
361
+ organizationsLimit: number;
362
+ idpInitiatedSsoEnabled: boolean;
363
363
  };
364
364
  resources: Record<string, number>;
365
365
  roles: Record<string, number>;
366
366
  quota: {
367
+ auditLogsRetentionDays: number | null;
367
368
  mauLimit: number | null;
368
- tokenLimit: number | null;
369
369
  applicationsLimit: number | null;
370
- machineToMachineLimit: number | null;
371
- resourcesLimit: number | null;
370
+ thirdPartyApplicationsLimit: number | null;
372
371
  scopesPerResourceLimit: number | null;
373
372
  socialConnectorsLimit: number | null;
373
+ userRolesLimit: number | null;
374
374
  machineToMachineRolesLimit: number | null;
375
375
  scopesPerRoleLimit: number | null;
376
376
  hooksLimit: number | null;
377
- auditLogsRetentionDays: number | null;
377
+ customJwtEnabled: boolean;
378
+ subjectTokenEnabled: boolean;
379
+ bringYourUiEnabled: boolean;
380
+ tokenLimit: number | null;
381
+ machineToMachineLimit: number | null;
382
+ resourcesLimit: number | null;
383
+ enterpriseSsoLimit: number | null;
384
+ tenantMembersLimit: number | null;
378
385
  mfaEnabled: boolean;
379
386
  organizationsEnabled: boolean;
387
+ organizationsLimit: number | null;
388
+ idpInitiatedSsoEnabled: boolean;
389
+ };
390
+ basicQuota: {
391
+ auditLogsRetentionDays: number | null;
392
+ mauLimit: number | null;
393
+ applicationsLimit: number | null;
380
394
  thirdPartyApplicationsLimit: number | null;
381
- tenantMembersLimit: number | null;
395
+ scopesPerResourceLimit: number | null;
396
+ socialConnectorsLimit: number | null;
397
+ userRolesLimit: number | null;
398
+ machineToMachineRolesLimit: number | null;
399
+ scopesPerRoleLimit: number | null;
400
+ hooksLimit: number | null;
382
401
  customJwtEnabled: boolean;
383
402
  subjectTokenEnabled: boolean;
384
403
  bringYourUiEnabled: boolean;
385
- userRolesLimit: number | null;
404
+ tokenLimit: number | null;
405
+ machineToMachineLimit: number | null;
406
+ resourcesLimit: number | null;
386
407
  enterpriseSsoLimit: number | null;
408
+ tenantMembersLimit: number | null;
409
+ mfaEnabled: boolean;
410
+ organizationsEnabled: boolean;
411
+ organizationsLimit: number | null;
412
+ idpInitiatedSsoEnabled: boolean;
387
413
  };
388
414
  }>;
389
- } & {
415
+ };
416
+ post: {
417
+ "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
418
+ usageKey: RealtimeReportableUsageKey;
419
+ }, {
420
+ message: string;
421
+ }>;
422
+ };
423
+ put: {};
424
+ delete: {};
425
+ copy: {};
426
+ head: {};
427
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
428
+ patch: {};
429
+ options: {};
430
+ get: {
390
431
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
391
432
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
392
433
  planId: string;
393
434
  currentPeriodStart: Date;
394
435
  currentPeriodEnd: Date;
436
+ isEnterprisePlan: boolean;
395
437
  id?: string | undefined;
396
438
  upcomingInvoice?: {
397
439
  subtotal: number;
@@ -399,112 +441,129 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
399
441
  total: number;
400
442
  totalExcludingTax: number | null;
401
443
  } | null | undefined;
402
- isAddOnAvailable?: boolean | undefined;
403
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
404
444
  }>;
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
445
  } & {
455
446
  "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
456
447
  usage: {
457
- mauLimit: number;
458
- tokenLimit: number;
459
448
  applicationsLimit: number;
460
- machineToMachineLimit: number;
461
- resourcesLimit: number;
449
+ thirdPartyApplicationsLimit: number;
462
450
  scopesPerResourceLimit: number;
463
451
  socialConnectorsLimit: number;
452
+ userRolesLimit: number;
464
453
  machineToMachineRolesLimit: number;
465
454
  scopesPerRoleLimit: number;
466
455
  hooksLimit: number;
467
- mfaEnabled: boolean;
468
- organizationsEnabled: boolean;
469
- thirdPartyApplicationsLimit: number;
470
- tenantMembersLimit: number;
471
456
  customJwtEnabled: boolean;
472
457
  subjectTokenEnabled: boolean;
473
458
  bringYourUiEnabled: boolean;
474
- userRolesLimit: number;
459
+ machineToMachineLimit: number;
460
+ resourcesLimit: number;
475
461
  enterpriseSsoLimit: number;
462
+ tenantMembersLimit: number;
463
+ mfaEnabled: boolean;
464
+ organizationsEnabled: boolean;
465
+ organizationsLimit: number;
466
+ idpInitiatedSsoEnabled: boolean;
476
467
  };
477
468
  resources: Record<string, number>;
478
469
  roles: Record<string, number>;
479
470
  quota: {
471
+ auditLogsRetentionDays: number | null;
480
472
  mauLimit: number | null;
481
- tokenLimit: number | null;
482
473
  applicationsLimit: number | null;
483
- machineToMachineLimit: number | null;
484
- resourcesLimit: number | null;
474
+ thirdPartyApplicationsLimit: number | null;
485
475
  scopesPerResourceLimit: number | null;
486
476
  socialConnectorsLimit: number | null;
477
+ userRolesLimit: number | null;
487
478
  machineToMachineRolesLimit: number | null;
488
479
  scopesPerRoleLimit: number | null;
489
480
  hooksLimit: number | null;
490
- auditLogsRetentionDays: number | null;
481
+ customJwtEnabled: boolean;
482
+ subjectTokenEnabled: boolean;
483
+ bringYourUiEnabled: boolean;
484
+ tokenLimit: number | null;
485
+ machineToMachineLimit: number | null;
486
+ resourcesLimit: number | null;
487
+ enterpriseSsoLimit: number | null;
488
+ tenantMembersLimit: number | null;
491
489
  mfaEnabled: boolean;
492
490
  organizationsEnabled: boolean;
491
+ organizationsLimit: number | null;
492
+ idpInitiatedSsoEnabled: boolean;
493
+ };
494
+ basicQuota: {
495
+ auditLogsRetentionDays: number | null;
496
+ mauLimit: number | null;
497
+ applicationsLimit: number | null;
493
498
  thirdPartyApplicationsLimit: number | null;
494
- tenantMembersLimit: number | null;
499
+ scopesPerResourceLimit: number | null;
500
+ socialConnectorsLimit: number | null;
501
+ userRolesLimit: number | null;
502
+ machineToMachineRolesLimit: number | null;
503
+ scopesPerRoleLimit: number | null;
504
+ hooksLimit: number | null;
495
505
  customJwtEnabled: boolean;
496
506
  subjectTokenEnabled: boolean;
497
507
  bringYourUiEnabled: boolean;
498
- userRolesLimit: number | null;
508
+ tokenLimit: number | null;
509
+ machineToMachineLimit: number | null;
510
+ resourcesLimit: number | null;
499
511
  enterpriseSsoLimit: number | null;
512
+ tenantMembersLimit: number | null;
513
+ mfaEnabled: boolean;
514
+ organizationsEnabled: boolean;
515
+ organizationsLimit: number | null;
516
+ idpInitiatedSsoEnabled: boolean;
500
517
  };
501
518
  }>;
519
+ } & {
520
+ "/tenants/:tenantId/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/periodic-usage", unknown, unknown, {
521
+ mauLimit: number;
522
+ tokenLimit: number;
523
+ }>;
524
+ } & {
525
+ "/tenants/:tenantId/subscription/add-on-skus": import("@withtyped/server").PathGuard<"/:tenantId/subscription/add-on-skus", unknown, unknown, {
526
+ tokenLimit?: {
527
+ id: string;
528
+ name: string | null;
529
+ createdAt: Date;
530
+ defaultPriceId: string | null;
531
+ unitPrice: number | null;
532
+ type: LogtoSkuType;
533
+ quota: {
534
+ auditLogsRetentionDays?: number | null | undefined;
535
+ mauLimit?: number | null | undefined;
536
+ applicationsLimit?: number | null | undefined;
537
+ thirdPartyApplicationsLimit?: number | null | undefined;
538
+ scopesPerResourceLimit?: number | null | undefined;
539
+ socialConnectorsLimit?: number | null | undefined;
540
+ userRolesLimit?: number | null | undefined;
541
+ machineToMachineRolesLimit?: number | null | undefined;
542
+ scopesPerRoleLimit?: number | null | undefined;
543
+ hooksLimit?: number | null | undefined;
544
+ customJwtEnabled?: boolean | undefined;
545
+ subjectTokenEnabled?: boolean | undefined;
546
+ bringYourUiEnabled?: boolean | undefined;
547
+ tokenLimit?: number | null | undefined;
548
+ machineToMachineLimit?: number | null | undefined;
549
+ resourcesLimit?: number | null | undefined;
550
+ enterpriseSsoLimit?: number | null | undefined;
551
+ tenantMembersLimit?: number | null | undefined;
552
+ mfaEnabled?: boolean | undefined;
553
+ organizationsEnabled?: boolean | undefined;
554
+ organizationsLimit?: number | null | undefined;
555
+ idpInitiatedSsoEnabled?: boolean | undefined;
556
+ };
557
+ updatedAt: Date;
558
+ productId: string | null;
559
+ } | undefined;
560
+ }>;
502
561
  } & {
503
562
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
504
563
  invoices: {
505
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
506
564
  id: string;
507
565
  createdAt: Date;
566
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
508
567
  updatedAt: Date;
509
568
  customerId: string | null;
510
569
  billingReason: string | null;
@@ -512,6 +571,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
512
571
  periodEnd: Date;
513
572
  amountDue: number;
514
573
  amountPaid: number;
574
+ basicSkuId: string | null;
515
575
  subscriptionId: string | null;
516
576
  hostedInvoiceUrl: string | null;
517
577
  invoicePdf: string | null;
@@ -519,18 +579,49 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
519
579
  skuId?: string | null | undefined;
520
580
  }[];
521
581
  }>;
582
+ } & {
583
+ "/tenants/:tenantId/available-skus": import("@withtyped/server").PathGuard<"/:tenantId/available-skus", {
584
+ type?: LogtoSkuType | undefined;
585
+ }, unknown, {
586
+ id: string;
587
+ name: string | null;
588
+ createdAt: Date;
589
+ defaultPriceId: string | null;
590
+ unitPrice: number | null;
591
+ type: LogtoSkuType;
592
+ quota: {
593
+ auditLogsRetentionDays?: number | null | undefined;
594
+ mauLimit?: number | null | undefined;
595
+ applicationsLimit?: number | null | undefined;
596
+ thirdPartyApplicationsLimit?: number | null | undefined;
597
+ scopesPerResourceLimit?: number | null | undefined;
598
+ socialConnectorsLimit?: number | null | undefined;
599
+ userRolesLimit?: number | null | undefined;
600
+ machineToMachineRolesLimit?: number | null | undefined;
601
+ scopesPerRoleLimit?: number | null | undefined;
602
+ hooksLimit?: number | null | undefined;
603
+ customJwtEnabled?: boolean | undefined;
604
+ subjectTokenEnabled?: boolean | undefined;
605
+ bringYourUiEnabled?: boolean | undefined;
606
+ tokenLimit?: number | null | undefined;
607
+ machineToMachineLimit?: number | null | undefined;
608
+ resourcesLimit?: number | null | undefined;
609
+ enterpriseSsoLimit?: number | null | undefined;
610
+ tenantMembersLimit?: number | null | undefined;
611
+ mfaEnabled?: boolean | undefined;
612
+ organizationsEnabled?: boolean | undefined;
613
+ organizationsLimit?: number | null | undefined;
614
+ idpInitiatedSsoEnabled?: boolean | undefined;
615
+ };
616
+ updatedAt: Date;
617
+ productId: string | null;
618
+ }[]>;
522
619
  } & {
523
620
  "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
524
621
  hostedInvoiceUrl: string;
525
622
  }>;
526
623
  };
527
624
  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
- } & {
534
625
  "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
535
626
  callbackUrl?: string | undefined;
536
627
  }, {
@@ -616,96 +707,143 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
616
707
  patch: {};
617
708
  options: {};
618
709
  get: {
619
- "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
710
+ "/skus": import("@withtyped/server").PathGuard<"/", {
711
+ type?: LogtoSkuType | undefined;
712
+ }, unknown, {
620
713
  id: string;
714
+ name: string | null;
621
715
  createdAt: Date;
622
- name: string;
716
+ defaultPriceId: string | null;
717
+ unitPrice: number | null;
718
+ type: LogtoSkuType;
719
+ quota: {
720
+ auditLogsRetentionDays?: number | null | undefined;
721
+ mauLimit?: number | null | undefined;
722
+ applicationsLimit?: number | null | undefined;
723
+ thirdPartyApplicationsLimit?: number | null | undefined;
724
+ scopesPerResourceLimit?: number | null | undefined;
725
+ socialConnectorsLimit?: number | null | undefined;
726
+ userRolesLimit?: number | null | undefined;
727
+ machineToMachineRolesLimit?: number | null | undefined;
728
+ scopesPerRoleLimit?: number | null | undefined;
729
+ hooksLimit?: number | null | undefined;
730
+ customJwtEnabled?: boolean | undefined;
731
+ subjectTokenEnabled?: boolean | undefined;
732
+ bringYourUiEnabled?: boolean | undefined;
733
+ tokenLimit?: number | null | undefined;
734
+ machineToMachineLimit?: number | null | undefined;
735
+ resourcesLimit?: number | null | undefined;
736
+ enterpriseSsoLimit?: number | null | undefined;
737
+ tenantMembersLimit?: number | null | undefined;
738
+ mfaEnabled?: boolean | undefined;
739
+ organizationsEnabled?: boolean | undefined;
740
+ organizationsLimit?: number | null | undefined;
741
+ idpInitiatedSsoEnabled?: boolean | undefined;
742
+ };
623
743
  updatedAt: Date;
744
+ productId: string | null;
745
+ }[]>;
746
+ };
747
+ post: {
748
+ "/skus": import("@withtyped/server").PathGuard<"/", unknown, {
749
+ type: LogtoSkuType.AddOn;
624
750
  quota: {
751
+ tokenLimit?: number | null | undefined;
752
+ machineToMachineLimit?: number | null | undefined;
753
+ resourcesLimit?: number | null | undefined;
754
+ enterpriseSsoLimit?: number | null | undefined;
755
+ hooksLimit?: number | null | undefined;
756
+ tenantMembersLimit?: number | null | undefined;
757
+ mfaEnabled?: boolean | undefined;
758
+ organizationsEnabled?: boolean | undefined;
759
+ organizationsLimit?: number | null | undefined;
760
+ auditLogsRetentionDays?: number | null | undefined;
761
+ mauLimit?: number | null | undefined;
762
+ applicationsLimit?: number | null | undefined;
763
+ thirdPartyApplicationsLimit?: number | null | undefined;
764
+ scopesPerResourceLimit?: number | null | undefined;
765
+ socialConnectorsLimit?: number | null | undefined;
766
+ userRolesLimit?: number | null | undefined;
767
+ machineToMachineRolesLimit?: number | null | undefined;
768
+ scopesPerRoleLimit?: number | null | undefined;
769
+ customJwtEnabled?: boolean | undefined;
770
+ subjectTokenEnabled?: boolean | undefined;
771
+ bringYourUiEnabled?: boolean | undefined;
772
+ idpInitiatedSsoEnabled?: boolean | undefined;
773
+ };
774
+ } | {
775
+ type: LogtoSkuType.Basic;
776
+ quota: {
777
+ auditLogsRetentionDays: number | null;
625
778
  mauLimit: number | null;
626
- tokenLimit: number | null;
627
779
  applicationsLimit: number | null;
628
- machineToMachineLimit: number | null;
629
- resourcesLimit: number | null;
780
+ thirdPartyApplicationsLimit: number | null;
630
781
  scopesPerResourceLimit: number | null;
631
- customDomainEnabled: boolean;
632
- omniSignInEnabled: boolean;
633
- builtInEmailConnectorEnabled: boolean;
634
782
  socialConnectorsLimit: number | null;
635
- standardConnectorsLimit: number | null;
636
- rolesLimit: number | null;
783
+ userRolesLimit: number | null;
637
784
  machineToMachineRolesLimit: number | null;
638
785
  scopesPerRoleLimit: number | null;
639
786
  hooksLimit: number | null;
640
- auditLogsRetentionDays: number | null;
641
- mfaEnabled: boolean;
642
- organizationsEnabled: boolean;
643
- ssoEnabled: boolean;
644
- thirdPartyApplicationsLimit: number | null;
645
- tenantMembersLimit: number | null;
646
787
  customJwtEnabled: boolean;
647
788
  subjectTokenEnabled: boolean;
648
789
  bringYourUiEnabled: boolean;
790
+ tokenLimit: number | null;
791
+ machineToMachineLimit: number | null;
792
+ resourcesLimit: number | null;
793
+ enterpriseSsoLimit: number | null;
794
+ tenantMembersLimit: number | null;
795
+ mfaEnabled: boolean;
796
+ organizationsEnabled: boolean;
797
+ organizationsLimit: number | null;
798
+ idpInitiatedSsoEnabled: boolean;
649
799
  };
650
- stripeProducts: {
651
- type: "flat" | "tier1" | "tier2" | "tier3";
652
- id: string;
653
- name: string;
654
- price: {
655
- id: string;
656
- unitAmountDecimal: string;
657
- quantity?: 1 | undefined;
658
- unitAmount?: number | null | undefined;
659
- };
660
- description?: string | undefined;
661
- }[];
662
- }[]>;
663
- };
664
- post: {};
665
- put: {};
666
- delete: {};
667
- copy: {};
668
- head: {};
669
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
670
- patch: {};
671
- options: {};
672
- get: {
673
- "/skus": import("@withtyped/server").PathGuard<"/", {
674
- type?: LogtoSkuType | undefined;
675
- }, unknown, {
676
- type: LogtoSkuType;
800
+ addOnRelations: {
801
+ tokenLimit: string;
802
+ };
803
+ }, {
677
804
  id: string;
678
- name: string | null;
805
+ createdAt: Date;
806
+ type: LogtoSkuType;
807
+ updatedAt: Date;
679
808
  quota: {
809
+ auditLogsRetentionDays?: number | null | undefined;
680
810
  mauLimit?: number | null | undefined;
681
- tokenLimit?: number | null | undefined;
682
811
  applicationsLimit?: number | null | undefined;
683
- machineToMachineLimit?: number | null | undefined;
684
- resourcesLimit?: number | null | undefined;
812
+ thirdPartyApplicationsLimit?: number | null | undefined;
685
813
  scopesPerResourceLimit?: number | null | undefined;
686
814
  socialConnectorsLimit?: number | null | undefined;
815
+ userRolesLimit?: number | null | undefined;
687
816
  machineToMachineRolesLimit?: number | null | undefined;
688
817
  scopesPerRoleLimit?: number | null | undefined;
689
818
  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
819
  customJwtEnabled?: boolean | undefined;
696
820
  subjectTokenEnabled?: boolean | undefined;
697
821
  bringYourUiEnabled?: boolean | undefined;
698
- userRolesLimit?: number | null | undefined;
822
+ tokenLimit?: number | null | undefined;
823
+ machineToMachineLimit?: number | null | undefined;
824
+ resourcesLimit?: number | null | undefined;
699
825
  enterpriseSsoLimit?: number | null | undefined;
826
+ tenantMembersLimit?: number | null | undefined;
827
+ mfaEnabled?: boolean | undefined;
828
+ organizationsEnabled?: boolean | undefined;
829
+ organizationsLimit?: number | null | undefined;
830
+ idpInitiatedSsoEnabled?: boolean | undefined;
700
831
  };
701
- createdAt: Date;
702
- updatedAt: Date;
703
- unitPrice: number | null;
704
- }[]>;
832
+ }>;
833
+ } & {
834
+ "/skus/:skuId/products": import("@withtyped/server").PathGuard<"/:skuId/products", {
835
+ isOneTime?: string | undefined;
836
+ }, {
837
+ name: string;
838
+ unitPrice: number;
839
+ }, {
840
+ productId: string;
841
+ }>;
705
842
  };
706
- post: {};
707
843
  put: {};
708
- delete: {};
844
+ delete: {
845
+ "/skus/:skuId": import("@withtyped/server").PathGuard<"/:skuId", unknown, unknown, unknown>;
846
+ };
709
847
  copy: {};
710
848
  head: {};
711
849
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
@@ -719,13 +857,12 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
719
857
  status: "open" | "complete" | "expired";
720
858
  tenantId: string | null;
721
859
  updatedAt: Date;
722
- planId: string;
723
860
  skuId: string | null;
861
+ planId: string | null;
724
862
  }>;
725
863
  };
726
864
  post: {
727
865
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
728
- planId: string;
729
866
  successCallbackUrl: string;
730
867
  tenantId?: string | undefined;
731
868
  skuId?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-a6cff75",
3
+ "version": "0.2.5-aac51e9",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -29,8 +29,8 @@
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": "^2.0.0"
32
+ "vite-tsconfig-paths": "^5.0.0",
33
+ "vitest": "^2.1.8"
34
34
  },
35
35
  "engines": {
36
36
  "node": "^20.9.0"
@@ -49,8 +49,8 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@silverhand/essentials": "^2.9.1",
53
- "@withtyped/server": "^0.13.6"
52
+ "@silverhand/essentials": "^2.9.2",
53
+ "@withtyped/server": "^0.14.0"
54
54
  },
55
55
  "scripts": {
56
56
  "precommit": "lint-staged",