@logto/cloud 0.2.5-5deb133 → 0.2.5-61f7709

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 +625 -64
  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,113 @@ 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
+ quota: {
123
+ mauLimit: number | null;
124
+ };
125
+ createdAt: Date;
126
+ usage: {
127
+ activeUsers: number;
128
+ };
49
129
  indicator: string;
50
130
  isSuspended: boolean;
51
131
  planId: string;
@@ -54,16 +134,22 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
54
134
  planId: string;
55
135
  currentPeriodStart: Date;
56
136
  currentPeriodEnd: Date;
137
+ id?: string | undefined;
138
+ upcomingInvoice?: {
139
+ subtotal: number;
140
+ subtotalExcludingTax: number | null;
141
+ total: number;
142
+ totalExcludingTax: number | null;
143
+ } | null | undefined;
144
+ isAddOnAvailable?: boolean | undefined;
145
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
57
146
  };
147
+ regionName: RegionName;
58
148
  tag: TenantTag;
59
- usage: {
60
- activeUsers: number;
61
- cost: number;
62
- };
63
149
  openInvoices: {
64
150
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
65
- createdAt: Date;
66
151
  id: string;
152
+ createdAt: Date;
67
153
  updatedAt: Date;
68
154
  customerId: string | null;
69
155
  billingReason: string | null;
@@ -77,10 +163,18 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
77
163
  }[];
78
164
  }>;
79
165
  };
166
+ options: {};
80
167
  get: {
81
168
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
82
169
  id: string;
83
170
  name: string;
171
+ quota: {
172
+ mauLimit: number | null;
173
+ };
174
+ createdAt: Date;
175
+ usage: {
176
+ activeUsers: number;
177
+ };
84
178
  indicator: string;
85
179
  isSuspended: boolean;
86
180
  planId: string;
@@ -89,16 +183,22 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
89
183
  planId: string;
90
184
  currentPeriodStart: Date;
91
185
  currentPeriodEnd: Date;
186
+ id?: string | undefined;
187
+ upcomingInvoice?: {
188
+ subtotal: number;
189
+ subtotalExcludingTax: number | null;
190
+ total: number;
191
+ totalExcludingTax: number | null;
192
+ } | null | undefined;
193
+ isAddOnAvailable?: boolean | undefined;
194
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
92
195
  };
196
+ regionName: RegionName;
93
197
  tag: TenantTag;
94
- usage: {
95
- activeUsers: number;
96
- cost: number;
97
- };
98
198
  openInvoices: {
99
199
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
100
- createdAt: Date;
101
200
  id: string;
201
+ createdAt: Date;
102
202
  updatedAt: Date;
103
203
  customerId: string | null;
104
204
  billingReason: string | null;
@@ -116,9 +216,17 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
116
216
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
117
217
  name?: string | undefined;
118
218
  tag?: TenantTag | undefined;
219
+ regionName?: RegionName | undefined;
119
220
  }, {
120
221
  id: string;
121
222
  name: string;
223
+ quota: {
224
+ mauLimit: number | null;
225
+ };
226
+ createdAt: Date;
227
+ usage: {
228
+ activeUsers: number;
229
+ };
122
230
  indicator: string;
123
231
  isSuspended: boolean;
124
232
  planId: string;
@@ -127,16 +235,22 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
127
235
  planId: string;
128
236
  currentPeriodStart: Date;
129
237
  currentPeriodEnd: Date;
238
+ id?: string | undefined;
239
+ upcomingInvoice?: {
240
+ subtotal: number;
241
+ subtotalExcludingTax: number | null;
242
+ total: number;
243
+ totalExcludingTax: number | null;
244
+ } | null | undefined;
245
+ isAddOnAvailable?: boolean | undefined;
246
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
130
247
  };
248
+ regionName: RegionName;
131
249
  tag: TenantTag;
