@logto/cloud 0.2.5-a3e852f → 0.2.5-c2fffa4

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 +379 -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 LogtoJwtTokenPath {
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: LogtoJwtTokenPath.AccessToken;
316
+ token: Record<string, Json>;
317
+ context: Record<string, Json>;
318
+ envVars?: Record<string, string> | undefined;
319
+ } | {
320
+ script: string;
321
+ tokenType: LogtoJwtTokenPath.ClientCredentials;
322
+ token: Record<string, Json>;
323
+ envVars?: 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,56 @@ 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;
206
372
  };
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
373
  }[]>;
221
374
  };
222
375
  post: {};
223
376
  put: {};
224
- head: {};
225
377
  delete: {};
226
378
  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
379
  head: {};
242
- delete: {};
243
- copy: {};
244
380
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
245
- options: {};
246
381
  patch: {};
382
+ options: {};
247
383
  get: {
248
384
  "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
249
- status: "open" | "complete" | "expired";
250
- createdAt: Date;
251
385
  id: string;
386
+ createdAt: Date;
252
387
  userId: string;
253
- updatedAt: Date;
388
+ status: "open" | "complete" | "expired";
254
389
  tenantId: string | null;
390
+ updatedAt: Date;
255
391
  planId: string;
256
392
  }>;
257
393
  };
258
394
  post: {
259
395
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
396
+ planId: string;
397
+ successCallbackUrl: string;
260
398
  tenantId?: string | undefined;
399
+ cancelCallbackUrl?: string | undefined;
261
400
  tenantTag?: TenantTag | undefined;
262
401
  tenantName?: string | undefined;
263
- cancelCallbackUrl?: string | undefined;
264
- planId: string;
265
- successCallbackUrl: string;
266
402
  }, {
267
- redirectUri?: string | null | undefined;
268
403
  sessionId: string;
404
+ redirectUri?: string | null | undefined;
269
405
  }>;
270
406
  };
271
407
  put: {};
272
- head: {};
273
408
  delete: {};
274
409
  copy: {};
410
+ head: {};
275
411
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
276
- options: {};
277
412
  patch: {};
413
+ options: {};
278
414
  get: {
279
415
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
280
416
  };
@@ -282,57 +418,215 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
282
418
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
283
419
  name: string;
284
420
  }, {
285
- createdAt: Date;
286
421
  id: string;
422
+ createdAt: Date;
287
423
  name: string;
288
424
  }>;
289
425
  } & {
290
426
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
291
- value: string;
292
427
  type: "hostname" | "query";
293
- }, {
294
428
  value: string;
295
- type: "hostname" | "query";
429
+ }, {
296
430
  createdAt: Date;
297
431
  affiliateId: string;
432
+ type: "hostname" | "query";
433
+ value: string;
298
434
  }>;
299
435
  };
300
436
  put: {};
301
- head: {};
302
437
  delete: {
303
438
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
304
- value: string;
305
439
  type: "hostname" | "query";
440
+ value: string;
306
441
  }, unknown>;
307
442
  };
308
443
  copy: {};
444
+ head: {};
309
445
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
310
- options: {};
311
446
  patch: {};
447
+ options: {};
312
448
  get: {};
313
449
  post: {
314
450
  "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
315
- hostname?: string | undefined;
316
- query?: string | undefined;
317
451
  createdAt: string;
318
452
  userId: string;
453
+ hostname?: string | undefined;
454
+ query?: string | undefined;
319
455
  }, {
320
- createdAt: Date;
321
456
  id: string;
457
+ createdAt: Date;
322
458
  affiliateId: string | null;
323
459
  userId: string;
324
460
  createdVia: {
461
+ createdAt: string;
325
462
  hostname?: string | undefined;
326
463
  query?: string | undefined;
327
- createdAt: string;
328
464
  };
329
465
  }>;
330
466
  };
331
467
  put: {};
468
+ delete: {};
469
+ copy: {};
332
470
  head: {};
