@logto/cloud 0.2.5-33a6965 → 0.2.5-3b703da

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 +555 -61
  2. package/package.json +16 -20
@@ -1,109 +1,371 @@
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 enum LogtoSkuType {
73
+ Basic = "Basic",
74
+ AddOn = "AddOn"
75
+ }
76
+ declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
28
77
  createdAt: Date;
29
78
  affiliateId: string;
30
79
  type: "hostname" | "query";
31
80
  value: string;
32
81
  }, "createdAt", "createdAt">;
33
82
  export type AffiliateProperty = InferModelType<typeof AffiliateProperties>;
34
- declare const Affiliates: import("@withtyped/server/model").default<"affiliates", {
35
- id: string;
36
- createdAt: Date;
83
+ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default<"affiliates", {
37
84
  name: string;
38
- }, "createdAt" | "id", "createdAt" | "id">;
85
+ createdAt: Date;
86
+ id: string;
87
+ }, "id" | "createdAt", "id" | "createdAt">;
39
88
  export type Affiliate = InferModelType<typeof Affiliates>;
89
+ declare enum RegionName {
90
+ EU = "EU",
91
+ US = "US"
92
+ }
40
93
  export type AffiliateData = Affiliate & {
41
94
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
42
95
  };
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").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
44
- options: {};
96
+ declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
97
+ request: {
98
+ id?: string | undefined;
99
+ method?: import("@withtyped/server").RequestMethod | undefined;
100
+ headers: import("http").IncomingHttpHeaders;
101
+ url: URL;
102
+ body?: unknown;
103
+ };
104
+ }, "request"> & {
105
+ request: Record<string, unknown> & {
106
+ id?: string | undefined;
107
+ method?: import("@withtyped/server").RequestMethod | undefined;
108
+ headers: import("http").IncomingHttpHeaders;
109
+ url: URL;
110
+ body?: unknown;
111
+ } & {
112
+ body?: Json | undefined;
113
+ bodyRaw?: Buffer | undefined;
114
+ };
115
+ }>, 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").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
45
116
  patch: {
46
117
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
47
118
  name?: string | undefined;
48
- tag?: TenantTag | undefined;
49
119
  }, {
50
120
  id: string;
51
121
  name: string;
122
+ createdAt: Date;
123
+ usage: {
124
+ activeUsers: number;
125
+ cost: number;
126
+ tokenUsage: number;
127
+ };
52
128
  indicator: string;
129
+ isSuspended: boolean;
53
130
  planId: string;
131
+ subscription: {
132
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
133
+ planId: string;
134
+ currentPeriodStart: Date;
135
+ currentPeriodEnd: Date;
136
+ id?: string | undefined;
137
+ };
138
+ regionName: RegionName;
54
139
  tag: TenantTag;
140
+ openInvoices: {
141
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
142
+ id: string;
143
+ createdAt: Date;
144
+ updatedAt: Date;
145
+ customerId: string | null;
146
+ billingReason: string | null;
147
+ periodStart: Date;
148
+ periodEnd: Date;
149
+ amountDue: number;
150
+ amountPaid: number;
151
+ subscriptionId: string | null;
152
+ hostedInvoiceUrl: string | null;
153
+ invoicePdf: string | null;
154
+ }[];
55
155
  }>;
56
156
  };
157
+ options: {};
57
158
  get: {
58
159
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
59
160
  id: string;
60
161
  name: string;
162
+ createdAt: Date;
163
+ usage: {
164
+ activeUsers: number;
165
+ cost: number;
166
+ tokenUsage: number;
167
+ };
61
168
  indicator: string;
169
+ isSuspended: boolean;
62
170
  planId: string;
171
+ subscription: {
172
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
173
+ planId: string;
174
+ currentPeriodStart: Date;
175
+ currentPeriodEnd: Date;
176
+ id?: string | undefined;
177
+ };
178
+ regionName: RegionName;
63
179
  tag: TenantTag;
180
+ openInvoices: {
181
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
182
+ id: string;
183
+ createdAt: Date;
184
+ updatedAt: Date;
185
+ customerId: string | null;
186
+ billingReason: string | null;
187
+ periodStart: Date;
188
+ periodEnd: Date;
189
+ amountDue: number;
190
+ amountPaid: number;
191
+ subscriptionId: string | null;
192
+ hostedInvoiceUrl: string | null;
193
+ invoicePdf: string | null;
194
+ }[];
64
195
  }[]>;