132
- usage: {
133
- activeUsers: number;
134
- cost: number;
135
- };
136
250
  openInvoices: {
137
251
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
138
- createdAt: Date;
139
252
  id: string;
253
+ createdAt: Date;
140
254
  updatedAt: Date;
141
255
  customerId: string | null;
142
256
  billingReason: string | null;
@@ -157,14 +271,126 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
157
271
  copy: {};
158
272
  head: {};
159
273
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
160
- options: {};
161
274
  patch: {};
275
+ options: {};
162
276
  get: {
163
277
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
164
278
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
165
279
  planId: string;
166
280
  currentPeriodStart: Date;
167
281
  currentPeriodEnd: Date;
282
+ id?: string | undefined;
283
+ upcomingInvoice?: {
284
+ subtotal: number;
285
+ subtotalExcludingTax: number | null;
286
+ total: number;
287
+ totalExcludingTax: number | null;
288
+ } | null | undefined;
289
+ isAddOnAvailable?: boolean | undefined;
290
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
291
+ }>;
292
+ } & {
293
+ "/tenants/my/subscription/quota": import("@withtyped/server").PathGuard<"/my/subscription/quota", unknown, unknown, {
294
+ mauLimit: number | null;
295
+ tokenLimit: number | null;
296
+ applicationsLimit: number | null;
297
+ machineToMachineLimit: number | null;
298
+ resourcesLimit: number | null;
299
+ scopesPerResourceLimit: number | null;
300
+ socialConnectorsLimit: number | null;
301
+ machineToMachineRolesLimit: number | null;
302
+ scopesPerRoleLimit: number | null;
303
+ hooksLimit: number | null;
304
+ auditLogsRetentionDays: number | null;
305
+ mfaEnabled: boolean;
306
+ organizationsEnabled: boolean;
307
+ thirdPartyApplicationsLimit: number | null;
308
+ tenantMembersLimit: number | null;
309
+ customJwtEnabled: boolean;
310
+ subjectTokenEnabled: boolean;
311
+ bringYourUiEnabled: boolean;
312
+ userRolesLimit: number | null;
313
+ enterpriseSsoLimit: number | null;
314
+ }>;
315
+ } & {
316
+ "/tenants/my/subscription/usage": import("@withtyped/server").PathGuard<"/my/subscription/usage", unknown, unknown, {
317
+ mauLimit: number;
318
+ tokenLimit: number;
319
+ applicationsLimit: number;
320
+ machineToMachineLimit: number;
321
+ resourcesLimit: number;
322
+ scopesPerResourceLimit: number;
323
+ socialConnectorsLimit: number;
324
+ machineToMachineRolesLimit: number;
325
+ scopesPerRoleLimit: number;
326
+ hooksLimit: number;
327
+ mfaEnabled: boolean;
328
+ organizationsEnabled: boolean;
329
+ thirdPartyApplicationsLimit: number;
330
+ tenantMembersLimit: number;
331
+ customJwtEnabled: boolean;
332
+ subjectTokenEnabled: boolean;
333
+ bringYourUiEnabled: boolean;
334
+ userRolesLimit: number;
335
+ enterpriseSsoLimit: number;
336
+ }>;
337
+ } & {
338
+ "/tenants/my/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/my/subscription/usage/:entityName/scopes", {
339
+ entityId?: string | undefined;
340
+ }, unknown, Record<string, number>>;
341
+ } & {
342
+ "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
343
+ usage: {
344
+ mauLimit: number;
345
+ tokenLimit: number;
346
+ applicationsLimit: number;
347
+ machineToMachineLimit: number;
348
+ resourcesLimit: number;
349
+ scopesPerResourceLimit: number;
350
+ socialConnectorsLimit: number;
351
+ machineToMachineRolesLimit: number;
352
+ scopesPerRoleLimit: number;
353
+ hooksLimit: number;
354
+ mfaEnabled: boolean;
355
+ organizationsEnabled: boolean;
356
+ thirdPartyApplicationsLimit: number;
357
+ tenantMembersLimit: number;
358
+ customJwtEnabled: boolean;
359
+ subjectTokenEnabled: boolean;
360
+ bringYourUiEnabled: boolean;
361
+ userRolesLimit: number;
362
+ enterpriseSsoLimit: number;
363
+ };
364
+ resources: Record<string, number>;
365
+ roles: Record<string, number>;
366
+ quota: {
367
+ mauLimit: number | null;
368
+ tokenLimit: number | null;
369
+ applicationsLimit: number | null;
370
+ machineToMachineLimit: number | null;
371
+ resourcesLimit: number | null;
372
+ scopesPerResourceLimit: number | null;
373
+ socialConnectorsLimit: number | null;
374
+ machineToMachineRolesLimit: number | null;
375
+ scopesPerRoleLimit: number | null;
376
+ hooksLimit: number | null;
377
+ auditLogsRetentionDays: number | null;
378
+ mfaEnabled: boolean;
379
+ organizationsEnabled: boolean;
380
+ thirdPartyApplicationsLimit: number | null;
381
+ tenantMembersLimit: number | null;
382
+ customJwtEnabled: boolean;
383
+ subjectTokenEnabled: boolean;
384
+ bringYourUiEnabled: boolean;
385
+ userRolesLimit: number | null;
386
+ enterpriseSsoLimit: number | null;
387
+ };
388
+ upcomingInvoice?: {
389
+ subtotal: number;
390
+ subtotalExcludingTax: number | null;
391
+ total: number;
392
+ totalExcludingTax: number | null;
393
+ } | null | undefined;
168
394
  }>;
