@logto/cloud 0.2.5-a3e852f → 0.2.5-a7eedce

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