@logto/cloud 0.2.5-61f7709 → 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 +185 -29
  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">>;
@@ -121,10 +135,12 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
121
135
  name: string;
122
136
  quota: {
123
137
  mauLimit: number | null;
138
+ tokenLimit: number | null;
124
139
  };
125
140
  createdAt: Date;
126
141
  usage: {
127
142
  activeUsers: number;
143
+ tokenUsage: number;
128
144
  };
129
145
  indicator: string;
130
146
  isSuspended: boolean;
@@ -134,6 +150,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
134
150
  planId: string;
135
151
  currentPeriodStart: Date;
136
152
  currentPeriodEnd: Date;
153
+ isEnterprisePlan: boolean;
137
154
  id?: string | undefined;
138
155
  upcomingInvoice?: {
139
156
  subtotal: number;
@@ -142,7 +159,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
142
159
  totalExcludingTax: number | null;
143
160
  } | null | undefined;
144
161
  isAddOnAvailable?: boolean | undefined;
145
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
146
162
  };
147
163
  regionName: RegionName;
148
164
  tag: TenantTag;
@@ -170,10 +186,12 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
170
186
  name: string;
171
187
  quota: {
172
188
  mauLimit: number | null;
189
+ tokenLimit: number | null;
173
190
  };
174
191
  createdAt: Date;
175
192
  usage: {
176
193
  activeUsers: number;
194
+ tokenUsage: number;
177
195
  };
178
196
  indicator: string;
179
197
  isSuspended: boolean;
@@ -183,6 +201,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
183
201
  planId: string;
184
202
  currentPeriodStart: Date;
185
203
  currentPeriodEnd: Date;
204
+ isEnterprisePlan: boolean;
186
205
  id?: string | undefined;
187
206
  upcomingInvoice?: {
188
207
  subtotal: number;
@@ -191,7 +210,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
191
210
  totalExcludingTax: number | null;
192
211
  } | null | undefined;
193
212
  isAddOnAvailable?: boolean | undefined;
194
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
195
213
  };
196
214
  regionName: RegionName;
197
215
  tag: TenantTag;
@@ -222,10 +240,12 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
222
240
  name: string;
223
241
  quota: {
224
242
  mauLimit: number | null;
243
+ tokenLimit: number | null;
225
244
  };
226
245
  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;
@@ -243,7 +264,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
243
264
  totalExcludingTax: number | null;
244
265
  } | null | undefined;
245
266
  isAddOnAvailable?: boolean | undefined;
246
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
247
267
  };
248
268
  regionName: RegionName;
249
269
  tag: TenantTag;
@@ -279,6 +299,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
279
299
  planId: string;
280
300
  currentPeriodStart: Date;
281
301
  currentPeriodEnd: Date;
302
+ isEnterprisePlan: boolean;
282
303
  id?: string | undefined;
283
304
  upcomingInvoice?: {
284
305
  subtotal: number;
@@ -287,7 +308,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
287
308
  totalExcludingTax: number | null;
288
309
  } | null | undefined;
289
310
  isAddOnAvailable?: boolean | undefined;
290
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
291
311
  }>;
292
312
  } & {
293
313
  "/tenants/my/subscription/quota": import("@withtyped/server").PathGuard<"/my/subscription/quota", unknown, unknown, {
@@ -311,11 +331,10 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
311
331
  bringYourUiEnabled: boolean;
312
332
  userRolesLimit: number | null;
313
333
  enterpriseSsoLimit: number | null;
334
+ organizationsLimit: number | null;
314
335
  }>;
315
336
  } & {
316
337
  "/tenants/my/subscription/usage": import("@withtyped/server").PathGuard<"/my/subscription/usage", unknown, unknown, {
317
- mauLimit: number;
318
- tokenLimit: number;
319
338
  applicationsLimit: number;
320
339
  machineToMachineLimit: number;
321
340
  resourcesLimit: number;
@@ -333,6 +352,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
333
352
  bringYourUiEnabled: boolean;
334
353
  userRolesLimit: number;
335
354
  enterpriseSsoLimit: number;
355
+ organizationsLimit: number;
336
356
  }>;
337
357
  } & {
338
358
  "/tenants/my/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/my/subscription/usage/:entityName/scopes", {
@@ -341,8 +361,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
341
361
  } & {
342
362
  "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
343
363
  usage: {
344
- mauLimit: number;
345
- tokenLimit: number;
346
364
  applicationsLimit: number;
347
365
  machineToMachineLimit: number;
348
366
  resourcesLimit: number;
@@ -360,6 +378,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
360
378
  bringYourUiEnabled: boolean;
361
379
  userRolesLimit: number;
362
380
  enterpriseSsoLimit: number;
381
+ organizationsLimit: number;
363
382
  };
364
383
  resources: Record<string, number>;
365
384
  roles: Record<string, number>;
@@ -384,13 +403,36 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
384
403
  bringYourUiEnabled: boolean;
385
404
  userRolesLimit: number | null;
386
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;
387
430
  };
388
- upcomingInvoice?: {
389
- subtotal: number;
390
- subtotalExcludingTax: number | null;
391
- total: number;
392
- totalExcludingTax: number | null;
393
- } | null | undefined;
431
+ }>;
432
+ } & {
433
+ "/tenants/my/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/my/subscription/periodic-usage", unknown, unknown, {
434
+ mauLimit: number;
435
+ tokenLimit: number;
394
436
  }>;
395
437
  } & {
396
438
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
@@ -398,6 +440,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
398
440
  planId: string;
399
441
  currentPeriodStart: Date;
400
442
  currentPeriodEnd: Date;
443
+ isEnterprisePlan: boolean;
401
444
  id?: string | undefined;
402
445
  upcomingInvoice?: {
403
446
  subtotal: number;
@@ -406,7 +449,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
406
449
  totalExcludingTax: number | null;
407
450
  } | null | undefined;
408
451
  isAddOnAvailable?: boolean | undefined;
409
- isAddOnVisibleToLegacyUsers?: boolean | undefined;
410
452
  }>;