169
395
  } & {
170
396
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
@@ -172,13 +398,125 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
172
398
  planId: string;
173
399
  currentPeriodStart: Date;
174
400
  currentPeriodEnd: Date;
401
+ id?: string | undefined;
402
+ upcomingInvoice?: {
403
+ subtotal: number;
404
+ subtotalExcludingTax: number | null;
405
+ total: number;
406
+ totalExcludingTax: number | null;
407
+ } | null | undefined;
408
+ isAddOnAvailable?: boolean | undefined;
409
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
410
+ }>;
411
+ } & {
412
+ "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
413
+ mauLimit: number | null;
414
+ tokenLimit: number | null;
415
+ applicationsLimit: number | null;
416
+ machineToMachineLimit: number | null;
417
+ resourcesLimit: number | null;
418
+ scopesPerResourceLimit: number | null;
419
+ socialConnectorsLimit: number | null;
420
+ machineToMachineRolesLimit: number | null;
421
+ scopesPerRoleLimit: number | null;
422
+ hooksLimit: number | null;
423
+ auditLogsRetentionDays: number | null;
424
+ mfaEnabled: boolean;
425
+ organizationsEnabled: boolean;
426
+ thirdPartyApplicationsLimit: number | null;
427
+ tenantMembersLimit: number | null;
428
+ customJwtEnabled: boolean;
429
+ subjectTokenEnabled: boolean;
430
+ bringYourUiEnabled: boolean;
431
+ userRolesLimit: number | null;
432
+ enterpriseSsoLimit: number | null;
433
+ }>;
434
+ } & {
435
+ "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
436
+ mauLimit: number;
437
+ tokenLimit: number;
438
+ applicationsLimit: number;
439
+ machineToMachineLimit: number;
440
+ resourcesLimit: number;
441
+ scopesPerResourceLimit: number;
442
+ socialConnectorsLimit: number;
443
+ machineToMachineRolesLimit: number;
444
+ scopesPerRoleLimit: number;
445
+ hooksLimit: number;
446
+ mfaEnabled: boolean;
447
+ organizationsEnabled: boolean;
448
+ thirdPartyApplicationsLimit: number;
449
+ tenantMembersLimit: number;
450
+ customJwtEnabled: boolean;
451
+ subjectTokenEnabled: boolean;
452
+ bringYourUiEnabled: boolean;
453
+ userRolesLimit: number;
454
+ enterpriseSsoLimit: number;
455
+ }>;
456
+ } & {
457
+ "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
458
+ entityId?: string | undefined;
459
+ }, unknown, Record<string, number>>;
460
+ } & {
461
+ "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
462
+ usage: {
463
+ mauLimit: number;
464
+ tokenLimit: number;
465
+ applicationsLimit: number;
466
+ machineToMachineLimit: number;
467
+ resourcesLimit: number;
468
+ scopesPerResourceLimit: number;
469
+ socialConnectorsLimit: number;
470
+ machineToMachineRolesLimit: number;
471
+ scopesPerRoleLimit: number;
472
+ hooksLimit: number;
473
+ mfaEnabled: boolean;
474
+ organizationsEnabled: boolean;
475
+ thirdPartyApplicationsLimit: number;
476
+ tenantMembersLimit: number;
477
+ customJwtEnabled: boolean;
478
+ subjectTokenEnabled: boolean;
479
+ bringYourUiEnabled: boolean;
480
+ userRolesLimit: number;
481
+ enterpriseSsoLimit: number;
482
+ };
483
+ resources: Record<string, number>;
484
+ roles: Record<string, number>;
485
+ quota: {
486
+ mauLimit: number | null;
487
+ tokenLimit: number | null;
488
+ applicationsLimit: number | null;
489
+ machineToMachineLimit: number | null;
490
+ resourcesLimit: number | null;
491
+ scopesPerResourceLimit: number | null;
492
+ socialConnectorsLimit: number | null;
493
+ machineToMachineRolesLimit: number | null;
494
+ scopesPerRoleLimit: number | null;
495
+ hooksLimit: number | null;
496
+ auditLogsRetentionDays: number | null;
497
+ mfaEnabled: boolean;
498
+ organizationsEnabled: boolean;
499
+ thirdPartyApplicationsLimit: number | null;
500
+ tenantMembersLimit: number | null;
501
+ customJwtEnabled: boolean;
502
+ subjectTokenEnabled: boolean;
503
+ bringYourUiEnabled: boolean;
504
+ userRolesLimit: number | null;
505
+ enterpriseSsoLimit: number | null;
506
+ };
507
+ upcomingInvoice?: {
508
+ subtotal: number;
509
+ subtotalExcludingTax: number | null;
510
+ total: number;
511
+ totalExcludingTax: number | null;
512
+ } | null | undefined;
175
513
  }>;
