@logto/cloud 0.2.5-d434baa → 0.2.5-e5d8200

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 +320 -101
  2. package/package.json +14 -18
@@ -1,54 +1,119 @@
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 const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
28
73
  createdAt: Date;
29
74
  affiliateId: string;
30
75
  type: "hostname" | "query";
31
76
  value: string;
32
77
  }, "createdAt", "createdAt">;
33
78
  export type AffiliateProperty = InferModelType<typeof AffiliateProperties>;
34
- declare const Affiliates: import("@withtyped/server/model").default<"affiliates", {
35
- id: string;
36
- createdAt: Date;
79
+ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default<"affiliates", {
37
80
  name: string;
38
- }, "createdAt" | "id", "createdAt" | "id">;
81
+ createdAt: Date;
82
+ id: string;
83
+ }, "id" | "createdAt", "id" | "createdAt">;
39
84
  export type Affiliate = InferModelType<typeof Affiliates>;
40
85
  export type AffiliateData = Affiliate & {
41
86
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
42
87
  };
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: {};
88
+ declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
89
+ request: {
90
+ method?: import("@withtyped/server").RequestMethod | undefined;
91
+ headers: import("http").IncomingHttpHeaders;
92
+ url: URL;
93
+ body?: unknown;
94
+ };
95
+ }, "request"> & {
96
+ request: Record<string, unknown> & {
97
+ method?: import("@withtyped/server").RequestMethod | undefined;
98
+ headers: import("http").IncomingHttpHeaders;
99
+ url: URL;
100
+ body?: unknown;
101
+ } & {
102
+ body?: Json | undefined;
103
+ bodyRaw?: Buffer | undefined;
104
+ };
105
+ }>, 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
106
  patch: {
46
107
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
47
108
  name?: string | undefined;
48
- tag?: TenantTag | undefined;
49
109
  }, {
50
110
  id: string;
51
111
  name: string;
112
+ usage: {
113
+ activeUsers: number;
114
+ cost: number;
115
+ tokenUsage: number;
116
+ };
52
117
  indicator: string;
53
118
  isSuspended: boolean;
54
119
  planId: string;
@@ -58,15 +123,10 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
58
123
  currentPeriodStart: Date;
59
124
  currentPeriodEnd: Date;
60
125
  };
61
- tag: TenantTag;
62
- usage: {
63
- activeUsers: number;
64
- cost: number;
65
- };
66
126
  openInvoices: {
67
127
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
68
- createdAt: Date;
69
128
  id: string;
129
+ createdAt: Date;
70
130
  updatedAt: Date;
71
131
  customerId: string | null;
72
132
  billingReason: string | null;
@@ -78,12 +138,19 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
78
138
  hostedInvoiceUrl: string | null;
79
139
  invoicePdf: string | null;
80
140
  }[];
141
+ tag: TenantTag;
81
142
  }>;
82
143
  };
144
+ options: {};
83
145
  get: {
84
146
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
85
147
  id: string;
86
148
  name: string;
149
+ usage: {
150
+ activeUsers: number;
151
+ cost: number;
152
+ tokenUsage: number;
153
+ };
87
154
  indicator: string;
88
155
  isSuspended: boolean;
89
156
  planId: string;
@@ -93,15 +160,10 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
93
160
  currentPeriodStart: Date;
94
161
  currentPeriodEnd: Date;
95
162
  };
96
- tag: TenantTag;
97
- usage: {
98
- activeUsers: number;
99
- cost: number;
100
- };
101
163
  openInvoices: {
102
164
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
103
- createdAt: Date;
104
165
  id: string;
166
+ createdAt: Date;
105
167
  updatedAt: Date;
106
168
  customerId: string | null;
107
169
  billingReason: string | null;
@@ -113,6 +175,7 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
113
175
  hostedInvoiceUrl: string | null;
114
176
  invoicePdf: string | null;
115
177
  }[];
178
+ tag: TenantTag;
116
179
  }[]>;
117
180
  };
118
181
  post: {
@@ -122,6 +185,11 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
122
185
  }, {
123
186
  id: string;
124
187
  name: string;
188
+ usage: {
189
+ activeUsers: number;
190
+ cost: number;
191
+ tokenUsage: number;
192
+ };
125
193
  indicator: string;
126
194
  isSuspended: boolean;
127
195
  planId: string;
@@ -131,15 +199,10 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
131
199
  currentPeriodStart: Date;
132
200
  currentPeriodEnd: Date;
133
201
  };
