@logto/cloud 0.2.5-a21a38a → 0.2.5-a6cff75

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 +468 -87
  2. package/package.json +10 -15
@@ -37,6 +37,20 @@ declare enum OrganizationInvitationStatus {
37
37
  Expired = "Expired",
38
38
  Revoked = "Revoked"
39
39
  }
40
+ /** The scopes (permissions) defined by the organization template. */
41
+ export type OrganizationScope = {
42
+ tenantId: string;
43
+ /** The globally unique identifier of the organization scope. */
44
+ id: string;
45
+ /** The organization scope's name, unique within the organization template. */
46
+ name: string;
47
+ /** A brief description of the organization scope. */
48
+ description: string | null;
49
+ };
50
+ declare enum LogtoJwtTokenKeyType {
51
+ AccessToken = "access-token",
52
+ ClientCredentials = "client-credentials"
53
+ }
40
54
  /**
41
55
  * The simplified organization role entity that is returned in the `roles` field
42
56
  * of the organization.
@@ -52,8 +66,12 @@ declare enum TenantTag {
52
66
  declare enum TenantRole {
53
67
  /** Admin of the tenant, who has all permissions. */
54
68
  Admin = "admin",
55
- /** Member of the tenant, who has permissions to operate the tenant data, but not the tenant settings. */
56
- Member = "member"
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"
57
75
  }
58
76
  declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
59
77
  createdAt: Date;
@@ -63,16 +81,21 @@ declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js"
63
81
  }, "createdAt", "createdAt">;
64
82
  export type AffiliateProperty = InferModelType<typeof AffiliateProperties>;
65
83
  declare const Affiliates: import("@withtyped/server/lib/model/index.js").default<"affiliates", {
66
- id: string;
67
- createdAt: Date;
68
84
  name: string;
69
- }, "createdAt" | "id", "createdAt" | "id">;
85
+ createdAt: Date;
86
+ id: string;
87
+ }, "id" | "createdAt", "id" | "createdAt">;
70
88
  export type Affiliate = InferModelType<typeof Affiliates>;
89
+ declare enum RegionName {
90
+ EU = "EU",
91
+ US = "US"
92
+ }
71
93
  export type AffiliateData = Affiliate & {
72
94
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
73
95
  };
74
96
  declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
75
97
  request: {
98
+ id?: string | undefined;
76
99
  method?: import("@withtyped/server").RequestMethod | undefined;
77
100
  headers: import("http").IncomingHttpHeaders;
78
101
  url: URL;
@@ -80,6 +103,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
80
103
  };
81
104
  }, "request"> & {
82
105
  request: Record<string, unknown> & {
106
+ id?: string | undefined;
83
107
  method?: import("@withtyped/server").RequestMethod | undefined;
84
108
  headers: import("http").IncomingHttpHeaders;
85
109
  url: URL;
@@ -89,17 +113,18 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
89
113
  bodyRaw?: Buffer | undefined;
90
114
  };
91
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<{
92
- options: {};
93
116
  patch: {
94
117
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
95
118
  name?: string | undefined;
96
119
  }, {
97
120
  id: string;
98
121
  name: string;
122
+ quota: {
123
+ mauLimit: number | null;
124
+ };
125
+ createdAt: Date;
99
126
  usage: {
100
127
  activeUsers: number;
101
- cost: number;
102
- tokenUsage: number;
103
128
  };
104
129
  indicator: string;
105
130
  isSuspended: boolean;
@@ -109,12 +134,22 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
109
134
  planId: string;
110
135
  currentPeriodStart: Date;
111
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;
112
146
  };
147
+ regionName: RegionName;
113
148
  tag: TenantTag;
114
149
  openInvoices: {
115
150
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
116
- createdAt: Date;
117
151
  id: string;
152
+ createdAt: Date;
118
153
  updatedAt: Date;
119
154
  customerId: string | null;
120
155
  billingReason: string | null;
@@ -128,14 +163,17 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
128
163
  }[];
129
164
  }>;
130
165
  };
