@logto/cloud 0.2.5-61f7709 → 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 +412 -261
  2. package/package.json +7 -7
@@ -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,10 +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 enum LogtoSkuType {
73
- Basic = "Basic",
74
- AddOn = "AddOn"
75
- }
76
77
  declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
77
78
  createdAt: Date;
78
79
  affiliateId: string;
@@ -86,10 +87,22 @@ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default
86
87
  id: string;
87
88
  }, "id" | "createdAt", "id" | "createdAt">;
88
89
  export type Affiliate = InferModelType<typeof Affiliates>;
89
- declare enum RegionName {
90
- EU = "EU",
91
- US = "US"
92
- }
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
+ };
93
106
  export type AffiliateData = Affiliate & {
94
107
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
95
108
  };
@@ -119,12 +132,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
119
132
  }, {
120
133
  id: string;
121
134
  name: string;
135
+ createdAt: Date;
122
136
  quota: {
123
137
  mauLimit: number | null;
138
+ tokenLimit: number | null;
124
139
  };
125
- createdAt: Date;
126
140
  usage: {
127
141
  activeUsers: number;
142
+ tokenUsage: number;
128
143
  };
129
144
  indicator: string;
130
145
  isSuspended: boolean;
@@ -134,6 +149,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
134
149
  planId: string;
135
150
  currentPeriodStart: Date;
136
151
  currentPeriodEnd: Date;
152
+ isEnterprisePlan: boolean;
137
153
  id?: string | undefined;
138
154
  upcomingInvoice?: {
139
155
  subtotal: number;
@@ -141,15 +157,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
141
157
  total: number;
142
158
  totalExcludingTax: number | null;
143
159
  } | null | undefined;
144
- isAddOnAvailable?: boolean | undefined;
145
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
146
160
  };
147
- regionName: RegionName;
161
+ regionName: string;
148
162
  tag: TenantTag;
149
163
  openInvoices: {
150
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
151
164
  id: string;
152
165
  createdAt: Date;
166
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
153
167
  updatedAt: Date;
154
168
  customerId: string | null;
155
169
  billingReason: string | null;
@@ -157,6 +171,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
157
171
  periodEnd: Date;
158
172
  amountDue: number;
159
173
  amountPaid: number;
174
+ basicSkuId: string | null;
160
175
  subscriptionId: string | null;
161
176
  hostedInvoiceUrl: string | null;
162
177
  invoicePdf: string | null;
@@ -168,12 +183,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
168
183
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
169
184
  id: string;
170
185
  name: string;
186
+ createdAt: Date;
171
187
  quota: {
172
188
  mauLimit: number | null;
189
+ tokenLimit: number | null;
173
190
  };
174
- createdAt: Date;
175
191
  usage: {
176
192
  activeUsers: number;
193
+ tokenUsage: number;
177
194
  };
178
195
  indicator: string;
179
196
  isSuspended: boolean;
@@ -183,6 +200,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
183
200
  planId: string;
184
201
  currentPeriodStart: Date;
185
202
  currentPeriodEnd: Date;
203
+ isEnterprisePlan: boolean;
186
204
  id?: string | undefined;
187
205
  upcomingInvoice?: {
188
206
  subtotal: number;
@@ -190,15 +208,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
190
208
  total: number;
191
209
  totalExcludingTax: number | null;
192
210
  } | null | undefined;
193
- isAddOnAvailable?: boolean | undefined;
194
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
195
211
  };
196
- regionName: RegionName;
212
+ regionName: string;
197
213
  tag: TenantTag;
198
214
  openInvoices: {
199
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
200
215
  id: string;
201
216
  createdAt: Date;
217
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
202
218
  updatedAt: Date;
203
219
  customerId: string | null;
204
220
  billingReason: string | null;
@@ -206,6 +222,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
206
222
  periodEnd: Date;
207
223
  amountDue: number;
208
224
  amountPaid: number;
225
+ basicSkuId: string | null;
209
226
  subscriptionId: string | null;
210
227
  hostedInvoiceUrl: string | null;
211
228
  invoicePdf: string | null;
@@ -214,18 +231,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
214
231
  };