411
453
  } & {
412
454
  "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
@@ -430,11 +472,10 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
430
472
  bringYourUiEnabled: boolean;
431
473
  userRolesLimit: number | null;
432
474
  enterpriseSsoLimit: number | null;
475
+ organizationsLimit: number | null;
433
476
  }>;
434
477
  } & {
435
478
  "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
436
- mauLimit: number;
437
- tokenLimit: number;
438
479
  applicationsLimit: number;
439
480
  machineToMachineLimit: number;
440
481
  resourcesLimit: number;
@@ -452,6 +493,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
452
493
  bringYourUiEnabled: boolean;
453
494
  userRolesLimit: number;
454
495
  enterpriseSsoLimit: number;
496
+ organizationsLimit: number;
455
497
  }>;
456
498
  } & {
457
499
  "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
@@ -460,8 +502,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
460
502
  } & {
461
503
  "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
462
504
  usage: {
463
- mauLimit: number;
464
- tokenLimit: number;
465
505
  applicationsLimit: number;
466
506
  machineToMachineLimit: number;
467
507
  resourcesLimit: number;
@@ -479,6 +519,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
479
519
  bringYourUiEnabled: boolean;
480
520
  userRolesLimit: number;
481
521
  enterpriseSsoLimit: number;
522
+ organizationsLimit: number;
482
523
  };
483
524
  resources: Record<string, number>;
484
525
  roles: Record<string, number>;
@@ -503,13 +544,36 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
503
544
  bringYourUiEnabled: boolean;
504
545
  userRolesLimit: number | null;
505
546
  enterpriseSsoLimit: number | null;
547
+ organizationsLimit: number | null;
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;
506
571
  };
507
- upcomingInvoice?: {
508
- subtotal: number;
509
- subtotalExcludingTax: number | null;
510
- total: number;
511
- totalExcludingTax: number | null;
512
- } | null | undefined;
572
+ }>;
573
+ } & {
574
+ "/tenants/:tenantId/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/periodic-usage", unknown, unknown, {
575
+ mauLimit: number;
576
+ tokenLimit: number;
513
577
  }>;
514
578
  } & {
515
579
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
@@ -538,7 +602,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
538
602
  };
539
603
  post: {
540
604
  "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
541
- usageKey: "tokenLimit" | "machineToMachineLimit" | "resourcesLimit" | "enterpriseSsoLimit" | "hooksLimit" | "tenantMembersLimit" | "mfaEnabled" | "organizationsEnabled";
605
+ usageKey: RealtimeReportableUsageKey;
542
606
  }, {
543
607
  message: string;
544
608
  }>;
@@ -709,15 +773,107 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
709
773
  bringYourUiEnabled?: boolean | undefined;
710
774
  userRolesLimit?: number | null | undefined;
711
775
  enterpriseSsoLimit?: number | null | undefined;
776
+ organizationsLimit?: number | null | undefined;
712
777
  };
713
778
  createdAt: Date;
714
779
  updatedAt: Date;
715
780
  unitPrice: number | null;
716
781
  }[]>;
717
782
  };
718
- 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
+ };
719
873
  put: {};
720
- delete: {};
874
+ delete: {
875
+ "/skus/:skuId": import("@withtyped/server").PathGuard<"/:skuId", unknown, unknown, unknown>;
876
+ };
721
877
  copy: {};
722
878
  head: {};
723
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-61f7709",
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",