134
- tag: TenantTag;
135
- usage: {
136
- activeUsers: number;
137
- cost: number;
138
- };
139
202
  openInvoices: {
140
203
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
141
- createdAt: Date;
142
204
  id: string;
205
+ createdAt: Date;
143
206
  updatedAt: Date;
144
207
  customerId: string | null;
145
208
  billingReason: string | null;
@@ -151,17 +214,18 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
151
214
  hostedInvoiceUrl: string | null;
152
215
  invoicePdf: string | null;
153
216
  }[];
217
+ tag: TenantTag;
154
218
  }>;
155
219
  };
156
220
  put: {};
157
- head: {};
158
221
  delete: {
159
222
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
160
223
  };
161
224
  copy: {};
225
+ head: {};
162
226
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
163
- options: {};
164
227
  patch: {};
228
+ options: {};
165
229
  get: {
166
230
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
167
231
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
@@ -180,8 +244,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
180
244
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
181
245
  invoices: {
182
246
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
183
- createdAt: Date;
184
247
  id: string;
248
+ createdAt: Date;
185
249
  updatedAt: Date;
186
250
  customerId: string | null;
187
251
  billingReason: string | null;
@@ -203,6 +267,7 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
203
267
  "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
204
268
  activeUsers: number;
205
269
  cost: number;
270
+ tokenUsage: number;
206
271
  }>;
207
272
  };
208
273
  post: {
@@ -213,14 +278,14 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
213
278
  }>;
214
279
  };
215
280
  put: {};
216
- head: {};
217
281
  delete: {
218
282
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
219
283
  };
220
284
  copy: {};
285
+ head: {};
221
286
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
222
- options: {};
223
287
  patch: {};
288
+ options: {};
224
289
  get: {
225
290
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
226
291
  from?: string | undefined;
@@ -231,12 +296,14 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
231
296
  post: {
232
297
  "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
233
298
  data: {
234
- type: VerificationCodeType;
299
+ type: TemplateType | VerificationCodeType;
235
300
  payload: {
301
+ code?: string | undefined;
302
+ link?: string | undefined;
303
+ } & Record<string, string> & {
236
304
  senderName?: string | undefined;
237
305
  companyInformation?: string | undefined;
238
306
  appLogo?: string | undefined;
239
- code: string;
240
307
  };
241
308
  to: string;
242
309
  };
@@ -244,28 +311,71 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
244
311
  } & {
245
312
  "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
246
313
  data: {
247
- type: VerificationCodeType;
314
+ type: TemplateType | VerificationCodeType;
248
315
  to: string;
249
316
  payload: {
250
- code: string;
251
- };
317
+ code?: string | undefined;
318
+ link?: string | undefined;
319
+ } & Record<string, string>;
252
320
  };
253
321
  }, unknown>;
322
+ } & {
323
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
324
+ isTest?: string | undefined;
325
+ }, {
326
+ script: string;
327
+ tokenType: LogtoJwtTokenKeyType.AccessToken;
328
+ token: Record<string, Json>;
329
+ context: Record<string, Json>;
330
+ environmentVariables?: Record<string, string> | undefined;
331
+ } | {
332
+ script: string;
333
+ tokenType: LogtoJwtTokenKeyType.ClientCredentials;
334
+ token: Record<string, Json>;
335
+ environmentVariables?: Record<string, string> | undefined;
336
+ }, Record<string, unknown>>;
337
+ };
338
+ put: {
339
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
340
+ "jwt.accessToken"?: {
341
+ production?: string | undefined;
342
+ test?: string | undefined;
343
+ } | undefined;
344
+ "jwt.clientCredentials"?: {
345
+ production?: string | undefined;
346
+ test?: string | undefined;
347
+ } | undefined;
348
+ }, unknown>;
349
+ };
350
+ delete: {
351
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
254
352
  };
255
- put: {};
256
- head: {};
257
- delete: {};
258
353
  copy: {};
354
+ head: {};
259
355
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
260
- options: {};
261
356
  patch: {};