215
232
  post: {
216
233
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
234
+ id?: string | undefined;
217
235
  name?: string | undefined;
218
236
  tag?: TenantTag | undefined;
219
- regionName?: RegionName | undefined;
237
+ regionName?: string | undefined;
220
238
  }, {
221
239
  id: string;
222
240
  name: string;
241
+ createdAt: Date;
223
242
  quota: {
224
243
  mauLimit: number | null;
244
+ tokenLimit: number | null;
225
245
  };
226
- createdAt: Date;
227
246
  usage: {
228
247
  activeUsers: number;
248
+ tokenUsage: number;
229
249
  };
230
250
  indicator: string;
231
251
  isSuspended: boolean;
@@ -235,6 +255,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
235
255
  planId: string;
236
256
  currentPeriodStart: Date;
237
257
  currentPeriodEnd: Date;
258
+ isEnterprisePlan: boolean;
238
259
  id?: string | undefined;
239
260
  upcomingInvoice?: {
240
261
  subtotal: number;
@@ -242,15 +263,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
242
263
  total: number;
243
264
  totalExcludingTax: number | null;
244
265
  } | null | undefined;
245
- isAddOnAvailable?: boolean | undefined;
246
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
247
266
  };
248
- regionName: RegionName;
267
+ regionName: string;
249
268
  tag: TenantTag;
250
269
  openInvoices: {
251
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
252
270
  id: string;
253
271
  createdAt: Date;
272
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
254
273
  updatedAt: Date;
255
274
  customerId: string | null;
256
275
  billingReason: string | null;
@@ -258,6 +277,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
258
277
  periodEnd: Date;
259
278
  amountDue: number;
260
279
  amountPaid: number;
280
+ basicSkuId: string | null;
261
281
  subscriptionId: string | null;
262
282
  hostedInvoiceUrl: string | null;
263
283
  invoicePdf: string | null;
@@ -276,9 +296,36 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
276
296
  get: {
277
297
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
278
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
+ };
279
325
  planId: string;
280
326
  currentPeriodStart: Date;
281
327
  currentPeriodEnd: Date;
328
+ isEnterprisePlan: boolean;
282
329
  id?: string | undefined;
283
330
  upcomingInvoice?: {
284
331
  subtotal: number;
@@ -286,118 +333,109 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
286
333
  total: number;
287
334
  totalExcludingTax: number | null;
288
335
  } | 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
336
  }>;
