@logto/cloud 0.2.5-93f5b5e → 0.2.5-98514d7

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