65
196
  };
66
197
  post: {
67
198
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
68
199
  name?: string | undefined;
69
200
  tag?: TenantTag | undefined;
201
+ regionName?: RegionName | undefined;
70
202
  }, {
71
203
  id: string;
72
204
  name: string;
205
+ createdAt: Date;
206
+ usage: {
207
+ activeUsers: number;
208
+ cost: number;
209
+ tokenUsage: number;
210
+ };
73
211
  indicator: string;
212
+ isSuspended: boolean;
74
213
  planId: string;
214
+ subscription: {
215
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
216
+ planId: string;
217
+ currentPeriodStart: Date;
218
+ currentPeriodEnd: Date;
219
+ id?: string | undefined;
220
+ };
221
+ regionName: RegionName;
75
222
  tag: TenantTag;
223
+ openInvoices: {
224
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
225
+ id: string;
226
+ createdAt: Date;
227
+ updatedAt: Date;
228
+ customerId: string | null;
229
+ billingReason: string | null;
230
+ periodStart: Date;
231
+ periodEnd: Date;
232
+ amountDue: number;
233
+ amountPaid: number;
234
+ subscriptionId: string | null;
235
+ hostedInvoiceUrl: string | null;
236
+ invoicePdf: string | null;
237
+ }[];
76
238
  }>;
77
239
  };
78
240
  put: {};
79
- head: {};
80
241
  delete: {
81
242
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
82
243
  };
83
244
  copy: {};
245
+ head: {};
84
246
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
85
- options: {};
86
247
  patch: {};
248
+ options: {};
87
249
  get: {
88
250
  "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
89
251
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
90
252
  planId: string;
91
253
  currentPeriodStart: Date;
92
254
  currentPeriodEnd: Date;
255
+ id?: string | undefined;
256
+ }>;
257
+ } & {
258
+ "/tenants/my/subscription/quota": import("@withtyped/server").PathGuard<"/my/subscription/quota", unknown, unknown, {
259
+ mauLimit: number | null;
260
+ tokenLimit: number | null;
261
+ applicationsLimit: number | null;
262
+ machineToMachineLimit: number | null;
263
+ resourcesLimit: number | null;
264
+ scopesPerResourceLimit: number | null;
265
+ socialConnectorsLimit: number | null;
266
+ machineToMachineRolesLimit: number | null;
267
+ scopesPerRoleLimit: number | null;
268
+ hooksLimit: number | null;
269
+ auditLogsRetentionDays: number | null;
270
+ mfaEnabled: boolean;
271
+ organizationsEnabled: boolean;
272
+ thirdPartyApplicationsLimit: number | null;
273
+ tenantMembersLimit: number | null;
274
+ customJwtEnabled: boolean;
275
+ subjectTokenEnabled: boolean;
276
+ bringYourUiEnabled: boolean;
277
+ userRolesLimit: number | null;
278
+ enterpriseSsoLimit: number | null;
93
279
  }>;
280
+ } & {
281
+ "/tenants/my/subscription/usage": import("@withtyped/server").PathGuard<"/my/subscription/usage", unknown, unknown, {
282
+ mauLimit: number;
283
+ tokenLimit: number;
284
+ applicationsLimit: number;
285
+ machineToMachineLimit: number;
286
+ resourcesLimit: number;
287
+ scopesPerResourceLimit: number;
288
+ socialConnectorsLimit: number;
289
+ machineToMachineRolesLimit: number;
290
+ scopesPerRoleLimit: number;
291
+ hooksLimit: number;
292
+ mfaEnabled: boolean;
293
+ organizationsEnabled: boolean;
294
+ thirdPartyApplicationsLimit: number;
295
+ tenantMembersLimit: number;
296
+ customJwtEnabled: boolean;
297
+ subjectTokenEnabled: boolean;
298
+ bringYourUiEnabled: boolean;
299
+ userRolesLimit: number;
300
+ enterpriseSsoLimit: number;
301
+ }>;
302
+ } & {
303
+ "/tenants/my/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/my/subscription/usage/:entityName/scopes", {
304
+ entityId?: string | undefined;
305
+ }, unknown, Record<string, number>>;
94
306
  } & {
95
307
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
96
308
  status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
97
309
  planId: string;
98
310
  currentPeriodStart: Date;
99
311
  currentPeriodEnd: Date;
312
+ id?: string | undefined;
100
313
  }>;