337
- } & {
338
- "/tenants/my/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/my/subscription/usage/:entityName/scopes", {
339
- entityId?: string | undefined;
340
- }, unknown, Record<string, number>>;
341
337
  } & {
342
338
  "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
343
339
  usage: {
344
- mauLimit: number;
345
- tokenLimit: number;
346
340
  applicationsLimit: number;
347
- machineToMachineLimit: number;
348
- resourcesLimit: number;
341
+ thirdPartyApplicationsLimit: number;
349
342
  scopesPerResourceLimit: number;
350
343
  socialConnectorsLimit: number;
344
+ userRolesLimit: number;
351
345
  machineToMachineRolesLimit: number;
352
346
  scopesPerRoleLimit: number;
353
347
  hooksLimit: number;
354
- mfaEnabled: boolean;
355
- organizationsEnabled: boolean;
356
- thirdPartyApplicationsLimit: number;
357
- tenantMembersLimit: number;
358
348
  customJwtEnabled: boolean;
359
349
  subjectTokenEnabled: boolean;
360
350
  bringYourUiEnabled: boolean;
361
- userRolesLimit: number;
351
+ machineToMachineLimit: number;
352
+ resourcesLimit: number;
362
353
  enterpriseSsoLimit: number;
354
+ tenantMembersLimit: number;
355
+ mfaEnabled: boolean;
356
+ organizationsEnabled: boolean;
357
+ organizationsLimit: number;
358
+ idpInitiatedSsoEnabled: boolean;
359
+ samlApplicationsLimit: number;
360
+ captchaEnabled: boolean;
363
361
  };
364
362
  resources: Record<string, number>;
365
363
  roles: Record<string, number>;
366
364
  quota: {
365
+ auditLogsRetentionDays: number | null;
367
366
  mauLimit: number | null;
368
- tokenLimit: number | null;
369
367
  applicationsLimit: number | null;
370
- machineToMachineLimit: number | null;
371
- resourcesLimit: number | null;
368
+ thirdPartyApplicationsLimit: number | null;
372
369
  scopesPerResourceLimit: number | null;
373
370
  socialConnectorsLimit: number | null;
371
+ userRolesLimit: number | null;
374
372
  machineToMachineRolesLimit: number | null;
375
373
  scopesPerRoleLimit: number | null;
376
374
  hooksLimit: number | null;
377
- auditLogsRetentionDays: number | null;
375
+ customJwtEnabled: boolean;
376
+ subjectTokenEnabled: boolean;
377
+ bringYourUiEnabled: boolean;
378
+ tokenLimit: number | null;
379
+ machineToMachineLimit: number | null;
380
+ resourcesLimit: number | null;
381
+ enterpriseSsoLimit: number | null;
382
+ tenantMembersLimit: number | null;
378
383
  mfaEnabled: boolean;
379
384
  organizationsEnabled: boolean;
385
+ organizationsLimit: number | null;
386
+ idpInitiatedSsoEnabled: boolean;
387
+ samlApplicationsLimit: number | null;
388
+ captchaEnabled: 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;
413
+ samlApplicationsLimit: number | null;
414
+ captchaEnabled: boolean;
387
415
  };
388
- upcomingInvoice?: {
389
- subtotal: number;
390
- subtotalExcludingTax: number | null;
391
- total: number;
392
- totalExcludingTax: number | null;
393
- } | null | undefined;
394
416
  }>;
395
- } & {
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: {
396
433
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
397
434
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
398
435
  planId: string;
399
436
  currentPeriodStart: Date;
400
437
  currentPeriodEnd: Date;
438
+ isEnterprisePlan: boolean;
401
439
  id?: string | undefined;
402
440
  upcomingInvoice?: {
403
441
  subtotal: number;
@@ -405,118 +443,137 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
405
443
  total: number;
406
444
  totalExcludingTax: number | null;
407
445
  } | null | undefined;
408
- isAddOnAvailable?: boolean | undefined;
409
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
410
- }>;
411
- } & {
412
- "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
413
- mauLimit: number | null;
414
- tokenLimit: number | null;
415
- applicationsLimit: number | null;
416
- machineToMachineLimit: number | null;
417
- resourcesLimit: number | null;
418
- scopesPerResourceLimit: number | null;
419
- socialConnectorsLimit: number | null;
420
- machineToMachineRolesLimit: number | null;
421
- scopesPerRoleLimit: number | null;
422
- hooksLimit: number | null;
423
- auditLogsRetentionDays: number | null;
424
- mfaEnabled: boolean;
425
- organizationsEnabled: boolean;
426
- thirdPartyApplicationsLimit: number | null;
427
- tenantMembersLimit: number | null;
428
- customJwtEnabled: boolean;
429
- subjectTokenEnabled: boolean;
430
- bringYourUiEnabled: boolean;
431
- userRolesLimit: number | null;
432
- enterpriseSsoLimit: number | null;
433
- }>;
434
- } & {
435
- "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
436
- mauLimit: number;
437
- tokenLimit: number;
438
- applicationsLimit: number;
439
- machineToMachineLimit: number;
440
- resourcesLimit: number;
441
- scopesPerResourceLimit: number;
442
- socialConnectorsLimit: number;
443
- machineToMachineRolesLimit: number;
444
- scopesPerRoleLimit: number;
445
- hooksLimit: number;
446
- mfaEnabled: boolean;
447
- organizationsEnabled: boolean;
448
- thirdPartyApplicationsLimit: number;
449
- tenantMembersLimit: number;
450
- customJwtEnabled: boolean;
451
- subjectTokenEnabled: boolean;
452
- bringYourUiEnabled: boolean;
453
- userRolesLimit: number;
454
- enterpriseSsoLimit: number;
455
446
  }>;
