@logto/cloud 0.2.5-1a68662 → 0.2.5-20fd0a2

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.
@@ -0,0 +1,1076 @@
1
+ // Generated by dts-bundle-generator v9.3.1
2
+
3
+ import { Json, JsonObject, RequestContext } from '@withtyped/server';
4
+ import { InferModelType } from '@withtyped/server/model';
5
+
6
+ export type WithAuthContext<Context = RequestContext> = Context & {
7
+ auth: {
8
+ /** The ID of the authenticated subject (`sub`). */
9
+ id: string;
10
+ /** The scopes that the subject has (`scope`). */
11
+ scopes: string[];
12
+ };
13
+ };
14
+ declare enum VerificationCodeType {
15
+ SignIn = "SignIn",
16
+ Register = "Register",
17
+ ForgotPassword = "ForgotPassword",
18
+ Generic = "Generic",
19
+ /** @deprecated Use `Generic` type template for sending test sms/email use case */
20
+ Test = "Test"
21
+ }
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 availableReportableUsageKeys: readonly [
73
+ "tokenLimit",
74
+ "machineToMachineLimit",
75
+ "resourcesLimit",
76
+ "enterpriseSsoLimit",
77
+ "hooksLimit",
78
+ "tenantMembersLimit",
79
+ "mfaEnabled",
80
+ "organizationsEnabled"
81
+ ];
82
+ export type ReportableUsageKey = (typeof availableReportableUsageKeys)[number];
83
+ export type RealtimeReportableUsageKey = Exclude<ReportableUsageKey, "tokenLimit">;
84
+ declare enum LogtoSkuType {
85
+ Basic = "Basic",
86
+ AddOn = "AddOn"
87
+ }
88
+ declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
89
+ createdAt: Date;
90
+ affiliateId: string;
91
+ type: "hostname" | "query";
92
+ value: string;
93
+ }, "createdAt", "createdAt">;
94
+ export type AffiliateProperty = InferModelType<typeof AffiliateProperties>;
95
+ declare const Affiliates: import("@withtyped/server/lib/model/index.js").default<"affiliates", {
96
+ name: string;
97
+ createdAt: Date;
98
+ id: string;
99
+ }, "id" | "createdAt", "id" | "createdAt">;
100
+ export type Affiliate = InferModelType<typeof Affiliates>;
101
+ declare enum RegionName {
102
+ EU = "EU",
103
+ US = "US"
104
+ }
105
+ export type AffiliateData = Affiliate & {
106
+ properties: Array<Pick<AffiliateProperty, "type" | "value">>;
107
+ };
108
+ declare const router: import("@withtyped/server").Router<RequestContext, WithAuthContext<Omit<import("@withtyped/server").BaseContext & {
109
+ request: {
110
+ id?: string | undefined;
111
+ method?: import("@withtyped/server").RequestMethod | undefined;
112
+ headers: import("http").IncomingHttpHeaders;
113
+ url: URL;
114
+ body?: unknown;
115
+ };
116
+ }, "request"> & {
117
+ request: Record<string, unknown> & {
118
+ id?: string | undefined;
119
+ method?: import("@withtyped/server").RequestMethod | undefined;
120
+ headers: import("http").IncomingHttpHeaders;
121
+ url: URL;
122
+ body?: unknown;
123
+ } & {
124
+ body?: Json | undefined;
125
+ bodyRaw?: Buffer | undefined;
126
+ };
127
+ }>, 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<{
128
+ patch: {
129
+ "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
130
+ name?: string | undefined;
131
+ }, {
132
+ id: string;
133
+ name: string;
134
+ quota: {
135
+ mauLimit: number | null;
136
+ tokenLimit: number | null;
137
+ };
138
+ createdAt: Date;
139
+ usage: {
140
+ activeUsers: number;
141
+ tokenUsage: number;
142
+ };
143
+ indicator: string;
144
+ isSuspended: boolean;
145
+ planId: string;
146
+ subscription: {
147
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
148
+ planId: string;
149
+ currentPeriodStart: Date;
150
+ currentPeriodEnd: Date;
151
+ isEnterprisePlan: boolean;
152
+ id?: string | undefined;
153
+ upcomingInvoice?: {
154
+ subtotal: number;
155
+ subtotalExcludingTax: number | null;
156
+ total: number;
157
+ totalExcludingTax: number | null;
158
+ } | null | undefined;
159
+ isAddOnAvailable?: boolean | undefined;
160
+ };
161
+ regionName: RegionName;
162
+ tag: TenantTag;
163
+ openInvoices: {
164
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
165
+ id: string;
166
+ createdAt: Date;
167
+ updatedAt: Date;
168
+ customerId: string | null;
169
+ billingReason: string | null;
170
+ periodStart: Date;
171
+ periodEnd: Date;
172
+ amountDue: number;
173
+ amountPaid: number;
174
+ subscriptionId: string | null;
175
+ hostedInvoiceUrl: string | null;
176
+ invoicePdf: string | null;
177
+ }[];
178
+ }>;
179
+ };
180
+ options: {};
181
+ get: {
182
+ "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
183
+ id: string;
184
+ name: string;
185
+ quota: {
186
+ mauLimit: number | null;
187
+ tokenLimit: number | null;
188
+ };
189
+ createdAt: Date;
190
+ usage: {
191
+ activeUsers: number;
192
+ tokenUsage: number;
193
+ };
194
+ indicator: string;
195
+ isSuspended: boolean;
196
+ planId: string;
197
+ subscription: {
198
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
199
+ planId: string;
200
+ currentPeriodStart: Date;
201
+ currentPeriodEnd: Date;
202
+ isEnterprisePlan: boolean;
203
+ id?: string | undefined;
204
+ upcomingInvoice?: {
205
+ subtotal: number;
206
+ subtotalExcludingTax: number | null;
207
+ total: number;
208
+ totalExcludingTax: number | null;
209
+ } | null | undefined;
210
+ isAddOnAvailable?: boolean | undefined;
211
+ };
212
+ regionName: RegionName;
213
+ tag: TenantTag;
214
+ openInvoices: {
215
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
216
+ id: string;
217
+ createdAt: Date;
218
+ updatedAt: Date;
219
+ customerId: string | null;
220
+ billingReason: string | null;
221
+ periodStart: Date;
222
+ periodEnd: Date;
223
+ amountDue: number;
224
+ amountPaid: number;
225
+ subscriptionId: string | null;
226
+ hostedInvoiceUrl: string | null;
227
+ invoicePdf: string | null;
228
+ }[];
229
+ }[]>;
230
+ };
231
+ post: {
232
+ "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
233
+ name?: string | undefined;
234
+ tag?: TenantTag | undefined;
235
+ regionName?: RegionName | undefined;
236
+ }, {
237
+ id: string;
238
+ name: string;
239
+ quota: {
240
+ mauLimit: number | null;
241
+ tokenLimit: number | null;
242
+ };
243
+ createdAt: Date;
244
+ usage: {
245
+ activeUsers: number;
246
+ tokenUsage: number;
247
+ };
248
+ indicator: string;
249
+ isSuspended: boolean;
250
+ planId: string;
251
+ subscription: {
252
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
253
+ planId: string;
254
+ currentPeriodStart: Date;
255
+ currentPeriodEnd: Date;
256
+ isEnterprisePlan: boolean;
257
+ id?: string | undefined;
258
+ upcomingInvoice?: {
259
+ subtotal: number;
260
+ subtotalExcludingTax: number | null;
261
+ total: number;
262
+ totalExcludingTax: number | null;
263
+ } | null | undefined;
264
+ isAddOnAvailable?: boolean | undefined;
265
+ };
266
+ regionName: RegionName;
267
+ tag: TenantTag;
268
+ openInvoices: {
269
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
270
+ id: string;
271
+ createdAt: Date;
272
+ updatedAt: Date;
273
+ customerId: string | null;
274
+ billingReason: string | null;
275
+ periodStart: Date;
276
+ periodEnd: Date;
277
+ amountDue: number;
278
+ amountPaid: number;
279
+ subscriptionId: string | null;
280
+ hostedInvoiceUrl: string | null;
281
+ invoicePdf: string | null;
282
+ }[];
283
+ }>;
284
+ };
285
+ put: {};
286
+ delete: {
287
+ "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
288
+ };
289
+ copy: {};
290
+ head: {};
291
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
292
+ patch: {};
293
+ options: {};
294
+ get: {
295
+ "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
296
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
297
+ planId: string;
298
+ currentPeriodStart: Date;
299
+ currentPeriodEnd: Date;
300
+ isEnterprisePlan: boolean;
301
+ id?: string | undefined;
302
+ upcomingInvoice?: {
303
+ subtotal: number;
304
+ subtotalExcludingTax: number | null;
305
+ total: number;
306
+ totalExcludingTax: number | null;
307
+ } | null | undefined;
308
+ isAddOnAvailable?: boolean | undefined;
309
+ }>;
310
+ } & {
311
+ "/tenants/my/subscription/quota": import("@withtyped/server").PathGuard<"/my/subscription/quota", unknown, unknown, {
312
+ mauLimit: number | null;
313
+ tokenLimit: number | null;
314
+ applicationsLimit: number | null;
315
+ machineToMachineLimit: number | null;
316
+ resourcesLimit: number | null;
317
+ scopesPerResourceLimit: number | null;
318
+ socialConnectorsLimit: number | null;
319
+ machineToMachineRolesLimit: number | null;
320
+ scopesPerRoleLimit: number | null;
321
+ hooksLimit: number | null;
322
+ auditLogsRetentionDays: number | null;
323
+ mfaEnabled: boolean;
324
+ organizationsEnabled: boolean;
325
+ thirdPartyApplicationsLimit: number | null;
326
+ tenantMembersLimit: number | null;
327
+ customJwtEnabled: boolean;
328
+ subjectTokenEnabled: boolean;
329
+ bringYourUiEnabled: boolean;
330
+ userRolesLimit: number | null;
331
+ enterpriseSsoLimit: number | null;
332
+ }>;
333
+ } & {
334
+ "/tenants/my/subscription/usage": import("@withtyped/server").PathGuard<"/my/subscription/usage", unknown, unknown, {
335
+ applicationsLimit: number;
336
+ machineToMachineLimit: number;
337
+ resourcesLimit: number;
338
+ scopesPerResourceLimit: number;
339
+ socialConnectorsLimit: number;
340
+ machineToMachineRolesLimit: number;
341
+ scopesPerRoleLimit: number;
342
+ hooksLimit: number;
343
+ mfaEnabled: boolean;
344
+ organizationsEnabled: boolean;
345
+ thirdPartyApplicationsLimit: number;
346
+ tenantMembersLimit: number;
347
+ customJwtEnabled: boolean;
348
+ subjectTokenEnabled: boolean;
349
+ bringYourUiEnabled: boolean;
350
+ userRolesLimit: number;
351
+ enterpriseSsoLimit: number;
352
+ }>;
353
+ } & {
354
+ "/tenants/my/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/my/subscription/usage/:entityName/scopes", {
355
+ entityId?: string | undefined;
356
+ }, unknown, Record<string, number>>;
357
+ } & {
358
+ "/tenants/my/subscription-usage": import("@withtyped/server").PathGuard<"/my/subscription-usage", unknown, unknown, {
359
+ usage: {
360
+ applicationsLimit: number;
361
+ machineToMachineLimit: number;
362
+ resourcesLimit: number;
363
+ scopesPerResourceLimit: number;
364
+ socialConnectorsLimit: number;
365
+ machineToMachineRolesLimit: number;
366
+ scopesPerRoleLimit: number;
367
+ hooksLimit: number;
368
+ mfaEnabled: boolean;
369
+ organizationsEnabled: boolean;
370
+ thirdPartyApplicationsLimit: number;
371
+ tenantMembersLimit: number;
372
+ customJwtEnabled: boolean;
373
+ subjectTokenEnabled: boolean;
374
+ bringYourUiEnabled: boolean;
375
+ userRolesLimit: number;
376
+ enterpriseSsoLimit: number;
377
+ };
378
+ resources: Record<string, number>;
379
+ roles: Record<string, number>;
380
+ quota: {
381
+ mauLimit: number | null;
382
+ tokenLimit: number | null;
383
+ applicationsLimit: number | null;
384
+ machineToMachineLimit: number | null;
385
+ resourcesLimit: number | null;
386
+ scopesPerResourceLimit: number | null;
387
+ socialConnectorsLimit: number | null;
388
+ machineToMachineRolesLimit: number | null;
389
+ scopesPerRoleLimit: number | null;
390
+ hooksLimit: number | null;
391
+ auditLogsRetentionDays: number | null;
392
+ mfaEnabled: boolean;
393
+ organizationsEnabled: boolean;
394
+ thirdPartyApplicationsLimit: number | null;
395
+ tenantMembersLimit: number | null;
396
+ customJwtEnabled: boolean;
397
+ subjectTokenEnabled: boolean;
398
+ bringYourUiEnabled: boolean;
399
+ userRolesLimit: number | null;
400
+ enterpriseSsoLimit: number | null;
401
+ };
402
+ }>;
403
+ } & {
404
+ "/tenants/my/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/my/subscription/periodic-usage", unknown, unknown, {
405
+ mauLimit: number;
406
+ tokenLimit: number;
407
+ }>;
408
+ } & {
409
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
410
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
411
+ planId: string;
412
+ currentPeriodStart: Date;
413
+ currentPeriodEnd: Date;
414
+ isEnterprisePlan: boolean;
415
+ id?: string | undefined;
416
+ upcomingInvoice?: {
417
+ subtotal: number;
418
+ subtotalExcludingTax: number | null;
419
+ total: number;
420
+ totalExcludingTax: number | null;
421
+ } | null | undefined;
422
+ isAddOnAvailable?: boolean | undefined;
423
+ }>;
424
+ } & {
425
+ "/tenants/:tenantId/subscription/quota": import("@withtyped/server").PathGuard<"/:tenantId/subscription/quota", unknown, unknown, {
426
+ mauLimit: number | null;
427
+ tokenLimit: number | null;
428
+ applicationsLimit: number | null;
429
+ machineToMachineLimit: number | null;
430
+ resourcesLimit: number | null;
431
+ scopesPerResourceLimit: number | null;
432
+ socialConnectorsLimit: number | null;
433
+ machineToMachineRolesLimit: number | null;
434
+ scopesPerRoleLimit: number | null;
435
+ hooksLimit: number | null;
436
+ auditLogsRetentionDays: number | null;
437
+ mfaEnabled: boolean;
438
+ organizationsEnabled: boolean;
439
+ thirdPartyApplicationsLimit: number | null;
440
+ tenantMembersLimit: number | null;
441
+ customJwtEnabled: boolean;
442
+ subjectTokenEnabled: boolean;
443
+ bringYourUiEnabled: boolean;
444
+ userRolesLimit: number | null;
445
+ enterpriseSsoLimit: number | null;
446
+ }>;
447
+ } & {
448
+ "/tenants/:tenantId/subscription/usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage", unknown, unknown, {
449
+ applicationsLimit: number;
450
+ machineToMachineLimit: number;
451
+ resourcesLimit: number;
452
+ scopesPerResourceLimit: number;
453
+ socialConnectorsLimit: number;
454
+ machineToMachineRolesLimit: number;
455
+ scopesPerRoleLimit: number;
456
+ hooksLimit: number;
457
+ mfaEnabled: boolean;
458
+ organizationsEnabled: boolean;
459
+ thirdPartyApplicationsLimit: number;
460
+ tenantMembersLimit: number;
461
+ customJwtEnabled: boolean;
462
+ subjectTokenEnabled: boolean;
463
+ bringYourUiEnabled: boolean;
464
+ userRolesLimit: number;
465
+ enterpriseSsoLimit: number;
466
+ }>;
467
+ } & {
468
+ "/tenants/:tenantId/subscription/usage/:entityName/scopes": import("@withtyped/server").PathGuard<"/:tenantId/subscription/usage/:entityName/scopes", {
469
+ entityId?: string | undefined;
470
+ }, unknown, Record<string, number>>;
471
+ } & {
472
+ "/tenants/:tenantId/subscription-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription-usage", unknown, unknown, {
473
+ usage: {
474
+ applicationsLimit: number;
475
+ machineToMachineLimit: number;
476
+ resourcesLimit: number;
477
+ scopesPerResourceLimit: number;
478
+ socialConnectorsLimit: number;
479
+ machineToMachineRolesLimit: number;
480
+ scopesPerRoleLimit: number;
481
+ hooksLimit: number;
482
+ mfaEnabled: boolean;
483
+ organizationsEnabled: boolean;
484
+ thirdPartyApplicationsLimit: number;
485
+ tenantMembersLimit: number;
486
+ customJwtEnabled: boolean;
487
+ subjectTokenEnabled: boolean;
488
+ bringYourUiEnabled: boolean;
489
+ userRolesLimit: number;
490
+ enterpriseSsoLimit: number;
491
+ };
492
+ resources: Record<string, number>;
493
+ roles: Record<string, number>;
494
+ quota: {
495
+ mauLimit: number | null;
496
+ tokenLimit: number | null;
497
+ applicationsLimit: number | null;
498
+ machineToMachineLimit: number | null;
499
+ resourcesLimit: number | null;
500
+ scopesPerResourceLimit: number | null;
501
+ socialConnectorsLimit: number | null;
502
+ machineToMachineRolesLimit: number | null;
503
+ scopesPerRoleLimit: number | null;
504
+ hooksLimit: number | null;
505
+ auditLogsRetentionDays: number | null;
506
+ mfaEnabled: boolean;
507
+ organizationsEnabled: boolean;
508
+ thirdPartyApplicationsLimit: number | null;
509
+ tenantMembersLimit: number | null;
510
+ customJwtEnabled: boolean;
511
+ subjectTokenEnabled: boolean;
512
+ bringYourUiEnabled: boolean;
513
+ userRolesLimit: number | null;
514
+ enterpriseSsoLimit: number | null;
515
+ };
516
+ }>;
517
+ } & {
518
+ "/tenants/:tenantId/subscription/periodic-usage": import("@withtyped/server").PathGuard<"/:tenantId/subscription/periodic-usage", unknown, unknown, {
519
+ mauLimit: number;
520
+ tokenLimit: number;
521
+ }>;
522
+ } & {
523
+ "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
524
+ invoices: {
525
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
526
+ id: string;
527
+ createdAt: Date;
528
+ updatedAt: Date;
529
+ customerId: string | null;
530
+ billingReason: string | null;
531
+ periodStart: Date;
532
+ periodEnd: Date;
533
+ amountDue: number;
534
+ amountPaid: number;
535
+ subscriptionId: string | null;
536
+ hostedInvoiceUrl: string | null;
537
+ invoicePdf: string | null;
538
+ planName: string | null;
539
+ skuId?: string | null | undefined;
540
+ }[];
541
+ }>;
542
+ } & {
543
+ "/tenants/:tenantId/invoices/:invoiceId/hosted-invoice-url": import("@withtyped/server").PathGuard<"/:tenantId/invoices/:invoiceId/hosted-invoice-url", unknown, unknown, {
544
+ hostedInvoiceUrl: string;
545
+ }>;
546
+ };
547
+ post: {
548
+ "/tenants/my/subscription/item-updates": import("@withtyped/server").PathGuard<"/my/subscription/item-updates", unknown, {
549
+ usageKey: RealtimeReportableUsageKey;
550
+ }, {
551
+ message: string;
552
+ }>;
553
+ } & {
554
+ "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
555
+ callbackUrl?: string | undefined;
556
+ }, {
557
+ redirectUri: string;
558
+ }>;
559
+ };
560
+ put: {};
561
+ delete: {
562
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
563
+ };
564
+ copy: {};
565
+ head: {};
566
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
567
+ patch: {};
568
+ options: {};
569
+ get: {
570
+ "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
571
+ from?: string | undefined;
572
+ }, unknown, {
573
+ count: number;
574
+ }>;
575
+ };
576
+ post: {
577
+ "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
578
+ data: {
579
+ type: TemplateType | VerificationCodeType;
580
+ payload: {
581
+ code?: string | undefined;
582
+ link?: string | undefined;
583
+ } & Record<string, string> & {
584
+ senderName?: string | undefined;
585
+ companyInformation?: string | undefined;
586
+ appLogo?: string | undefined;
587
+ };
588
+ to: string;
589
+ };
590
+ }, unknown>;
591
+ } & {
592
+ "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
593
+ data: {
594
+ type: TemplateType | VerificationCodeType;
595
+ to: string;
596
+ payload: {
597
+ code?: string | undefined;
598
+ link?: string | undefined;
599
+ } & Record<string, string>;
600
+ };
601
+ }, unknown>;
602
+ } & {
603
+ "/services/custom-jwt": import("@withtyped/server").PathGuard<"/custom-jwt", {
604
+ isTest?: string | undefined;
605
+ }, {
606
+ context: Record<string, Json>;
607
+ script: string;
608
+ tokenType: LogtoJwtTokenKeyType.AccessToken;
609
+ token: Record<string, Json>;
610
+ environmentVariables?: Record<string, string> | undefined;
611
+ } | {
612
+ script: string;
613
+ tokenType: LogtoJwtTokenKeyType.ClientCredentials;
614
+ token: Record<string, Json>;
615
+ environmentVariables?: Record<string, string> | undefined;
616
+ }, Record<string, unknown>>;
617
+ };
618
+ put: {
619
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, {
620
+ "jwt.accessToken"?: {
621
+ production?: string | undefined;
622
+ test?: string | undefined;
623
+ } | undefined;
624
+ "jwt.clientCredentials"?: {
625
+ production?: string | undefined;
626
+ test?: string | undefined;
627
+ } | undefined;
628
+ }, unknown>;
629
+ };
630
+ delete: {
631
+ "/services/custom-jwt/worker": import("@withtyped/server").PathGuard<"/custom-jwt/worker", unknown, unknown, unknown>;
632
+ };
633
+ copy: {};
634
+ head: {};
635
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
636
+ patch: {};
637
+ options: {};
638
+ get: {
639
+ "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
640
+ id: string;
641
+ createdAt: Date;
642
+ name: string;
643
+ updatedAt: Date;
644
+ quota: {
645
+ mauLimit: number | null;
646
+ tokenLimit: number | null;
647
+ applicationsLimit: number | null;
648
+ machineToMachineLimit: number | null;
649
+ resourcesLimit: number | null;
650
+ scopesPerResourceLimit: number | null;
651
+ customDomainEnabled: boolean;
652
+ omniSignInEnabled: boolean;
653
+ builtInEmailConnectorEnabled: boolean;
654
+ socialConnectorsLimit: number | null;
655
+ standardConnectorsLimit: number | null;
656
+ rolesLimit: number | null;
657
+ machineToMachineRolesLimit: number | null;
658
+ scopesPerRoleLimit: number | null;
659
+ hooksLimit: number | null;
660
+ auditLogsRetentionDays: number | null;
661
+ mfaEnabled: boolean;
662
+ organizationsEnabled: boolean;
663
+ ssoEnabled: boolean;
664
+ thirdPartyApplicationsLimit: number | null;
665
+ tenantMembersLimit: number | null;
666
+ customJwtEnabled: boolean;
667
+ subjectTokenEnabled: boolean;
668
+ bringYourUiEnabled: boolean;
669
+ };
670
+ stripeProducts: {
671
+ type: "flat" | "tier1" | "tier2" | "tier3";
672
+ id: string;
673
+ name: string;
674
+ price: {
675
+ id: string;
676
+ unitAmountDecimal: string;
677
+ quantity?: 1 | undefined;
678
+ unitAmount?: number | null | undefined;
679
+ };
680
+ description?: string | undefined;
681
+ }[];
682
+ }[]>;
683
+ };
684
+ post: {};
685
+ put: {};
686
+ delete: {};
687
+ copy: {};
688
+ head: {};
689
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
690
+ patch: {};
691
+ options: {};
692
+ get: {
693
+ "/skus": import("@withtyped/server").PathGuard<"/", {
694
+ type?: LogtoSkuType | undefined;
695
+ }, unknown, {
696
+ type: LogtoSkuType;
697
+ id: string;
698
+ name: string | null;
699
+ quota: {
700
+ mauLimit?: number | null | undefined;
701
+ tokenLimit?: number | null | undefined;
702
+ applicationsLimit?: number | null | undefined;
703
+ machineToMachineLimit?: number | null | undefined;
704
+ resourcesLimit?: number | null | undefined;
705
+ scopesPerResourceLimit?: number | null | undefined;
706
+ socialConnectorsLimit?: number | null | undefined;
707
+ machineToMachineRolesLimit?: number | null | undefined;
708
+ scopesPerRoleLimit?: number | null | undefined;
709
+ hooksLimit?: number | null | undefined;
710
+ auditLogsRetentionDays?: number | null | undefined;
711
+ mfaEnabled?: boolean | undefined;
712
+ organizationsEnabled?: boolean | undefined;
713
+ thirdPartyApplicationsLimit?: number | null | undefined;
714
+ tenantMembersLimit?: number | null | undefined;
715
+ customJwtEnabled?: boolean | undefined;
716
+ subjectTokenEnabled?: boolean | undefined;
717
+ bringYourUiEnabled?: boolean | undefined;
718
+ userRolesLimit?: number | null | undefined;
719
+ enterpriseSsoLimit?: number | null | undefined;
720
+ };
721
+ createdAt: Date;
722
+ updatedAt: Date;
723
+ unitPrice: number | null;
724
+ }[]>;
725
+ };
726
+ post: {
727
+ "/skus": import("@withtyped/server").PathGuard<"/", unknown, {
728
+ type: LogtoSkuType.AddOn;
729
+ quota: {
730
+ tokenLimit?: number | null | undefined;
731
+ machineToMachineLimit?: number | null | undefined;
732
+ resourcesLimit?: number | null | undefined;
733
+ enterpriseSsoLimit?: number | null | undefined;
734
+ hooksLimit?: number | null | undefined;
735
+ tenantMembersLimit?: number | null | undefined;
736
+ mfaEnabled?: boolean | undefined;
737
+ organizationsEnabled?: boolean | undefined;
738
+ mauLimit?: number | null | undefined;
739
+ applicationsLimit?: number | null | undefined;
740
+ scopesPerResourceLimit?: number | null | undefined;
741
+ socialConnectorsLimit?: number | null | undefined;
742
+ machineToMachineRolesLimit?: number | null | undefined;
743
+ scopesPerRoleLimit?: number | null | undefined;
744
+ auditLogsRetentionDays?: number | null | undefined;
745
+ thirdPartyApplicationsLimit?: number | null | undefined;
746
+ customJwtEnabled?: boolean | undefined;
747
+ subjectTokenEnabled?: boolean | undefined;
748
+ bringYourUiEnabled?: boolean | undefined;
749
+ userRolesLimit?: number | null | undefined;
750
+ };
751
+ } | {
752
+ type: LogtoSkuType.Basic;
753
+ quota: {
754
+ mauLimit: number | null;
755
+ tokenLimit: number | null;
756
+ applicationsLimit: number | null;
757
+ machineToMachineLimit: number | null;
758
+ resourcesLimit: number | null;
759
+ scopesPerResourceLimit: number | null;
760
+ socialConnectorsLimit: number | null;
761
+ machineToMachineRolesLimit: number | null;
762
+ scopesPerRoleLimit: number | null;
763
+ hooksLimit: number | null;
764
+ auditLogsRetentionDays: number | null;
765
+ mfaEnabled: boolean;
766
+ organizationsEnabled: boolean;
767
+ thirdPartyApplicationsLimit: number | null;
768
+ tenantMembersLimit: number | null;
769
+ customJwtEnabled: boolean;
770
+ subjectTokenEnabled: boolean;
771
+ bringYourUiEnabled: boolean;
772
+ userRolesLimit: number | null;
773
+ enterpriseSsoLimit: number | null;
774
+ };
775
+ }, {
776
+ id: string;
777
+ createdAt: Date;
778
+ type: LogtoSkuType;
779
+ updatedAt: Date;
780
+ quota: {
781
+ mauLimit?: number | null | undefined;
782
+ tokenLimit?: number | null | undefined;
783
+ applicationsLimit?: number | null | undefined;
784
+ machineToMachineLimit?: number | null | undefined;
785
+ resourcesLimit?: number | null | undefined;
786
+ scopesPerResourceLimit?: number | null | undefined;
787
+ socialConnectorsLimit?: number | null | undefined;
788
+ machineToMachineRolesLimit?: number | null | undefined;
789
+ scopesPerRoleLimit?: number | null | undefined;
790
+ hooksLimit?: number | null | undefined;
791
+ auditLogsRetentionDays?: number | null | undefined;
792
+ mfaEnabled?: boolean | undefined;
793
+ organizationsEnabled?: boolean | undefined;
794
+ thirdPartyApplicationsLimit?: number | null | undefined;
795
+ tenantMembersLimit?: number | null | undefined;
796
+ customJwtEnabled?: boolean | undefined;
797
+ subjectTokenEnabled?: boolean | undefined;
798
+ bringYourUiEnabled?: boolean | undefined;
799
+ userRolesLimit?: number | null | undefined;
800
+ enterpriseSsoLimit?: number | null | undefined;
801
+ };
802
+ }>;
803
+ } & {
804
+ "/skus/:skuId/products": import("@withtyped/server").PathGuard<"/:skuId/products", {
805
+ isOneTime?: string | undefined;
806
+ }, {
807
+ name: string;
808
+ unitPrice: number;
809
+ }, {
810
+ productId: string;
811
+ }>;
812
+ };
813
+ put: {};
814
+ delete: {
815
+ "/skus/:skuId": import("@withtyped/server").PathGuard<"/:skuId", unknown, unknown, unknown>;
816
+ };
817
+ copy: {};
818
+ head: {};
819
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
820
+ patch: {};
821
+ options: {};
822
+ get: {
823
+ "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
824
+ id: string;
825
+ createdAt: Date;
826
+ userId: string;
827
+ status: "open" | "complete" | "expired";
828
+ tenantId: string | null;
829
+ updatedAt: Date;
830
+ planId: string;
831
+ skuId: string | null;
832
+ }>;
833
+ };
834
+ post: {
835
+ "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
836
+ planId: string;
837
+ successCallbackUrl: string;
838
+ tenantId?: string | undefined;
839
+ skuId?: string | undefined;
840
+ tenantName?: string | undefined;
841
+ tenantTag?: TenantTag | undefined;
842
+ tenantRegionName?: RegionName | undefined;
843
+ cancelCallbackUrl?: string | undefined;
844
+ }, {
845
+ sessionId: string;
846
+ redirectUri?: string | null | undefined;
847
+ }>;
848
+ };
849
+ put: {};
850
+ delete: {};
851
+ copy: {};
852
+ head: {};
853
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
854
+ patch: {};
855
+ options: {};
856
+ get: {
857
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
858
+ };
859
+ post: {
860
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
861
+ name: string;
862
+ }, {
863
+ id: string;
864
+ createdAt: Date;
865
+ name: string;
866
+ }>;
867
+ } & {
868
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
869
+ type: "hostname" | "query";
870
+ value: string;
871
+ }, {
872
+ createdAt: Date;
873
+ affiliateId: string;
874
+ type: "hostname" | "query";
875
+ value: string;
876
+ }>;
877
+ };
878
+ put: {};
879
+ delete: {
880
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
881
+ type: "hostname" | "query";
882
+ value: string;
883
+ }, unknown>;
884
+ };
885
+ copy: {};
886
+ head: {};
887
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
888
+ patch: {};
889
+ options: {};
890
+ get: {};
891
+ post: {
892
+ "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
893
+ createdAt: string;
894
+ userId: string;
895
+ hostname?: string | undefined;
896
+ query?: string | undefined;
897
+ }, {
898
+ id: string;
899
+ createdAt: Date;
900
+ affiliateId: string | null;
901
+ userId: string;
902
+ createdVia: {
903
+ createdAt: string;
904
+ hostname?: string | undefined;
905
+ query?: string | undefined;
906
+ };
907
+ }>;
908
+ };
909
+ put: {};
910
+ delete: {};
911
+ copy: {};
912
+ head: {};
913
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
914
+ patch: {
915
+ "/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
916
+ status: OrganizationInvitationStatus.Accepted;
917
+ }, unknown>;
918
+ };
919
+ options: {};
920
+ get: {
921
+ "/invitations": import("@withtyped/server").PathGuard<"/", unknown, unknown, ({
922
+ id: string;
923
+ createdAt: number;
924
+ status: OrganizationInvitationStatus;
925
+ tenantId: string;
926
+ updatedAt: number;
927
+ inviterId: string | null;
928
+ invitee: string;
929
+ acceptedUserId: string | null;
930
+ organizationId: string;
931
+ expiresAt: number;
932
+ organizationRoles: OrganizationRoleEntity[];
933
+ } & {
934
+ tenantName: string;
935
+ tenantTag: TenantTag;
936
+ })[]>;
937
+ } & {
938
+ "/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:invitationId", unknown, unknown, {
939
+ id: string;
940
+ createdAt: number;
941
+ status: OrganizationInvitationStatus;
942
+ tenantId: string;
943
+ updatedAt: number;
944
+ inviterId: string | null;
945
+ invitee: string;
946
+ acceptedUserId: string | null;
947
+ organizationId: string;
948
+ expiresAt: number;
949
+ organizationRoles: OrganizationRoleEntity[];
950
+ }>;
951
+ };
952
+ post: {};
953
+ put: {};
954
+ delete: {};
955
+ copy: {};
956
+ head: {};
957
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
958
+ patch: {};
959
+ options: {};
960
+ get: {};
961
+ post: {};
962
+ put: {};
963
+ delete: {
964
+ "/me": import("@withtyped/server").PathGuard<"/", unknown, unknown, unknown>;
965
+ };
966
+ copy: {};
967
+ head: {};
968
+ }, "/api">>, "/api">;
969
+ export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
970
+ request: {
971
+ id?: string | undefined;
972
+ method?: import("@withtyped/server").RequestMethod | undefined;
973
+ headers: import("http").IncomingHttpHeaders;
974
+ url: URL;
975
+ body?: unknown;
976
+ };
977
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
978
+ patch: {
979
+ "/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
980
+ status: OrganizationInvitationStatus.Revoked;
981
+ }, {
982
+ id: string;
983
+ createdAt: number;
984
+ status: OrganizationInvitationStatus;
985
+ tenantId: string;
986
+ updatedAt: number;
987
+ inviterId: string | null;
988
+ invitee: string;
989
+ acceptedUserId: string | null;
990
+ organizationId: string;
991
+ expiresAt: number;
992
+ organizationRoles: OrganizationRoleEntity[];
993
+ }>;
994
+ };
995
+ options: {};
996
+ get: {
997
+ "/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
998
+ id: string;
999
+ name: string | null;
1000
+ username: string | null;
1001
+ primaryEmail: string | null;
1002
+ primaryPhone: string | null;
1003
+ avatar: string | null;
1004
+ organizationRoles: OrganizationRoleEntity[];
1005
+ }[]>;
1006
+ } & {
1007
+ "/:tenantId/members/:userId/scopes": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/scopes", unknown, unknown, OrganizationScope[]>;
1008
+ } & {
1009
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, ({
1010
+ id: string;
1011
+ createdAt: number;
1012
+ status: OrganizationInvitationStatus;
1013
+ tenantId: string;
1014
+ updatedAt: number;
1015
+ inviterId: string | null;
1016
+ invitee: string;
1017
+ acceptedUserId: string | null;
1018
+ organizationId: string;
1019
+ expiresAt: number;
1020
+ organizationRoles: OrganizationRoleEntity[];
1021
+ } & {
1022
+ inviterName?: string | undefined;
1023
+ })[]>;
1024
+ };
1025
+ post: {
1026
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
1027
+ invitee: string | string[];
1028
+ roleName: TenantRole;
1029
+ expiresAt?: number | undefined;
1030
+ }, {
1031
+ id: string;
1032
+ createdAt: number;
1033
+ status: OrganizationInvitationStatus;
1034
+ tenantId: string;
1035
+ updatedAt: number;
1036
+ inviterId: string | null;
1037
+ invitee: string;
1038
+ acceptedUserId: string | null;
1039
+ organizationId: string;
1040
+ expiresAt: number;
1041
+ organizationRoles: OrganizationRoleEntity[];
1042
+ } | {
1043
+ id: string;
1044
+ createdAt: number;
1045
+ status: OrganizationInvitationStatus;
1046
+ tenantId: string;
1047
+ updatedAt: number;
1048
+ inviterId: string | null;
1049
+ invitee: string;
1050
+ acceptedUserId: string | null;
1051
+ organizationId: string;
1052
+ expiresAt: number;
1053
+ organizationRoles: OrganizationRoleEntity[];
1054
+ }[]>;
1055
+ } & {
1056
+ "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
1057
+ };
1058
+ put: {
1059
+ "/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
1060
+ roleName: TenantRole;
1061
+ }, unknown>;
1062
+ };
1063
+ delete: {
1064
+ "/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
1065
+ } & {
1066
+ "/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
1067
+ };
1068
+ copy: {};
1069
+ head: {};
1070
+ }, "/api/tenants">>, "/api/tenants">;
1071
+
1072
+ export {
1073
+ router as default,
1074
+ };
1075
+
1076
+ export {};
package/package.json CHANGED
@@ -1,63 +1,68 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-1a68662",
3
+ "version": "0.2.5-20fd0a2",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
7
7
  "license": "Elastic-2.0",