166
+ options: {};
131
167
  get: {
132
168
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
133
169
  id: string;
134
170
  name: string;
171
+ quota: {
172
+ mauLimit: number | null;
173
+ };
174
+ createdAt: Date;
135
175
  usage: {
136
176
  activeUsers: number;
137
- cost: number;
138
- tokenUsage: number;
139
177
  };
140
178
  indicator: string;
141
179
  isSuspended: boolean;
@@ -145,12 +183,22 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
145
183
  planId: string;
146
184
  currentPeriodStart: Date;
147
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;
148
195
  };
196
+ regionName: RegionName;
149
197
  tag: TenantTag;
150
198
  openInvoices: {
151
199
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
152
- createdAt: Date;
153
200
  id: string;
201
+ createdAt: Date;
154
202
  updatedAt: Date;
155
203
  customerId: string | null;
156
204
  billingReason: string | null;
@@ -168,13 +216,16 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
168
216
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
169
217
  name?: string | undefined;
170
218
  tag?: TenantTag | undefined;
219
+ regionName?: RegionName | undefined;
171
220
  }, {
172
221
  id: string;
173
222
  name: string;
223
+ quota: {
224
+ mauLimit: number | null;
225
+ };
226
+ createdAt: Date;
174
227
  usage: {
175
228
  activeUsers: number;
176
- cost: number;
177
- tokenUsage: number;
178
229
  };
179
230
  indicator: string;
180
231
  isSuspended: boolean;
@@ -184,12 +235,22 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
184
235
  planId: string;
185
236
  currentPeriodStart: Date;
186
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;
187
247
  };
248
+ regionName: RegionName;
188
249
  tag: TenantTag;
189
250
  openInvoices: {
190
251
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
191
- createdAt: Date;
192
252
  id: string;
253
+ createdAt: Date;
193
254
  updatedAt: Date;
194
255
  customerId: string | null;
195
256
  billingReason: string | null;
@@ -210,14 +271,120 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
210
271
  copy: {};
211
272
  head: {};
212
273
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
213
- options: {};
214
274
  patch: {};
275
+ options: {};
215
276
  get: {
216
277
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
217
278
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
218
279
  planId: string;
219
280
  currentPeriodStart: Date;
220
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
+ };
221
388
  }>;
