@logto/cloud 0.2.5-1116646 → 0.2.5-1661979

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