314
+ } & {
315
+ "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
316
+ mauLimit: number | null;
317
+ tokenLimit: number | null;
318
+ applicationsLimit: number | null;
319
+ machineToMachineLimit: number | null;
320
+ resourcesLimit: number | null;
321
+ scopesPerResourceLimit: number | null;
322
+ socialConnectorsLimit: number | null;
323
+ machineToMachineRolesLimit: number | null;
324
+ scopesPerRoleLimit: number | null;
325
+ hooksLimit: number | null;
326
+ auditLogsRetentionDays: number | null;
327
+ mfaEnabled: boolean;
328
+ organizationsEnabled: boolean;
329
+ thirdPartyApplicationsLimit: number | null;
330
+ tenantMembersLimit: number | null;
331
+ customJwtEnabled: boolean;
332
+ subjectTokenEnabled: boolean;
333
+ bringYourUiEnabled: boolean;
334
+ userRolesLimit: number | null;
335
+ enterpriseSsoLimit: number | null;
336
+ }>;
337
+ } & {
338
+ "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
339
+ mauLimit: number;
340
+ tokenLimit: number;
341
+ applicationsLimit: number;
342
+ machineToMachineLimit: number;
343
+ resourcesLimit: number;
344
+ scopesPerResourceLimit: number;
345
+ socialConnectorsLimit: number;
346
+ machineToMachineRolesLimit: number;
347
+ scopesPerRoleLimit: number;
348
+ hooksLimit: number;
349
+ mfaEnabled: boolean;
350
+ organizationsEnabled: boolean;
351
+ thirdPartyApplicationsLimit: number;
352
+ tenantMembersLimit: number;
353
+ customJwtEnabled: boolean;
354
+ subjectTokenEnabled: boolean;
355
+ bringYourUiEnabled: boolean;
356
+ userRolesLimit: number;
357
+ enterpriseSsoLimit: number;
358
+ }>;
359
+ } & {
360
+ "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
361
+ entityId?: string | undefined;
362
+ }, unknown, Record<string, number>>;
101
363
  } & {
102
364
  "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
103
365
  invoices: {
104
366
  status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
105
- createdAt: Date;
106
367
  id: string;
368
+ createdAt: Date;
107
369
  updatedAt: Date;
108
370
  customerId: string | null;
109
371
  billingReason: string | null;
@@ -117,10 +379,15 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
117
379
  planName: string | null;
118
380
  }[];
119
381
  }>;
382
+ } & {
383
+ "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
384
+ hostedInvoiceUrl: string;
385
+ }>;
120
386
  } & {
121
387
  "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
122
388
  activeUsers: number;
123
389
  cost: number;
390
+ tokenUsage: number;
124
391
  }>;
125
392
  };
126
393
  post: {
@@ -131,14 +398,14 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
131
398
  }>;
132
399
  };
133
400
  put: {};
134
- head: {};
135
401
  delete: {
136
402
  "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
137
403
  };
138
404
  copy: {};
405
+ head: {};
139
406
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
140
- options: {};
141
407
  patch: {};
408
+ options: {};
142
409
  get: {
143
410
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
144
411
  from?: string | undefined;
@@ -149,44 +416,74 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
149
416
  post: {
150
417
  "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
151
418
  data: {
152
- type: VerificationCodeType;
153
- to: string;
419
+ type: TemplateType | VerificationCodeType;
154
420
  payload: {
421
+ code?: string | undefined;
422
+ link?: string | undefined;
423
+ } & Record<string, string> & {
155
424
  senderName?: string | undefined;
156
425
  companyInformation?: string | undefined;
157
426
  appLogo?: string | undefined;
158
- code: string;
159
427
  };
428
+ to: string;
160
429
  };
161
430
  }, unknown>;
162
431
  } & {
163
432
  "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
164
433
  data: {
165
- type: VerificationCodeType;
434
+ type: TemplateType | VerificationCodeType;
166
435
  to: string;
167
436
  payload: {
168
- senderName?: string | undefined;
169
- companyInformation?: string | undefined;
170
- appLogo?: string | undefined;
171
- code: string;
172
- };
437
+ code?: string | undefined;
438
+ link?: string | undefined;
439
+ } & Record<string, string>;
173
440
  };
174
441
  }, unknown>;