176
514
  } & {
177
515
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
178
516
  invoices: {
179
517
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
180
- createdAt: Date;
181
518
  id: string;
519
+ createdAt: Date;
182
520
  updatedAt: Date;
183
521
  customerId: string | null;
184
522
  billingReason: string | null;
@@ -190,19 +528,21 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
190
528
  hostedInvoiceUrl: string | null;
191
529
  invoicePdf: string | null;
192
530
  planName: string | null;
531
+ skuId?: string | null | undefined;
193
532
  }[];
194
533
  }>;
195
534
  } & {
196
535
  "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
197
536
  hostedInvoiceUrl: string;
198
537
  }>;
199
- } & {
200
- "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
201
- activeUsers: number;
202
- cost: number;
203
- }>;
204
538
  };
205
539
  post: {
540
+ "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
541
+ usageKey: "tokenLimit" | "machineToMachineLimit" | "resourcesLimit" | "enterpriseSsoLimit" | "hooksLimit" | "tenantMembersLimit" | "mfaEnabled" | "organizationsEnabled";
542
+ }, {
543
+ message: string;
544
+ }>;
545
+ } & {
206
546
  "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
207
547
  callbackUrl?: string | undefined;
208
548
  }, {
@@ -216,8 +556,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
216
556
  copy: {};
217
557
  head: {};
218
558
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
219
- options: {};
220
559
  patch: {};
560
+ options: {};
221
561
  get: {
222
562
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
223
563
  from?: string | undefined;
@@ -228,9 +568,11 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
228
568
  post: {
229
569
  "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
230
570
  data: {
231
- type: VerificationCodeType;
571
+ type: TemplateType | VerificationCodeType;
232
572
  payload: {
233
- code: string;
573
+ code?: string | undefined;
574
+ link?: string | undefined;
575
+ } & Record<string, string> & {
234
576
  senderName?: string | undefined;
235
577
  companyInformation?: string | undefined;
236
578
  appLogo?: string | undefined;
@@ -241,26 +583,56 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
241
583
  } & {
242
584
  "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
243
585
  data: {
244
- type: VerificationCodeType;
586
+ type: TemplateType | VerificationCodeType;
245
587
  to: string;
246
588
  payload: {
247
- code: string;
248
- };
589
+ code?: string | undefined;
590
+ link?: string | undefined;
591
+ } & Record<string, string>;
249
592
  };
250
593
  }, unknown>;
594
+ } & {
595
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
596
+ isTest?: string | undefined;
597
+ }, {
598
+ context: Record<string, Json>;
599
+ script: string;
600
+ tokenType: LogtoJwtTokenKeyType.AccessToken;
601
+ token: Record<string, Json>;
602
+ environmentVariables?: Record<string, string> | undefined;
603
+ } | {
604
+ script: string;
605
+ tokenType: LogtoJwtTokenKeyType.ClientCredentials;
606
+ token: Record<string, Json>;
607
+ environmentVariables?: Record<string, string> | undefined;
608
+ }, Record<string, unknown>>;
609
+ };
610
+ put: {
611
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
612
+ "jwt.accessToken"?: {
613
+ production?: string | undefined;
614
+ test?: string | undefined;
615
+ } | undefined;
616
+ "jwt.clientCredentials"?: {
617
+ production?: string | undefined;
618
+ test?: string | undefined;
619
+ } | undefined;
620
+ }, unknown>;
621
+ };
622
+ delete: {
623
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
251
624
  };