8
8
  "type": "module",
9
9
  "files": [
10
- "build"
10
+ "lib"
11
11
  ],
12
12
  "exports": {
13
- "./routes": "./build/routes/index.js"
13
+ "./routes": "./lib/routes/index.js"
14
14
  },
15
15
  "imports": {
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",
27
- "dts-bundle-generator": "^8.0.1",
28
- "eslint": "^8.21.0",
29
- "jest": "^29.5.0",
30
- "lint-staged": "^13.0.0",
31
- "nodemon": "^2.0.19",
32
- "prettier": "^2.8.1",
33
- "typescript": "^5.0.0"
24
+ "@types/node": "^20.0.0",
25
+ "@types/yargs": "^17.0.24",
26
+ "dts-bundle-generator": "^9.3.1",
27
+ "eslint": "^8.57.0",
28
+ "lint-staged": "^15.0.0",
29
+ "nodemon": "^3.0.0",
30
+ "prettier": "^3.0.0",
31
+ "typescript": "^5.3.3",
32
+ "vite-tsconfig-paths": "^4.3.1",
33
+ "vitest": "^2.0.0"
34
34
  },
35
35
  "engines": {
36
- "node": "^18.12.0"
36
+ "node": "^20.9.0"
37
37
  },
38
38
  "eslintConfig": {
39
- "extends": "@silverhand"
39
+ "extends": "@silverhand",
40
+ "rules": {
41
+ "no-console": "error"
42
+ },
43
+ "ignorePatterns": [
44
+ "types.test.ts"
45
+ ]
40
46
  },