442
+ } & {
443
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
444
+ isTest?: string | undefined;
445
+ }, {
446
+ context: Record<string, Json>;
447
+ script: string;
448
+ tokenType: LogtoJwtTokenKeyType.AccessToken;
449
+ token: Record<string, Json>;
450
+ environmentVariables?: Record<string, string> | undefined;
451
+ } | {
452
+ script: string;
453
+ tokenType: LogtoJwtTokenKeyType.ClientCredentials;
454
+ token: Record<string, Json>;
455
+ environmentVariables?: Record<string, string> | undefined;
456
+ }, Record<string, unknown>>;
457
+ };
458
+ put: {
459
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
460
+ "jwt.accessToken"?: {
461
+ production?: string | undefined;
462
+ test?: string | undefined;
463
+ } | undefined;
464
+ "jwt.clientCredentials"?: {
465
+ production?: string | undefined;
466
+ test?: string | undefined;
467
+ } | undefined;
468
+ }, unknown>;
469
+ };
470
+ delete: {
471
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
175
472
  };
176
- put: {};
177
- head: {};
178
- delete: {};
179
473
  copy: {};
474
+ head: {};
180
475
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
181
- options: {};
182
476
  patch: {};
477
+ options: {};
183
478
  get: {
184
479
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
185
- createdAt: Date;
186
480
  id: string;
481
+ createdAt: Date;
187
482
  name: string;
483
+ updatedAt: Date;
188
484
  quota: {
189
485
  mauLimit: number | null;
486
+ tokenLimit: number | null;
190
487
  applicationsLimit: number | null;
191
488
  machineToMachineLimit: number | null;
192
489
  resourcesLimit: number | null;
@@ -197,64 +494,116 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
197
494
  socialConnectorsLimit: number | null;
198
495
  standardConnectorsLimit: number | null;
199
496
  rolesLimit: number | null;
497
+ machineToMachineRolesLimit: number | null;
200
498
  scopesPerRoleLimit: number | null;
201
499
  hooksLimit: number | null;
202
500
  auditLogsRetentionDays: number | null;
501
+ mfaEnabled: boolean;
502
+ organizationsEnabled: boolean;
503
+ ssoEnabled: boolean;
504
+ thirdPartyApplicationsLimit: number | null;
505
+ tenantMembersLimit: number | null;
506
+ customJwtEnabled: boolean;
507
+ subjectTokenEnabled: boolean;
508
+ bringYourUiEnabled: boolean;
203
509
  };
204
510
  stripeProducts: {
205
- description?: string | undefined;
206
511
  type: "flat" | "tier1" | "tier2" | "tier3";
207
512
  id: string;
208
513
  name: string;
209
514
  price: {
210
- quantity?: 1 | undefined;
211
- unitAmount?: number | null | undefined;
212
515
  id: string;
213
516
  unitAmountDecimal: string;
517
+ quantity?: 1 | undefined;
518
+ unitAmount?: number | null | undefined;
214
519
  };
520
+ description?: string | undefined;
215
521
  }[];
216
- updatedAt: Date;
217
522
  }[]>;
218
523
  };
219
524
  post: {};
220
525
  put: {};
221
- head: {};
222
526
  delete: {};
223
527
  copy: {};
528
+ head: {};
224
529
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
530
+ patch: {};
225
531
  options: {};
532
+ get: {
533
+ "/skus": import("@withtyped/server").PathGuard<"/", {
534
+ type?: LogtoSkuType | undefined;
535
+ }, unknown, {
536
+ type: LogtoSkuType;
537
+ id: string;
538
+ name: string | null;
539
+ quota: {
540
+ mauLimit?: number | null | undefined;
541
+ tokenLimit?: number | null | undefined;
542
+ applicationsLimit?: number | null | undefined;
543
+ machineToMachineLimit?: number | null | undefined;
544
+ resourcesLimit?: number | null | undefined;
545
+ scopesPerResourceLimit?: number | null | undefined;
546
+ socialConnectorsLimit?: number | null | undefined;
547
+ machineToMachineRolesLimit?: number | null | undefined;
548
+ scopesPerRoleLimit?: number | null | undefined;
549
+ hooksLimit?: number | null | undefined;
550
+ auditLogsRetentionDays?: number | null | undefined;
551
+ mfaEnabled?: boolean | undefined;
552
+ organizationsEnabled?: boolean | undefined;
553
+ thirdPartyApplicationsLimit?: number | null | undefined;
554
+ tenantMembersLimit?: number | null | undefined;
555
+ customJwtEnabled?: boolean | undefined;
556
+ subjectTokenEnabled?: boolean | undefined;
557
+ bringYourUiEnabled?: boolean | undefined;
558
+ userRolesLimit?: number | null | undefined;
559
+ enterpriseSsoLimit?: number | null | undefined;
560
+ };
561
+ createdAt: Date;
562
+ updatedAt: Date;
563
+ unitPrice: number | null;
564
+ }[]>;
565
+ };
566
+ post: {};
567
+ put: {};
568
+ delete: {};
569
+ copy: {};
570
+ head: {};
571
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
226
572
  patch: {};
