@logto/cloud 0.2.5-94f7bcc → 0.2.5-98514d7

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 +211 -25
  2. package/package.json +7 -7
@@ -37,6 +37,16 @@ declare enum OrganizationInvitationStatus {
37
37
  Expired = "Expired",
38
38
  Revoked = "Revoked"
39
39
  }
40
+ /** The scopes (permissions) defined by the organization template. */
41
+ export type OrganizationScope = {
42
+ tenantId: string;
43
+ /** The globally unique identifier of the organization scope. */
44
+ id: string;
45
+ /** The organization scope's name, unique within the organization template. */
46
+ name: string;
47
+ /** A brief description of the organization scope. */
48
+ description: string | null;
49
+ };
40
50
  declare enum LogtoJwtTokenKeyType {
41
51
  AccessToken = "access-token",
42
52
  ClientCredentials = "client-credentials"
@@ -59,6 +69,10 @@ declare enum TenantRole {
59
69
  /** Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
60
70
  Collaborator = "collaborator"
61
71
  }
72
+ declare enum LogtoSkuType {
73
+ Basic = "Basic",
74
+ AddOn = "AddOn"
75
+ }
62
76
  declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
63
77
  createdAt: Date;
64
78
  affiliateId: string;
@@ -72,11 +86,16 @@ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default
72
86
  id: string;
73
87
  }, "id" | "createdAt", "id" | "createdAt">;
74
88
  export type Affiliate = InferModelType<typeof Affiliates>;
89
+ declare enum RegionName {
90
+ EU = "EU",
91
+ US = "US"
92
+ }
75
93
  export type AffiliateData = Affiliate & {
76
94
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
77
95
  };
78
96
  declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
79
97
  request: {
98
+ id?: string | undefined;
80
99
  method?: import("@withtyped/server").RequestMethod | undefined;
81
100
  headers: import("http").IncomingHttpHeaders;
82
101
  url: URL;
@@ -84,6 +103,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
84
103
  };
85
104
  }, "request"> & {
86
105
  request: Record<string, unknown> & {
106
+ id?: string | undefined;
87
107
  method?: import("@withtyped/server").RequestMethod | undefined;
88
108
  headers: import("http").IncomingHttpHeaders;
89
109
  url: URL;
@@ -92,13 +112,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
92
112
  body?: Json | undefined;
93
113
  bodyRaw?: Buffer | undefined;
94
114
  };
95
- }>, 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<{
96
116
  patch: {
97
117
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
98
118
  name?: string | undefined;
99
119
  }, {
100
120
  id: string;
101
121
  name: string;
122
+ createdAt: Date;
102
123
  usage: {
103
124
  activeUsers: number;
104
125
  cost: number;
@@ -112,7 +133,10 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
112
133
  planId: string;
113
134
  currentPeriodStart: Date;
114
135
  currentPeriodEnd: Date;
136
+ id?: string | undefined;
115
137
  };
138
+ regionName: RegionName;
139
+ tag: TenantTag;
116
140
  openInvoices: {
117
141
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
118
142
  id: string;
@@ -128,7 +152,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
128
152
  hostedInvoiceUrl: string | null;
129
153
  invoicePdf: string | null;
130
154
  }[];
131
- tag: TenantTag;
132
155
  }>;
133
156
  };
134
157
  options: {};
@@ -136,6 +159,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
136
159
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
137
160
  id: string;
138
161
  name: string;
162
+ createdAt: Date;
139
163
  usage: {
140
164
  activeUsers: number;
141
165
  cost: number;
@@ -149,7 +173,10 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
149
173
  planId: string;
150
174
  currentPeriodStart: Date;
151
175
  currentPeriodEnd: Date;
176
+ id?: string | undefined;
152
177
  };
178
+ regionName: RegionName;
179
+ tag: TenantTag;
153
180
  openInvoices: {
154
181
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
155
182
  id: string;
@@ -165,16 +192,17 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
165
192
  hostedInvoiceUrl: string | null;
166
193
  invoicePdf: string | null;
167
194
  }[];
168
- tag: TenantTag;
169
195
  }[]>;
170
196
  };
171
197
  post: {
172
198
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
173
199
  name?: string | undefined;
174
200
  tag?: TenantTag | undefined;
201
+ regionName?: RegionName | undefined;
175
202
  }, {
176
203
  id: string;
177
204
  name: string;
205
+ createdAt: Date;
178
206
  usage: {
179
207
  activeUsers: number;
180
208
  cost: number;
@@ -188,7 +216,10 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
188
216
  planId: string;
189
217
  currentPeriodStart: Date;
190
218
  currentPeriodEnd: Date;
219
+ id?: string | undefined;
191
220
  };
221
+ regionName: RegionName;
222
+ tag: TenantTag;
192
223
  openInvoices: {
193
224
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
194
225
  id: string;
@@ -204,7 +235,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
204
235
  hostedInvoiceUrl: string | null;
205
236
  invoicePdf: string | null;
206
237
  }[];
207
- tag: TenantTag;
208
238
  }>;
209
239
  };
210
240
  put: {};
@@ -222,14 +252,110 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
222
252
  planId: string;
223
253
  currentPeriodStart: Date;
224
254
  currentPeriodEnd: Date;
255
+ id?: string | undefined;
256
+ }>;
257
+ } & {
258
+ "/tenants/my/subscription/quota": import("@withtyped/server").PathGuard<"/my/subscription/quota", unknown, unknown, {
259
+ mauLimit: number | null;
260
+ tokenLimit: number | null;
261
+ applicationsLimit: number | null;
262
+ machineToMachineLimit: number | null;
263
+ resourcesLimit: number | null;
264
+ scopesPerResourceLimit: number | null;
265
+ socialConnectorsLimit: number | null;
266
+ machineToMachineRolesLimit: number | null;
267
+ scopesPerRoleLimit: number | null;
268
+ hooksLimit: number | null;
269
+ auditLogsRetentionDays: number | null;
270
+ mfaEnabled: boolean;
271
+ organizationsEnabled: boolean;
272
+ thirdPartyApplicationsLimit: number | null;
273
+ tenantMembersLimit: number | null;
274
+ customJwtEnabled: boolean;
275
+ subjectTokenEnabled: boolean;
276
+ userRolesLimit: number | null;
277
+ enterpriseSsoLimit: number | null;
225
278
  }>;
279
+ } & {
280
+ "/tenants/my/subscription/usage": import("@withtyped/server").PathGuard<"/my/subscription/usage", unknown, unknown, {
281
+ mauLimit: number;
282
+ tokenLimit: number;
283
+ applicationsLimit: number;
284
+ machineToMachineLimit: number;
285
+ resourcesLimit: number;
286
+ scopesPerResourceLimit: number;
287
+ socialConnectorsLimit: number;
288
+ machineToMachineRolesLimit: number;
289
+ scopesPerRoleLimit: number;
290
+ hooksLimit: number;
291
+ mfaEnabled: boolean;
292
+ organizationsEnabled: boolean;
293
+ thirdPartyApplicationsLimit: number;
294
+ tenantMembersLimit: number;
295
+ customJwtEnabled: boolean;
296
+ subjectTokenEnabled: boolean;
297
+ userRolesLimit: number;
298
+ enterpriseSsoLimit: number;
299
+ }>;
300
+ } & {
301
+ "/tenants/my/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/my/subscription/usage/:entityName/scopes", {
302
+ entityId?: string | undefined;
303
+ }, unknown, Record<string, number>>;
226
304
  } & {
227
305
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
228
306
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
229
307
  planId: string;
230
308
  currentPeriodStart: Date;
231
309
  currentPeriodEnd: Date;
310
+ id?: string | undefined;
311
+ }>;
312
+ } & {
313
+ "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
314
+ mauLimit: number | null;
315
+ tokenLimit: number | null;
316
+ applicationsLimit: number | null;
317
+ machineToMachineLimit: number | null;
318
+ resourcesLimit: number | null;
319
+ scopesPerResourceLimit: number | null;
320
+ socialConnectorsLimit: number | null;
321
+ machineToMachineRolesLimit: number | null;
322
+ scopesPerRoleLimit: number | null;
323
+ hooksLimit: number | null;
324
+ auditLogsRetentionDays: number | null;
325
+ mfaEnabled: boolean;
326
+ organizationsEnabled: boolean;
327
+ thirdPartyApplicationsLimit: number | null;
328
+ tenantMembersLimit: number | null;
329
+ customJwtEnabled: boolean;
330
+ subjectTokenEnabled: boolean;
331
+ userRolesLimit: number | null;
332
+ enterpriseSsoLimit: number | null;
232
333
  }>;
334
+ } & {
335
+ "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
336
+ mauLimit: number;
337
+ tokenLimit: number;
338
+ applicationsLimit: number;
339
+ machineToMachineLimit: number;
340
+ resourcesLimit: number;
341
+ scopesPerResourceLimit: number;
342
+ socialConnectorsLimit: number;
343
+ machineToMachineRolesLimit: number;
344
+ scopesPerRoleLimit: number;
345
+ hooksLimit: number;
346
+ mfaEnabled: boolean;
347
+ organizationsEnabled: boolean;
348
+ thirdPartyApplicationsLimit: number;
349
+ tenantMembersLimit: number;
350
+ customJwtEnabled: boolean;
351
+ subjectTokenEnabled: boolean;
352
+ userRolesLimit: number;
353
+ enterpriseSsoLimit: number;
354
+ }>;
355
+ } & {
356
+ "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
357
+ entityId?: string | undefined;
358
+ }, unknown, Record<string, number>>;
233
359
  } & {
234
360
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
235
361
  invoices: {
@@ -310,11 +436,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
310
436
  };
311
437
  }, unknown>;
312
438
  } & {
313
- "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", unknown, {
439
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
440
+ isTest?: string | undefined;
441
+ }, {
442
+ context: Record<string, Json>;
314
443
  script: string;
315
444
  tokenType: LogtoJwtTokenKeyType.AccessToken;
316
445
  token: Record<string, Json>;
317
- context: Record<string, Json>;
318
446
  environmentVariables?: Record<string, string> | undefined;
319
447
  } | {
320
448
  script: string;
@@ -325,13 +453,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
325
453
  };
326
454
  put: {
327
455
  "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
328
- production?: {
329
- "jwt.accessToken"?: string | undefined;
330
- "jwt.clientCredentials"?: string | undefined;
456
+ "jwt.accessToken"?: {
457
+ production?: string | undefined;
458
+ test?: string | undefined;
331
459
  } | undefined;
332
- test?: {
333
- "jwt.accessToken"?: string | undefined;
334
- "jwt.clientCredentials"?: string | undefined;
460
+ "jwt.clientCredentials"?: {
461
+ production?: string | undefined;
462
+ test?: string | undefined;
335
463
  } | undefined;
336
464
  }, unknown>;
337
465
  };
@@ -349,18 +477,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
349
477
  createdAt: Date;
350
478
  name: string;
351
479
  updatedAt: Date;
352
- stripeProducts: {
353
- type: "flat" | "tier1" | "tier2" | "tier3";
354
- id: string;
355
- name: string;
356
- price: {
357
- id: string;
358
- unitAmountDecimal: string;
359
- quantity?: 1 | undefined;
360
- unitAmount?: number | null | undefined;
361
- };
362
- description?: string | undefined;
363
- }[];
364
480
  quota: {
365
481
  mauLimit: number | null;
366
482
  tokenLimit: number | null;
@@ -384,7 +500,61 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
384
500
  thirdPartyApplicationsLimit: number | null;
385
501
  tenantMembersLimit: number | null;
386
502
  customJwtEnabled: boolean;
503
+ subjectTokenEnabled: boolean;
504
+ };
505
+ stripeProducts: {
506
+ type: "flat" | "tier1" | "tier2" | "tier3";
507
+ id: string;
508
+ name: string;
509
+ price: {
510
+ id: string;
511
+ unitAmountDecimal: string;
512
+ quantity?: 1 | undefined;
513
+ unitAmount?: number | null | undefined;
514
+ };
515
+ description?: string | undefined;
516
+ }[];
517
+ }[]>;
518
+ };
519
+ post: {};
520
+ put: {};
521
+ delete: {};
522
+ copy: {};
523
+ head: {};
524
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
525
+ patch: {};
526
+ options: {};
527
+ get: {
528
+ "/skus": import("@withtyped/server").PathGuard<"/", {
529
+ type?: LogtoSkuType | undefined;
530
+ }, unknown, {
531
+ type: LogtoSkuType;
532
+ id: string;
533
+ name: string | null;
534
+ quota: {
535
+ mauLimit?: number | null | undefined;
536
+ applicationsLimit?: number | null | undefined;
537
+ thirdPartyApplicationsLimit?: number | null | undefined;
538
+ scopesPerResourceLimit?: number | null | undefined;
539
+ socialConnectorsLimit?: number | null | undefined;
540
+ userRolesLimit?: number | null | undefined;
541
+ machineToMachineRolesLimit?: number | null | undefined;
542
+ scopesPerRoleLimit?: number | null | undefined;
543
+ hooksLimit?: number | null | undefined;
544
+ auditLogsRetentionDays?: number | null | undefined;
545
+ customJwtEnabled?: boolean | undefined;
546
+ subjectTokenEnabled?: boolean | undefined;
547
+ tokenLimit?: number | null | undefined;
548
+ machineToMachineLimit?: number | null | undefined;
549
+ resourcesLimit?: number | null | undefined;
550
+ enterpriseSsoLimit?: number | null | undefined;
551
+ tenantMembersLimit?: number | null | undefined;
552
+ mfaEnabled?: boolean | undefined;
553
+ organizationsEnabled?: boolean | undefined;
387
554
  };
555
+ createdAt: Date;
556
+ updatedAt: Date;
557
+ unitPrice: number | null;
388
558
  }[]>;
389
559
  };
390
560
  post: {};
@@ -411,9 +581,11 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
411
581
  planId: string;
412
582
  successCallbackUrl: string;
413
583
  tenantId?: string | undefined;
584
+ skuId?: string | undefined;
414
585
  cancelCallbackUrl?: string | undefined;
415
586
  tenantTag?: TenantTag | undefined;
416
587
  tenantName?: string | undefined;
588
+ tenantRegionName?: RegionName | undefined;
417
589
  }, {
418
590
  sessionId: string;
419
591
  redirectUri?: string | null | undefined;
@@ -504,8 +676,8 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
504
676
  expiresAt: number;
505
677
  organizationRoles: OrganizationRoleEntity[];
506
678
  } & {
507
- tenantTag: TenantTag;
508
679
  tenantName: string;
680
+ tenantTag: TenantTag;
509
681
  })[]>;
510
682
  } & {
511
683
  "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
@@ -527,9 +699,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
527
699
  delete: {};
528
700
  copy: {};
529
701
  head: {};
702
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
703
+ patch: {};
704
+ options: {};
705
+ get: {};
706
+ post: {};
707
+ put: {};
708
+ delete: {
709
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
710
+ };
711
+ copy: {};
712
+ head: {};
530
713
  }, "/api">>, "/api">;
531
714
  export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
532
715
  request: {
716
+ id?: string | undefined;
533
717
  method?: import("@withtyped/server").RequestMethod | undefined;
534
718
  headers: import("http").IncomingHttpHeaders;
535
719
  url: URL;
@@ -564,6 +748,8 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
564
748
  avatar: string | null;
565
749
  organizationRoles: OrganizationRoleEntity[];
566
750
  }[]>;
751
+ } & {
752
+ "/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
567
753
  } & {
568
754
  "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
569
755
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-94f7bcc",
3
+ "version": "0.2.5-98514d7",
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",