@logto/cloud 0.2.5-5a698db → 0.2.5-632268d

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 +565 -59
  2. package/package.json +14 -18
@@ -1,11 +1,13 @@
1
- // Generated by dts-bundle-generator v8.0.1
1
+ // Generated by dts-bundle-generator v9.3.1
2
2
 
3
- import { RequestContext } from '@withtyped/server';
3
+ import { Json, JsonObject, RequestContext } from '@withtyped/server';
4
4
  import { InferModelType } from '@withtyped/server/model';
5
5
 
6
6
  export type WithAuthContext<Context = RequestContext> = Context & {
7
7
  auth: {
8
+ /** The ID of the authenticated subject (`sub`). */
8
9
  id: string;
10
+ /** The scopes that the subject has (`scope`). */
9
11
  scopes: string[];
10
12
  };
11
13
  };
@@ -17,35 +19,112 @@ declare enum VerificationCodeType {
17
19
  /** @deprecated Use `Generic` type template for sending test sms/email use case */
18
20
  Test = "Test"
19
21
  }
22
+ declare enum TemplateType {
23
+ /** The template for sending verification code when user is signing in. */
24
+ SignIn = "SignIn",
25
+ /** The template for sending verification code when user is registering. */
26
+ Register = "Register",
27
+ /** The template for sending verification code when user is resetting password. */
28
+ ForgotPassword = "ForgotPassword",
29
+ /** The template for sending organization invitation. */
30
+ OrganizationInvitation = "OrganizationInvitation",
31
+ /** The template for generic usage. */
32
+ Generic = "Generic"
33
+ }
34
+ declare enum OrganizationInvitationStatus {
35
+ Pending = "Pending",
36
+ Accepted = "Accepted",
37
+ Expired = "Expired",
38
+ Revoked = "Revoked"
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
+ };
50
+ declare enum LogtoJwtTokenKeyType {
51
+ AccessToken = "access-token",
52
+ ClientCredentials = "client-credentials"
53
+ }
54
+ /**
55
+ * The simplified organization role entity that is returned in the `roles` field
56
+ * of the organization.
57
+ */
58
+ export type OrganizationRoleEntity = {
59
+ id: string;
60
+ name: string;
61
+ };
20
62
  declare enum TenantTag {
21
63
  Development = "development",
22
- Staging = "staging",
23
64
  Production = "production"
24
65
  }
