@logto/cloud 0.2.5-821690c → 0.2.5-923c26f

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 +238 -27
  2. package/package.json +7 -7
@@ -69,6 +69,10 @@ 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 enum LogtoSkuType {
73
+ Basic = "Basic",
74
+ AddOn = "AddOn"
75
+ }
72
76
  declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
73
77
  createdAt: Date;
74
78
  affiliateId: string;
@@ -82,11 +86,16 @@ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default
82
86
  id: string;
83
87
  }, "id" | "createdAt", "id" | "createdAt">;
84
88
  export type Affiliate = InferModelType<typeof Affiliates>;
89
+ declare enum RegionName {
90
+ EU = "EU",
91
+ US = "US"
92
+ }
85
93
  export type AffiliateData = Affiliate & {
86
94
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
87
95
  };
88
96
  declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
89
97
  request: {
98
+ id?: string | undefined;
90
99
  method?: import("@withtyped/server").RequestMethod | undefined;
91
100
  headers: import("http").IncomingHttpHeaders;
92
101
  url: URL;
@@ -94,6 +103,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
94
103
  };
95
104
  }, "request"> & {
96
105
  request: Record<string, unknown> & {
106
+ id?: string | undefined;
97
107
  method?: import("@withtyped/server").RequestMethod | undefined;
98
108
  headers: import("http").IncomingHttpHeaders;
99
109
  url: URL;
@@ -102,13 +112,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
102
112
  body?: Json | undefined;
103
113
  bodyRaw?: Buffer | undefined;
104
114
  };
105
- }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
115
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
106
116
  patch: {
107
117
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
108
118
  name?: string | undefined;
109
119
  }, {
110
120
  id: string;
111
121
  name: string;
122
+ createdAt: Date;
112
123
  usage: {
113
124
  activeUsers: number;
114
125
  cost: number;
@@ -122,7 +133,16 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
122
133
  planId: string;
123
134
  currentPeriodStart: Date;
124
135
  currentPeriodEnd: Date;
136
+ id?: string | undefined;
137
+ upcomingInvoice?: {
138
+ subtotal: number;
139
+ subtotalExcludingTax: number | null;
140
+ total: number;
141
+ totalExcludingTax: number | null;
142
+ } | null | undefined;
125
143
  };
144
+ regionName: RegionName;
145
+ tag: TenantTag;
126
146
  openInvoices: {
127
147
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
128
148
  id: string;
@@ -138,7 +158,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
138
158
  hostedInvoiceUrl: string | null;
139
159
  invoicePdf: string | null;
140
160
  }[];
141
- tag: TenantTag;
142
161
  }>;
143
162
  };
144
163
  options: {};
@@ -146,6 +165,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
146
165
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
147
166
  id: string;
148
167
  name: string;
168
+ createdAt: Date;
149
169
  usage: {
150
170
  activeUsers: number;
151
171
  cost: number;
@@ -159,7 +179,16 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
159
179
  planId: string;
160
180
  currentPeriodStart: Date;
161
181
  currentPeriodEnd: Date;
182
+ id?: string | undefined;
183
+ upcomingInvoice?: {
184
+ subtotal: number;
185
+ subtotalExcludingTax: number | null;
186
+ total: number;
187
+ totalExcludingTax: number | null;
188
+ } | null | undefined;
162
189
  };
190
+ regionName: RegionName;
191
+ tag: TenantTag;
163
192
  openInvoices: {
164
193
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
165
194
  id: string;
@@ -175,16 +204,17 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
175
204
  hostedInvoiceUrl: string | null;
176
205
  invoicePdf: string | null;
177
206
  }[];
178
- tag: TenantTag;
179
207
  }[]>;
180
208
  };
181
209
  post: {
182
210
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
183
211
  name?: string | undefined;
184
212
  tag?: TenantTag | undefined;
213
+ regionName?: RegionName | undefined;
185
214
  }, {
186
215
  id: string;
187
216
  name: string;
217
+ createdAt: Date;
188
218
  usage: {
189
219
  activeUsers: number;
190
220
  cost: number;
@@ -198,7 +228,16 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
198
228
  planId: string;
199
229
  currentPeriodStart: Date;
200
230
  currentPeriodEnd: Date;
231
+ id?: string | undefined;
232
+ upcomingInvoice?: {
233
+ subtotal: number;
234
+ subtotalExcludingTax: number | null;
235
+ total: number;
236
+ totalExcludingTax: number | null;
237
+ } | null | undefined;
201
238
  };
239
+ regionName: RegionName;
240
+ tag: TenantTag;
202
241
  openInvoices: {
203
242
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
204
243
  id: string;
@@ -214,7 +253,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
214
253
  hostedInvoiceUrl: string | null;
215
254
  invoicePdf: string | null;
216
255
  }[];
217
- tag: TenantTag;
218
256
  }>;