573
+ options: {};
227
574
  get: {
228
575
  "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
229
- status: "open" | "complete" | "expired";
230
- createdAt: Date;
231
576
  id: string;
577
+ createdAt: Date;
232
578
  userId: string;
233
- updatedAt: Date;
579
+ status: "open" | "complete" | "expired";
234
580
  tenantId: string | null;
581
+ updatedAt: Date;
235
582
  planId: string;
236
583
  }>;
237
584
  };
238
585
  post: {
239
586
  "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
587
+ planId: string;
588
+ successCallbackUrl: string;
240
589
  tenantId?: string | undefined;
241
- tenantTag?: TenantTag | undefined;
242
590
  tenantName?: string | undefined;
591
+ tenantTag?: TenantTag | undefined;
592
+ tenantRegionName?: RegionName | undefined;
593
+ skuId?: string | undefined;
243
594
  cancelCallbackUrl?: string | undefined;
244
- planId: string;
245
- successCallbackUrl: string;
246
595
  }, {
247
- redirectUri?: string | null | undefined;
248
596
  sessionId: string;
597
+ redirectUri?: string | null | undefined;
249
598
  }>;
250
599
  };
251
600
  put: {};
252
- head: {};
253
601
  delete: {};
254
602
  copy: {};
603
+ head: {};
255
604
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
256
- options: {};
257
605
  patch: {};
606
+ options: {};
258
607
  get: {
259
608
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
260
609
  };
@@ -262,57 +611,202 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
262
611
  "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
263
612
  name: string;
264
613
  }, {
265
- createdAt: Date;
266
614
  id: string;
615
+ createdAt: Date;
267
616
  name: string;
268
617
  }>;
269
618
  } & {
270
619
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
271
- value: string;
272
620
  type: "hostname" | "query";
273
- }, {
274
621
  value: string;
275
- type: "hostname" | "query";
622
+ }, {
276
623
  createdAt: Date;
277
624
  affiliateId: string;
625
+ type: "hostname" | "query";
626
+ value: string;
278
627
  }>;
279
628
  };
280
629
  put: {};
281
- head: {};
282
630
  delete: {
283
631
  "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
284
- value: string;
285
632
  type: "hostname" | "query";
633
+ value: string;
286
634
  }, unknown>;
287
635
  };
288
636
  copy: {};
637
+ head: {};
289
638
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
290
- options: {};
291
639
  patch: {};
640
+ options: {};
292
641
  get: {};
293
642
  post: {
294
643
  "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
295
- hostname?: string | undefined;
296
- query?: string | undefined;
297
644
  createdAt: string;
298
645
  userId: string;
646
+ hostname?: string | undefined;
647
+ query?: string | undefined;
299
648
  }, {
300
- createdAt: Date;
301
649
  id: string;
650
+ createdAt: Date;
302
651
  affiliateId: string | null;
303
652
  userId: string;
304
653
  createdVia: {
654
+ createdAt: string;
305
655
  hostname?: string | undefined;
306
656
  query?: string | undefined;
307
- createdAt: string;
308
657
  };
309
658
  }>;
310
659
  };
311
660
  put: {};
661
+ delete: {};
662
+ copy: {};
312
663
  head: {};
