@logto/cloud 0.2.5-632268d → 0.2.5-6654b82

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 +237 -24
  2. package/package.json +3 -3
@@ -69,6 +69,19 @@ declare enum TenantRole {
69
69
  /** Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
70
70
  Collaborator = "collaborator"
71
71
  }
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">;
72
85
  declare enum LogtoSkuType {
73
86
  Basic = "Basic",
74
87
  AddOn = "AddOn"
@@ -88,7 +101,8 @@ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default
88
101
  export type Affiliate = InferModelType<typeof Affiliates>;
89
102
  declare enum RegionName {
90
103
  EU = "EU",
91
- US = "US"
104
+ US = "US",
105
+ AU = "AU"
92
106
  }
93
107
  export type AffiliateData = Affiliate & {
94
108
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
@@ -119,10 +133,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
119
133
  }, {
120
134
  id: string;
121
135
  name: string;
136
+ quota: {
137
+ mauLimit: number | null;
138
+ tokenLimit: number | null;
139
+ };
122
140
  createdAt: Date;
123
141
  usage: {
124
142
  activeUsers: number;
125
- cost: number;
126
143
  tokenUsage: number;
127
144
  };
128
145
  indicator: string;
@@ -133,6 +150,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
133
150
  planId: string;
134
151
  currentPeriodStart: Date;
135
152
  currentPeriodEnd: Date;
153
+ isEnterprisePlan: boolean;
136
154
  id?: string | undefined;
137
155
  upcomingInvoice?: {
138
156
  subtotal: number;
@@ -141,7 +159,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
141
159
  totalExcludingTax: number | null;
142
160
  } | null | undefined;
143
161
  isAddOnAvailable?: boolean | undefined;
144
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
145
162
  };
146
163
  regionName: RegionName;
147
164
  tag: TenantTag;
@@ -167,10 +184,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
167
184
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
168
185
  id: string;
169
186
  name: string;
187
+ quota: {
188
+ mauLimit: number | null;
189
+ tokenLimit: number | null;
190
+ };
170
191
  createdAt: Date;
171
192
  usage: {
172
193
  activeUsers: number;
173
- cost: number;
174
194
  tokenUsage: number;
175
195
  };
176
196
  indicator: string;
@@ -181,6 +201,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
181
201
  planId: string;
182
202
  currentPeriodStart: Date;
183
203
  currentPeriodEnd: Date;
204
+ isEnterprisePlan: boolean;
184
205
  id?: string | undefined;
185
206
  upcomingInvoice?: {
186
207
  subtotal: number;
@@ -189,7 +210,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
189
210
  totalExcludingTax: number | null;
190
211
  } | null | undefined;
191
212
  isAddOnAvailable?: boolean | undefined;
192
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
193
213
  };
194
214
  regionName: RegionName;
195
215
  tag: TenantTag;
@@ -218,10 +238,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
218
238
  }, {
219
239
  id: string;
220
240
  name: string;
241
+ quota: {
242
+ mauLimit: number | null;
243
+ tokenLimit: number | null;
244
+ };
221
245
  createdAt: Date;
222
246
  usage: {
223
247
  activeUsers: number;
224
- cost: number;
225
248
  tokenUsage: number;
226
249
  };
227
250
  indicator: string;
@@ -232,6 +255,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
232
255
  planId: string;
233
256
  currentPeriodStart: Date;
234
257
  currentPeriodEnd: Date;
258
+ isEnterprisePlan: boolean;
235
259
  id?: string | undefined;
236
260
  upcomingInvoice?: {
237
261
  subtotal: number;
@@ -240,7 +264,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
240
264
  totalExcludingTax: number | null;
241
265
  } | null | undefined;
242
266
  isAddOnAvailable?: boolean | undefined;
243
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
244
267
  };
245
268
  regionName: RegionName;
246
269
  tag: TenantTag;
@@ -276,6 +299,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
276
299
  planId: string;
277
300
  currentPeriodStart: Date;
278
301
  currentPeriodEnd: Date;
302
+ isEnterprisePlan: boolean;
279
303
  id?: string | undefined;
280
304
  upcomingInvoice?: {
281
305
  subtotal: number;
@@ -284,7 +308,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
284
308
  totalExcludingTax: number | null;
285
309
  } | null | undefined;
286
310
  isAddOnAvailable?: boolean | undefined;
287
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
288
311
  }>;
289
312
  } & {
290
313
  "/tenants/my/subscription/quota": import("@withtyped/server").PathGuard<"/my/subscription/quota", unknown, unknown, {
@@ -308,11 +331,10 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
308
331
  bringYourUiEnabled: boolean;
309
332
  userRolesLimit: number | null;
310
333
  enterpriseSsoLimit: number | null;
334
+ organizationsLimit: number | null;
311
335
  }>;
312
336
  } & {
313
337
  "/tenants/my/subscription/usage": import("@withtyped/server").PathGuard<"/my/subscription/usage", unknown, unknown, {
314
- mauLimit: number;
315
- tokenLimit: number;
316
338
  applicationsLimit: number;
317
339
  machineToMachineLimit: number;
318
340
  resourcesLimit: number;
@@ -330,17 +352,95 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
330
352
  bringYourUiEnabled: boolean;
331
353
  userRolesLimit: number;
332
354
  enterpriseSsoLimit: number;
355
+ organizationsLimit: number;
333
356
  }>;
334
357
  } & {
335
358
  "/tenants/my/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/my/subscription/usage/:entityName/scopes", {
336
359
  entityId?: string | undefined;
337
360
  }, unknown, Record<string, number>>;
361
+ } & {
362
+ "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
363
+ usage: {
364
+ applicationsLimit: number;
365
+ machineToMachineLimit: number;
366
+ resourcesLimit: number;
367
+ scopesPerResourceLimit: number;
368
+ socialConnectorsLimit: number;
369
+ machineToMachineRolesLimit: number;
370
+ scopesPerRoleLimit: number;
371
+ hooksLimit: number;
372
+ mfaEnabled: boolean;
373
+ organizationsEnabled: boolean;
374
+ thirdPartyApplicationsLimit: number;
375
+ tenantMembersLimit: number;
376
+ customJwtEnabled: boolean;
377
+ subjectTokenEnabled: boolean;
378
+ bringYourUiEnabled: boolean;
379
+ userRolesLimit: number;
380
+ enterpriseSsoLimit: number;
381
+ organizationsLimit: number;
382
+ };
383
+ resources: Record<string, number>;
384
+ roles: Record<string, number>;
385
+ quota: {
386
+ mauLimit: number | null;
387
+ tokenLimit: number | null;
388
+ applicationsLimit: number | null;
389
+ machineToMachineLimit: number | null;
390
+ resourcesLimit: number | null;
391
+ scopesPerResourceLimit: number | null;
392
+ socialConnectorsLimit: number | null;
393
+ machineToMachineRolesLimit: number | null;
394
+ scopesPerRoleLimit: number | null;
395
+ hooksLimit: number | null;
396
+ auditLogsRetentionDays: number | null;
397
+ mfaEnabled: boolean;
398
+ organizationsEnabled: boolean;
399
+ thirdPartyApplicationsLimit: number | null;
400
+ tenantMembersLimit: number | null;
401
+ customJwtEnabled: boolean;
402
+ subjectTokenEnabled: boolean;
403
+ bringYourUiEnabled: boolean;
404
+ userRolesLimit: number | null;
405
+ enterpriseSsoLimit: number | null;
406
+ organizationsLimit: number | null;
407
+ };
408
+ basicQuota: {
409
+ mauLimit: number | null;
410
+ tokenLimit: number | null;
411
+ applicationsLimit: number | null;
412
+ machineToMachineLimit: number | null;
413
+ resourcesLimit: number | null;
414
+ scopesPerResourceLimit: number | null;
415
+ socialConnectorsLimit: number | null;
416
+ machineToMachineRolesLimit: number | null;
417
+ scopesPerRoleLimit: number | null;
418
+ hooksLimit: number | null;
419
+ auditLogsRetentionDays: number | null;
420
+ mfaEnabled: boolean;
421
+ organizationsEnabled: boolean;
422
+ thirdPartyApplicationsLimit: number | null;
423
+ tenantMembersLimit: number | null;
424
+ customJwtEnabled: boolean;
425
+ subjectTokenEnabled: boolean;
426
+ bringYourUiEnabled: boolean;
427
+ userRolesLimit: number | null;
428
+ enterpriseSsoLimit: number | null;
429
+ organizationsLimit: number | null;
430
+ };
431
+ }>;
432
+ } & {
433
+ "/tenants/my/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/my/subscription/periodic-usage", unknown, unknown, {
434
+ mauLimit: number;
435
+ tokenLimit: number;
436
+ }>;
338
437
  } & {
339
438
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
340
439
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
341
440
  planId: string;
342
441
  currentPeriodStart: Date;
343
442
  currentPeriodEnd: Date;
443
+ isEnterprisePlan: boolean;
344
444
  id?: string | undefined;
345
445
  upcomingInvoice?: {
346
446
  subtotal: number;
@@ -349,7 +449,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
349
449
  totalExcludingTax: number | null;
350
450
  } | null | undefined;
351
451
  isAddOnAvailable?: boolean | undefined;
352
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
353
452
  }>;
354
453
  } & {
355
454
  "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
@@ -373,11 +472,10 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
373
472
  bringYourUiEnabled: boolean;
374
473
  userRolesLimit: number | null;
375
474
  enterpriseSsoLimit: number | null;
475
+ organizationsLimit: number | null;
376
476
  }>;
377
477
  } & {
378
478
  "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
379
- mauLimit: number;
380
- tokenLimit: number;
381
479
  applicationsLimit: number;
382
480
  machineToMachineLimit: number;
383
481
  resourcesLimit: number;
@@ -395,6 +493,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
395
493
  bringYourUiEnabled: boolean;
396
494
  userRolesLimit: number;
397
495
  enterpriseSsoLimit: number;
496
+ organizationsLimit: number;
398
497
  }>;
399
498
  } & {
400
499
  "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
@@ -403,8 +502,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
403
502
  } & {
404
503
  "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
405
504
  usage: {
406
- mauLimit: number;
407
- tokenLimit: number;
408
505
  applicationsLimit: number;
409
506
  machineToMachineLimit: number;
410
507
  resourcesLimit: number;
@@ -422,6 +519,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
422
519
  bringYourUiEnabled: boolean;
423
520
  userRolesLimit: number;
424
521
  enterpriseSsoLimit: number;
522
+ organizationsLimit: number;
425
523
  };
426
524
  resources: Record<string, number>;
427
525
  roles: Record<string, number>;
@@ -446,7 +544,36 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
446
544
  bringYourUiEnabled: boolean;
447
545
  userRolesLimit: number | null;
448
546
  enterpriseSsoLimit: number | null;
547
+ organizationsLimit: number | null;
449
548
  };
549
+ basicQuota: {
550
+ mauLimit: number | null;
551
+ tokenLimit: number | null;
552
+ applicationsLimit: number | null;
553
+ machineToMachineLimit: number | null;
554
+ resourcesLimit: number | null;
555
+ scopesPerResourceLimit: number | null;
556
+ socialConnectorsLimit: number | null;
557
+ machineToMachineRolesLimit: number | null;
558
+ scopesPerRoleLimit: number | null;
559
+ hooksLimit: number | null;
560
+ auditLogsRetentionDays: number | null;
561
+ mfaEnabled: boolean;
562
+ organizationsEnabled: boolean;
563
+ thirdPartyApplicationsLimit: number | null;
564
+ tenantMembersLimit: number | null;
565
+ customJwtEnabled: boolean;
566
+ subjectTokenEnabled: boolean;
567
+ bringYourUiEnabled: boolean;
568
+ userRolesLimit: number | null;
569
+ enterpriseSsoLimit: number | null;
570
+ organizationsLimit: number | null;
571
+ };
572
+ }>;
573
+ } & {
574
+ "/tenants/:tenantId/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/periodic-usage", unknown, unknown, {
575
+ mauLimit: number;
576
+ tokenLimit: number;
450
577
  }>;
451
578
  } & {
452
579
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
@@ -472,16 +599,10 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
472
599
  "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
473
600
  hostedInvoiceUrl: string;
474
601
  }>;
475
- } & {
476
- "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
477
- activeUsers: number;
478
- cost: number;
479
- tokenUsage: number;
480
- }>;
481
602
  };
482
603
  post: {
483
604
  "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
484
- usageKey: "tokenLimit" | "machineToMachineLimit" | "resourcesLimit" | "enterpriseSsoLimit" | "hooksLimit" | "tenantMembersLimit" | "mfaEnabled" | "organizationsEnabled";
605
+ usageKey: RealtimeReportableUsageKey;
485
606
  }, {
486
607
  message: string;
487
608
  }>;
@@ -652,15 +773,107 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
652
773
  bringYourUiEnabled?: boolean | undefined;
653
774
  userRolesLimit?: number | null | undefined;
654
775
  enterpriseSsoLimit?: number | null | undefined;
776
+ organizationsLimit?: number | null | undefined;
655
777
  };
656
778
  createdAt: Date;
657
779
  updatedAt: Date;
658
780
  unitPrice: number | null;
659
781
  }[]>;
660
782
  };
661
- post: {};
783
+ post: {
784
+ "/skus": import("@withtyped/server").PathGuard<"/", unknown, {
785
+ type: LogtoSkuType.AddOn;
786
+ quota: {
787
+ tokenLimit?: number | null | undefined;
788
+ machineToMachineLimit?: number | null | undefined;
789
+ resourcesLimit?: number | null | undefined;
790
+ enterpriseSsoLimit?: number | null | undefined;
791
+ hooksLimit?: number | null | undefined;
792
+ tenantMembersLimit?: number | null | undefined;
793
+ mfaEnabled?: boolean | undefined;
794
+ organizationsEnabled?: boolean | undefined;
795
+ organizationsLimit?: number | null | undefined;
796
+ mauLimit?: number | null | undefined;
797
+ applicationsLimit?: number | null | undefined;
798
+ scopesPerResourceLimit?: number | null | undefined;
799
+ socialConnectorsLimit?: number | null | undefined;
800
+ machineToMachineRolesLimit?: number | null | undefined;
801
+ scopesPerRoleLimit?: number | null | undefined;
802
+ auditLogsRetentionDays?: number | null | undefined;
803
+ thirdPartyApplicationsLimit?: number | null | undefined;
804
+ customJwtEnabled?: boolean | undefined;
805
+ subjectTokenEnabled?: boolean | undefined;
806
+ bringYourUiEnabled?: boolean | undefined;
807
+ userRolesLimit?: number | null | undefined;
808
+ };
809
+ } | {
810
+ type: LogtoSkuType.Basic;
811
+ quota: {
812
+ mauLimit: number | null;
813
+ tokenLimit: number | null;
814
+ applicationsLimit: number | null;
815
+ machineToMachineLimit: number | null;
816
+ resourcesLimit: number | null;
817
+ scopesPerResourceLimit: number | null;
818
+ socialConnectorsLimit: number | null;
819
+ machineToMachineRolesLimit: number | null;
820
+ scopesPerRoleLimit: number | null;
821
+ hooksLimit: number | null;
822
+ auditLogsRetentionDays: number | null;
823
+ mfaEnabled: boolean;
824
+ organizationsEnabled: boolean;
825
+ thirdPartyApplicationsLimit: number | null;
826
+ tenantMembersLimit: number | null;
827
+ customJwtEnabled: boolean;
828
+ subjectTokenEnabled: boolean;
829
+ bringYourUiEnabled: boolean;
830
+ userRolesLimit: number | null;
831
+ enterpriseSsoLimit: number | null;
832
+ organizationsLimit: number | null;
833
+ };
834
+ }, {
835
+ id: string;
836
+ createdAt: Date;
837
+ type: LogtoSkuType;
838
+ updatedAt: Date;
839
+ quota: {
840
+ mauLimit?: number | null | undefined;
841
+ tokenLimit?: number | null | undefined;
842
+ applicationsLimit?: number | null | undefined;
843
+ machineToMachineLimit?: number | null | undefined;
844
+ resourcesLimit?: number | null | undefined;
845
+ scopesPerResourceLimit?: number | null | undefined;
846
+ socialConnectorsLimit?: number | null | undefined;
847
+ machineToMachineRolesLimit?: number | null | undefined;
848
+ scopesPerRoleLimit?: number | null | undefined;
849
+ hooksLimit?: number | null | undefined;
850
+ auditLogsRetentionDays?: number | null | undefined;
851
+ mfaEnabled?: boolean | undefined;
852
+ organizationsEnabled?: boolean | undefined;
853
+ thirdPartyApplicationsLimit?: number | null | undefined;
854
+ tenantMembersLimit?: number | null | undefined;
855
+ customJwtEnabled?: boolean | undefined;
856
+ subjectTokenEnabled?: boolean | undefined;
857
+ bringYourUiEnabled?: boolean | undefined;
858
+ userRolesLimit?: number | null | undefined;
859
+ enterpriseSsoLimit?: number | null | undefined;
860
+ organizationsLimit?: number | null | undefined;
861
+ };
862
+ }>;
863
+ } & {
864
+ "/skus/:skuId/products": import("@withtyped/server").PathGuard<"/:skuId/products", {
865
+ isOneTime?: string | undefined;
866
+ }, {
867
+ name: string;
868
+ unitPrice: number;
869
+ }, {
870
+ productId: string;
871
+ }>;
872
+ };
662
873
  put: {};
663
- delete: {};
874
+ delete: {
875
+ "/skus/:skuId": import("@withtyped/server").PathGuard<"/:skuId", unknown, unknown, unknown>;
876
+ };
664
877
  copy: {};
665
878
  head: {};
666
879
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-632268d",
3
+ "version": "0.2.5-6654b82",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -29,7 +29,7 @@
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",
32
+ "vite-tsconfig-paths": "^5.0.0",
33
33
  "vitest": "^2.0.0"
34
34
  },
35
35
  "engines": {
@@ -50,7 +50,7 @@
50
50
  },
51
51
  "dependencies": {
52
52
  "@silverhand/essentials": "^2.9.1",
53
- "@withtyped/server": "^0.13.6"
53
+ "@withtyped/server": "^0.14.0"
54
54
  },
55
55
  "scripts": {
56
56
  "precommit": "lint-staged",