219
257
  };
220
258
  put: {};
@@ -232,14 +270,126 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
232
270
  planId: string;
233
271
  currentPeriodStart: Date;
234
272
  currentPeriodEnd: Date;
273
+ id?: string | undefined;
274
+ upcomingInvoice?: {
275
+ subtotal: number;
276
+ subtotalExcludingTax: number | null;
277
+ total: number;
278
+ totalExcludingTax: number | null;
279
+ } | null | undefined;
235
280
  }>;
281
+ } & {
282
+ "/tenants/my/subscription/quota": import("@withtyped/server").PathGuard<"/my/subscription/quota", unknown, unknown, {
283
+ mauLimit: number | null;
284
+ tokenLimit: number | null;
285
+ applicationsLimit: number | null;
286
+ machineToMachineLimit: number | null;
287
+ resourcesLimit: number | null;
288
+ scopesPerResourceLimit: number | null;
289
+ socialConnectorsLimit: number | null;
290
+ machineToMachineRolesLimit: number | null;
291
+ scopesPerRoleLimit: number | null;
292
+ hooksLimit: number | null;
293
+ auditLogsRetentionDays: number | null;
294
+ mfaEnabled: boolean;
295
+ organizationsEnabled: boolean;
296
+ thirdPartyApplicationsLimit: number | null;
297
+ tenantMembersLimit: number | null;
298
+ customJwtEnabled: boolean;
299
+ subjectTokenEnabled: boolean;
300
+ bringYourUiEnabled: boolean;
301
+ userRolesLimit: number | null;
302
+ enterpriseSsoLimit: number | null;
303
+ }>;
304
+ } & {
305
+ "/tenants/my/subscription/usage": import("@withtyped/server").PathGuard<"/my/subscription/usage", unknown, unknown, {
306
+ mauLimit: number;
307
+ tokenLimit: number;
308
+ applicationsLimit: number;
309
+ machineToMachineLimit: number;
310
+ resourcesLimit: number;
311
+ scopesPerResourceLimit: number;
312
+ socialConnectorsLimit: number;
313
+ machineToMachineRolesLimit: number;
314
+ scopesPerRoleLimit: number;
315
+ hooksLimit: number;
316
+ mfaEnabled: boolean;
317
+ organizationsEnabled: boolean;
318
+ thirdPartyApplicationsLimit: number;
319
+ tenantMembersLimit: number;
320
+ customJwtEnabled: boolean;
321
+ subjectTokenEnabled: boolean;
322
+ bringYourUiEnabled: boolean;
323
+ userRolesLimit: number;
324
+ enterpriseSsoLimit: number;
325
+ }>;
326
+ } & {
327
+ "/tenants/my/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/my/subscription/usage/:entityName/scopes", {
328
+ entityId?: string | undefined;
329
+ }, unknown, Record<string, number>>;
236
330
  } & {
237
331
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
238
332
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
239
333
  planId: string;
240
334
  currentPeriodStart: Date;
241
335
  currentPeriodEnd: Date;
336
+ id?: string | undefined;
337
+ upcomingInvoice?: {
338
+ subtotal: number;
339
+ subtotalExcludingTax: number | null;
340
+ total: number;
341
+ totalExcludingTax: number | null;
342
+ } | null | undefined;
242
343
  }>;