25
- declare const AffiliateProperties: import("@withtyped/server/model").default<"affiliate_properties", {
66
+ declare enum TenantRole {
67
+ /** Admin of the tenant, who has all permissions. */
68
+ Admin = "admin",
69
+ /** Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
70
+ Collaborator = "collaborator"
71
+ }
72
+ declare enum LogtoSkuType {
73
+ Basic = "Basic",
74
+ AddOn = "AddOn"
75
+ }
76
+ declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
26
77
  createdAt: Date;
27
78
  affiliateId: string;
28
79
  type: "hostname" | "query";
29
80
  value: string;
30
81
  }, "createdAt", "createdAt">;
31
82
  export type AffiliateProperty = InferModelType<typeof AffiliateProperties>;
32
- declare const Affiliates: import("@withtyped/server/model").default<"affiliates", {
33
- id: string;
34
- createdAt: Date;
83
+ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default<"affiliates", {
35
84
  name: string;
36
- }, "createdAt" | "id", "createdAt" | "id">;
85
+ createdAt: Date;
86
+ id: string;
87
+ }, "id" | "createdAt", "id" | "createdAt">;
37
88
  export type Affiliate = InferModelType<typeof Affiliates>;
89
+ declare enum RegionName {
90
+ EU = "EU",
91
+ US = "US"
92
+ }
38
93
  export type AffiliateData = Affiliate & {
39
94
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
40
95
  };
41
- declare const router: import("@withtyped/server").Router<WithAuthContext, 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<{
42
- options: {};
96
+ declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
97
+ request: {
98
+ id?: string | undefined;
99
+ method?: import("@withtyped/server").RequestMethod | undefined;
100
+ headers: import("http").IncomingHttpHeaders;
101
+ url: URL;
102
+ body?: unknown;
103
+ };
104
+ }, "request"> & {
105
+ request: Record<string, unknown> & {
106
+ id?: string | undefined;
107
+ method?: import("@withtyped/server").RequestMethod | undefined;
108
+ headers: import("http").IncomingHttpHeaders;
109
+ url: URL;
110
+ body?: unknown;
111
+ } & {
112
+ body?: Json | undefined;
113
+ bodyRaw?: Buffer | undefined;
114
+ };
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<{
43
116
  patch: {
44
117
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
45
118
  name?: string | undefined;
46
119
  }, {
47
120
  id: string;
48
121
  name: string;
122
+ createdAt: Date;
123
+ usage: {
124
+ activeUsers: number;
125
+ cost: number;
126
+ tokenUsage: number;
127
+ };
49
128
  indicator: string;
50
129
  isSuspended: boolean;
51
130
  planId: string;
@@ -54,16 +133,22 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
54
133
  planId: string;
55
134
  currentPeriodStart: Date;
56
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;
143
+ isAddOnAvailable?: boolean | undefined;
144
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
57
145
  };
146
+ regionName: RegionName;
58
147
  tag: TenantTag;
59
- usage: {
60
- activeUsers: number;
61
- cost: number;
62
- };
63
148
  openInvoices: {
64
149
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
65
- createdAt: Date;
66
150
  id: string;
151
+ createdAt: Date;
67
152
  updatedAt: Date;
68
153
  customerId: string | null;
69
154
  billingReason: string | null;
@@ -77,10 +162,17 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
77
162
  }[];
78
163
  }>;
79
164
  };
165
+ options: {};
80
166
  get: {
81
167
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
82
168
  id: string;
83
169
  name: string;
170
+ createdAt: Date;
171
+ usage: {
172
+ activeUsers: number;
173
+ cost: number;
174
+ tokenUsage: number;
175
+ };
84
176
  indicator: string;
85
177
  isSuspended: boolean;
86
178
  planId: string;
@@ -89,16 +181,22 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
89
181
  planId: string;
90
182
  currentPeriodStart: Date;
91
183
  currentPeriodEnd: Date;
184
+ id?: string | undefined;
185
+ upcomingInvoice?: {
186
+ subtotal: number;
187
+ subtotalExcludingTax: number | null;
188
+ total: number;
189
+ totalExcludingTax: number | null;
190
+ } | null | undefined;
191
+ isAddOnAvailable?: boolean | undefined;
192
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
92
193
  };
194
+ regionName: RegionName;
93
195
  tag: TenantTag;
94
- usage: {
95
- activeUsers: number;
96
- cost: number;
97
- };
98
196
  openInvoices: {
99
197
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
100
- createdAt: Date;
101
198
  id: string;
199
+ createdAt: Date;
102
200
  updatedAt: Date;
103
201
  customerId: string | null;
104
202
  billingReason: string | null;
@@ -116,9 +214,16 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
116
214
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
117
215
  name?: string | undefined;
118
216
  tag?: TenantTag | undefined;
217
+ regionName?: RegionName | undefined;
119
218
  }, {
120
219
  id: string;
121
220
  name: string;
221
+ createdAt: Date;
222
+ usage: {
223
+ activeUsers: number;
224
+ cost: number;
225
+ tokenUsage: number;
226
+ };
122
227
  indicator: string;
123
228
  isSuspended: boolean;
124
229
  planId: string;
@@ -127,16 +232,22 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
127
232
  planId: string;
128
233
  currentPeriodStart: Date;
129
234
  currentPeriodEnd: Date;
235
+ id?: string | undefined;
236
+ upcomingInvoice?: {
237
+ subtotal: number;
238
+ subtotalExcludingTax: number | null;
239
+ total: number;
240
+ totalExcludingTax: number | null;
241
+ } | null | undefined;
242
+ isAddOnAvailable?: boolean | undefined;
243
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
130
244
  };
245
+ regionName: RegionName;
131
246
  tag: TenantTag;
132
- usage: {
133
- activeUsers: number;
134
- cost: number;
135
- };
136
247
  openInvoices: {
137
248
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
138
- createdAt: Date;
139
249
  id: string;
250
+ createdAt: Date;
140
251
  updatedAt: Date;
141
252
  customerId: string | null;
142
253
  billingReason: string | null;
@@ -157,28 +268,192 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
157
268
  copy: {};
158
269
  head: {};
159
270
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
160
- options: {};
161
271
  patch: {};
272
+ options: {};
162
273
  get: {
163
274
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
164
275
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
165
276
  planId: string;
166
277
  currentPeriodStart: Date;
167
278
  currentPeriodEnd: Date;
279
+ id?: string | undefined;
280
+ upcomingInvoice?: {
281
+ subtotal: number;
282
+ subtotalExcludingTax: number | null;
283
+ total: number;
284
+ totalExcludingTax: number | null;
285
+ } | null | undefined;
286
+ isAddOnAvailable?: boolean | undefined;
287
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
168
288
  }>;
289
+ } & {
290
+ "/tenants/my/subscription/quota": import("@withtyped/server").PathGuard<"/my/subscription/quota", unknown, unknown, {
291
+ mauLimit: number | null;
292
+ tokenLimit: number | null;
293
+ applicationsLimit: number | null;
294
+ machineToMachineLimit: number | null;
295
+ resourcesLimit: number | null;
296
+ scopesPerResourceLimit: number | null;
297
+ socialConnectorsLimit: number | null;
298
+ machineToMachineRolesLimit: number | null;
299
+ scopesPerRoleLimit: number | null;
300
+ hooksLimit: number | null;
301
+ auditLogsRetentionDays: number | null;
302
+ mfaEnabled: boolean;
303
+ organizationsEnabled: boolean;
304
+ thirdPartyApplicationsLimit: number | null;
305
+ tenantMembersLimit: number | null;
306
+ customJwtEnabled: boolean;
307
+ subjectTokenEnabled: boolean;
308
+ bringYourUiEnabled: boolean;
309
+ userRolesLimit: number | null;
310
+ enterpriseSsoLimit: number | null;
311
+ }>;
312
+ } & {
313
+ "/tenants/my/subscription/usage": import("@withtyped/server").PathGuard<"/my/subscription/usage", unknown, unknown, {
314
+ mauLimit: number;
315
+ tokenLimit: number;
316
+ applicationsLimit: number;
317
+ machineToMachineLimit: number;
318
+ resourcesLimit: number;
319
+ scopesPerResourceLimit: number;
320
+ socialConnectorsLimit: number;
321
+ machineToMachineRolesLimit: number;
322
+ scopesPerRoleLimit: number;
323
+ hooksLimit: number;
324
+ mfaEnabled: boolean;
325
+ organizationsEnabled: boolean;
326
+ thirdPartyApplicationsLimit: number;
327
+ tenantMembersLimit: number;
328
+ customJwtEnabled: boolean;
329
+ subjectTokenEnabled: boolean;
330
+ bringYourUiEnabled: boolean;
331
+ userRolesLimit: number;
332
+ enterpriseSsoLimit: number;
333
+ }>;
334
+ } & {
335
+ "/tenants/my/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/my/subscription/usage/:entityName/scopes", {
336
+ entityId?: string | undefined;
337
+ }, unknown, Record<string, number>>;
169
338
  } & {
170
339
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
171
340
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
172
341
  planId: string;
173
342
  currentPeriodStart: Date;
174
343
  currentPeriodEnd: Date;
344
+ id?: string | undefined;
345
+ upcomingInvoice?: {
346
+ subtotal: number;
347
+ subtotalExcludingTax: number | null;
348
+ total: number;
349
+ totalExcludingTax: number | null;
350
+ } | null | undefined;
351
+ isAddOnAvailable?: boolean | undefined;
352
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
353
+ }>;
354
+ } & {
355
+ "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
356
+ mauLimit: number | null;
357
+ tokenLimit: number | null;
358
+ applicationsLimit: number | null;
359
+ machineToMachineLimit: number | null;
360
+ resourcesLimit: number | null;
361
+ scopesPerResourceLimit: number | null;
362
+ socialConnectorsLimit: number | null;
363
+ machineToMachineRolesLimit: number | null;
364
+ scopesPerRoleLimit: number | null;
365
+ hooksLimit: number | null;
366
+ auditLogsRetentionDays: number | null;
367
+ mfaEnabled: boolean;
368
+ organizationsEnabled: boolean;
369
+ thirdPartyApplicationsLimit: number | null;
370
+ tenantMembersLimit: number | null;
371
+ customJwtEnabled: boolean;
372
+ subjectTokenEnabled: boolean;
373
+ bringYourUiEnabled: boolean;
374
+ userRolesLimit: number | null;
375
+ enterpriseSsoLimit: number | null;
376
+ }>;
377
+ } & {
378
+ "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
379
+ mauLimit: number;
380
+ tokenLimit: number;
381
+ applicationsLimit: number;
382
+ machineToMachineLimit: number;
383
+ resourcesLimit: number;
384
+ scopesPerResourceLimit: number;
385
+ socialConnectorsLimit: number;
386
+ machineToMachineRolesLimit: number;
387
+ scopesPerRoleLimit: number;
388
+ hooksLimit: number;
389
+ mfaEnabled: boolean;
390
+ organizationsEnabled: boolean;
391
+ thirdPartyApplicationsLimit: number;
392
+ tenantMembersLimit: number;
393
+ customJwtEnabled: boolean;
394
+ subjectTokenEnabled: boolean;
395
+ bringYourUiEnabled: boolean;
396
+ userRolesLimit: number;
397
+ enterpriseSsoLimit: number;
398
+ }>;
399
+ } & {
400
+ "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
401
+ entityId?: string | undefined;
402
+ }, unknown, Record<string, number>>;
403
+ } & {
404
+ "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
405
+ usage: {
406
+ mauLimit: number;
407
+ tokenLimit: number;
408
+ applicationsLimit: number;
409
+ machineToMachineLimit: number;
410
+ resourcesLimit: number;
411
+ scopesPerResourceLimit: number;
412
+ socialConnectorsLimit: number;
413
+ machineToMachineRolesLimit: number;
414
+ scopesPerRoleLimit: number;
415
+ hooksLimit: number;
416
+ mfaEnabled: boolean;
417
+ organizationsEnabled: boolean;
418
+ thirdPartyApplicationsLimit: number;
419
+ tenantMembersLimit: number;
420
+ customJwtEnabled: boolean;
421
+ subjectTokenEnabled: boolean;
422
+ bringYourUiEnabled: boolean;
423
+ userRolesLimit: number;
424
+ enterpriseSsoLimit: number;
425
+ };
426
+ resources: Record<string, number>;
427
+ roles: Record<string, number>;
428
+ quota: {
429
+ mauLimit: number | null;
430
+ tokenLimit: number | null;
431
+ applicationsLimit: number | null;
432
+ machineToMachineLimit: number | null;
433
+ resourcesLimit: number | null;
434
+ scopesPerResourceLimit: number | null;
435
+ socialConnectorsLimit: number | null;
436
+ machineToMachineRolesLimit: number | null;
437
+ scopesPerRoleLimit: number | null;
438
+ hooksLimit: number | null;
439
+ auditLogsRetentionDays: number | null;
440
+ mfaEnabled: boolean;
441
+ organizationsEnabled: boolean;
442
+ thirdPartyApplicationsLimit: number | null;
443
+ tenantMembersLimit: number | null;
444
+ customJwtEnabled: boolean;
445
+ subjectTokenEnabled: boolean;
446
+ bringYourUiEnabled: boolean;
447
+ userRolesLimit: number | null;
448
+ enterpriseSsoLimit: number | null;
449
+ };
175
450
  }>;
176
451
  } & {
177
452
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
178
453
  invoices: {
179
454
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
180
- createdAt: Date;
181
455
  id: string;
456
+ createdAt: Date;
182
457
  updatedAt: Date;
183
458
  customerId: string | null;
184
459
  billingReason: string | null;
@@ -190,6 +465,7 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
190
465
  hostedInvoiceUrl: string | null;
191
466
  invoicePdf: string | null;
192
467
  planName: string | null;
468
+ skuId?: string | null | undefined;
193
469
  }[];
194
470
  }>;
195
471
  } & {
@@ -200,9 +476,16 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
200
476
  "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
201
477
  activeUsers: number;
202
478
  cost: number;
479
+ tokenUsage: number;
203
480
  }>;
204
481
  };
205
482
  post: {
483
+ "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
484
+ usageKey: "tokenLimit" | "machineToMachineLimit" | "resourcesLimit" | "enterpriseSsoLimit" | "hooksLimit" | "tenantMembersLimit" | "mfaEnabled" | "organizationsEnabled";
485
+ }, {
486
+ message: string;
487
+ }>;
488
+ } & {
206
489
  "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
207
490
  callbackUrl?: string | undefined;
208
491
  }, {
@@ -216,8 +499,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
216
499
  copy: {};
217
500
  head: {};
218
501
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
219
- options: {};
220
502
  patch: {};
503
+ options: {};
221
504
  get: {
222
505
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
223
506
  from?: string | undefined;
@@ -228,9 +511,11 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
228
511
  post: {
229
512
  "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
230
513
  data: {
231
- type: VerificationCodeType;
514
+ type: TemplateType | VerificationCodeType;
232
515
  payload: {
233
- code: string;
516
+ code?: string | undefined;
517
+ link?: string | undefined;
518
+ } & Record<string, string> & {
234
519
  senderName?: string | undefined;
235
520
  companyInformation?: string | undefined;
236
521
  appLogo?: string | undefined;
@@ -241,28 +526,59 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
241
526
  } & {
242
527
  "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
243
528
  data: {
244
- type: VerificationCodeType;
529
+ type: TemplateType | VerificationCodeType;
245
530
  to: string;
246
531
  payload: {
247
- code: string;
248
- };
532
+ code?: string | undefined;
533
+ link?: string | undefined;
534
+ } & Record<string, string>;
249
535
  };
250
536
  }, unknown>;
537
+ } & {
538
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
539
+ isTest?: string | undefined;
540
+ }, {
541
+ context: Record<string, Json>;
542
+ script: string;
543
+ tokenType: LogtoJwtTokenKeyType.AccessToken;
544
+ token: Record<string, Json>;
545
+ environmentVariables?: Record<string, string> | undefined;
546
+ } | {
547
+ script: string;
548
+ tokenType: LogtoJwtTokenKeyType.ClientCredentials;
549
+ token: Record<string, Json>;
550
+ environmentVariables?: Record<string, string> | undefined;
551
+ }, Record<string, unknown>>;
552
+ };
553
+ put: {
554
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
555
+ "jwt.accessToken"?: {
556
+ production?: string | undefined;
557
+ test?: string | undefined;
558
+ } | undefined;
559
+ "jwt.clientCredentials"?: {
560
+ production?: string | undefined;
561
+ test?: string | undefined;
562
+ } | undefined;
563
+ }, unknown>;
564
+ };
565
+ delete: {
566
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
251
567
  };
252
- put: {};
253
- delete: {};
254
568
  copy: {};
255
569
  head: {};
256
570
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
257
- options: {};
258
571
  patch: {};
572
+ options: {};
259
573
  get: {
260
574
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
261
- createdAt: Date;
262
575
  id: string;
576
+ createdAt: Date;
263
577
  name: string;
578
+ updatedAt: Date;
264
579
  quota: {
265
580
  mauLimit: number | null;
581
+ tokenLimit: number | null;
266
582
  applicationsLimit: number | null;
267
583
  machineToMachineLimit: number | null;
268
584
  resourcesLimit: number | null;
@@ -273,12 +589,18 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
273
589
  socialConnectorsLimit: number | null;
274
590
  standardConnectorsLimit: number | null;
275
591
  rolesLimit: number | null;
592
+ machineToMachineRolesLimit: number | null;
276
593
  scopesPerRoleLimit: number | null;
277
594
  hooksLimit: number | null;
278
595
  auditLogsRetentionDays: number | null;
279
596
  mfaEnabled: boolean;
280
597
  organizationsEnabled: boolean;
281
598
  ssoEnabled: boolean;
599
+ thirdPartyApplicationsLimit: number | null;
600
+ tenantMembersLimit: number | null;
601
+ customJwtEnabled: boolean;
602
+ subjectTokenEnabled: boolean;
603
+ bringYourUiEnabled: boolean;
282
604
  };
283
605
  stripeProducts: {
284
606
  type: "flat" | "tier1" | "tier2" | "tier3";
@@ -292,7 +614,6 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
292
614
  };
293
615
  description?: string | undefined;
294
616
  }[];
295
- updatedAt: Date;
296
617
  }[]>;
297
618
  };
298
619
  post: {};
@@ -301,16 +622,41 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
301
622
  copy: {};
302
623
  head: {};
303
624
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
304
- options: {};
305
625
  patch: {};
626
+ options: {};
306
627
  get: {
307
- "/my/tenant": import("@withtyped/server").PathGuard<"/tenant", unknown, unknown, {
308
- name: string;
628
+ "/skus": import("@withtyped/server").PathGuard<"/", {
629
+ type?: LogtoSkuType | undefined;
630
+ }, unknown, {
631
+ type: LogtoSkuType;
309
632
  id: string;
310
- indicator: string;
311
- isSuspended: boolean;
312
- tag: TenantTag;
313
- }>;
633
+ name: string | null;
634
+ quota: {
635
+ mauLimit?: number | null | undefined;
636
+ tokenLimit?: number | null | undefined;
637
+ applicationsLimit?: number | null | undefined;
638
+ machineToMachineLimit?: number | null | undefined;
639
+ resourcesLimit?: number | null | undefined;
640
+ scopesPerResourceLimit?: number | null | undefined;
641
+ socialConnectorsLimit?: number | null | undefined;
642
+ machineToMachineRolesLimit?: number | null | undefined;
643
+ scopesPerRoleLimit?: number | null | undefined;
644
+ hooksLimit?: number | null | undefined;
645
+ auditLogsRetentionDays?: number | null | undefined;
646
+ mfaEnabled?: boolean | undefined;
647
+ organizationsEnabled?: boolean | undefined;
648
+ thirdPartyApplicationsLimit?: number | null | undefined;
649
+ tenantMembersLimit?: number | null | undefined;
650
+ customJwtEnabled?: boolean | undefined;
651
+ subjectTokenEnabled?: boolean | undefined;
652
+ bringYourUiEnabled?: boolean | undefined;
653
+ userRolesLimit?: number | null | undefined;
654
+ enterpriseSsoLimit?: number | null | undefined;
655
+ };
656
+ createdAt: Date;
657
+ updatedAt: Date;
658
+ unitPrice: number | null;
659
+ }[]>;
314
660
  };
315
661
  post: {};
316
662
  put: {};
@@ -318,17 +664,18 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
318
664
  copy: {};
319
665
  head: {};
320
666
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
321
- options: {};
322
667
  patch: {};
668
+ options: {};
323
669
  get: {
324
670
  "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
325
- status: "open" | "complete" | "expired";
326
- createdAt: Date;
327
671
  id: string;
672
+ createdAt: Date;
328
673
  userId: string;
329
- updatedAt: Date;
674
+ status: "open" | "complete" | "expired";
330
675
  tenantId: string | null;
676
+ updatedAt: Date;
331
677
  planId: string;
678
+ skuId: string | null;
332
679
  }>;
333
680
  };
334
681
  post: {
@@ -336,9 +683,11 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
336
683
  planId: string;
337
684
  successCallbackUrl: string;
338
685
  tenantId?: string | undefined;
339
- cancelCallbackUrl?: string | undefined;
340
- tenantTag?: TenantTag | undefined;
686
+ skuId?: string | undefined;
341
687
  tenantName?: string | undefined;
688
+ tenantTag?: TenantTag | undefined;
689
+ tenantRegionName?: RegionName | undefined;
690
+ cancelCallbackUrl?: string | undefined;
342
691
  }, {
343
692
  sessionId: string;
344
693
  redirectUri?: string | null | undefined;
@@ -349,8 +698,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
349
698
  copy: {};
350
699
  head: {};
351
700
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
352
- options: {};
353
701
  patch: {};
702
+ options: {};
354
703
  get: {
355
704
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
356
705
  };
@@ -358,33 +707,33 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
358
707
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
359
708
  name: string;
360
709
  }, {
361
- createdAt: Date;
362
710
  id: string;
711
+ createdAt: Date;
363
712
  name: string;
364
713
  }>;
365
714
  } & {
366
715
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
367
- value: string;
368
716
  type: "hostname" | "query";
369
- }, {
370
717
  value: string;
371
- type: "hostname" | "query";
718
+ }, {
372
719
  createdAt: Date;
373
720
  affiliateId: string;
721
+ type: "hostname" | "query";
722
+ value: string;
374
723
  }>;
375
724
  };
376
725
  put: {};
377
726
  delete: {
378
727
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
379
- value: string;
380
728
  type: "hostname" | "query";
729
+ value: string;
381
730
  }, unknown>;
382
731
  };
383
732
  copy: {};
384
733
  head: {};
385
734
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
386
- options: {};
387
735
  patch: {};
736
+ options: {};
388
737
  get: {};
389
738
  post: {
390
739
  "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
@@ -393,8 +742,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
393
742
  hostname?: string | undefined;
394
743
  query?: string | undefined;
395
744
  }, {
396
- createdAt: Date;
397
745
  id: string;
746
+ createdAt: Date;
398
747
  affiliateId: string | null;
399
748
  userId: string;
400
749
  createdVia: {
@@ -408,7 +757,164 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
408
757
  delete: {};
409
758
  copy: {};
410
759
  head: {};
760
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
761
+ patch: {
762
+ "/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
763
+ status: OrganizationInvitationStatus.Accepted;
764
+ }, unknown>;
765
+ };
766
+ options: {};
767
+ get: {
768
+ "/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
769
+ id: string;
770
+ createdAt: number;
771
+ status: OrganizationInvitationStatus;
772
+ tenantId: string;
773
+ updatedAt: number;
774
+ inviterId: string | null;
775
+ invitee: string;
776
+ acceptedUserId: string | null;
777
+ organizationId: string;
778
+ expiresAt: number;
779
+ organizationRoles: OrganizationRoleEntity[];
780
+ } & {
781
+ tenantName: string;
782
+ tenantTag: TenantTag;
783
+ })[]>;
784
+ } & {
785
+ "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
786
+ id: string;
787
+ createdAt: number;
788
+ status: OrganizationInvitationStatus;
789
+ tenantId: string;
790
+ updatedAt: number;
791
+ inviterId: string | null;
792
+ invitee: string;
793
+ acceptedUserId: string | null;
794
+ organizationId: string;
795
+ expiresAt: number;
796
+ organizationRoles: OrganizationRoleEntity[];
797
+ }>;
798
+ };
799
+ post: {};
800
+ put: {};
801
+ delete: {};
802
+ copy: {};
803
+ head: {};
804
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
805
+ patch: {};
806
+ options: {};
807
+ get: {};
808
+ post: {};
809
+ put: {};
810
+ delete: {
811
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
812
+ };
813
+ copy: {};
814
+ head: {};
411
815
  }, "/api">>, "/api">;
816
+ export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
817
+ request: {
818
+ id?: string | undefined;
819
+ method?: import("@withtyped/server").RequestMethod | undefined;
820
+ headers: import("http").IncomingHttpHeaders;
821
+ url: URL;
822
+ body?: unknown;
823
+ };
824
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
825
+ patch: {
826
+ "/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
827
+ status: OrganizationInvitationStatus.Revoked;
828
+ }, {
829
+ id: string;
830
+ createdAt: number;
831
+ status: OrganizationInvitationStatus;
832
+ tenantId: string;
833
+ updatedAt: number;
834
+ inviterId: string | null;
835
+ invitee: string;
836
+ acceptedUserId: string | null;
837
+ organizationId: string;
838
+ expiresAt: number;
839
+ organizationRoles: OrganizationRoleEntity[];
840
+ }>;
841
+ };
842
+ options: {};
843
+ get: {
844
+ "/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
845
+ id: string;
846
+ name: string | null;
847
+ username: string | null;
848
+ primaryEmail: string | null;
849
+ primaryPhone: string | null;
850
+ avatar: string | null;
851
+ organizationRoles: OrganizationRoleEntity[];
852
+ }[]>;
853
+ } & {
854
+ "/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
855
+ } & {
856
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
857
+ id: string;
858
+ createdAt: number;
859
+ status: OrganizationInvitationStatus;
860
+ tenantId: string;
861
+ updatedAt: number;
862
+ inviterId: string | null;
863
+ invitee: string;
864
+ acceptedUserId: string | null;
865
+ organizationId: string;
866
+ expiresAt: number;
867
+ organizationRoles: OrganizationRoleEntity[];
868
+ } & {
869
+ inviterName?: string | undefined;
870
+ })[]>;
871
+ };
872
+ post: {
873
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
874
+ invitee: string | string[];
875
+ roleName: TenantRole;
876
+ expiresAt?: number | undefined;
877
+ }, {
878
+ id: string;
879
+ createdAt: number;
880
+ status: OrganizationInvitationStatus;
881
+ tenantId: string;
882
+ updatedAt: number;
883
+ inviterId: string | null;
884
+ invitee: string;
885
+ acceptedUserId: string | null;
886
+ organizationId: string;
887
+ expiresAt: number;
888
+ organizationRoles: OrganizationRoleEntity[];
889
+ } | {
890
+ id: string;
891
+ createdAt: number;
892
+ status: OrganizationInvitationStatus;
893
+ tenantId: string;
894
+ updatedAt: number;
895
+ inviterId: string | null;
896
+ invitee: string;
897
+ acceptedUserId: string | null;
898
+ organizationId: string;
899
+ expiresAt: number;
900
+ organizationRoles: OrganizationRoleEntity[];
901
+ }[]>;
902
+ } & {
903
+ "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
904
+ };
905
+ put: {
906
+ "/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
907
+ roleName: TenantRole;
908
+ }, unknown>;
909
+ };
910
+ delete: {
911
+ "/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
912
+ } & {
913
+ "/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
914
+ };
915
+ copy: {};
916
+ head: {};
917
+ }, "/api/tenants">>, "/api/tenants">;
412
918
 
413
919
  export {
414
920
  router as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-5a698db",
3
+ "version": "0.2.5-632268d",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -16,25 +16,24 @@
16
16
  "#src/*": "./build/*"
17
17
  },
18
18
  "devDependencies": {
19
- "@silverhand/eslint-config": "4.0.1",
20
- "@silverhand/jest-config": "4.0.0",
21
- "@silverhand/ts-config": "4.0.0",
19
+ "@silverhand/eslint-config": "6.0.1",
20
+ "@silverhand/ts-config": "6.0.0",
22
21
  "@types/accepts": "^1.3.5",
23
22
  "@types/http-proxy": "^1.17.9",
24
- "@types/jest": "^29.4.0",
25
23
  "@types/mime-types": "^2.1.1",
26
- "@types/node": "^18.11.18",
24
+ "@types/node": "^20.0.0",
27
25
  "@types/yargs": "^17.0.24",
28
- "dts-bundle-generator": "^8.0.1",
29
- "eslint": "^8.44.0",
30
- "jest": "^29.5.0",
26
+ "dts-bundle-generator": "^9.3.1",
27
+ "eslint": "^8.57.0",
31
28
  "lint-staged": "^15.0.0",
32
29
  "nodemon": "^3.0.0",
33
30
  "prettier": "^3.0.0",
34
- "typescript": "^5.0.0"
31
+ "typescript": "^5.3.3",
32
+ "vite-tsconfig-paths": "^4.3.1",
33
+ "vitest": "^2.0.0"
35
34
  },
36
35
  "engines": {
37
- "node": "^18.12.0"
36
+ "node": "^20.9.0"
38
37
  },
39
38
  "eslintConfig": {
40
39
  "extends": "@silverhand",
@@ -50,22 +49,19 @@
50
49
  "access": "public"
51
50
  },
52
51
  "dependencies": {
53
- "@silverhand/essentials": "^2.8.5",
54
- "@withtyped/server": "^0.12.7"
52
+ "@silverhand/essentials": "^2.9.1",
53
+ "@withtyped/server": "^0.13.6"
55
54
  },
56
55
  "scripts": {
57
56
  "precommit": "lint-staged",
58
57
  "build": "rm -rf build/ && tsc -p tsconfig.build.json && pnpm build:lib",
59
58
  "//": "It is not used to build the service itself.",
60
- "build:lib": "rm -rf lib/ && dts-bundle-generator src/routes/index.ts --project tsconfig.build.json -o lib/routes/index.d.ts",
61
- "build:test": "rm -rf build/ && tsc -p tsconfig.test.json --sourcemap",
59
+ "build:lib": "rm -rf lib/ && dts-bundle-generator src/routes/index.ts --project tsconfig.build.lib.json -o lib/routes/index.d.ts",
62
60
  "lint": "eslint --ext .ts src",
63
61
  "lint:report": "pnpm lint --format json --output-file report.json",
64
62
  "dev": "rm -rf build/ && nodemon",
65
63
  "start": "NODE_ENV=production node .",
66
- "test:only": "NODE_OPTIONS=\"--experimental-vm-modules --max_old_space_size=4096\" jest --logHeapUsage",
67
- "test": "pnpm build:test && pnpm test:only && pnpm build:lib && pnpm test:types",
68
- "test:ci": "pnpm test:only --coverage --silent",
64
+ "test": "vitest && pnpm build:lib && pnpm test:types",
69
65
  "test:types": "tsc -p tsconfig.test.types.json",
70
66
  "cli": "node ./build/cli/index.js"
71
67
  }