41
47
  "prettier": "@silverhand/eslint-config/.prettierrc",
42
48
  "publishConfig": {
43
49
  "access": "public"
44
50
  },
45
51
  "dependencies": {
46
- "@withtyped/server": "^0.12.0"
52
+ "@silverhand/essentials": "^2.9.1",
53
+ "@withtyped/server": "^0.14.0"
47
54
  },
48
55
  "scripts": {
49
56
  "precommit": "lint-staged",
50
- "build": "rm -rf build/ && tsc -p tsconfig.build.json",
57
+ "build": "rm -rf build/ && tsc -p tsconfig.build.json && pnpm build:lib",
51
58
  "//": "It is not used to build the service itself.",
52
- "build:lib": "rm -rf build/ && dts-bundle-generator src/routes/index.ts --project tsconfig.build.json -o build/routes/index.d.ts",
53
- "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",
54
60
  "lint": "eslint --ext .ts src",
55
61
  "lint:report": "pnpm lint --format json --output-file report.json",
56
62
  "dev": "rm -rf build/ && nodemon",
57
63
  "start": "NODE_ENV=production node .",
58
- "test:only": "NODE_OPTIONS=\"--experimental-vm-modules --max_old_space_size=4096\" jest --logHeapUsage",
59
- "test": "pnpm build:test && pnpm test:only",
60
- "test:ci": "pnpm test:only --coverage --silent",
61
- "test:types": "tsc -p tsconfig.test.types.json"
64
+ "test": "vitest && pnpm build:lib && pnpm test:types",
65
+ "test:types": "tsc -p tsconfig.test.types.json",
66
+ "cli": "node ./build/cli/index.js"
62
67
  }