344
+ } & {
345
+ "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
346
+ mauLimit: number | null;
347
+ tokenLimit: number | null;
348
+ applicationsLimit: number | null;
349
+ machineToMachineLimit: number | null;
350
+ resourcesLimit: number | null;
351
+ scopesPerResourceLimit: number | null;
352
+ socialConnectorsLimit: number | null;
353
+ machineToMachineRolesLimit: number | null;
354
+ scopesPerRoleLimit: number | null;
355
+ hooksLimit: number | null;
356
+ auditLogsRetentionDays: number | null;
357
+ mfaEnabled: boolean;
358
+ organizationsEnabled: boolean;
359
+ thirdPartyApplicationsLimit: number | null;
360
+ tenantMembersLimit: number | null;
361
+ customJwtEnabled: boolean;
362
+ subjectTokenEnabled: boolean;
363
+ bringYourUiEnabled: boolean;
364
+ userRolesLimit: number | null;
365
+ enterpriseSsoLimit: number | null;
366
+ }>;
367
+ } & {
368
+ "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
369
+ mauLimit: number;
370
+ tokenLimit: number;
371
+ applicationsLimit: number;
372
+ machineToMachineLimit: number;
373
+ resourcesLimit: number;
374
+ scopesPerResourceLimit: number;
375
+ socialConnectorsLimit: number;
376
+ machineToMachineRolesLimit: number;
377
+ scopesPerRoleLimit: number;
378
+ hooksLimit: number;
379
+ mfaEnabled: boolean;
380
+ organizationsEnabled: boolean;
381
+ thirdPartyApplicationsLimit: number;
382
+ tenantMembersLimit: number;
383
+ customJwtEnabled: boolean;
384
+ subjectTokenEnabled: boolean;
385
+ bringYourUiEnabled: boolean;
386
+ userRolesLimit: number;
387
+ enterpriseSsoLimit: number;
388
+ }>;
389
+ } & {
390
+ "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
391
+ entityId?: string | undefined;
392
+ }, unknown, Record<string, number>>;
243
393
  } & {
244
394
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
245
395
  invoices: {
@@ -320,11 +470,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
320
470
  };
321
471
  }, unknown>;
322
472
  } & {
323
- "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", unknown, {
473
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
474
+ isTest?: string | undefined;
475
+ }, {
476
+ context: Record<string, Json>;
324
477
  script: string;
325
478
  tokenType: LogtoJwtTokenKeyType.AccessToken;
326
479
  token: Record<string, Json>;
327
- context: Record<string, Json>;
328
480
  environmentVariables?: Record<string, string> | undefined;
329
481
  } | {
330
482
  script: string;
@@ -335,13 +487,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
335
487
  };
336
488
  put: {
337
489
  "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
338
- production?: {
339
- "jwt.accessToken"?: string | undefined;
340
- "jwt.clientCredentials"?: string | undefined;
490
+ "jwt.accessToken"?: {
491
+ production?: string | undefined;
492
+ test?: string | undefined;
341
493
  } | undefined;
342
- test?: {
343
- "jwt.accessToken"?: string | undefined;
344
- "jwt.clientCredentials"?: string | undefined;
494
+ "jwt.clientCredentials"?: {
495
+ production?: string | undefined;
496
+ test?: string | undefined;
345
497
  } | undefined;
346
498
  }, unknown>;
347
499
  };
@@ -359,18 +511,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
359
511
  createdAt: Date;
360
512
  name: string;
361
513
  updatedAt: Date;
362
- stripeProducts: {
363
- type: "flat" | "tier1" | "tier2" | "tier3";
364
- id: string;
365
- name: string;
366
- price: {
367
- id: string;
368
- unitAmountDecimal: string;
369
- quantity?: 1 | undefined;
370
- unitAmount?: number | null | undefined;
371
- };
372
- description?: string | undefined;
373
- }[];
374
514
  quota: {
375
515
  mauLimit: number | null;
376
516
  tokenLimit: number | null;
@@ -394,7 +534,63 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
394
534
  thirdPartyApplicationsLimit: number | null;
395
535
  tenantMembersLimit: number | null;
396
536
  customJwtEnabled: boolean;
537
+ subjectTokenEnabled: boolean;
538
+ bringYourUiEnabled: boolean;
539
+ };
540
+ stripeProducts: {
541
+ type: "flat" | "tier1" | "tier2" | "tier3";
542
+ id: string;
543
+ name: string;
544
+ price: {
545
+ id: string;
546
+ unitAmountDecimal: string;
547
+ quantity?: 1 | undefined;
548
+ unitAmount?: number | null | undefined;
549
+ };
550
+ description?: string | undefined;
551
+ }[];
552
+ }[]>;
553
+ };
554
+ post: {};
555
+ put: {};
556
+ delete: {};
557
+ copy: {};
558
+ head: {};
559
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
560
+ patch: {};
561
+ options: {};
562
+ get: {
563
+ "/skus": import("@withtyped/server").PathGuard<"/", {
564
+ type?: LogtoSkuType | undefined;
565
+ }, unknown, {
566
+ type: LogtoSkuType;
567
+ id: string;
568
+ name: string | null;
569
+ quota: {
570
+ mauLimit?: number | null | undefined;
571
+ tokenLimit?: number | null | undefined;
572
+ applicationsLimit?: number | null | undefined;
573
+ machineToMachineLimit?: number | null | undefined;
574
+ resourcesLimit?: number | null | undefined;
575
+ scopesPerResourceLimit?: number | null | undefined;
576
+ socialConnectorsLimit?: number | null | undefined;
577
+ machineToMachineRolesLimit?: number | null | undefined;
578
+ scopesPerRoleLimit?: number | null | undefined;
579
+ hooksLimit?: number | null | undefined;
580
+ auditLogsRetentionDays?: number | null | undefined;
581
+ mfaEnabled?: boolean | undefined;
582
+ organizationsEnabled?: boolean | undefined;
583
+ thirdPartyApplicationsLimit?: number | null | undefined;
584
+ tenantMembersLimit?: number | null | undefined;
585
+ customJwtEnabled?: boolean | undefined;
586
+ subjectTokenEnabled?: boolean | undefined;
587
+ bringYourUiEnabled?: boolean | undefined;
588
+ userRolesLimit?: number | null | undefined;
589
+ enterpriseSsoLimit?: number | null | undefined;
397
590
  };
591
+ createdAt: Date;
592
+ updatedAt: Date;
593
+ unitPrice: number | null;
398
594
  }[]>;
399
595
  };