456
- } & {
457
- "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
458
- entityId?: string | undefined;
459
- }, unknown, Record<string, number>>;
460
447
  } & {
461
448
  "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
462
449
  usage: {
463
- mauLimit: number;
464
- tokenLimit: number;
465
450
  applicationsLimit: number;
466
- machineToMachineLimit: number;
467
- resourcesLimit: number;
451
+ thirdPartyApplicationsLimit: number;
468
452
  scopesPerResourceLimit: number;
469
453
  socialConnectorsLimit: number;
454
+ userRolesLimit: number;
470
455
  machineToMachineRolesLimit: number;
471
456
  scopesPerRoleLimit: number;
472
457
  hooksLimit: number;
473
- mfaEnabled: boolean;
474
- organizationsEnabled: boolean;
475
- thirdPartyApplicationsLimit: number;
476
- tenantMembersLimit: number;
477
458
  customJwtEnabled: boolean;
478
459
  subjectTokenEnabled: boolean;
479
460
  bringYourUiEnabled: boolean;
480
- userRolesLimit: number;
461
+ machineToMachineLimit: number;
462
+ resourcesLimit: number;
481
463
  enterpriseSsoLimit: number;
464
+ tenantMembersLimit: number;
465
+ mfaEnabled: boolean;
466
+ organizationsEnabled: boolean;
467
+ organizationsLimit: number;
468
+ idpInitiatedSsoEnabled: boolean;
469
+ samlApplicationsLimit: number;
470
+ captchaEnabled: boolean;
482
471
  };
483
472
  resources: Record<string, number>;
484
473
  roles: Record<string, number>;
485
474
  quota: {
475
+ auditLogsRetentionDays: number | null;
486
476
  mauLimit: number | null;
487
- tokenLimit: number | null;
488
477
  applicationsLimit: number | null;
489
- machineToMachineLimit: number | null;
490
- resourcesLimit: number | null;
478
+ thirdPartyApplicationsLimit: number | null;
491
479
  scopesPerResourceLimit: number | null;
492
480
  socialConnectorsLimit: number | null;
481
+ userRolesLimit: number | null;
493
482
  machineToMachineRolesLimit: number | null;
494
483
  scopesPerRoleLimit: number | null;
495
484
  hooksLimit: number | null;
496
- auditLogsRetentionDays: number | null;
485
+ customJwtEnabled: boolean;
486
+ subjectTokenEnabled: boolean;
487
+ bringYourUiEnabled: boolean;
488
+ tokenLimit: number | null;
489
+ machineToMachineLimit: number | null;
490
+ resourcesLimit: number | null;
491
+ enterpriseSsoLimit: number | null;
492
+ tenantMembersLimit: number | null;
497
493
  mfaEnabled: boolean;
498
494
  organizationsEnabled: boolean;
495
+ organizationsLimit: number | null;
496
+ idpInitiatedSsoEnabled: boolean;
497
+ samlApplicationsLimit: number | null;
498
+ captchaEnabled: boolean;
499
+ };
500
+ basicQuota: {
501
+ auditLogsRetentionDays: number | null;
502
+ mauLimit: number | null;
503
+ applicationsLimit: number | null;
499
504
  thirdPartyApplicationsLimit: number | null;
500
- tenantMembersLimit: number | null;
505
+ scopesPerResourceLimit: number | null;
506
+ socialConnectorsLimit: number | null;
507
+ userRolesLimit: number | null;
508
+ machineToMachineRolesLimit: number | null;
509
+ scopesPerRoleLimit: number | null;
510
+ hooksLimit: number | null;
501
511
  customJwtEnabled: boolean;
502
512
  subjectTokenEnabled: boolean;
503
513
  bringYourUiEnabled: boolean;
504
- userRolesLimit: number | null;
514
+ tokenLimit: number | null;
515
+ machineToMachineLimit: number | null;
516
+ resourcesLimit: number | null;
505
517
  enterpriseSsoLimit: number | null;
518
+ tenantMembersLimit: number | null;
519
+ mfaEnabled: boolean;
520
+ organizationsEnabled: boolean;
521
+ organizationsLimit: number | null;
522
+ idpInitiatedSsoEnabled: boolean;
523
+ samlApplicationsLimit: number | null;
524
+ captchaEnabled: boolean;
506
525
  };
507
- upcomingInvoice?: {
508
- subtotal: number;
509
- subtotalExcludingTax: number | null;
510
- total: number;
511
- totalExcludingTax: number | null;
512
- } | null | undefined;
526
+ }>;
527
+ } & {
528
+ "/tenants/:tenantId/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/periodic-usage", unknown, unknown, {
529
+ mauLimit: number;
530
+ tokenLimit: number;
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;
513
570
  }>;
514
571
  } & {
515
572
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
516
573
  invoices: {
517
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
518
574
  id: string;
519
575
  createdAt: Date;
576
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
520
577
  updatedAt: Date;
521
578
  customerId: string | null;
522
579
  billingReason: string | null;
@@ -524,6 +581,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
524
581
  periodEnd: Date;
525
582
  amountDue: number;
526
583
  amountPaid: number;
584
+ basicSkuId: string | null;
527
585
  subscriptionId: string | null;
528
586
  hostedInvoiceUrl: string | null;
529
587
  invoicePdf: string | null;
@@ -531,18 +589,51 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
531
589
  skuId?: string | null | undefined;
532
590
  }[];
533
591
  }>;