664
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
665
+ patch: {
666
+ "/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
667
+ status: OrganizationInvitationStatus.Accepted;
668
+ }, unknown>;
669
+ };
670
+ options: {};
671
+ get: {
672
+ "/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
673
+ id: string;
674
+ createdAt: number;
675
+ status: OrganizationInvitationStatus;
676
+ tenantId: string;
677
+ updatedAt: number;
678
+ inviterId: string | null;
679
+ invitee: string;
680
+ acceptedUserId: string | null;
681
+ organizationId: string;
682
+ expiresAt: number;
683
+ organizationRoles: OrganizationRoleEntity[];
684
+ } & {
685
+ tenantName: string;
686
+ tenantTag: TenantTag;
687
+ })[]>;
688
+ } & {
689
+ "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
690
+ id: string;
691
+ createdAt: number;
692
+ status: OrganizationInvitationStatus;
693
+ tenantId: string;
694
+ updatedAt: number;
695
+ inviterId: string | null;
696
+ invitee: string;
697
+ acceptedUserId: string | null;
698
+ organizationId: string;
699
+ expiresAt: number;
700
+ organizationRoles: OrganizationRoleEntity[];
701
+ }>;
702
+ };
703
+ post: {};
704
+ put: {};
313
705
  delete: {};
314
706
  copy: {};
707
+ head: {};
708
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
709
+ patch: {};
710
+ options: {};
711
+ get: {};
712
+ post: {};
713
+ put: {};
714
+ delete: {
715
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
716
+ };
717
+ copy: {};
718
+ head: {};
315
719
  }, "/api">>, "/api">;
720
+ export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
721
+ request: {
722
+ id?: string | undefined;
723
+ method?: import("@withtyped/server").RequestMethod | undefined;
724
+ headers: import("http").IncomingHttpHeaders;
725
+ url: URL;
726
+ body?: unknown;
727
+ };
728
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
729
+ patch: {
730
+ "/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
731
+ status: OrganizationInvitationStatus.Revoked;
732
+ }, {
733
+ id: string;
734
+ createdAt: number;
735
+ status: OrganizationInvitationStatus;
736
+ tenantId: string;
737
+ updatedAt: number;
738
+ inviterId: string | null;
739
+ invitee: string;
740
+ acceptedUserId: string | null;
741
+ organizationId: string;
742
+ expiresAt: number;
743
+ organizationRoles: OrganizationRoleEntity[];
744
+ }>;
745
+ };
746
+ options: {};
747
+ get: {
748
+ "/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
749
+ id: string;
750
+ name: string | null;
751
+ username: string | null;
752
+ primaryEmail: string | null;
753
+ primaryPhone: string | null;
754
+ avatar: string | null;
755
+ organizationRoles: OrganizationRoleEntity[];
756
+ }[]>;
757
+ } & {
758
+ "/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
759
+ } & {
760
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
761
+ id: string;
762
+ createdAt: number;
763
+ status: OrganizationInvitationStatus;
764
+ tenantId: string;
765
+ updatedAt: number;
766
+ inviterId: string | null;
767
+ invitee: string;
768
+ acceptedUserId: string | null;
769
+ organizationId: string;
770
+ expiresAt: number;
771
+ organizationRoles: OrganizationRoleEntity[];
772
+ } & {
773
+ inviterName?: string | undefined;
774
+ })[]>;
775
+ };
776
+ post: {
777
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
778
+ invitee: string;
779
+ roleName: TenantRole;
780
+ expiresAt?: number | undefined;
781
+ }, {
782
+ id: string;
783
+ createdAt: number;
784
+ status: OrganizationInvitationStatus;
785
+ tenantId: string;
786
+ updatedAt: number;
787
+ inviterId: string | null;
788
+ invitee: string;
789
+ acceptedUserId: string | null;
790
+ organizationId: string;
791
+ expiresAt: number;
792
+ organizationRoles: OrganizationRoleEntity[];
793
+ }>;
794
+ } & {
795
+ "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
796
+ };
797
+ put: {
798
+ "/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
799
+ roleName: TenantRole;
800
+ }, unknown>;
801
+ };
802
+ delete: {
803
+ "/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
804
+ } & {
805
+ "/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
806
+ };
807
+ copy: {};
808
+ head: {};
809
+ }, "/api/tenants">>, "/api/tenants">;
316
810
 
317
811
  export {
318
812
  router as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-33a6965",
3
+ "version": "0.2.5-3b703da",
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": "3.0.1",
20
- "@silverhand/jest-config": "3.0.0",
21
- "@silverhand/ts-config": "3.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.21.0",
30
- "jest": "^29.5.0",
31
- "lint-staged": "^13.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
- "prettier": "^2.8.1",
34
- "typescript": "^5.0.0"
30
+ "prettier": "^3.0.0",
31
+ "typescript": "^5.3.3",
32
+ "vite-tsconfig-paths": "^4.3.1",
33
+ "vitest": "^2.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.7.0",
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
  }