222
389
  } & {
223
390
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
@@ -225,13 +392,119 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
225
392
  planId: string;
226
393
  currentPeriodStart: Date;
227
394
  currentPeriodEnd: Date;
395
+ id?: string | undefined;
396
+ upcomingInvoice?: {
397
+ subtotal: number;
398
+ subtotalExcludingTax: number | null;
399
+ total: number;
400
+ totalExcludingTax: number | null;
401
+ } | null | undefined;
402
+ isAddOnAvailable?: boolean | undefined;
403
+ isAddOnVisibleToLegacyUsers?: boolean | undefined;
404
+ }>;
405
+ } & {
406
+ "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
407
+ mauLimit: number | null;
408
+ tokenLimit: number | null;
409
+ applicationsLimit: number | null;
410
+ machineToMachineLimit: number | null;
411
+ resourcesLimit: number | null;
412
+ scopesPerResourceLimit: number | null;
413
+ socialConnectorsLimit: number | null;
414
+ machineToMachineRolesLimit: number | null;
415
+ scopesPerRoleLimit: number | null;
416
+ hooksLimit: number | null;
417
+ auditLogsRetentionDays: number | null;
418
+ mfaEnabled: boolean;
419
+ organizationsEnabled: boolean;
420
+ thirdPartyApplicationsLimit: number | null;
421
+ tenantMembersLimit: number | null;
422
+ customJwtEnabled: boolean;
423
+ subjectTokenEnabled: boolean;
424
+ bringYourUiEnabled: boolean;
425
+ userRolesLimit: number | null;
426
+ enterpriseSsoLimit: number | null;
427
+ }>;
428
+ } & {
429
+ "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
430
+ mauLimit: number;
431
+ tokenLimit: number;
432
+ applicationsLimit: number;
433
+ machineToMachineLimit: number;
434
+ resourcesLimit: number;
435
+ scopesPerResourceLimit: number;
436
+ socialConnectorsLimit: number;
437
+ machineToMachineRolesLimit: number;
438
+ scopesPerRoleLimit: number;
439
+ hooksLimit: number;
440
+ mfaEnabled: boolean;
441
+ organizationsEnabled: boolean;
442
+ thirdPartyApplicationsLimit: number;
443
+ tenantMembersLimit: number;
444
+ customJwtEnabled: boolean;
445
+ subjectTokenEnabled: boolean;
446
+ bringYourUiEnabled: boolean;
447
+ userRolesLimit: number;
448
+ enterpriseSsoLimit: number;
449
+ }>;
450
+ } & {
451
+ "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
452
+ entityId?: string | undefined;
453
+ }, unknown, Record<string, number>>;
454
+ } & {
455
+ "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
456
+ usage: {
457
+ mauLimit: number;
458
+ tokenLimit: number;
459
+ applicationsLimit: number;
460
+ machineToMachineLimit: number;
461
+ resourcesLimit: number;
462
+ scopesPerResourceLimit: number;
463
+ socialConnectorsLimit: number;
464
+ machineToMachineRolesLimit: number;
465
+ scopesPerRoleLimit: number;
466
+ hooksLimit: number;
467
+ mfaEnabled: boolean;
468
+ organizationsEnabled: boolean;
469
+ thirdPartyApplicationsLimit: number;
470
+ tenantMembersLimit: number;
471
+ customJwtEnabled: boolean;
472
+ subjectTokenEnabled: boolean;
473
+ bringYourUiEnabled: boolean;
474
+ userRolesLimit: number;
475
+ enterpriseSsoLimit: number;
476
+ };
477
+ resources: Record<string, number>;
478
+ roles: Record<string, number>;
479
+ quota: {
480
+ mauLimit: number | null;
481
+ tokenLimit: number | null;
482
+ applicationsLimit: number | null;
483
+ machineToMachineLimit: number | null;
484
+ resourcesLimit: number | null;
485
+ scopesPerResourceLimit: number | null;
486
+ socialConnectorsLimit: number | null;
487
+ machineToMachineRolesLimit: number | null;
488
+ scopesPerRoleLimit: number | null;
489
+ hooksLimit: number | null;
490
+ auditLogsRetentionDays: number | null;
491
+ mfaEnabled: boolean;
492
+ organizationsEnabled: boolean;
493
+ thirdPartyApplicationsLimit: number | null;
494
+ tenantMembersLimit: number | null;
495
+ customJwtEnabled: boolean;
496
+ subjectTokenEnabled: boolean;
497
+ bringYourUiEnabled: boolean;
498
+ userRolesLimit: number | null;
499
+ enterpriseSsoLimit: number | null;
500
+ };
228
501
  }>;
229
502
  } & {
230
503
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
231
504
  invoices: {
232
505
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
233
- createdAt: Date;
234
506
  id: string;
507
+ createdAt: Date;
235
508
  updatedAt: Date;
236
509
  customerId: string | null;
237
510
  billingReason: string | null;
@@ -243,20 +516,21 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
243
516
  hostedInvoiceUrl: string | null;
244
517
  invoicePdf: string | null;
245
518
  planName: string | null;
519
+ skuId?: string | null | undefined;
246
520
  }[];
247
521
  }>;
248
522
  } & {
249
523
  "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
250
524
  hostedInvoiceUrl: string;
251
525
  }>;
252
- } & {
253
- "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
254
- activeUsers: number;
255
- cost: number;
256
- tokenUsage: number;
257
- }>;
258
526
  };