592
+ } & {
593
+ "/tenants/:tenantId/available-skus": import("@withtyped/server").PathGuard<"/:tenantId/available-skus", {
594
+ type?: LogtoSkuType | undefined;
595
+ }, unknown, {
596
+ id: string;
597
+ name: string | null;
598
+ createdAt: Date;
599
+ defaultPriceId: string | null;
600
+ unitPrice: number | null;
601
+ type: LogtoSkuType;
602
+ quota: {
603
+ auditLogsRetentionDays?: number | null | undefined;
604
+ mauLimit?: number | null | undefined;
605
+ applicationsLimit?: number | null | undefined;
606
+ thirdPartyApplicationsLimit?: number | null | undefined;
607
+ scopesPerResourceLimit?: number | null | undefined;
608
+ socialConnectorsLimit?: number | null | undefined;
609
+ userRolesLimit?: number | null | undefined;
610
+ machineToMachineRolesLimit?: number | null | undefined;
611
+ scopesPerRoleLimit?: number | null | undefined;
612
+ hooksLimit?: number | null | undefined;
613
+ customJwtEnabled?: boolean | undefined;
614
+ subjectTokenEnabled?: boolean | undefined;
615
+ bringYourUiEnabled?: boolean | undefined;
616
+ tokenLimit?: number | null | undefined;
617
+ machineToMachineLimit?: number | null | undefined;
618
+ resourcesLimit?: number | null | undefined;
619
+ enterpriseSsoLimit?: number | null | undefined;
620
+ tenantMembersLimit?: number | null | undefined;
621
+ mfaEnabled?: boolean | undefined;
622
+ organizationsEnabled?: boolean | undefined;
623
+ organizationsLimit?: number | null | undefined;
624
+ idpInitiatedSsoEnabled?: boolean | undefined;
625
+ samlApplicationsLimit?: number | null | undefined;
626
+ captchaEnabled?: boolean | undefined;
627
+ };
628
+ updatedAt: Date;
629
+ productId: string | null;
630
+ }[]>;
534
631
  } & {
535
632
  "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
536
633
  hostedInvoiceUrl: string;
537
634
  }>;
538
635
  };