357
+ options: {};
262
358
  get: {
263
359
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
264
- createdAt: Date;
265
360
  id: string;
361
+ createdAt: Date;
266
362
  name: string;
363
+ updatedAt: Date;
364
+ stripeProducts: {
365
+ type: "flat" | "tier1" | "tier2" | "tier3";
366
+ id: string;
367
+ name: string;
368
+ price: {
369
+ id: string;
370
+ unitAmountDecimal: string;
371
+ quantity?: 1 | undefined;
372
+ unitAmount?: number | null | undefined;
373
+ };
374
+ description?: string | undefined;
375
+ }[];
267
376
  quota: {
268
377
  mauLimit: number | null;
378
+ tokenLimit: number | null;
269
379
  applicationsLimit: number | null;
270
380
  machineToMachineLimit: number | null;
271
381
  resourcesLimit: number | null;
@@ -276,82 +386,58 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
276
386
  socialConnectorsLimit: number | null;
277
387
  standardConnectorsLimit: number | null;
278
388
  rolesLimit: number | null;
389
+ machineToMachineRolesLimit: number | null;
279
390
  scopesPerRoleLimit: number | null;
280
391
  hooksLimit: number | null;
281
392
  auditLogsRetentionDays: number | null;
282
393
  mfaEnabled: boolean;
394
+ organizationsEnabled: boolean;
395
+ ssoEnabled: boolean;
396
+ thirdPartyApplicationsLimit: number | null;
397
+ tenantMembersLimit: number | null;
398
+ customJwtEnabled: boolean;
283
399
  };
284
- stripeProducts: {
285
- description?: string | undefined;
286
- type: "flat" | "tier1" | "tier2" | "tier3";
287
- id: string;
288
- name: string;
289
- price: {
290
- quantity?: 1 | undefined;
291
- unitAmount?: number | null | undefined;
292
- id: string;
293
- unitAmountDecimal: string;
294
- };
295
- }[];
296
- updatedAt: Date;
297
400
  }[]>;
298
401
  };
299
402
  post: {};
300
403
  put: {};
301
- head: {};
302
404
  delete: {};
303
405
  copy: {};
304
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
305
- options: {};
306
- patch: {};
307
- get: {
308
- "/my/tenant": import("@withtyped/server").PathGuard<"/tenant", unknown, unknown, {
309
- id: string;
310
- name: string;
311
- indicator: string;
312
- isSuspended: boolean;
313
- tag: TenantTag;
314
- }>;
315
- };
316
- post: {};
317
- put: {};
318
406
  head: {};
319
- delete: {};
320
- copy: {};
321
407
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
322
- options: {};
323
408
  patch: {};
409
+ options: {};
324
410
  get: {
325
411
  "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
326
- status: "open" | "complete" | "expired";
327
- createdAt: Date;
328
412
  id: string;
413
+ createdAt: Date;
329
414
  userId: string;
330
- updatedAt: Date;
415
+ status: "open" | "complete" | "expired";
331
416
  tenantId: string | null;
417
+ updatedAt: Date;
332
418
  planId: string;
333
419
  }>;
334
420
  };
335
421
  post: {
336
422
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
423
+ planId: string;
424
+ successCallbackUrl: string;
337
425
  tenantId?: string | undefined;
426
+ cancelCallbackUrl?: string | undefined;
338
427
  tenantTag?: TenantTag | undefined;
339
428
  tenantName?: string | undefined;
340
- cancelCallbackUrl?: string | undefined;
341
- planId: string;
342
- successCallbackUrl: string;
343
429
  }, {
344
- redirectUri?: string | null | undefined;
345
430
  sessionId: string;
431
+ redirectUri?: string | null | undefined;
346
432
  }>;
347
433
  };
348
434
  put: {};
349
- head: {};
350
435
  delete: {};
351
436
  copy: {};
437
+ head: {};
352
438
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
353
- options: {};
354
439
  patch: {};
440
+ options: {};
355
441
  get: {
356
442
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
357
443
  };
@@ -359,57 +445,190 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
359
445
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
360
446
  name: string;
361
447
  }, {
362
- createdAt: Date;
363
448
  id: string;
449
+ createdAt: Date;
364
450
  name: string;
365
451
  }>;
366
452
  } & {
367
453
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
368
- value: string;
369
454
  type: "hostname" | "query";
370
- }, {
371
455
  value: string;
372
- type: "hostname" | "query";
456
+ }, {
373
457
  createdAt: Date;
374
458
  affiliateId: string;
459
+ type: "hostname" | "query";
460
+ value: string;
375
461
  }>;
376
462
  };
377
463
  put: {};
378
- head: {};
379
464
  delete: {
380
465
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
381
- value: string;
382
466
  type: "hostname" | "query";
467
+ value: string;
383
468
  }, unknown>;
384
469
  };
385
470
  copy: {};
471
+ head: {};
386
472
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
387
- options: {};
388
473
  patch: {};
474
+ options: {};
389
475
  get: {};
390
476
  post: {
391
477
  "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
392
- hostname?: string | undefined;
393
- query?: string | undefined;
394
478
  createdAt: string;
395
479
  userId: string;
480
+ hostname?: string | undefined;
481
+ query?: string | undefined;
396
482
  }, {
397
- createdAt: Date;
398
483
  id: string;
484
+ createdAt: Date;
399
485
  affiliateId: string | null;
400
486
  userId: string;
401
487
  createdVia: {
488
+ createdAt: string;
402
489
  hostname?: string | undefined;
403
490
  query?: string | undefined;
404
- createdAt: string;
405
491
  };
406
492
  }>;