259
527
  post: {
528
+ "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
529
+ usageKey: "tokenLimit" | "machineToMachineLimit" | "resourcesLimit" | "enterpriseSsoLimit" | "hooksLimit" | "tenantMembersLimit" | "mfaEnabled" | "organizationsEnabled";
530
+ }, {
531
+ message: string;
532
+ }>;
533
+ } & {
260
534
  "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
261
535
  callbackUrl?: string | undefined;
262
536
  }, {
@@ -270,8 +544,8 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
270
544
  copy: {};
271
545
  head: {};
272
546
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
273
- options: {};
274
547
  patch: {};
548
+ options: {};
275
549
  get: {
276
550
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
277
551
  from?: string | undefined;
@@ -286,6 +560,7 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
286
560
  payload: {
287
561
  code?: string | undefined;
288
562
  link?: string | undefined;
563
+ } & Record<string, string> & {
289
564
  senderName?: string | undefined;
290
565
  companyInformation?: string | undefined;
291
566
  appLogo?: string | undefined;
@@ -301,22 +576,51 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
301
576
  payload: {
302
577
  code?: string | undefined;
303
578
  link?: string | undefined;
304
- };
579
+ } & Record<string, string>;
305
580
  };
306
581
  }, unknown>;
582
+ } & {
583
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
584
+ isTest?: string | undefined;
585
+ }, {
586
+ context: Record<string, Json>;
587
+ script: string;
588
+ tokenType: LogtoJwtTokenKeyType.AccessToken;
589
+ token: Record<string, Json>;
590
+ environmentVariables?: Record<string, string> | undefined;
591
+ } | {
592
+ script: string;
593
+ tokenType: LogtoJwtTokenKeyType.ClientCredentials;
594
+ token: Record<string, Json>;
595
+ environmentVariables?: Record<string, string> | undefined;
596
+ }, Record<string, unknown>>;
597
+ };
598
+ put: {
599
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
600
+ "jwt.accessToken"?: {
601
+ production?: string | undefined;
602
+ test?: string | undefined;
603
+ } | undefined;
604
+ "jwt.clientCredentials"?: {
605
+ production?: string | undefined;
606
+ test?: string | undefined;
607
+ } | undefined;
608
+ }, unknown>;
609
+ };
610
+ delete: {
611
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
307
612
  };
308
- put: {};
309
- delete: {};
310
613
  copy: {};
311
614
  head: {};
312
615
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
313
- options: {};
314
616
  patch: {};
617
+ options: {};
315
618
  get: {
316
619
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
317
- createdAt: Date;
318
620
  id: string;
621
+ createdAt: Date;
319
622
  name: string;
623
+ updatedAt: Date;
320
624
  quota: {
321
625
  mauLimit: number | null;
322
626
  tokenLimit: number | null;
@@ -338,6 +642,10 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
338
642
  organizationsEnabled: boolean;
339
643
  ssoEnabled: boolean;
340
644
  thirdPartyApplicationsLimit: number | null;
645
+ tenantMembersLimit: number | null;
646
+ customJwtEnabled: boolean;
647
+ subjectTokenEnabled: boolean;
648
+ bringYourUiEnabled: boolean;
341
649
  };
342
650
  stripeProducts: {
343
651
  type: "flat" | "tier1" | "tier2" | "tier3";
@@ -351,7 +659,6 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
351
659
  };
352
660
  description?: string | undefined;
353
661
  }[];
354
- updatedAt: Date;
355
662
  }[]>;
356
663
  };
357
664
  post: {};
@@ -360,16 +667,41 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
360
667
  copy: {};
361
668
  head: {};
362
669
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
363
- options: {};
364
670
  patch: {};
671
+ options: {};
365
672
  get: {
366
- "/my/tenant": import("@withtyped/server").PathGuard<"/tenant", unknown, unknown, {
367
- name: string;
673
+ "/skus": import("@withtyped/server").PathGuard<"/", {
674
+ type?: LogtoSkuType | undefined;
675
+ }, unknown, {
676
+ type: LogtoSkuType;
368
677
  id: string;
369
- indicator: string;
370
- isSuspended: boolean;
371
- tag: TenantTag;
372
- }>;
678
+ name: string | null;
679
+ quota: {
680
+ mauLimit?: number | null | undefined;
681
+ tokenLimit?: number | null | undefined;
682
+ applicationsLimit?: number | null | undefined;
683
+ machineToMachineLimit?: number | null | undefined;
684
+ resourcesLimit?: number | null | undefined;
685
+ scopesPerResourceLimit?: number | null | undefined;
686
+ socialConnectorsLimit?: number | null | undefined;
687
+ machineToMachineRolesLimit?: number | null | undefined;
688
+ scopesPerRoleLimit?: number | null | undefined;
689
+ hooksLimit?: number | null | undefined;
690
+ auditLogsRetentionDays?: number | null | undefined;
691
+ mfaEnabled?: boolean | undefined;
692
+ organizationsEnabled?: boolean | undefined;
693
+ thirdPartyApplicationsLimit?: number | null | undefined;
694
+ tenantMembersLimit?: number | null | undefined;
695
+ customJwtEnabled?: boolean | undefined;
696
+ subjectTokenEnabled?: boolean | undefined;
697
+ bringYourUiEnabled?: boolean | undefined;
698
+ userRolesLimit?: number | null | undefined;
699
+ enterpriseSsoLimit?: number | null | undefined;
700
+ };
701
+ createdAt: Date;
702
+ updatedAt: Date;
703
+ unitPrice: number | null;
704
+ }[]>;
373
705
  };