400
596
  post: {};
@@ -414,6 +610,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
414
610
  tenantId: string | null;
415
611
  updatedAt: Date;
416
612
  planId: string;
613
+ skuId: string | null;
417
614
  }>;
418
615
  };
419
616
  post: {
@@ -421,9 +618,11 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
421
618
  planId: string;
422
619
  successCallbackUrl: string;
423
620
  tenantId?: string | undefined;
424
- cancelCallbackUrl?: string | undefined;
425
- tenantTag?: TenantTag | undefined;
621
+ skuId?: string | undefined;
426
622
  tenantName?: string | undefined;
623
+ tenantTag?: TenantTag | undefined;
624
+ tenantRegionName?: RegionName | undefined;
625
+ cancelCallbackUrl?: string | undefined;
427
626
  }, {
428
627
  sessionId: string;
429
628
  redirectUri?: string | null | undefined;
@@ -514,8 +713,8 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
514
713
  expiresAt: number;
515
714
  organizationRoles: OrganizationRoleEntity[];
516
715
  } & {
517
- tenantTag: TenantTag;
518
716
  tenantName: string;
717
+ tenantTag: TenantTag;
519
718
  })[]>;
520
719
  } & {
521
720
  "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
@@ -537,9 +736,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
537
736
  delete: {};
538
737
  copy: {};
539
738
  head: {};
739
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
740
+ patch: {};
741
+ options: {};
742
+ get: {};
743
+ post: {};
744
+ put: {};
745
+ delete: {
746
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
747
+ };
748
+ copy: {};
749
+ head: {};
540
750
  }, "/api">>, "/api">;
541
751
  export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
542
752
  request: {
753
+ id?: string | undefined;
543
754
  method?: import("@withtyped/server").RequestMethod | undefined;
544
755
  headers: import("http").IncomingHttpHeaders;
545
756
  url: URL;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-821690c",
3
+ "version": "0.2.5-923c26f",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -16,21 +16,21 @@
16
16
  "#src/*": "./build/*"
17
17
  },
18
18
  "devDependencies": {
19
- "@silverhand/eslint-config": "5.0.0",
20
- "@silverhand/ts-config": "5.0.0",
19
+ "@silverhand/eslint-config": "6.0.1",
20
+ "@silverhand/ts-config": "6.0.0",
21
21
  "@types/accepts": "^1.3.5",
22
22
  "@types/http-proxy": "^1.17.9",
23
23
  "@types/mime-types": "^2.1.1",
24
24
  "@types/node": "^20.0.0",
25
25
  "@types/yargs": "^17.0.24",
26
26
  "dts-bundle-generator": "^9.3.1",
27
- "eslint": "^8.44.0",
27
+ "eslint": "^8.57.0",
28
28
  "lint-staged": "^15.0.0",
29
29
  "nodemon": "^3.0.0",
30
30
  "prettier": "^3.0.0",
31
31
  "typescript": "^5.3.3",
32
32
  "vite-tsconfig-paths": "^4.3.1",
33
- "vitest": "^1.0.0"
33
+ "vitest": "^2.0.0"
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.0",
53
- "@withtyped/server": "^0.13.3"
52
+ "@silverhand/essentials": "^2.9.1",
53
+ "@withtyped/server": "^0.13.6"
54
54
  },
55
55
  "scripts": {
56
56
  "precommit": "lint-staged",