@logto/cloud 0.2.5-a3e852f → 0.2.5-ab8a489

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