374
706
  post: {};
375
707
  put: {};
@@ -377,17 +709,18 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
377
709
  copy: {};
378
710
  head: {};
379
711
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
380
- options: {};
381
712
  patch: {};
713
+ options: {};
382
714
  get: {
383
715
  "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
384
- status: "open" | "complete" | "expired";
385
- createdAt: Date;
386
716
  id: string;
717
+ createdAt: Date;
387
718
  userId: string;
388
- updatedAt: Date;
719
+ status: "open" | "complete" | "expired";
389
720
  tenantId: string | null;
721
+ updatedAt: Date;
390
722
  planId: string;
723
+ skuId: string | null;
391
724
  }>;
392
725
  };
393
726
  post: {
@@ -395,9 +728,11 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
395
728
  planId: string;
396
729
  successCallbackUrl: string;
397
730
  tenantId?: string | undefined;
398
- cancelCallbackUrl?: string | undefined;
399
- tenantTag?: TenantTag | undefined;
731
+ skuId?: string | undefined;
400
732
  tenantName?: string | undefined;
733
+ tenantTag?: TenantTag | undefined;
734
+ tenantRegionName?: RegionName | undefined;
735
+ cancelCallbackUrl?: string | undefined;
401
736
  }, {
402
737
  sessionId: string;
403
738
  redirectUri?: string | null | undefined;
@@ -408,8 +743,8 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
408
743
  copy: {};
409
744
  head: {};
410
745
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
411
- options: {};
412
746
  patch: {};
747
+ options: {};
413
748
  get: {
414
749
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
415
750
  };
@@ -417,33 +752,33 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
417
752
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
418
753
  name: string;
419
754
  }, {
420
- createdAt: Date;
421
755
  id: string;
756
+ createdAt: Date;
422
757
  name: string;
423
758
  }>;
424
759
  } & {
425
760
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
426
- value: string;
427
761
  type: "hostname" | "query";
428
- }, {
429
762
  value: string;
430
- type: "hostname" | "query";
763
+ }, {
431
764
  createdAt: Date;
432
765
  affiliateId: string;
766
+ type: "hostname" | "query";
767
+ value: string;
433
768
  }>;
434
769
  };
435
770
  put: {};
436
771
  delete: {
437
772
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
438
- value: string;
439
773
  type: "hostname" | "query";
774
+ value: string;
440
775
  }, unknown>;
441
776
  };
442
777
  copy: {};
443
778
  head: {};
444
779
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
445
- options: {};
446
780
  patch: {};
781
+ options: {};
447
782
  get: {};