252
- put: {};
253
- delete: {};
254
625
  copy: {};
255
626
  head: {};
256
627
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
257
- options: {};
258
628
  patch: {};
629
+ options: {};
259
630
  get: {
260
631
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
261
- createdAt: Date;
262
632
  id: string;
633
+ createdAt: Date;
263
634
  name: string;
635
+ updatedAt: Date;
264
636
  quota: {
265
637
  mauLimit: number | null;
266
638
  tokenLimit: number | null;
@@ -281,6 +653,11 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
281
653
  mfaEnabled: boolean;
282
654
  organizationsEnabled: boolean;
283
655
  ssoEnabled: boolean;
656
+ thirdPartyApplicationsLimit: number | null;
657
+ tenantMembersLimit: number | null;
658
+ customJwtEnabled: boolean;
659
+ subjectTokenEnabled: boolean;
660
+ bringYourUiEnabled: boolean;
284
661
  };
285
662
  stripeProducts: {
286
663
  type: "flat" | "tier1" | "tier2" | "tier3";
@@ -294,7 +671,6 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
294
671
  };
295
672
  description?: string | undefined;
296
673
  }[];
297
- updatedAt: Date;
298
674
  }[]>;
299
675
  };
300
676
  post: {};
@@ -303,16 +679,41 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
303
679
  copy: {};
304
680
  head: {};
305
681
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
306
- options: {};
307
682
  patch: {};
683
+ options: {};
308
684
  get: {
309
- "/my/tenant": import("@withtyped/server").PathGuard<"/tenant", unknown, unknown, {
310
- name: string;
685
+ "/skus": import("@withtyped/server").PathGuard<"/", {
686
+ type?: LogtoSkuType | undefined;
687
+ }, unknown, {
688
+ type: LogtoSkuType;
311
689
  id: string;
312
- indicator: string;
313
- isSuspended: boolean;
314
- tag: TenantTag;
315
- }>;
690
+ name: string | null;
691
+ quota: {
692
+ mauLimit?: number | null | undefined;
693
+ tokenLimit?: number | null | undefined;
694
+ applicationsLimit?: number | null | undefined;
695
+ machineToMachineLimit?: number | null | undefined;
696
+ resourcesLimit?: number | null | undefined;
697
+ scopesPerResourceLimit?: number | null | undefined;
698
+ socialConnectorsLimit?: number | null | undefined;
699
+ machineToMachineRolesLimit?: number | null | undefined;
700
+ scopesPerRoleLimit?: number | null | undefined;
701
+ hooksLimit?: number | null | undefined;
702
+ auditLogsRetentionDays?: number | null | undefined;
703
+ mfaEnabled?: boolean | undefined;
704
+ organizationsEnabled?: boolean | undefined;
705
+ thirdPartyApplicationsLimit?: number | null | undefined;
706
+ tenantMembersLimit?: number | null | undefined;
707
+ customJwtEnabled?: boolean | undefined;
708
+ subjectTokenEnabled?: boolean | undefined;
709
+ bringYourUiEnabled?: boolean | undefined;
710
+ userRolesLimit?: number | null | undefined;
711
+ enterpriseSsoLimit?: number | null | undefined;
712
+ };
713
+ createdAt: Date;
714
+ updatedAt: Date;
715
+ unitPrice: number | null;
716
+ }[]>;
316
717
  };
