@logto/cloud 0.2.5-93f5b5e → 0.2.5-94f7bcc

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