539
636
  post: {
540
- "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
541
- usageKey: "tokenLimit" | "machineToMachineLimit" | "resourcesLimit" | "enterpriseSsoLimit" | "hooksLimit" | "tenantMembersLimit" | "mfaEnabled" | "organizationsEnabled";
542
- }, {
543
- message: string;
544
- }>;
545
- } & {
546
637
  "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
547
638
  callbackUrl?: string | undefined;
548
639
  }, {
@@ -568,11 +659,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
568
659
  post: {
569
660
  "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
570
661
  data: {
571
- type: TemplateType | VerificationCodeType;
662
+ type: TemplateType;
572
663
  payload: {
573
- code?: string | undefined;
574
664
  link?: string | undefined;
575
- } & Record<string, string> & {
665
+ code?: string | undefined;
666
+ locale?: string | undefined;
667
+ } & {
668
+ [k: string]: unknown;
669
+ } & {
576
670
  senderName?: string | undefined;
577
671
  companyInformation?: string | undefined;
578
672
  appLogo?: string | undefined;
@@ -583,27 +677,30 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
583
677
  } & {
584
678
  "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
585
679
  data: {
586
- type: TemplateType | VerificationCodeType;
680
+ type: TemplateType;
587
681
  to: string;
588
682
  payload: {
589
683
  code?: string | undefined;
590
684
  link?: string | undefined;
591
- } & Record<string, string>;
685
+ locale?: string | undefined;
686
+ } & {
687
+ [k: string]: unknown;
688
+ };
592
689
  };
593
690
  }, unknown>;
594
691
  } & {
595
692
  "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
596
693
  isTest?: string | undefined;
597
694
  }, {
695
+ token: Record<string, Json>;
598
696
  context: Record<string, Json>;
599
697
  script: string;
600
698
  tokenType: LogtoJwtTokenKeyType.AccessToken;
601
- token: Record<string, Json>;
602
699
  environmentVariables?: Record<string, string> | undefined;
603
700
  } | {
701
+ token: Record<string, Json>;
604
702
  script: string;
605
703
  tokenType: LogtoJwtTokenKeyType.ClientCredentials;
606
- token: Record<string, Json>;
607
704
  environmentVariables?: Record<string, string> | undefined;
608
705
  }, Record<string, unknown>>;
609
706
  };
@@ -628,96 +725,151 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
628
725
  patch: {};
629
726
  options: {};
