@logto/cloud 0.2.5-ab8a489 → 0.2.5-b5c7745

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 +593 -102
  2. package/package.json +8 -8
@@ -11,14 +11,6 @@ export type WithAuthContext<Context = RequestContext> = Context & {
11
11
  scopes: string[];
12
12
  };
13
13
  };
14
- declare enum VerificationCodeType {
15
- SignIn = "SignIn",
16
- Register = "Register",
17
- ForgotPassword = "ForgotPassword",
18
- Generic = "Generic",
19
- /** @deprecated Use `Generic` type template for sending test sms/email use case */
20
- Test = "Test"
21
- }
22
14
  declare enum TemplateType {
23
15
  /** The template for sending verification code when user is signing in. */
24
16
  SignIn = "SignIn",
@@ -29,7 +21,11 @@ declare enum TemplateType {
29
21
  /** The template for sending organization invitation. */
30
22
  OrganizationInvitation = "OrganizationInvitation",
31
23
  /** The template for generic usage. */
32
- Generic = "Generic"
24
+ Generic = "Generic",
25
+ /** The template for validating user permission for sensitive operations. */
26
+ UserPermissionValidation = "UserPermissionValidation",
27
+ /** The template for binding a new identifier to an existing account. */
28
+ BindNewIdentifier = "BindNewIdentifier"
33
29
  }
34
30
  declare enum OrganizationInvitationStatus {
35
31
  Pending = "Pending",
@@ -37,6 +33,16 @@ declare enum OrganizationInvitationStatus {
37
33
  Expired = "Expired",
38
34
  Revoked = "Revoked"
39
35
  }
36
+ /** The scopes (permissions) defined by the organization template. */
37
+ export type OrganizationScope = {
38
+ tenantId: string;
39
+ /** The globally unique identifier of the organization scope. */
40
+ id: string;
41
+ /** The organization scope's name, unique within the organization template. */
42
+ name: string;
43
+ /** A brief description of the organization scope. */
44
+ description: string | null;
45
+ };
40
46
  declare enum LogtoJwtTokenKeyType {
41
47
  AccessToken = "access-token",
42
48
  ClientCredentials = "client-credentials"
@@ -59,6 +65,23 @@ declare enum TenantRole {
59
65
  /** Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
60
66
  Collaborator = "collaborator"
61
67
  }
68
+ declare const availableReportableUsageKeys: readonly [
69
+ "tokenLimit",
70
+ "machineToMachineLimit",
71
+ "resourcesLimit",
72
+ "enterpriseSsoLimit",
73
+ "hooksLimit",
74
+ "tenantMembersLimit",
75
+ "mfaEnabled",
76
+ "organizationsEnabled",
77
+ "organizationsLimit"
78
+ ];
79
+ export type ReportableUsageKey = (typeof availableReportableUsageKeys)[number];
80
+ export type RealtimeReportableUsageKey = Exclude<ReportableUsageKey, "tokenLimit">;
81
+ declare enum LogtoSkuType {
82
+ Basic = "Basic",
83
+ AddOn = "AddOn"
84
+ }
62
85
  declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
63
86
  createdAt: Date;
64
87
  affiliateId: string;
@@ -72,11 +95,18 @@ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default
72
95
  id: string;
73
96
  }, "id" | "createdAt", "id" | "createdAt">;
74
97
  export type Affiliate = InferModelType<typeof Affiliates>;
98
+ declare enum RegionName {
99
+ EU = "EU",
100
+ US = "US",
101
+ AU = "AU",
102
+ CrescLabJP = "CRESCLAB_JP"
103
+ }
75
104
  export type AffiliateData = Affiliate & {
76
105
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
77
106
  };
78
107
  declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
79
108
  request: {
109
+ id?: string | undefined;
80
110
  method?: import("@withtyped/server").RequestMethod | undefined;
81
111
  headers: import("http").IncomingHttpHeaders;
82
112
  url: URL;
@@ -84,6 +114,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
84
114
  };
85
115
  }, "request"> & {
86
116
  request: Record<string, unknown> & {
117
+ id?: string | undefined;
87
118
  method?: import("@withtyped/server").RequestMethod | undefined;
88
119
  headers: import("http").IncomingHttpHeaders;
89
120
  url: URL;
@@ -92,16 +123,20 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
92
123
  body?: Json | undefined;
93
124
  bodyRaw?: Buffer | undefined;
94
125
  };
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<{
126
+ }>, 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
127
  patch: {
97
128
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
98
129
  name?: string | undefined;
99
130
  }, {
100
131
  id: string;
101
132
  name: string;
133
+ createdAt: Date;
134
+ quota: {
135
+ mauLimit: number | null;
136
+ tokenLimit: number | null;
137
+ };
102
138
  usage: {
103
139
  activeUsers: number;
104
- cost: number;
105
140
  tokenUsage: number;
106
141
  };
107
142
  indicator: string;
@@ -112,11 +147,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
112
147
  planId: string;
113
148
  currentPeriodStart: Date;
114
149
  currentPeriodEnd: Date;
150
+ isEnterprisePlan: boolean;
151
+ id?: string | undefined;
152
+ upcomingInvoice?: {
153
+ subtotal: number;
154
+ subtotalExcludingTax: number | null;
155
+ total: number;
156
+ totalExcludingTax: number | null;
157
+ } | null | undefined;
115
158
  };
159
+ regionName: RegionName;
160
+ tag: TenantTag;
116
161
  openInvoices: {
117
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
118
162
  id: string;
119
163
  createdAt: Date;
164
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
120
165
  updatedAt: Date;
121
166
  customerId: string | null;
122
167
  billingReason: string | null;
@@ -124,11 +169,11 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
124
169
  periodEnd: Date;
125
170
  amountDue: number;
126
171
  amountPaid: number;
172
+ basicSkuId: string | null;
127
173
  subscriptionId: string | null;
128
174
  hostedInvoiceUrl: string | null;
129
175
  invoicePdf: string | null;
130
176
  }[];
131
- tag: TenantTag;
132
177
  }>;
133
178
  };
134
179
  options: {};
@@ -136,9 +181,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
136
181
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
137
182
  id: string;
138
183
  name: string;
184
+ createdAt: Date;
185
+ quota: {
186
+ mauLimit: number | null;
187
+ tokenLimit: number | null;
188
+ };
139
189
  usage: {
140
190
  activeUsers: number;
141
- cost: number;
142
191
  tokenUsage: number;
143
192
  };
144
193
  indicator: string;
@@ -149,11 +198,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
149
198
  planId: string;
150
199
  currentPeriodStart: Date;
151
200
  currentPeriodEnd: Date;
201
+ isEnterprisePlan: boolean;
202
+ id?: string | undefined;
203
+ upcomingInvoice?: {
204
+ subtotal: number;
205
+ subtotalExcludingTax: number | null;
206
+ total: number;
207
+ totalExcludingTax: number | null;
208
+ } | null | undefined;
152
209
  };
210
+ regionName: RegionName;
211
+ tag: TenantTag;
153
212
  openInvoices: {
154
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
155
213
  id: string;
156
214
  createdAt: Date;
215
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
157
216
  updatedAt: Date;
158
217
  customerId: string | null;
159
218
  billingReason: string | null;
@@ -161,23 +220,29 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
161
220
  periodEnd: Date;
162
221
  amountDue: number;
163
222
  amountPaid: number;
223
+ basicSkuId: string | null;
164
224
  subscriptionId: string | null;
165
225
  hostedInvoiceUrl: string | null;
166
226
  invoicePdf: string | null;
167
227
  }[];
168
- tag: TenantTag;
169
228
  }[]>;
170
229
  };
171
230
  post: {
172
231
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
232
+ id?: string | undefined;
173
233
  name?: string | undefined;
174
234
  tag?: TenantTag | undefined;
235
+ regionName?: RegionName | undefined;
175
236
  }, {
176
237
  id: string;
177
238
  name: string;
239
+ createdAt: Date;
240
+ quota: {
241
+ mauLimit: number | null;
242
+ tokenLimit: number | null;
243
+ };
178
244
  usage: {
179
245
  activeUsers: number;
180
- cost: number;
181
246
  tokenUsage: number;
182
247
  };
183
248
  indicator: string;
@@ -188,11 +253,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
188
253
  planId: string;
189
254
  currentPeriodStart: Date;
190
255
  currentPeriodEnd: Date;
256
+ isEnterprisePlan: boolean;
257
+ id?: string | undefined;
258
+ upcomingInvoice?: {
259
+ subtotal: number;
260
+ subtotalExcludingTax: number | null;
261
+ total: number;
262
+ totalExcludingTax: number | null;
263
+ } | null | undefined;
191
264
  };
265
+ regionName: RegionName;
266
+ tag: TenantTag;
192
267
  openInvoices: {
193
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
194
268
  id: string;
195
269
  createdAt: Date;
270
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
196
271
  updatedAt: Date;
197
272
  customerId: string | null;
198
273
  billingReason: string | null;
@@ -200,11 +275,11 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
200
275
  periodEnd: Date;
201
276
  amountDue: number;
202
277
  amountPaid: number;
278
+ basicSkuId: string | null;
203
279
  subscriptionId: string | null;
204
280
  hostedInvoiceUrl: string | null;
205
281
  invoicePdf: string | null;
206
282
  }[];
207
- tag: TenantTag;
208
283
  }>;
209
284
  };
210
285
  put: {};
@@ -219,23 +294,284 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
219
294
  get: {
220
295
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
221
296
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
297
+ quota: {
298
+ auditLogsRetentionDays: number | null;
299
+ mauLimit: number | null;
300
+ applicationsLimit: number | null;
301
+ thirdPartyApplicationsLimit: number | null;
302
+ scopesPerResourceLimit: number | null;
303
+ socialConnectorsLimit: number | null;
304
+ userRolesLimit: number | null;
305
+ machineToMachineRolesLimit: number | null;
306
+ scopesPerRoleLimit: number | null;
307
+ hooksLimit: number | null;
308
+ customJwtEnabled: boolean;
309
+ subjectTokenEnabled: boolean;
310
+ bringYourUiEnabled: boolean;
311
+ tokenLimit: number | null;
312
+ machineToMachineLimit: number | null;
313
+ resourcesLimit: number | null;
314
+ enterpriseSsoLimit: number | null;
315
+ tenantMembersLimit: number | null;
316
+ mfaEnabled: boolean;
317
+ organizationsEnabled: boolean;
318
+ organizationsLimit: number | null;
319
+ idpInitiatedSsoEnabled: boolean;
320
+ samlApplicationsLimit: number | null;
321
+ captchaEnabled: boolean;
322
+ };
222
323
  planId: string;
223
324
  currentPeriodStart: Date;
224
325
  currentPeriodEnd: Date;
326
+ isEnterprisePlan: boolean;
327
+ id?: string | undefined;
328
+ upcomingInvoice?: {
329
+ subtotal: number;
330
+ subtotalExcludingTax: number | null;
331
+ total: number;
332
+ totalExcludingTax: number | null;
333
+ } | null | undefined;
225
334
  }>;
226
335
  } & {
336
+ "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
337
+ usage: {
338
+ applicationsLimit: number;
339
+ thirdPartyApplicationsLimit: number;
340
+ scopesPerResourceLimit: number;
341
+ socialConnectorsLimit: number;
342
+ userRolesLimit: number;
343
+ machineToMachineRolesLimit: number;
344
+ scopesPerRoleLimit: number;
345
+ hooksLimit: number;
346
+ customJwtEnabled: boolean;
347
+ subjectTokenEnabled: boolean;
348
+ bringYourUiEnabled: boolean;
349
+ machineToMachineLimit: number;
350
+ resourcesLimit: number;
351
+ enterpriseSsoLimit: number;
352
+ tenantMembersLimit: number;
353
+ mfaEnabled: boolean;
354
+ organizationsEnabled: boolean;
355
+ organizationsLimit: number;
356
+ idpInitiatedSsoEnabled: boolean;
357
+ samlApplicationsLimit: number;
358
+ captchaEnabled: boolean;
359
+ };
360
+ resources: Record<string, number>;
361
+ roles: Record<string, number>;
362
+ quota: {
363
+ auditLogsRetentionDays: number | null;
364
+ mauLimit: number | null;
365
+ applicationsLimit: number | null;
366
+ thirdPartyApplicationsLimit: number | null;
367
+ scopesPerResourceLimit: number | null;
368
+ socialConnectorsLimit: number | null;
369
+ userRolesLimit: number | null;
370
+ machineToMachineRolesLimit: number | null;
371
+ scopesPerRoleLimit: number | null;
372
+ hooksLimit: number | null;
373
+ customJwtEnabled: boolean;
374
+ subjectTokenEnabled: boolean;
375
+ bringYourUiEnabled: boolean;
376
+ tokenLimit: number | null;
377
+ machineToMachineLimit: number | null;
378
+ resourcesLimit: number | null;
379
+ enterpriseSsoLimit: number | null;
380
+ tenantMembersLimit: number | null;
381
+ mfaEnabled: boolean;
382
+ organizationsEnabled: boolean;
383
+ organizationsLimit: number | null;
384
+ idpInitiatedSsoEnabled: boolean;
385
+ samlApplicationsLimit: number | null;
386
+ captchaEnabled: boolean;
387
+ };
388
+ basicQuota: {
389
+ auditLogsRetentionDays: number | null;
390
+ mauLimit: number | null;
391
+ applicationsLimit: number | null;
392
+ thirdPartyApplicationsLimit: number | null;
393
+ scopesPerResourceLimit: number | null;
394
+ socialConnectorsLimit: number | null;
395
+ userRolesLimit: number | null;
396
+ machineToMachineRolesLimit: number | null;
397
+ scopesPerRoleLimit: number | null;
398
+ hooksLimit: number | null;
399
+ customJwtEnabled: boolean;
400
+ subjectTokenEnabled: boolean;
401
+ bringYourUiEnabled: boolean;
402
+ tokenLimit: number | null;
403
+ machineToMachineLimit: number | null;
404
+ resourcesLimit: number | null;
405
+ enterpriseSsoLimit: number | null;
406
+ tenantMembersLimit: number | null;
407
+ mfaEnabled: boolean;
408
+ organizationsEnabled: boolean;
409
+ organizationsLimit: number | null;
410
+ idpInitiatedSsoEnabled: boolean;
411
+ samlApplicationsLimit: number | null;
412
+ captchaEnabled: boolean;
413
+ };
414
+ }>;
415
+ };
416
+ post: {
417
+ "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
418
+ usageKey: RealtimeReportableUsageKey;
419
+ }, {
420
+ message: string;
421
+ }>;
422
+ };
423
+ put: {};
424
+ delete: {};
425
+ copy: {};
426
+ head: {};
427
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
428
+ patch: {};
429
+ options: {};
430
+ get: {
227
431
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
228
432
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
229
433
  planId: string;
230
434
  currentPeriodStart: Date;
231
435
  currentPeriodEnd: Date;
436
+ isEnterprisePlan: boolean;
437
+ id?: string | undefined;
438
+ upcomingInvoice?: {
439
+ subtotal: number;
440
+ subtotalExcludingTax: number | null;
441
+ total: number;
442
+ totalExcludingTax: number | null;
443
+ } | null | undefined;
444
+ }>;
445
+ } & {
446
+ "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
447
+ usage: {
448
+ applicationsLimit: number;
449
+ thirdPartyApplicationsLimit: number;
450
+ scopesPerResourceLimit: number;
451
+ socialConnectorsLimit: number;
452
+ userRolesLimit: number;
453
+ machineToMachineRolesLimit: number;
454
+ scopesPerRoleLimit: number;
455
+ hooksLimit: number;
456
+ customJwtEnabled: boolean;
457
+ subjectTokenEnabled: boolean;
458
+ bringYourUiEnabled: boolean;
459
+ machineToMachineLimit: number;
460
+ resourcesLimit: number;
461
+ enterpriseSsoLimit: number;
462
+ tenantMembersLimit: number;
463
+ mfaEnabled: boolean;
464
+ organizationsEnabled: boolean;
465
+ organizationsLimit: number;
466
+ idpInitiatedSsoEnabled: boolean;
467
+ samlApplicationsLimit: number;
468
+ captchaEnabled: boolean;
469
+ };
470
+ resources: Record<string, number>;
471
+ roles: Record<string, number>;
472
+ quota: {
473
+ auditLogsRetentionDays: number | null;
474
+ mauLimit: number | null;
475
+ applicationsLimit: number | null;
476
+ thirdPartyApplicationsLimit: number | null;
477
+ scopesPerResourceLimit: number | null;
478
+ socialConnectorsLimit: number | null;
479
+ userRolesLimit: number | null;
480
+ machineToMachineRolesLimit: number | null;
481
+ scopesPerRoleLimit: number | null;
482
+ hooksLimit: number | null;
483
+ customJwtEnabled: boolean;
484
+ subjectTokenEnabled: boolean;
485
+ bringYourUiEnabled: boolean;
486
+ tokenLimit: number | null;
487
+ machineToMachineLimit: number | null;
488
+ resourcesLimit: number | null;
489
+ enterpriseSsoLimit: number | null;
490
+ tenantMembersLimit: number | null;
491
+ mfaEnabled: boolean;
492
+ organizationsEnabled: boolean;
493
+ organizationsLimit: number | null;
494
+ idpInitiatedSsoEnabled: boolean;
495
+ samlApplicationsLimit: number | null;
496
+ captchaEnabled: boolean;
497
+ };
498
+ basicQuota: {
499
+ auditLogsRetentionDays: number | null;
500
+ mauLimit: number | null;
501
+ applicationsLimit: number | null;
502
+ thirdPartyApplicationsLimit: number | null;
503
+ scopesPerResourceLimit: number | null;
504
+ socialConnectorsLimit: number | null;
505
+ userRolesLimit: number | null;
506
+ machineToMachineRolesLimit: number | null;
507
+ scopesPerRoleLimit: number | null;
508
+ hooksLimit: number | null;
509
+ customJwtEnabled: boolean;
510
+ subjectTokenEnabled: boolean;
511
+ bringYourUiEnabled: boolean;
512
+ tokenLimit: number | null;
513
+ machineToMachineLimit: number | null;
514
+ resourcesLimit: number | null;
515
+ enterpriseSsoLimit: number | null;
516
+ tenantMembersLimit: number | null;
517
+ mfaEnabled: boolean;
518
+ organizationsEnabled: boolean;
519
+ organizationsLimit: number | null;
520
+ idpInitiatedSsoEnabled: boolean;
521
+ samlApplicationsLimit: number | null;
522
+ captchaEnabled: boolean;
523
+ };
524
+ }>;
525
+ } & {
526
+ "/tenants/:tenantId/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/periodic-usage", unknown, unknown, {
527
+ mauLimit: number;
528
+ tokenLimit: number;
529
+ }>;
530
+ } & {
531
+ "/tenants/:tenantId/subscription/add-on-skus": import("@withtyped/server").PathGuard<"/:tenantId/subscription/add-on-skus", unknown, unknown, {
532
+ tokenLimit?: {
533
+ id: string;
534
+ name: string | null;
535
+ createdAt: Date;
536
+ defaultPriceId: string | null;
537
+ unitPrice: number | null;
538
+ type: LogtoSkuType;
539
+ quota: {
540
+ auditLogsRetentionDays?: number | null | undefined;
541
+ mauLimit?: number | null | undefined;
542
+ applicationsLimit?: number | null | undefined;
543
+ thirdPartyApplicationsLimit?: number | null | undefined;
544
+ scopesPerResourceLimit?: number | null | undefined;
545
+ socialConnectorsLimit?: number | null | undefined;
546
+ userRolesLimit?: number | null | undefined;
547
+ machineToMachineRolesLimit?: number | null | undefined;
548
+ scopesPerRoleLimit?: number | null | undefined;
549
+ hooksLimit?: number | null | undefined;
550
+ customJwtEnabled?: boolean | undefined;
551
+ subjectTokenEnabled?: boolean | undefined;
552
+ bringYourUiEnabled?: boolean | undefined;
553
+ tokenLimit?: number | null | undefined;
554
+ machineToMachineLimit?: number | null | undefined;
555
+ resourcesLimit?: number | null | undefined;
556
+ enterpriseSsoLimit?: number | null | undefined;
557
+ tenantMembersLimit?: number | null | undefined;
558
+ mfaEnabled?: boolean | undefined;
559
+ organizationsEnabled?: boolean | undefined;
560
+ organizationsLimit?: number | null | undefined;
561
+ idpInitiatedSsoEnabled?: boolean | undefined;
562
+ samlApplicationsLimit?: number | null | undefined;
563
+ captchaEnabled?: boolean | undefined;
564
+ };
565
+ updatedAt: Date;
566
+ productId: string | null;
567
+ } | undefined;
232
568
  }>;
233
569
  } & {
234
570
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
235
571
  invoices: {
236
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
237
572
  id: string;
238
573
  createdAt: Date;
574
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
239
575
  updatedAt: Date;
240
576
  customerId: string | null;
241
577
  billingReason: string | null;
@@ -243,22 +579,57 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
243
579
  periodEnd: Date;
244
580
  amountDue: number;
245
581
  amountPaid: number;
582
+ basicSkuId: string | null;
246
583
  subscriptionId: string | null;
247
584
  hostedInvoiceUrl: string | null;
248
585
  invoicePdf: string | null;
249
586
  planName: string | null;
587
+ skuId?: string | null | undefined;
250
588
  }[];
251
589
  }>;
590
+ } & {
591
+ "/tenants/:tenantId/available-skus": import("@withtyped/server").PathGuard<"/:tenantId/available-skus", {
592
+ type?: LogtoSkuType | undefined;
593
+ }, unknown, {
594
+ id: string;
595
+ name: string | null;
596
+ createdAt: Date;
597
+ defaultPriceId: string | null;
598
+ unitPrice: number | null;
599
+ type: LogtoSkuType;
600
+ quota: {
601
+ auditLogsRetentionDays?: number | null | undefined;
602
+ mauLimit?: number | null | undefined;
603
+ applicationsLimit?: number | null | undefined;
604
+ thirdPartyApplicationsLimit?: number | null | undefined;
605
+ scopesPerResourceLimit?: number | null | undefined;
606
+ socialConnectorsLimit?: number | null | undefined;
607
+ userRolesLimit?: number | null | undefined;
608
+ machineToMachineRolesLimit?: number | null | undefined;
609
+ scopesPerRoleLimit?: number | null | undefined;
610
+ hooksLimit?: number | null | undefined;
611
+ customJwtEnabled?: boolean | undefined;
612
+ subjectTokenEnabled?: boolean | undefined;
613
+ bringYourUiEnabled?: boolean | undefined;
614
+ tokenLimit?: number | null | undefined;
615
+ machineToMachineLimit?: number | null | undefined;
616
+ resourcesLimit?: number | null | undefined;
617
+ enterpriseSsoLimit?: number | null | undefined;
618
+ tenantMembersLimit?: number | null | undefined;
619
+ mfaEnabled?: boolean | undefined;
620
+ organizationsEnabled?: boolean | undefined;
621
+ organizationsLimit?: number | null | undefined;
622
+ idpInitiatedSsoEnabled?: boolean | undefined;
623
+ samlApplicationsLimit?: number | null | undefined;
624
+ captchaEnabled?: boolean | undefined;
625
+ };
626
+ updatedAt: Date;
627
+ productId: string | null;
628
+ }[]>;
252
629
  } & {
253
630
  "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
254
631
  hostedInvoiceUrl: string;
255
632
  }>;
256
- } & {
257
- "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
258
- activeUsers: number;
259
- cost: number;
260
- tokenUsage: number;
261
- }>;
262
633
  };
263
634
  post: {
264
635
  "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
@@ -286,11 +657,14 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
286
657
  post: {
287
658
  "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
288
659
  data: {
289
- type: TemplateType | VerificationCodeType;
660
+ type: TemplateType;
290
661
  payload: {
291
- code?: string | undefined;
292
662
  link?: string | undefined;
293
- } & Record<string, string> & {
663
+ code?: string | undefined;
664
+ locale?: string | undefined;
665
+ } & {
666
+ [k: string]: unknown;
667
+ } & {
294
668
  senderName?: string | undefined;
295
669
  companyInformation?: string | undefined;
296
670
  appLogo?: string | undefined;
@@ -301,81 +675,199 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
301
675
  } & {
302
676
  "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
303
677
  data: {
304
- type: TemplateType | VerificationCodeType;
678
+ type: TemplateType;
305
679
  to: string;
306
680
  payload: {
307
681
  code?: string | undefined;
308
682
  link?: string | undefined;
309
- } & Record<string, string>;
683
+ locale?: string | undefined;
684
+ } & {
685
+ [k: string]: unknown;
686
+ };
310
687
  };
311
688
  }, unknown>;
312
689
  } & {
313
- "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", unknown, {
314
- script: string;
315
- tokenType: LogtoJwtTokenKeyType.AccessToken;
690
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
691
+ isTest?: string | undefined;
692
+ }, {
316
693
  token: Record<string, Json>;
317
694
  context: Record<string, Json>;
695
+ script: string;
696
+ tokenType: LogtoJwtTokenKeyType.AccessToken;
318
697
  environmentVariables?: Record<string, string> | undefined;
319
698
  } | {
699
+ token: Record<string, Json>;
320
700
  script: string;
321
701
  tokenType: LogtoJwtTokenKeyType.ClientCredentials;
322
- token: Record<string, Json>;
323
702
  environmentVariables?: Record<string, string> | undefined;
324
703
  }, Record<string, unknown>>;
325
704
  };
326
- put: {};
327
- delete: {};
705
+ put: {
706
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
707
+ "jwt.accessToken"?: {
708
+ production?: string | undefined;
709
+ test?: string | undefined;
710
+ } | undefined;
711
+ "jwt.clientCredentials"?: {
712
+ production?: string | undefined;
713
+ test?: string | undefined;
714
+ } | undefined;
715
+ }, unknown>;
716
+ };
717
+ delete: {
718
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
719
+ };
328
720
  copy: {};
329
721
  head: {};
330
722
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
331
723
  patch: {};
332
724
  options: {};
333
725
  get: {
334
- "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
726
+ "/skus": import("@withtyped/server").PathGuard<"/", {
727
+ type?: LogtoSkuType | undefined;
728
+ }, unknown, {
335
729
  id: string;
730
+ name: string | null;
336
731
  createdAt: Date;
337
- name: string;
732
+ defaultPriceId: string | null;
733
+ unitPrice: number | null;
734
+ type: LogtoSkuType;
735
+ quota: {
736
+ auditLogsRetentionDays?: number | null | undefined;
737
+ mauLimit?: number | null | undefined;
738
+ applicationsLimit?: number | null | undefined;
739
+ thirdPartyApplicationsLimit?: number | null | undefined;
740
+ scopesPerResourceLimit?: number | null | undefined;
741
+ socialConnectorsLimit?: number | null | undefined;
742
+ userRolesLimit?: number | null | undefined;
743
+ machineToMachineRolesLimit?: number | null | undefined;
744
+ scopesPerRoleLimit?: number | null | undefined;
745
+ hooksLimit?: number | null | undefined;
746
+ customJwtEnabled?: boolean | undefined;
747
+ subjectTokenEnabled?: boolean | undefined;
748
+ bringYourUiEnabled?: boolean | undefined;
749
+ tokenLimit?: number | null | undefined;
750
+ machineToMachineLimit?: number | null | undefined;
751
+ resourcesLimit?: number | null | undefined;
752
+ enterpriseSsoLimit?: number | null | undefined;
753
+ tenantMembersLimit?: number | null | undefined;
754
+ mfaEnabled?: boolean | undefined;
755
+ organizationsEnabled?: boolean | undefined;
756
+ organizationsLimit?: number | null | undefined;
757
+ idpInitiatedSsoEnabled?: boolean | undefined;
758
+ samlApplicationsLimit?: number | null | undefined;
759
+ captchaEnabled?: boolean | undefined;
760
+ };
338
761
  updatedAt: Date;
339
- stripeProducts: {
340
- type: "flat" | "tier1" | "tier2" | "tier3";
341
- id: string;
342
- name: string;
343
- price: {
344
- id: string;
345
- unitAmountDecimal: string;
346
- quantity?: 1 | undefined;
347
- unitAmount?: number | null | undefined;
348
- };
349
- description?: string | undefined;
350
- }[];
762
+ productId: string | null;
763
+ }[]>;
764
+ };
765
+ post: {
766
+ "/skus": import("@withtyped/server").PathGuard<"/", unknown, {
767
+ type: LogtoSkuType.AddOn;
351
768
  quota: {
769
+ tokenLimit?: number | null | undefined;
770
+ machineToMachineLimit?: number | null | undefined;
771
+ resourcesLimit?: number | null | undefined;
772
+ enterpriseSsoLimit?: number | null | undefined;
773
+ hooksLimit?: number | null | undefined;
774
+ tenantMembersLimit?: number | null | undefined;
775
+ mfaEnabled?: boolean | undefined;
776
+ organizationsEnabled?: boolean | undefined;
777
+ organizationsLimit?: number | null | undefined;
778
+ auditLogsRetentionDays?: number | null | undefined;
779
+ mauLimit?: number | null | undefined;
780
+ applicationsLimit?: number | null | undefined;
781
+ thirdPartyApplicationsLimit?: number | null | undefined;
782
+ scopesPerResourceLimit?: number | null | undefined;
783
+ socialConnectorsLimit?: number | null | undefined;
784
+ userRolesLimit?: number | null | undefined;
785
+ machineToMachineRolesLimit?: number | null | undefined;
786
+ scopesPerRoleLimit?: number | null | undefined;
787
+ customJwtEnabled?: boolean | undefined;
788
+ subjectTokenEnabled?: boolean | undefined;
789
+ bringYourUiEnabled?: boolean | undefined;
790
+ idpInitiatedSsoEnabled?: boolean | undefined;
791
+ samlApplicationsLimit?: number | null | undefined;
792
+ captchaEnabled?: boolean | undefined;
793
+ };
794
+ } | {
795
+ type: LogtoSkuType.Basic;
796
+ quota: {
797
+ auditLogsRetentionDays: number | null;
352
798
  mauLimit: number | null;
353
- tokenLimit: number | null;
354
799
  applicationsLimit: number | null;
355
- machineToMachineLimit: number | null;
356
- resourcesLimit: number | null;
800
+ thirdPartyApplicationsLimit: number | null;
357
801
  scopesPerResourceLimit: number | null;
358
- customDomainEnabled: boolean;
359
- omniSignInEnabled: boolean;
360
- builtInEmailConnectorEnabled: boolean;
361
802
  socialConnectorsLimit: number | null;
362
- standardConnectorsLimit: number | null;
363
- rolesLimit: number | null;
803
+ userRolesLimit: number | null;
364
804
  machineToMachineRolesLimit: number | null;
365
805
  scopesPerRoleLimit: number | null;
366
806
  hooksLimit: number | null;
367
- auditLogsRetentionDays: number | null;
807
+ customJwtEnabled: boolean;
808
+ subjectTokenEnabled: boolean;
809
+ bringYourUiEnabled: boolean;
810
+ tokenLimit: number | null;
811
+ machineToMachineLimit: number | null;
812
+ resourcesLimit: number | null;
813
+ enterpriseSsoLimit: number | null;
814
+ tenantMembersLimit: number | null;
368
815
  mfaEnabled: boolean;
369
816
  organizationsEnabled: boolean;
370
- ssoEnabled: boolean;
371
- thirdPartyApplicationsLimit: number | null;
372
- tenantMembersLimit: number | null;
817
+ organizationsLimit: number | null;
818
+ idpInitiatedSsoEnabled: boolean;
819
+ samlApplicationsLimit: number | null;
820
+ captchaEnabled: boolean;
373
821
  };
374
- }[]>;
822
+ addOnRelations: {
823
+ tokenLimit: string;
824
+ };
825
+ }, {
826
+ id: string;
827
+ createdAt: Date;
828
+ type: LogtoSkuType;
829
+ updatedAt: Date;
830
+ quota: {
831
+ auditLogsRetentionDays?: number | null | undefined;
832
+ mauLimit?: number | null | undefined;
833
+ applicationsLimit?: number | null | undefined;
834
+ thirdPartyApplicationsLimit?: number | null | undefined;
835
+ scopesPerResourceLimit?: number | null | undefined;
836
+ socialConnectorsLimit?: number | null | undefined;
837
+ userRolesLimit?: number | null | undefined;
838
+ machineToMachineRolesLimit?: number | null | undefined;
839
+ scopesPerRoleLimit?: number | null | undefined;
840
+ hooksLimit?: number | null | undefined;
841
+ customJwtEnabled?: boolean | undefined;
842
+ subjectTokenEnabled?: boolean | undefined;
843
+ bringYourUiEnabled?: boolean | undefined;
844
+ tokenLimit?: number | null | undefined;
845
+ machineToMachineLimit?: number | null | undefined;
846
+ resourcesLimit?: number | null | undefined;
847
+ enterpriseSsoLimit?: number | null | undefined;
848
+ tenantMembersLimit?: number | null | undefined;
849
+ mfaEnabled?: boolean | undefined;
850
+ organizationsEnabled?: boolean | undefined;
851
+ organizationsLimit?: number | null | undefined;
852
+ idpInitiatedSsoEnabled?: boolean | undefined;
853
+ samlApplicationsLimit?: number | null | undefined;
854
+ captchaEnabled?: boolean | undefined;
855
+ };
856
+ }>;
857
+ } & {
858
+ "/skus/:skuId/products": import("@withtyped/server").PathGuard<"/:skuId/products", {
859
+ isOneTime?: string | undefined;
860
+ }, {
861
+ name: string;
862
+ unitPrice: number;
863
+ }, {
864
+ productId: string;
865
+ }>;
375
866
  };
376
- post: {};
377
867
  put: {};
378
- delete: {};
868
+ delete: {
869
+ "/skus/:skuId": import("@withtyped/server").PathGuard<"/:skuId", unknown, unknown, unknown>;
870
+ };
379
871
  copy: {};
380
872
  head: {};
381
873
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
@@ -389,17 +881,19 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
389
881
  status: "open" | "complete" | "expired";
390
882
  tenantId: string | null;
391
883
  updatedAt: Date;
392
- planId: string;
884
+ skuId: string | null;
885
+ planId: string | null;
393
886
  }>;
394
887
  };
395
888
  post: {
396
889
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
397
- planId: string;
398
890
  successCallbackUrl: string;
399
891
  tenantId?: string | undefined;
400
- cancelCallbackUrl?: string | undefined;
401
- tenantTag?: TenantTag | undefined;
892
+ skuId?: string | undefined;
402
893
  tenantName?: string | undefined;
894
+ tenantTag?: TenantTag | undefined;
895
+ tenantRegionName?: RegionName | undefined;
896
+ cancelCallbackUrl?: string | undefined;
403
897
  }, {
404
898
  sessionId: string;
405
899
  redirectUri?: string | null | undefined;
@@ -490,8 +984,8 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
490
984
  expiresAt: number;
491
985
  organizationRoles: OrganizationRoleEntity[];
492
986
  } & {
493
- tenantTag: TenantTag;
494
987
  tenantName: string;
988
+ tenantTag: TenantTag;
495
989
  })[]>;
496
990
  } & {
497
991
  "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
@@ -513,9 +1007,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
513
1007
  delete: {};
514
1008
  copy: {};
515
1009
  head: {};
1010
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
1011
+ patch: {};
1012
+ options: {};
1013
+ get: {};
1014
+ post: {};
1015
+ put: {};
1016
+ delete: {
1017
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
1018
+ };
1019
+ copy: {};
1020
+ head: {};
516
1021
  }, "/api">>, "/api">;
517
1022
  export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
518
1023
  request: {
1024
+ id?: string | undefined;
519
1025
  method?: import("@withtyped/server").RequestMethod | undefined;
520
1026
  headers: import("http").IncomingHttpHeaders;
521
1027
  url: URL;
@@ -550,6 +1056,8 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
550
1056
  avatar: string | null;
551
1057
  organizationRoles: OrganizationRoleEntity[];
552
1058
  }[]>;
1059
+ } & {
1060
+ "/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
553
1061
  } & {
554
1062
  "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
555
1063
  id: string;
@@ -569,7 +1077,7 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
569
1077
  };
570
1078
  post: {
571
1079
  "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
572
- invitee: string;
1080
+ invitee: string | string[];
573
1081
  roleName: TenantRole;
574
1082
  expiresAt?: number | undefined;
575
1083
  }, {
@@ -584,7 +1092,19 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
584
1092
  organizationId: string;
585
1093
  expiresAt: number;
586
1094
  organizationRoles: OrganizationRoleEntity[];
587
- }>;
1095
+ } | {
1096
+ id: string;
1097
+ createdAt: number;
1098
+ status: OrganizationInvitationStatus;
1099
+ tenantId: string;
1100
+ updatedAt: number;
1101
+ inviterId: string | null;
1102
+ invitee: string;
1103
+ acceptedUserId: string | null;
1104
+ organizationId: string;
1105
+ expiresAt: number;
1106
+ organizationRoles: OrganizationRoleEntity[];
1107
+ }[]>;
588
1108
  } & {
589
1109
  "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
590
1110
  };
@@ -601,35 +1121,6 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
601
1121
  copy: {};
602
1122
  head: {};
603
1123
  }, "/api/tenants">>, "/api/tenants">;
604
- export declare const functionsRouter: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
605
- request: {
606
- method?: import("@withtyped/server").RequestMethod | undefined;
607
- headers: import("http").IncomingHttpHeaders;
608
- url: URL;
609
- body?: unknown;
610
- };
611
- }, "request"> & {
612
- request: Record<string, unknown> & {
613
- method?: import("@withtyped/server").RequestMethod | undefined;
614
- headers: import("http").IncomingHttpHeaders;
615
- url: URL;
616
- body?: unknown;
617
- } & {
618
- body?: Json | undefined;
619
- bodyRaw?: Buffer | undefined;
620
- };
621
- }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
622
- patch: {};
623
- options: {};
624
- get: {};
625
- post: {
626
- "/database-alteration": import("@withtyped/server").PathGuard<"/database-alteration", unknown, Json, unknown>;
627
- };
628
- put: {};
629
- delete: {};
630
- copy: {};
631
- head: {};
632
- }, "/functions">>, "/functions">;
633
1124
 
634
1125
  export {
635
1126
  router as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-ab8a489",
3
+ "version": "0.2.5-b5c7745",
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
- "vite-tsconfig-paths": "^4.3.1",
33
- "vitest": "^1.0.0"
32
+ "vite-tsconfig-paths": "^5.0.0",
33
+ "vitest": "^2.1.8"
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.2",
53
+ "@withtyped/server": "^0.14.0"
54
54
  },
55
55
  "scripts": {
56
56
  "precommit": "lint-staged",