317
718
  post: {};
318
719
  put: {};
@@ -320,17 +721,18 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
320
721
  copy: {};
321
722
  head: {};
322
723
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
323
- options: {};
324
724
  patch: {};
725
+ options: {};
325
726
  get: {
326
727
  "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
327
- status: "open" | "complete" | "expired";
328
- createdAt: Date;
329
728
  id: string;
729
+ createdAt: Date;
330
730
  userId: string;
331
- updatedAt: Date;
731
+ status: "open" | "complete" | "expired";
332
732
  tenantId: string | null;
733
+ updatedAt: Date;
333
734
  planId: string;
735
+ skuId: string | null;
334
736
  }>;
335
737
  };
336
738
  post: {
@@ -338,9 +740,11 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
338
740
  planId: string;
339
741
  successCallbackUrl: string;
340
742
  tenantId?: string | undefined;
341
- cancelCallbackUrl?: string | undefined;
342
- tenantTag?: TenantTag | undefined;
743
+ skuId?: string | undefined;
343
744
  tenantName?: string | undefined;
745
+ tenantTag?: TenantTag | undefined;
746
+ tenantRegionName?: RegionName | undefined;
747
+ cancelCallbackUrl?: string | undefined;
344
748
  }, {
345
749
  sessionId: string;
346
750
  redirectUri?: string | null | undefined;
@@ -351,8 +755,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
351
755
  copy: {};
352
756
  head: {};
353
757
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
354
- options: {};
355
758
  patch: {};
759
+ options: {};
356
760
  get: {
357
761
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
358
762
  };
@@ -360,33 +764,33 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
360
764
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
361
765
  name: string;
362
766
  }, {
363
- createdAt: Date;
364
767
  id: string;
768
+ createdAt: Date;
365
769
  name: string;
366
770
  }>;
367
771
  } & {
368
772
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
369
- value: string;
370
773
  type: "hostname" | "query";
371
- }, {
372
774
  value: string;
373
- type: "hostname" | "query";
775
+ }, {
374
776
  createdAt: Date;
375
777
  affiliateId: string;
778
+ type: "hostname" | "query";
779
+ value: string;
376
780
  }>;
377
781
  };
378
782
  put: {};
379
783
  delete: {
380
784
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
381
- value: string;
382
785
  type: "hostname" | "query";
786
+ value: string;
383
787
  }, unknown>;
384
788
  };
385
789
  copy: {};
386
790
  head: {};
387
791
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
388
- options: {};
389
792
  patch: {};
793
+ options: {};
390
794
  get: {};
391
795
  post: {
392
796
  "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
@@ -395,8 +799,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
395
799
  hostname?: string | undefined;
396
800
  query?: string | undefined;
397
801
  }, {
398
- createdAt: Date;
399
802
  id: string;
803
+ createdAt: Date;
400
804
  affiliateId: string | null;
401
805
  userId: string;
402
806
  createdVia: {
@@ -410,7 +814,164 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
410
814
  delete: {};
411
815
  copy: {};
412
816
  head: {};
817
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
818
+ patch: {
819
+ "/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
820
+ status: OrganizationInvitationStatus.Accepted;
821
+ }, unknown>;
822
+ };
823
+ options: {};
824
+ get: {
825
+ "/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
826
+ id: string;
827
+ createdAt: number;
828
+ status: OrganizationInvitationStatus;
829
+ tenantId: string;
830
+ updatedAt: number;
831
+ inviterId: string | null;
832
+ invitee: string;
833
+ acceptedUserId: string | null;
834
+ organizationId: string;
835
+ expiresAt: number;
836
+ organizationRoles: OrganizationRoleEntity[];
837
+ } & {
838
+ tenantName: string;
839
+ tenantTag: TenantTag;
840
+ })[]>;
841
+ } & {
842
+ "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
843
+ id: string;
844
+ createdAt: number;
845
+ status: OrganizationInvitationStatus;
846
+ tenantId: string;
847
+ updatedAt: number;
848
+ inviterId: string | null;
849
+ invitee: string;
850
+ acceptedUserId: string | null;
851
+ organizationId: string;
852
+ expiresAt: number;
853
+ organizationRoles: OrganizationRoleEntity[];
854
+ }>;
855
+ };
856
+ post: {};
857
+ put: {};
858
+ delete: {};
859
+ copy: {};
860
+ head: {};
861
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
862
+ patch: {};
863
+ options: {};
864
+ get: {};
865
+ post: {};
866
+ put: {};
867
+ delete: {
868
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
869
+ };
870
+ copy: {};
871
+ head: {};
413
872
  }, "/api">>, "/api">;