630
727
  get: {
631
- "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
728
+ "/skus": import("@withtyped/server").PathGuard<"/", {
729
+ type?: LogtoSkuType | undefined;
730
+ }, unknown, {
632
731
  id: string;
732
+ name: string | null;
633
733
  createdAt: Date;
634
- name: string;
734
+ defaultPriceId: string | null;
735
+ unitPrice: number | null;
736
+ type: LogtoSkuType;
737
+ quota: {
738
+ auditLogsRetentionDays?: number | null | undefined;
739
+ mauLimit?: number | null | undefined;
740
+ applicationsLimit?: number | null | undefined;
741
+ thirdPartyApplicationsLimit?: number | null | undefined;
742
+ scopesPerResourceLimit?: number | null | undefined;
743
+ socialConnectorsLimit?: number | null | undefined;
744
+ userRolesLimit?: number | null | undefined;
745
+ machineToMachineRolesLimit?: number | null | undefined;
746
+ scopesPerRoleLimit?: number | null | undefined;
747
+ hooksLimit?: number | null | undefined;
748
+ customJwtEnabled?: boolean | undefined;
749
+ subjectTokenEnabled?: boolean | undefined;
750
+ bringYourUiEnabled?: boolean | undefined;
751
+ tokenLimit?: number | null | undefined;
752
+ machineToMachineLimit?: number | null | undefined;
753
+ resourcesLimit?: number | null | undefined;
754
+ enterpriseSsoLimit?: number | null | undefined;
755
+ tenantMembersLimit?: number | null | undefined;
756
+ mfaEnabled?: boolean | undefined;
757
+ organizationsEnabled?: boolean | undefined;
758
+ organizationsLimit?: number | null | undefined;
759
+ idpInitiatedSsoEnabled?: boolean | undefined;
760
+ samlApplicationsLimit?: number | null | undefined;
761
+ captchaEnabled?: boolean | undefined;
762
+ };
635
763
  updatedAt: Date;
764
+ productId: string | null;
765
+ }[]>;
766
+ };
767
+ post: {
768
+ "/skus": import("@withtyped/server").PathGuard<"/", unknown, {
769
+ type: LogtoSkuType.AddOn;
636
770
  quota: {
771
+ tokenLimit?: number | null | undefined;
772
+ machineToMachineLimit?: number | null | undefined;
773
+ resourcesLimit?: number | null | undefined;
774
+ enterpriseSsoLimit?: number | null | undefined;
775
+ hooksLimit?: number | null | undefined;
776
+ tenantMembersLimit?: number | null | undefined;
777
+ mfaEnabled?: boolean | undefined;
778
+ organizationsEnabled?: boolean | undefined;
779
+ organizationsLimit?: number | null | undefined;
780
+ auditLogsRetentionDays?: number | null | undefined;
781
+ mauLimit?: number | null | undefined;
782
+ applicationsLimit?: number | null | undefined;
783
+ thirdPartyApplicationsLimit?: number | null | undefined;
784
+ scopesPerResourceLimit?: number | null | undefined;
785
+ socialConnectorsLimit?: number | null | undefined;
786
+ userRolesLimit?: number | null | undefined;
787
+ machineToMachineRolesLimit?: number | null | undefined;
788
+ scopesPerRoleLimit?: number | null | undefined;
789
+ customJwtEnabled?: boolean | undefined;
790
+ subjectTokenEnabled?: boolean | undefined;
791
+ bringYourUiEnabled?: boolean | undefined;
792
+ idpInitiatedSsoEnabled?: boolean | undefined;
793
+ samlApplicationsLimit?: number | null | undefined;
794
+ captchaEnabled?: boolean | undefined;
795
+ };
796
+ } | {
797
+ type: LogtoSkuType.Basic;
798
+ quota: {
799
+ auditLogsRetentionDays: number | null;
637
800
  mauLimit: number | null;
638
- tokenLimit: number | null;
639
801
  applicationsLimit: number | null;
640
- machineToMachineLimit: number | null;
641
- resourcesLimit: number | null;
802
+ thirdPartyApplicationsLimit: number | null;
642
803
  scopesPerResourceLimit: number | null;
643
- customDomainEnabled: boolean;
644
- omniSignInEnabled: boolean;
645
- builtInEmailConnectorEnabled: boolean;
646
804
  socialConnectorsLimit: number | null;
647
- standardConnectorsLimit: number | null;
648
- rolesLimit: number | null;
805
+ userRolesLimit: number | null;
649
806
  machineToMachineRolesLimit: number | null;
650
807
  scopesPerRoleLimit: number | null;
651
808
  hooksLimit: number | null;
652
- auditLogsRetentionDays: number | null;
653
- mfaEnabled: boolean;
654
- organizationsEnabled: boolean;
655
- ssoEnabled: boolean;
656
- thirdPartyApplicationsLimit: number | null;
657
- tenantMembersLimit: number | null;
658
809
  customJwtEnabled: boolean;
659
810
  subjectTokenEnabled: boolean;
660
811
  bringYourUiEnabled: boolean;
812
+ tokenLimit: number | null;
813
+ machineToMachineLimit: number | null;
814
+ resourcesLimit: number | null;
815
+ enterpriseSsoLimit: number | null;
816
+ tenantMembersLimit: number | null;
817
+ mfaEnabled: boolean;
818
+ organizationsEnabled: boolean;
819
+ organizationsLimit: number | null;
820
+ idpInitiatedSsoEnabled: boolean;
821
+ samlApplicationsLimit: number | null;
822
+ captchaEnabled: boolean;
661
823
  };
662
- stripeProducts: {
663
- type: "flat" | "tier1" | "tier2" | "tier3";
664
- id: string;
665
- name: string;
666
- price: {
667
- id: string;
668
- unitAmountDecimal: string;
669
- quantity?: 1 | undefined;
670
- unitAmount?: number | null | undefined;
671
- };
672
- description?: string | undefined;
673
- }[];
674
- }[]>;
675
- };
676
- post: {};
677
- put: {};
678
- delete: {};
679
- copy: {};
680
- head: {};
681
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
682
- patch: {};
683
- options: {};
684
- get: {
685
- "/skus": import("@withtyped/server").PathGuard<"/", {
686
- type?: LogtoSkuType | undefined;
687
- }, unknown, {
688
- type: LogtoSkuType;
824
+ addOnRelations: {
825
+ tokenLimit: string;
826
+ };
827
+ }, {
689
828
  id: string;
690
- name: string | null;
829
+ createdAt: Date;
830
+ type: LogtoSkuType;
831
+ updatedAt: Date;
691
832
  quota: {
833
+ auditLogsRetentionDays?: number | null | undefined;
692
834
  mauLimit?: number | null | undefined;
693
- tokenLimit?: number | null | undefined;
694
835
  applicationsLimit?: number | null | undefined;
695
- machineToMachineLimit?: number | null | undefined;
696
- resourcesLimit?: number | null | undefined;
836
+ thirdPartyApplicationsLimit?: number | null | undefined;
697
837
  scopesPerResourceLimit?: number | null | undefined;
698
838
  socialConnectorsLimit?: number | null | undefined;
839
+ userRolesLimit?: number | null | undefined;
699
840
  machineToMachineRolesLimit?: number | null | undefined;
700
841
  scopesPerRoleLimit?: number | null | undefined;
701
842
  hooksLimit?: number | null | undefined;
702
- auditLogsRetentionDays?: number | null | undefined;
703
- mfaEnabled?: boolean | undefined;
704
- organizationsEnabled?: boolean | undefined;
705
- thirdPartyApplicationsLimit?: number | null | undefined;
706
- tenantMembersLimit?: number | null | undefined;
707
843
  customJwtEnabled?: boolean | undefined;
708
844
  subjectTokenEnabled?: boolean | undefined;
709
845
  bringYourUiEnabled?: boolean | undefined;
710
- userRolesLimit?: number | null | undefined;
846
+ tokenLimit?: number | null | undefined;
847
+ machineToMachineLimit?: number | null | undefined;
848
+ resourcesLimit?: number | null | undefined;
711
849
  enterpriseSsoLimit?: number | null | undefined;
850
+ tenantMembersLimit?: number | null | undefined;
851
+ mfaEnabled?: boolean | undefined;
852
+ organizationsEnabled?: boolean | undefined;
853
+ organizationsLimit?: number | null | undefined;
854
+ idpInitiatedSsoEnabled?: boolean | undefined;
855
+ samlApplicationsLimit?: number | null | undefined;
856
+ captchaEnabled?: boolean | undefined;
712
857
  };
713
- createdAt: Date;
714
- updatedAt: Date;
715
- unitPrice: number | null;
716
- }[]>;
858
+ }>;
859
+ } & {
860
+ "/skus/:skuId/products": import("@withtyped/server").PathGuard<"/:skuId/products", {
861
+ isOneTime?: string | undefined;
862
+ }, {
863
+ name: string;
864
+ unitPrice: number;
865
+ }, {
866
+ productId: string;
867
+ }>;
717
868
  };
718
- post: {};
719
869
  put: {};
720
- delete: {};
870
+ delete: {
871
+ "/skus/:skuId": import("@withtyped/server").PathGuard<"/:skuId", unknown, unknown, unknown>;
872
+ };
721
873
  copy: {};
722
874
  head: {};
723
875
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
@@ -731,19 +883,18 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
731
883
  status: "open" | "complete" | "expired";
732
884
  tenantId: string | null;
733
885
  updatedAt: Date;
734
- planId: string;
735
886
  skuId: string | null;
887
+ planId: string | null;
736
888
  }>;
737
889
  };
738
890
  post: {
739
891
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
740
- planId: string;
741
892
  successCallbackUrl: string;
742
893
  tenantId?: string | undefined;
743
894
  skuId?: string | undefined;
744
895
  tenantName?: string | undefined;
745
896
  tenantTag?: TenantTag | undefined;
746
- tenantRegionName?: RegionName | undefined;
897
+ tenantRegionName?: string | undefined;
747
898
  cancelCallbackUrl?: string | undefined;
748
899
  }, {
749
900
  sessionId: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-61f7709",
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",
@@ -29,11 +29,11 @@
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": "^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.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",