407
493
  };
408
494
  put: {};
495
+ delete: {};
496
+ copy: {};
409
497
  head: {};
498
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
499
+ patch: {
500
+ "/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
501
+ status: OrganizationInvitationStatus.Accepted;
502
+ }, unknown>;
503
+ };
504
+ options: {};
505
+ get: {
506
+ "/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
507
+ id: string;
508
+ createdAt: number;
509
+ status: OrganizationInvitationStatus;
510
+ tenantId: string;
511
+ updatedAt: number;
512
+ inviterId: string | null;
513
+ invitee: string;
514
+ acceptedUserId: string | null;
515
+ organizationId: string;
516
+ expiresAt: number;
517
+ organizationRoles: OrganizationRoleEntity[];
518
+ } & {
519
+ tenantTag: TenantTag;
520
+ tenantName: string;
521
+ })[]>;
522
+ } & {
523
+ "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
524
+ id: string;
525
+ createdAt: number;
526
+ status: OrganizationInvitationStatus;
527
+ tenantId: string;
528
+ updatedAt: number;
529
+ inviterId: string | null;
530
+ invitee: string;
531
+ acceptedUserId: string | null;
532
+ organizationId: string;
533
+ expiresAt: number;
534
+ organizationRoles: OrganizationRoleEntity[];
535
+ }>;
536
+ };
537
+ post: {};
538
+ put: {};
410
539
  delete: {};
411
540
  copy: {};
541
+ head: {};
412
542
  }, "/api">>, "/api">;
543
+ export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
544
+ request: {
545
+ method?: import("@withtyped/server").RequestMethod | undefined;
546
+ headers: import("http").IncomingHttpHeaders;
547
+ url: URL;
548
+ body?: unknown;
549
+ };
550
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
551
+ patch: {
552
+ "/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
553
+ status: OrganizationInvitationStatus.Revoked;
554
+ }, {
555
+ id: string;
556
+ createdAt: number;
557
+ status: OrganizationInvitationStatus;
558
+ tenantId: string;
559
+ updatedAt: number;
560
+ inviterId: string | null;
561
+ invitee: string;
562
+ acceptedUserId: string | null;
563
+ organizationId: string;
564
+ expiresAt: number;
565
+ organizationRoles: OrganizationRoleEntity[];
566
+ }>;
567
+ };
568
+ options: {};
569
+ get: {
570
+ "/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
571
+ id: string;
572
+ name: string | null;
573
+ username: string | null;
574
+ primaryEmail: string | null;
575
+ primaryPhone: string | null;
576
+ avatar: string | null;
577
+ organizationRoles: OrganizationRoleEntity[];
578
+ }[]>;
579
+ } & {
580
+ "/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
581
+ } & {
582
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
583
+ id: string;
584
+ createdAt: number;
585
+ status: OrganizationInvitationStatus;
586
+ tenantId: string;
587
+ updatedAt: number;
588
+ inviterId: string | null;
589
+ invitee: string;
590
+ acceptedUserId: string | null;
591
+ organizationId: string;
592
+ expiresAt: number;
593
+ organizationRoles: OrganizationRoleEntity[];
594
+ } & {
595
+ inviterName?: string | undefined;
596
+ })[]>;
597
+ };
598
+ post: {
599
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
600
+ invitee: string;
601
+ roleName: TenantRole;
602
+ expiresAt?: number | undefined;
603
+ }, {
604
+ id: string;
605
+ createdAt: number;
606
+ status: OrganizationInvitationStatus;
607
+ tenantId: string;
608
+ updatedAt: number;
609
+ inviterId: string | null;
610
+ invitee: string;
611
+ acceptedUserId: string | null;
612
+ organizationId: string;
613
+ expiresAt: number;
614
+ organizationRoles: OrganizationRoleEntity[];
615
+ }>;
616
+ } & {
617
+ "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
618
+ };
619
+ put: {
620
+ "/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
621
+ roleName: TenantRole;
622
+ }, unknown>;
623
+ };
624
+ delete: {
625
+ "/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
626
+ } & {
627
+ "/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
628
+ };
629
+ copy: {};
630
+ head: {};
631
+ }, "/api/tenants">>, "/api/tenants">;
413
632
 
414
633
  export {
415
634
  router as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-d434baa",
3
+ "version": "0.2.5-e5d8200",
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": "5.0.0",
20
+ "@silverhand/ts-config": "5.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",
26
+ "dts-bundle-generator": "^9.3.1",
29
27
  "eslint": "^8.44.0",
30
- "jest": "^29.5.0",
31
- "lint-staged": "^14.0.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": "^1.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.0",
53
+ "@withtyped/server": "^0.13.3"
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
  }