873
+ export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
874
+ request: {
875
+ id?: string | undefined;
876
+ method?: import("@withtyped/server").RequestMethod | undefined;
877
+ headers: import("http").IncomingHttpHeaders;
878
+ url: URL;
879
+ body?: unknown;
880
+ };
881
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
882
+ patch: {
883
+ "/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
884
+ status: OrganizationInvitationStatus.Revoked;
885
+ }, {
886
+ id: string;
887
+ createdAt: number;
888
+ status: OrganizationInvitationStatus;
889
+ tenantId: string;
890
+ updatedAt: number;
891
+ inviterId: string | null;
892
+ invitee: string;
893
+ acceptedUserId: string | null;
894
+ organizationId: string;
895
+ expiresAt: number;
896
+ organizationRoles: OrganizationRoleEntity[];
897
+ }>;
898
+ };
899
+ options: {};
900
+ get: {
901
+ "/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
902
+ id: string;
903
+ name: string | null;
904
+ username: string | null;
905
+ primaryEmail: string | null;
906
+ primaryPhone: string | null;
907
+ avatar: string | null;
908
+ organizationRoles: OrganizationRoleEntity[];
909
+ }[]>;
910
+ } & {
911
+ "/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
912
+ } & {
913
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
914
+ id: string;
915
+ createdAt: number;
916
+ status: OrganizationInvitationStatus;
917
+ tenantId: string;
918
+ updatedAt: number;
919
+ inviterId: string | null;
920
+ invitee: string;
921
+ acceptedUserId: string | null;
922
+ organizationId: string;
923
+ expiresAt: number;
924
+ organizationRoles: OrganizationRoleEntity[];
925
+ } & {
926
+ inviterName?: string | undefined;
927
+ })[]>;
928
+ };
929
+ post: {
930
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
931
+ invitee: string | string[];
932
+ roleName: TenantRole;
933
+ expiresAt?: number | undefined;
934
+ }, {
935
+ id: string;
936
+ createdAt: number;
937
+ status: OrganizationInvitationStatus;
938
+ tenantId: string;
939
+ updatedAt: number;
940
+ inviterId: string | null;
941
+ invitee: string;
942
+ acceptedUserId: string | null;
943
+ organizationId: string;
944
+ expiresAt: number;
945
+ organizationRoles: OrganizationRoleEntity[];
946
+ } | {
947
+ id: string;
948
+ createdAt: number;
949
+ status: OrganizationInvitationStatus;
950
+ tenantId: string;
951
+ updatedAt: number;
952
+ inviterId: string | null;
953
+ invitee: string;
954
+ acceptedUserId: string | null;
955
+ organizationId: string;
956
+ expiresAt: number;
957
+ organizationRoles: OrganizationRoleEntity[];
958
+ }[]>;
959
+ } & {
960
+ "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
961
+ };
962
+ put: {
963
+ "/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
964
+ roleName: TenantRole;
965
+ }, unknown>;
966
+ };
967
+ delete: {
968
+ "/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
969
+ } & {
970
+ "/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
971
+ };
972
+ copy: {};
973
+ head: {};
974
+ }, "/api/tenants">>, "/api/tenants">;
414
975
 
415
976
  export {
416
977
  router as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-5deb133",
3
+ "version": "0.2.5-61f7709",
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.6",
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
  }