@logto/cloud 0.2.5-ab8a489 → 0.2.5-b98b019

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 +515 -87
  2. package/package.json +8 -8
@@ -16,6 +16,8 @@ declare enum VerificationCodeType {
16
16
  Register = "Register",
17
17
  ForgotPassword = "ForgotPassword",
18
18
  Generic = "Generic",
19
+ UserPermissionValidation = "UserPermissionValidation",
20
+ BindNewIdentifier = "BindNewIdentifier",
19
21
  /** @deprecated Use `Generic` type template for sending test sms/email use case */
20
22
  Test = "Test"
21
23
  }
@@ -29,7 +31,11 @@ declare enum TemplateType {
29
31
  /** The template for sending organization invitation. */
30
32
  OrganizationInvitation = "OrganizationInvitation",
31
33
  /** The template for generic usage. */
32
- Generic = "Generic"
34
+ Generic = "Generic",
35
+ /** The template for validating user permission for sensitive operations. */
36
+ UserPermissionValidation = "UserPermissionValidation",
37
+ /** The template for binding a new identifier to an existing account. */
38
+ BindNewIdentifier = "BindNewIdentifier"
33
39
  }
34
40
  declare enum OrganizationInvitationStatus {
35
41
  Pending = "Pending",
@@ -37,6 +43,16 @@ declare enum OrganizationInvitationStatus {
37
43
  Expired = "Expired",
38
44
  Revoked = "Revoked"
39
45
  }
46
+ /** The scopes (permissions) defined by the organization template. */
47
+ export type OrganizationScope = {
48
+ tenantId: string;
49
+ /** The globally unique identifier of the organization scope. */
50
+ id: string;
51
+ /** The organization scope's name, unique within the organization template. */
52
+ name: string;
53
+ /** A brief description of the organization scope. */
54
+ description: string | null;
55
+ };
40
56
  declare enum LogtoJwtTokenKeyType {
41
57
  AccessToken = "access-token",
42
58
  ClientCredentials = "client-credentials"
@@ -59,6 +75,23 @@ declare enum TenantRole {
59
75
  /** Collaborator of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
60
76
  Collaborator = "collaborator"
61
77
  }
78
+ declare const availableReportableUsageKeys: readonly [
79
+ "tokenLimit",
80
+ "machineToMachineLimit",
81
+ "resourcesLimit",
82
+ "enterpriseSsoLimit",
83
+ "hooksLimit",
84
+ "tenantMembersLimit",
85
+ "mfaEnabled",
86
+ "organizationsEnabled",
87
+ "organizationsLimit"
88
+ ];
89
+ export type ReportableUsageKey = (typeof availableReportableUsageKeys)[number];
90
+ export type RealtimeReportableUsageKey = Exclude<ReportableUsageKey, "tokenLimit">;
91
+ declare enum LogtoSkuType {
92
+ Basic = "Basic",
93
+ AddOn = "AddOn"
94
+ }
62
95
  declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
63
96
  createdAt: Date;
64
97
  affiliateId: string;
@@ -72,11 +105,17 @@ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default
72
105
  id: string;
73
106
  }, "id" | "createdAt", "id" | "createdAt">;
74
107
  export type Affiliate = InferModelType<typeof Affiliates>;
108
+ declare enum RegionName {
109
+ EU = "EU",
110
+ US = "US",
111
+ AU = "AU"
112
+ }
75
113
  export type AffiliateData = Affiliate & {
76
114
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
77
115
  };
78
116
  declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
79
117
  request: {
118
+ id?: string | undefined;
80
119
  method?: import("@withtyped/server").RequestMethod | undefined;
81
120
  headers: import("http").IncomingHttpHeaders;
82
121
  url: URL;
@@ -84,6 +123,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
84
123
  };
85
124
  }, "request"> & {
86
125
  request: Record<string, unknown> & {
126
+ id?: string | undefined;
87
127
  method?: import("@withtyped/server").RequestMethod | undefined;
88
128
  headers: import("http").IncomingHttpHeaders;
89
129
  url: URL;
@@ -92,16 +132,20 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
92
132
  body?: Json | undefined;
93
133
  bodyRaw?: Buffer | undefined;
94
134
  };
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<{
135
+ }>, 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
136
  patch: {
97
137
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
98
138
  name?: string | undefined;
99
139
  }, {
100
140
  id: string;
101
141
  name: string;
142
+ createdAt: Date;
143
+ quota: {
144
+ mauLimit: number | null;
145
+ tokenLimit: number | null;
146
+ };
102
147
  usage: {
103
148
  activeUsers: number;
104
- cost: number;
105
149
  tokenUsage: number;
106
150
  };
107
151
  indicator: string;
@@ -112,11 +156,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
112
156
  planId: string;
113
157
  currentPeriodStart: Date;
114
158
  currentPeriodEnd: Date;
159
+ isEnterprisePlan: boolean;
160
+ id?: string | undefined;
161
+ upcomingInvoice?: {
162
+ subtotal: number;
163
+ subtotalExcludingTax: number | null;
164
+ total: number;
165
+ totalExcludingTax: number | null;
166
+ } | null | undefined;
115
167
  };
168
+ regionName: RegionName;
169
+ tag: TenantTag;
116
170
  openInvoices: {
117
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
118
171
  id: string;
119
172
  createdAt: Date;
173
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
120
174
  updatedAt: Date;
121
175
  customerId: string | null;
122
176
  billingReason: string | null;
@@ -124,11 +178,11 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
124
178
  periodEnd: Date;
125
179
  amountDue: number;
126
180
  amountPaid: number;
181
+ basicSkuId: string | null;
127
182
  subscriptionId: string | null;
128
183
  hostedInvoiceUrl: string | null;
129
184
  invoicePdf: string | null;
130
185
  }[];
131
- tag: TenantTag;
132
186
  }>;
133
187
  };
134
188
  options: {};
@@ -136,9 +190,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
136
190
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
137
191
  id: string;
138
192
  name: string;
193
+ createdAt: Date;
194
+ quota: {
195
+ mauLimit: number | null;
196
+ tokenLimit: number | null;
197
+ };
139
198
  usage: {
140
199
  activeUsers: number;
141
- cost: number;
142
200
  tokenUsage: number;
143
201
  };
144
202
  indicator: string;
@@ -149,11 +207,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
149
207
  planId: string;
150
208
  currentPeriodStart: Date;
151
209
  currentPeriodEnd: Date;
210
+ isEnterprisePlan: boolean;
211
+ id?: string | undefined;
212
+ upcomingInvoice?: {
213
+ subtotal: number;
214
+ subtotalExcludingTax: number | null;
215
+ total: number;
216
+ totalExcludingTax: number | null;
217
+ } | null | undefined;
152
218
  };
219
+ regionName: RegionName;
220
+ tag: TenantTag;
153
221
  openInvoices: {
154
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
155
222
  id: string;
156
223
  createdAt: Date;
224
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
157
225
  updatedAt: Date;
158
226
  customerId: string | null;
159
227
  billingReason: string | null;
@@ -161,23 +229,28 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
161
229
  periodEnd: Date;
162
230
  amountDue: number;
163
231
  amountPaid: number;
232
+ basicSkuId: string | null;
164
233
  subscriptionId: string | null;
165
234
  hostedInvoiceUrl: string | null;
166
235
  invoicePdf: string | null;
167
236
  }[];
168
- tag: TenantTag;
169
237
  }[]>;
170
238
  };
171
239
  post: {
172
240
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
173
241
  name?: string | undefined;
174
242
  tag?: TenantTag | undefined;
243
+ regionName?: RegionName | undefined;
175
244
  }, {
176
245
  id: string;
177
246
  name: string;
247
+ createdAt: Date;
248
+ quota: {
249
+ mauLimit: number | null;
250
+ tokenLimit: number | null;
251
+ };
178
252
  usage: {
179
253
  activeUsers: number;
180
- cost: number;
181
254
  tokenUsage: number;
182
255
  };
183
256
  indicator: string;
@@ -188,11 +261,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
188
261
  planId: string;
189
262
  currentPeriodStart: Date;
190
263
  currentPeriodEnd: Date;
264
+ isEnterprisePlan: boolean;
265
+ id?: string | undefined;
266
+ upcomingInvoice?: {
267
+ subtotal: number;
268
+ subtotalExcludingTax: number | null;
269
+ total: number;
270
+ totalExcludingTax: number | null;
271
+ } | null | undefined;
191
272
  };
273
+ regionName: RegionName;
274
+ tag: TenantTag;
192
275
  openInvoices: {
193
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
194
276
  id: string;
195
277
  createdAt: Date;
278
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
196
279
  updatedAt: Date;
197
280
  customerId: string | null;
198
281
  billingReason: string | null;
@@ -200,11 +283,11 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
200
283
  periodEnd: Date;
201
284
  amountDue: number;
202
285
  amountPaid: number;
286
+ basicSkuId: string | null;
203
287
  subscriptionId: string | null;
204
288
  hostedInvoiceUrl: string | null;
205
289
  invoicePdf: string | null;
206
290
  }[];
207
- tag: TenantTag;
208
291
  }>;
209
292
  };
210
293
  put: {};
@@ -219,23 +302,231 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
219
302
  get: {
220
303
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
221
304
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
305
+ quota: {
306
+ auditLogsRetentionDays: number | null;
307
+ mauLimit: number | null;
308
+ applicationsLimit: number | null;
309
+ thirdPartyApplicationsLimit: number | null;
310
+ scopesPerResourceLimit: number | null;
311
+ socialConnectorsLimit: number | null;
312
+ userRolesLimit: number | null;
313
+ machineToMachineRolesLimit: number | null;
314
+ scopesPerRoleLimit: number | null;
315
+ hooksLimit: number | null;
316
+ customJwtEnabled: boolean;
317
+ subjectTokenEnabled: boolean;
318
+ bringYourUiEnabled: boolean;
319
+ tokenLimit: number | null;
320
+ machineToMachineLimit: number | null;
321
+ resourcesLimit: number | null;
322
+ enterpriseSsoLimit: number | null;
323
+ tenantMembersLimit: number | null;
324
+ mfaEnabled: boolean;
325
+ organizationsEnabled: boolean;
326
+ organizationsLimit: number | null;
327
+ idpInitiatedSsoEnabled: boolean;
328
+ };
222
329
  planId: string;
223
330
  currentPeriodStart: Date;
224
331
  currentPeriodEnd: Date;
332
+ isEnterprisePlan: boolean;
333
+ id?: string | undefined;
334
+ upcomingInvoice?: {
335
+ subtotal: number;
336
+ subtotalExcludingTax: number | null;
337
+ total: number;
338
+ totalExcludingTax: number | null;
339
+ } | null | undefined;
225
340
  }>;
226
341
  } & {
342
+ "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
343
+ usage: {
344
+ applicationsLimit: number;
345
+ thirdPartyApplicationsLimit: number;
346
+ scopesPerResourceLimit: number;
347
+ socialConnectorsLimit: number;
348
+ userRolesLimit: number;
349
+ machineToMachineRolesLimit: number;
350
+ scopesPerRoleLimit: number;
351
+ hooksLimit: number;
352
+ customJwtEnabled: boolean;
353
+ subjectTokenEnabled: boolean;
354
+ bringYourUiEnabled: boolean;
355
+ machineToMachineLimit: number;
356
+ resourcesLimit: number;
357
+ enterpriseSsoLimit: number;
358
+ tenantMembersLimit: number;
359
+ mfaEnabled: boolean;
360
+ organizationsEnabled: boolean;
361
+ organizationsLimit: number;
362
+ idpInitiatedSsoEnabled: boolean;
363
+ };
364
+ resources: Record<string, number>;
365
+ roles: Record<string, number>;
366
+ quota: {
367
+ auditLogsRetentionDays: number | null;
368
+ mauLimit: number | null;
369
+ applicationsLimit: number | null;
370
+ thirdPartyApplicationsLimit: number | null;
371
+ scopesPerResourceLimit: number | null;
372
+ socialConnectorsLimit: number | null;
373
+ userRolesLimit: number | null;
374
+ machineToMachineRolesLimit: number | null;
375
+ scopesPerRoleLimit: number | null;
376
+ hooksLimit: number | null;
377
+ customJwtEnabled: boolean;
378
+ subjectTokenEnabled: boolean;
379
+ bringYourUiEnabled: boolean;
380
+ tokenLimit: number | null;
381
+ machineToMachineLimit: number | null;
382
+ resourcesLimit: number | null;
383
+ enterpriseSsoLimit: number | null;
384
+ tenantMembersLimit: number | null;
385
+ mfaEnabled: boolean;
386
+ organizationsEnabled: boolean;
387
+ organizationsLimit: number | null;
388
+ idpInitiatedSsoEnabled: boolean;
389
+ };
390
+ basicQuota: {
391
+ auditLogsRetentionDays: number | null;
392
+ mauLimit: number | null;
393
+ applicationsLimit: number | null;
394
+ thirdPartyApplicationsLimit: number | null;
395
+ scopesPerResourceLimit: number | null;
396
+ socialConnectorsLimit: number | null;
397
+ userRolesLimit: number | null;
398
+ machineToMachineRolesLimit: number | null;
399
+ scopesPerRoleLimit: number | null;
400
+ hooksLimit: number | null;
401
+ customJwtEnabled: boolean;
402
+ subjectTokenEnabled: boolean;
403
+ bringYourUiEnabled: boolean;
404
+ tokenLimit: number | null;
405
+ machineToMachineLimit: number | null;
406
+ resourcesLimit: number | null;
407
+ enterpriseSsoLimit: number | null;
408
+ tenantMembersLimit: number | null;
409
+ mfaEnabled: boolean;
410
+ organizationsEnabled: boolean;
411
+ organizationsLimit: number | null;
412
+ idpInitiatedSsoEnabled: 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
+ };
468
+ resources: Record<string, number>;
469
+ roles: Record<string, number>;
470
+ quota: {
471
+ auditLogsRetentionDays: number | null;
472
+ mauLimit: number | null;
473
+ applicationsLimit: number | null;
474
+ thirdPartyApplicationsLimit: number | null;
475
+ scopesPerResourceLimit: number | null;
476
+ socialConnectorsLimit: number | null;
477
+ userRolesLimit: number | null;
478
+ machineToMachineRolesLimit: number | null;
479
+ scopesPerRoleLimit: number | null;
480
+ hooksLimit: number | null;
481
+ customJwtEnabled: boolean;
482
+ subjectTokenEnabled: boolean;
483
+ bringYourUiEnabled: boolean;
484
+ tokenLimit: number | null;
485
+ machineToMachineLimit: number | null;
486
+ resourcesLimit: number | null;
487
+ enterpriseSsoLimit: number | null;
488
+ tenantMembersLimit: number | null;
489
+ mfaEnabled: boolean;
490
+ organizationsEnabled: boolean;
491
+ organizationsLimit: number | null;
492
+ idpInitiatedSsoEnabled: boolean;
493
+ };
494
+ basicQuota: {
495
+ auditLogsRetentionDays: number | null;
496
+ mauLimit: number | null;
497
+ applicationsLimit: number | null;
498
+ thirdPartyApplicationsLimit: number | null;
499
+ scopesPerResourceLimit: number | null;
500
+ socialConnectorsLimit: number | null;
501
+ userRolesLimit: number | null;
502
+ machineToMachineRolesLimit: number | null;
503
+ scopesPerRoleLimit: number | null;
504
+ hooksLimit: number | null;
505
+ customJwtEnabled: boolean;
506
+ subjectTokenEnabled: boolean;
507
+ bringYourUiEnabled: boolean;
508
+ tokenLimit: number | null;
509
+ machineToMachineLimit: number | null;
510
+ resourcesLimit: number | null;
511
+ enterpriseSsoLimit: number | null;
512
+ tenantMembersLimit: number | null;
513
+ mfaEnabled: boolean;
514
+ organizationsEnabled: boolean;
515
+ organizationsLimit: number | null;
516
+ idpInitiatedSsoEnabled: boolean;
517
+ };
518
+ }>;
519
+ } & {
520
+ "/tenants/:tenantId/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/periodic-usage", unknown, unknown, {
521
+ mauLimit: number;
522
+ tokenLimit: number;
232
523
  }>;
233
524
  } & {
234
525
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
235
526
  invoices: {
236
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
237
527
  id: string;
238
528
  createdAt: Date;
529
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
239
530
  updatedAt: Date;
240
531
  customerId: string | null;
241
532
  billingReason: string | null;
@@ -243,22 +534,55 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
243
534
  periodEnd: Date;
244
535
  amountDue: number;
245
536
  amountPaid: number;
537
+ basicSkuId: string | null;
246
538
  subscriptionId: string | null;
247
539
  hostedInvoiceUrl: string | null;
248
540
  invoicePdf: string | null;
249
541
  planName: string | null;
542
+ skuId?: string | null | undefined;
250
543
  }[];
251
544
  }>;
545
+ } & {
546
+ "/tenants/:tenantId/available-skus": import("@withtyped/server").PathGuard<"/:tenantId/available-skus", {
547
+ type?: LogtoSkuType | undefined;
548
+ }, unknown, {
549
+ id: string;
550
+ name: string | null;
551
+ createdAt: Date;
552
+ defaultPriceId: string | null;
553
+ unitPrice: number | null;
554
+ type: LogtoSkuType;
555
+ quota: {
556
+ auditLogsRetentionDays?: number | null | undefined;
557
+ mauLimit?: number | null | undefined;
558
+ applicationsLimit?: number | null | undefined;
559
+ thirdPartyApplicationsLimit?: number | null | undefined;
560
+ scopesPerResourceLimit?: number | null | undefined;
561
+ socialConnectorsLimit?: number | null | undefined;
562
+ userRolesLimit?: number | null | undefined;
563
+ machineToMachineRolesLimit?: number | null | undefined;
564
+ scopesPerRoleLimit?: number | null | undefined;
565
+ hooksLimit?: number | null | undefined;
566
+ customJwtEnabled?: boolean | undefined;
567
+ subjectTokenEnabled?: boolean | undefined;
568
+ bringYourUiEnabled?: boolean | undefined;
569
+ tokenLimit?: number | null | undefined;
570
+ machineToMachineLimit?: number | null | undefined;
571
+ resourcesLimit?: number | null | undefined;
572
+ enterpriseSsoLimit?: number | null | undefined;
573
+ tenantMembersLimit?: number | null | undefined;
574
+ mfaEnabled?: boolean | undefined;
575
+ organizationsEnabled?: boolean | undefined;
576
+ organizationsLimit?: number | null | undefined;
577
+ idpInitiatedSsoEnabled?: boolean | undefined;
578
+ };
579
+ updatedAt: Date;
580
+ productId: string | null;
581
+ }[]>;
252
582
  } & {
253
583
  "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
254
584
  hostedInvoiceUrl: string;
255
585
  }>;
256
- } & {
257
- "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
258
- activeUsers: number;
259
- cost: number;
260
- tokenUsage: number;
261
- }>;
262
586
  };
263
587
  post: {
264
588
  "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
@@ -310,11 +634,13 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
310
634
  };
311
635
  }, unknown>;
312
636
  } & {
313
- "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", unknown, {
637
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
638
+ isTest?: string | undefined;
639
+ }, {
640
+ context: Record<string, Json>;
314
641
  script: string;
315
642
  tokenType: LogtoJwtTokenKeyType.AccessToken;
316
643
  token: Record<string, Json>;
317
- context: Record<string, Json>;
318
644
  environmentVariables?: Record<string, string> | undefined;
319
645
  } | {
320
646
  script: string;
@@ -323,59 +649,161 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
323
649
  environmentVariables?: Record<string, string> | undefined;
324
650
  }, Record<string, unknown>>;
325
651
  };
326
- put: {};
327
- delete: {};
652
+ put: {
653
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
654
+ "jwt.accessToken"?: {
655
+ production?: string | undefined;
656
+ test?: string | undefined;
657
+ } | undefined;
658
+ "jwt.clientCredentials"?: {
659
+ production?: string | undefined;
660
+ test?: string | undefined;
661
+ } | undefined;
662
+ }, unknown>;
663
+ };
664
+ delete: {
665
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
666
+ };
328
667
  copy: {};
329
668
  head: {};
330
669
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
331
670
  patch: {};
332
671
  options: {};
333
672
  get: {
334
- "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
673
+ "/skus": import("@withtyped/server").PathGuard<"/", {
674
+ type?: LogtoSkuType | undefined;
675
+ }, unknown, {
335
676
  id: string;
677
+ name: string | null;
336
678
  createdAt: Date;
337
- name: string;
679
+ defaultPriceId: string | null;
680
+ unitPrice: number | null;
681
+ type: LogtoSkuType;
682
+ quota: {
683
+ auditLogsRetentionDays?: number | null | undefined;
684
+ mauLimit?: number | null | undefined;
685
+ applicationsLimit?: number | null | undefined;
686
+ thirdPartyApplicationsLimit?: number | null | undefined;
687
+ scopesPerResourceLimit?: number | null | undefined;
688
+ socialConnectorsLimit?: number | null | undefined;
689
+ userRolesLimit?: number | null | undefined;
690
+ machineToMachineRolesLimit?: number | null | undefined;
691
+ scopesPerRoleLimit?: number | null | undefined;
692
+ hooksLimit?: number | null | undefined;
693
+ customJwtEnabled?: boolean | undefined;
694
+ subjectTokenEnabled?: boolean | undefined;
695
+ bringYourUiEnabled?: boolean | undefined;
696
+ tokenLimit?: number | null | undefined;
697
+ machineToMachineLimit?: number | null | undefined;
698
+ resourcesLimit?: number | null | undefined;
699
+ enterpriseSsoLimit?: number | null | undefined;
700
+ tenantMembersLimit?: number | null | undefined;
701
+ mfaEnabled?: boolean | undefined;
702
+ organizationsEnabled?: boolean | undefined;
703
+ organizationsLimit?: number | null | undefined;
704
+ idpInitiatedSsoEnabled?: boolean | undefined;
705
+ };
338
706
  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
- }[];
707
+ productId: string | null;
708
+ }[]>;
709
+ };
710
+ post: {
711
+ "/skus": import("@withtyped/server").PathGuard<"/", unknown, {
712
+ type: LogtoSkuType.AddOn;
351
713
  quota: {
714
+ tokenLimit?: number | null | undefined;
715
+ machineToMachineLimit?: number | null | undefined;
716
+ resourcesLimit?: number | null | undefined;
717
+ enterpriseSsoLimit?: number | null | undefined;
718
+ hooksLimit?: number | null | undefined;
719
+ tenantMembersLimit?: number | null | undefined;
720
+ mfaEnabled?: boolean | undefined;
721
+ organizationsEnabled?: boolean | undefined;
722
+ organizationsLimit?: number | null | undefined;
723
+ auditLogsRetentionDays?: number | null | undefined;
724
+ mauLimit?: number | null | undefined;
725
+ applicationsLimit?: number | null | undefined;
726
+ thirdPartyApplicationsLimit?: number | null | undefined;
727
+ scopesPerResourceLimit?: number | null | undefined;
728
+ socialConnectorsLimit?: number | null | undefined;
729
+ userRolesLimit?: number | null | undefined;
730
+ machineToMachineRolesLimit?: number | null | undefined;
731
+ scopesPerRoleLimit?: number | null | undefined;
732
+ customJwtEnabled?: boolean | undefined;
733
+ subjectTokenEnabled?: boolean | undefined;
734
+ bringYourUiEnabled?: boolean | undefined;
735
+ idpInitiatedSsoEnabled?: boolean | undefined;
736
+ };
737
+ } | {
738
+ type: LogtoSkuType.Basic;
739
+ quota: {
740
+ auditLogsRetentionDays: number | null;
352
741
  mauLimit: number | null;
353
- tokenLimit: number | null;
354
742
  applicationsLimit: number | null;
355
- machineToMachineLimit: number | null;
356
- resourcesLimit: number | null;
743
+ thirdPartyApplicationsLimit: number | null;
357
744
  scopesPerResourceLimit: number | null;
358
- customDomainEnabled: boolean;
359
- omniSignInEnabled: boolean;
360
- builtInEmailConnectorEnabled: boolean;
361
745
  socialConnectorsLimit: number | null;
362
- standardConnectorsLimit: number | null;
363
- rolesLimit: number | null;
746
+ userRolesLimit: number | null;
364
747
  machineToMachineRolesLimit: number | null;
365
748
  scopesPerRoleLimit: number | null;
366
749
  hooksLimit: number | null;
367
- auditLogsRetentionDays: number | null;
750
+ customJwtEnabled: boolean;
751
+ subjectTokenEnabled: boolean;
752
+ bringYourUiEnabled: boolean;
753
+ tokenLimit: number | null;
754
+ machineToMachineLimit: number | null;
755
+ resourcesLimit: number | null;
756
+ enterpriseSsoLimit: number | null;
757
+ tenantMembersLimit: number | null;
368
758
  mfaEnabled: boolean;
369
759
  organizationsEnabled: boolean;
370
- ssoEnabled: boolean;
371
- thirdPartyApplicationsLimit: number | null;
372
- tenantMembersLimit: number | null;
760
+ organizationsLimit: number | null;
761
+ idpInitiatedSsoEnabled: boolean;
373
762
  };
374
- }[]>;
763
+ }, {
764
+ id: string;
765
+ createdAt: Date;
766
+ type: LogtoSkuType;
767
+ updatedAt: Date;
768
+ quota: {
769
+ auditLogsRetentionDays?: number | null | undefined;
770
+ mauLimit?: number | null | undefined;
771
+ applicationsLimit?: number | null | undefined;
772
+ thirdPartyApplicationsLimit?: number | null | undefined;
773
+ scopesPerResourceLimit?: number | null | undefined;
774
+ socialConnectorsLimit?: number | null | undefined;
775
+ userRolesLimit?: number | null | undefined;
776
+ machineToMachineRolesLimit?: number | null | undefined;
777
+ scopesPerRoleLimit?: number | null | undefined;
778
+ hooksLimit?: number | null | undefined;
779
+ customJwtEnabled?: boolean | undefined;
780
+ subjectTokenEnabled?: boolean | undefined;
781
+ bringYourUiEnabled?: boolean | undefined;
782
+ tokenLimit?: number | null | undefined;
783
+ machineToMachineLimit?: number | null | undefined;
784
+ resourcesLimit?: number | null | undefined;
785
+ enterpriseSsoLimit?: number | null | undefined;
786
+ tenantMembersLimit?: number | null | undefined;
787
+ mfaEnabled?: boolean | undefined;
788
+ organizationsEnabled?: boolean | undefined;
789
+ organizationsLimit?: number | null | undefined;
790
+ idpInitiatedSsoEnabled?: boolean | undefined;
791
+ };
792
+ }>;
793
+ } & {
794
+ "/skus/:skuId/products": import("@withtyped/server").PathGuard<"/:skuId/products", {
795
+ isOneTime?: string | undefined;
796
+ }, {
797
+ name: string;
798
+ unitPrice: number;
799
+ }, {
800
+ productId: string;
801
+ }>;
375
802
  };
376
- post: {};
377
803
  put: {};
378
- delete: {};
804
+ delete: {
805
+ "/skus/:skuId": import("@withtyped/server").PathGuard<"/:skuId", unknown, unknown, unknown>;
806
+ };
379
807
  copy: {};
380
808
  head: {};
381
809
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
@@ -389,17 +817,20 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
389
817
  status: "open" | "complete" | "expired";
390
818
  tenantId: string | null;
391
819
  updatedAt: Date;
392
- planId: string;
820
+ skuId: string | null;
821
+ planId: string | null;
393
822
  }>;
394
823
  };
395
824
  post: {
396
825
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
397
- planId: string;
398
826
  successCallbackUrl: string;
399
827
  tenantId?: string | undefined;
400
- cancelCallbackUrl?: string | undefined;
401
- tenantTag?: TenantTag | undefined;
828
+ skuId?: string | undefined;
829
+ planId?: string | undefined;
402
830
  tenantName?: string | undefined;
831
+ tenantTag?: TenantTag | undefined;
832
+ tenantRegionName?: RegionName | undefined;
833
+ cancelCallbackUrl?: string | undefined;
403
834
  }, {
404
835
  sessionId: string;
405
836
  redirectUri?: string | null | undefined;
@@ -490,8 +921,8 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
490
921
  expiresAt: number;
491
922
  organizationRoles: OrganizationRoleEntity[];
492
923
  } & {
493
- tenantTag: TenantTag;
494
924
  tenantName: string;
925
+ tenantTag: TenantTag;
495
926
  })[]>;
496
927
  } & {
497
928
  "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
@@ -513,9 +944,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
513
944
  delete: {};
514
945
  copy: {};
515
946
  head: {};
947
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
948
+ patch: {};
949
+ options: {};
950
+ get: {};
951
+ post: {};
952
+ put: {};
953
+ delete: {
954
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
955
+ };
956
+ copy: {};
957
+ head: {};
516
958
  }, "/api">>, "/api">;
517
959
  export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
518
960
  request: {
961
+ id?: string | undefined;
519
962
  method?: import("@withtyped/server").RequestMethod | undefined;
520
963
  headers: import("http").IncomingHttpHeaders;
521
964
  url: URL;
@@ -550,6 +993,8 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
550
993
  avatar: string | null;
551
994
  organizationRoles: OrganizationRoleEntity[];
552
995
  }[]>;
996
+ } & {
997
+ "/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
553
998
  } & {
554
999
  "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
555
1000
  id: string;
@@ -569,7 +1014,7 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
569
1014
  };
570
1015
  post: {
571
1016
  "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
572
- invitee: string;
1017
+ invitee: string | string[];
573
1018
  roleName: TenantRole;
574
1019
  expiresAt?: number | undefined;
575
1020
  }, {
@@ -584,7 +1029,19 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
584
1029
  organizationId: string;
585
1030
  expiresAt: number;
586
1031
  organizationRoles: OrganizationRoleEntity[];
587
- }>;
1032
+ } | {
1033
+ id: string;
1034
+ createdAt: number;
1035
+ status: OrganizationInvitationStatus;
1036
+ tenantId: string;
1037
+ updatedAt: number;
1038
+ inviterId: string | null;
1039
+ invitee: string;
1040
+ acceptedUserId: string | null;
1041
+ organizationId: string;
1042
+ expiresAt: number;
1043
+ organizationRoles: OrganizationRoleEntity[];
1044
+ }[]>;
588
1045
  } & {
589
1046
  "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
590
1047
  };
@@ -601,35 +1058,6 @@ export declare const tenantAuthRouter: import("@withtyped/server").Router<Reques
601
1058
  copy: {};
602
1059
  head: {};
603
1060
  }, "/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
1061
 
634
1062
  export {
635
1063
  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-b98b019",
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.0.0"
34
34
  },
35
35
  "engines": {
36
36
  "node": "^20.9.0"
@@ -49,8 +49,8 @@
49
49
  "access": "public"
50
50
  },
51
51
  "dependencies": {
52
- "@silverhand/essentials": "^2.9.0",
53
- "@withtyped/server": "^0.13.3"
52
+ "@silverhand/essentials": "^2.9.2",
53
+ "@withtyped/server": "^0.14.0"
54
54
  },
55
55
  "scripts": {
56
56
  "precommit": "lint-staged",