448
783
  post: {
449
784
  "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
@@ -452,8 +787,8 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
452
787
  hostname?: string | undefined;
453
788
  query?: string | undefined;
454
789
  }, {
455
- createdAt: Date;
456
790
  id: string;
791
+ createdAt: Date;
457
792
  affiliateId: string | null;
458
793
  userId: string;
459
794
  createdVia: {
@@ -468,101 +803,147 @@ declare const router: import("@withtyped/server").Router<RequestContext, WithAut
468
803
  copy: {};
469
804
  head: {};
470
805
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
806
+ patch: {
807
+ "/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
808
+ status: OrganizationInvitationStatus.Accepted;
809
+ }, unknown>;
810
+ };
471
811
  options: {};
472
- patch: {};
473
- get: {};
474
- post: {};
475
- put: {};
476
- delete: {
477
- "/logs/expired": import("@withtyped/server").PathGuard<"/expired", {
478
- dryRun?: string | undefined;
479
- }, unknown, {
480
- affectedRows: number;
812
+ get: {
813
+ "/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
814
+ id: string;
815
+ createdAt: number;
816
+ status: OrganizationInvitationStatus;
817
+ tenantId: string;
818
+ updatedAt: number;
819
+ inviterId: string | null;
820
+ invitee: string;
821
+ acceptedUserId: string | null;
822
+ organizationId: string;
823
+ expiresAt: number;
824
+ organizationRoles: OrganizationRoleEntity[];
825
+ } & {
826
+ tenantName: string;
827
+ tenantTag: TenantTag;
828
+ })[]>;
829
+ } & {
830
+ "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
831
+ id: string;
832
+ createdAt: number;
833
+ status: OrganizationInvitationStatus;
834
+ tenantId: string;
835
+ updatedAt: number;
836
+ inviterId: string | null;
837
+ invitee: string;
838
+ acceptedUserId: string | null;
839
+ organizationId: string;
840
+ expiresAt: number;
841
+ organizationRoles: OrganizationRoleEntity[];
481
842
  }>;
482
843
  };
844
+ post: {};
845
+ put: {};
846
+ delete: {};
483
847
  copy: {};
484
848
  head: {};
485
849
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
850
+ patch: {};
486
851
  options: {};
487
- patch: {
488
- "/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
489
- status: OrganizationInvitationStatus.Accepted;
490
- }, unknown>;
491
- };
492
852
  get: {};
493
853
  post: {};
494
854
  put: {};
495
- delete: {};
855
+ delete: {
856
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
857
+ };
496
858
  copy: {};
497
859
  head: {};
498
860
  }, "/api">>, "/api">;
499
861
  export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
500
862
  request: {
863
+ id?: string | undefined;
501
864
  method?: import("@withtyped/server").RequestMethod | undefined;
502
865
  headers: import("http").IncomingHttpHeaders;
503
866
  url: URL;
504
867
  body?: unknown;
505
868
  };
506
869
  }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
507
- options: {};
508
870
  patch: {
509
871
  "/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
510
872
  status: OrganizationInvitationStatus.Revoked;
511
873
  }, {
512
- status: OrganizationInvitationStatus;
513
- createdAt: number;
514
874
  id: string;
515
- updatedAt: number;
875
+ createdAt: number;
876
+ status: OrganizationInvitationStatus;
516
877
  tenantId: string;
517
- organizationId: string;
878
+ updatedAt: number;
518
879
  inviterId: string | null;
519
- expiresAt: number;
520
- organizationRoles: OrganizationRoleEntity[];
521
880
  invitee: string;
522
881
  acceptedUserId: string | null;
882
+ organizationId: string;
883
+ expiresAt: number;
884
+ organizationRoles: OrganizationRoleEntity[];
523
885
  }>;
524
886
  };
887
+ options: {};
525
888
  get: {
526
889
  "/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
527
890
  id: string;
528
891
  name: string | null;
529
892
  username: string | null;
530
893
  primaryEmail: string | null;
894
+ primaryPhone: string | null;
895
+ avatar: string | null;
531
896
  organizationRoles: OrganizationRoleEntity[];
532
897
  }[]>;
533
898
  } & {
534
- "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, {
535
- status: OrganizationInvitationStatus;
536
- createdAt: number;
899
+ "/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
900
+ } & {
901
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
537
902
  id: string;
538
- updatedAt: number;
903
+ createdAt: number;
904
+ status: OrganizationInvitationStatus;
539
905
  tenantId: string;
540
- organizationId: string;
906
+ updatedAt: number;
541
907
  inviterId: string | null;
542
- expiresAt: number;
543
- organizationRoles: OrganizationRoleEntity[];
544
908
  invitee: string;
545
909
  acceptedUserId: string | null;
546
- }[]>;
910
+ organizationId: string;
911
+ expiresAt: number;
912
+ organizationRoles: OrganizationRoleEntity[];
913
+ } & {
914
+ inviterName?: string | undefined;
915
+ })[]>;
547
916
  };