471
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
472
+ patch: {
473
+ "/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
474
+ status: OrganizationInvitationStatus.Accepted;
475
+ }, unknown>;
476
+ };
477
+ options: {};
478
+ get: {
479
+ "/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
480
+ id: string;
481
+ createdAt: number;
482
+ status: OrganizationInvitationStatus;
483
+ tenantId: string;
484
+ updatedAt: number;
485
+ organizationId: string;
486
+ inviterId: string | null;
487
+ invitee: string;
488
+ expiresAt: number;
489
+ acceptedUserId: string | null;
490
+ organizationRoles: OrganizationRoleEntity[];
491
+ } & {
492
+ tenantTag: TenantTag;
493
+ tenantName: string;
494
+ })[]>;
495
+ } & {
496
+ "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
497
+ id: string;
498
+ createdAt: number;
499
+ status: OrganizationInvitationStatus;
500
+ tenantId: string;
501
+ updatedAt: number;
502
+ organizationId: string;
503
+ inviterId: string | null;
504
+ invitee: string;
505
+ expiresAt: number;
506
+ acceptedUserId: string | null;
507
+ organizationRoles: OrganizationRoleEntity[];
508
+ }>;
509
+ };
510
+ post: {};
511
+ put: {};
333
512
  delete: {};
334
513
  copy: {};
514
+ head: {};
335
515
  }, "/api">>, "/api">;
516
+ export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
517
+ request: {
518
+ method?: import("@withtyped/server").RequestMethod | undefined;
519
+ headers: import("http").IncomingHttpHeaders;
520
+ url: URL;
521
+ body?: unknown;
522
+ };
523
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
524
+ patch: {
525
+ "/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
526
+ status: OrganizationInvitationStatus.Revoked;
527
+ }, {
528
+ id: string;
529
+ createdAt: number;
530
+ status: OrganizationInvitationStatus;
531
+ tenantId: string;
532
+ updatedAt: number;
533
+ organizationId: string;
534
+ inviterId: string | null;
535
+ invitee: string;
536
+ expiresAt: number;
537
+ acceptedUserId: string | null;
538
+ organizationRoles: OrganizationRoleEntity[];
539
+ }>;
540
+ };
541
+ options: {};
542
+ get: {
543
+ "/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
544
+ id: string;
545
+ name: string | null;
546
+ username: string | null;
547
+ primaryEmail: string | null;
548
+ primaryPhone: string | null;
549
+ avatar: string | null;
550
+ organizationRoles: OrganizationRoleEntity[];
551
+ }[]>;
552
+ } & {
553
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, {
554
+ id: string;
555
+ createdAt: number;
556
+ status: OrganizationInvitationStatus;
557
+ tenantId: string;
558
+ updatedAt: number;
559
+ organizationId: string;
560
+ inviterId: string | null;
561
+ invitee: string;
562
+ expiresAt: number;
563
+ acceptedUserId: string | null;
564
+ organizationRoles: OrganizationRoleEntity[];
565
+ }[]>;
566
+ };
567
+ post: {
568
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
569
+ invitee: string;
570
+ roleName: TenantRole;
571
+ expiresAt?: number | undefined;
572
+ }, {
573
+ id: string;
574
+ createdAt: number;
575
+ status: OrganizationInvitationStatus;
576
+ tenantId: string;
577
+ updatedAt: number;
578
+ organizationId: string;
579
+ inviterId: string | null;
580
+ invitee: string;
581
+ expiresAt: number;
582
+ acceptedUserId: string | null;
583
+ organizationRoles: OrganizationRoleEntity[];
584
+ }>;
585
+ } & {
586
+ "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
587
+ };
588
+ put: {
589
+ "/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
590
+ roleName: TenantRole;
591
+ }, unknown>;
592
+ };
593
+ delete: {
594
+ "/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
595
+ } & {
596
+ "/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
597
+ };
598
+ copy: {};
599
+ head: {};
600
+ }, "/api/tenants">>, "/api/tenants">;
601
+ export declare const functionsRouter: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
602
+ request: {
603
+ method?: import("@withtyped/server").RequestMethod | undefined;
604
+ headers: import("http").IncomingHttpHeaders;
605
+ url: URL;
606
+ body?: unknown;
607
+ };
608
+ }, "request"> & {
609
+ request: Record<string, unknown> & {
610
+ method?: import("@withtyped/server").RequestMethod | undefined;
611
+ headers: import("http").IncomingHttpHeaders;
612
+ url: URL;
613
+ body?: unknown;
614
+ } & {
615
+ body?: Json | undefined;
616
+ bodyRaw?: Buffer | undefined;
617
+ };
618
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
619
+ patch: {};
620
+ options: {};
621
+ get: {};
622
+ post: {
623
+ "/database-alteration": import("@withtyped/server").PathGuard<"/database-alteration", unknown, Json, unknown>;
624
+ };
625
+ put: {};
626
+ delete: {};
627
+ copy: {};
628
+ head: {};
629
+ }, "/functions">>, "/functions">;
336
630
 
337
631
  export {
338
632
  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-c2fffa4",
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
  }