63
68
  }
@@ -1,120 +0,0 @@
1
- // Generated by dts-bundle-generator v8.0.1
2
-
3
- import { RequestContext } from '@withtyped/server';
4
- import { InferModelType } from '@withtyped/server/model';
5
-
6
- export type WithAuthContext<Context = RequestContext> = Context & {
7
- auth: {
8
- id: string;
9
- scopes: string[];
10
- };
11
- };
12
- declare enum TenantTag {
13
- Development = "development",
14
- Staging = "staging",
15
- Production = "production"
16
- }
17
- declare const Tenants: import("@withtyped/server/model").default<"tenants", {
18
- id: string;
19
- dbUser: string | null;
20
- dbUserPassword: string | null;
21
- name: string;
22
- tag: TenantTag;
23
- createdAt: Date;
24
- }, "name" | "createdAt" | "tag", "createdAt">;
25
- export type TenantModel = InferModelType<typeof Tenants>;
26
- export type TenantInfo = Pick<TenantModel, "id" | "name" | "tag"> & {
27
- indicator: string;
28
- };
29
- declare enum VerificationCodeType {
30
- SignIn = "SignIn",
31
- Register = "Register",
32
- ForgotPassword = "ForgotPassword",
33
- /** @deprecated */
34
- Continue = "Continue",
35
- Generic = "Generic",
36
- /** @deprecated Use `Generic` type template for sending test sms/email use case */
37
- Test = "Test"
38
- }
39
- declare const router: import("@withtyped/server").Router<WithAuthContext, import("@withtyped/server").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
40
- patch: {
41
- "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
42
- name?: string | undefined;
43
- tag?: TenantTag | undefined;
44
- }, TenantInfo>;
45
- };
46
- get: {
47
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, TenantInfo[]>;
48
- };
49
- post: {
50
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
51
- name?: string | undefined;
52
- tag?: TenantTag | undefined;
53
- }, TenantInfo>;
54
- };
55
- put: {};
56
- head: {};
57
- delete: {
58
- "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
59
- };
60
- options: {};
61
- copy: {};
62
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
63
- patch: {};
64
- get: {
65
- "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
66
- from?: string | undefined;
67
- }, unknown, unknown>;
68
- };
69
- post: {
70
- "/services/send-email": import("@withtyped/server").PathGuard<"/send-email", unknown, {
71
- data: {
72
- type: VerificationCodeType;
73
- to: string;
74
- payload: {
75
- fromName?: string | undefined;
76
- companyAddress?: string | undefined;
77
- appLogo?: string | undefined;
78
- code: string;
79
- };
80
- };
81
- }, unknown>;
82
- } & {
83
- "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
84
- data: {
85
- type: VerificationCodeType;
86
- to: string;
87
- payload: {
88
- fromName?: string | undefined;
89
- companyAddress?: string | undefined;
90
- appLogo?: string | undefined;
91
- code: string;
92
- };
93
- };
94
- }, unknown>;
95
- } & {
96
- "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
97
- data: {
98
- type: VerificationCodeType;
99
- to: string;
100
- payload: {
101
- fromName?: string | undefined;
102
- companyAddress?: string | undefined;
103
- appLogo?: string | undefined;
104
- code: string;
105
- };
106
- };
107
- }, unknown>;
108
- };
109
- put: {};
110
- head: {};
111
- delete: {};
112
- options: {};
113
- copy: {};
114
- }, "/api">>, "/api">;
115
-
116
- export {
117
- router as default,
118
- };
119
-
120
- export {};