548
917
  post: {
549
918
  "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
919
+ invitee: string | string[];
550
920
  roleName: TenantRole;
551
- invitee: string;
552
921
  expiresAt?: number | undefined;
553
922
  }, {
554
- status: OrganizationInvitationStatus;
555
- createdAt: number;
556
923
  id: string;
557
- updatedAt: number;
924
+ createdAt: number;
925
+ status: OrganizationInvitationStatus;
558
926
  tenantId: string;
559
- organizationId: string;
927
+ updatedAt: number;
560
928
  inviterId: string | null;
929
+ invitee: string;
930
+ acceptedUserId: string | null;
931
+ organizationId: string;
561
932
  expiresAt: number;
562
933
  organizationRoles: OrganizationRoleEntity[];
934
+ } | {
935
+ id: string;
936
+ createdAt: number;
937
+ status: OrganizationInvitationStatus;
938
+ tenantId: string;
939
+ updatedAt: number;
940
+ inviterId: string | null;
563
941
  invitee: string;
564
942
  acceptedUserId: string | null;
565
- }>;
943
+ organizationId: string;
944
+ expiresAt: number;
945
+ organizationRoles: OrganizationRoleEntity[];
946
+ }[]>;
566
947
  } & {
567
948
  "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
568
949
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-a21a38a",
3
+ "version": "0.2.5-a6cff75",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -16,23 +16,21 @@
16
16
  "#src/*": "./build/*"
17
17
  },
18
18
  "devDependencies": {
19
- "@silverhand/eslint-config": "5.0.0",
20
- "@silverhand/jest-config": "5.0.0",
21
- "@silverhand/ts-config": "5.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
24
  "@types/node": "^20.0.0",
27
25
  "@types/yargs": "^17.0.24",
28
26
  "dts-bundle-generator": "^9.3.1",
29
- "eslint": "^8.44.0",
30
- "jest": "^29.5.0",
27
+ "eslint": "^8.57.0",
31
28
  "lint-staged": "^15.0.0",
32
29
  "nodemon": "^3.0.0",
33
- "p-map": "^7.0.1",
34
30
  "prettier": "^3.0.0",
35
- "typescript": "^5.3.3"
31
+ "typescript": "^5.3.3",
32
+ "vite-tsconfig-paths": "^4.3.1",
33
+ "vitest": "^2.0.0"
36
34
  },
37
35
  "engines": {
38
36
  "node": "^20.9.0"
@@ -51,22 +49,19 @@
51
49
  "access": "public"
52
50
  },
53
51
  "dependencies": {
54
- "@silverhand/essentials": "^2.9.0",
55
- "@withtyped/server": "^0.13.3"
52
+ "@silverhand/essentials": "^2.9.1",
53
+ "@withtyped/server": "^0.13.6"
56
54
  },
57
55
  "scripts": {
58
56
  "precommit": "lint-staged",
59
57
  "build": "rm -rf build/ && tsc -p tsconfig.build.json && pnpm build:lib",
60
58
  "//": "It is not used to build the service itself.",
61
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
- "build:test": "rm -rf build/ && tsc -p tsconfig.test.json --sourcemap",
63
60
  "lint": "eslint --ext .ts src",
64
61
  "lint:report": "pnpm lint --format json --output-file report.json",
65
62
  "dev": "rm -rf build/ && nodemon",
66
63
  "start": "NODE_ENV=production node .",
67
- "test:only": "NODE_OPTIONS=\"--experimental-vm-modules --max_old_space_size=4096\" jest --logHeapUsage",
68
- "test": "pnpm build:test && pnpm test:only && pnpm build:lib && pnpm test:types",
69
- "test:ci": "pnpm test:only --coverage --silent",
64
+ "test": "vitest && pnpm build:lib && pnpm test:types",
70
65
  "test:types": "tsc -p tsconfig.test.types.json",
71
66
  "cli": "node ./build/cli/index.js"
72
67
  }