@logto/cloud 0.2.5-1116646 → 0.2.5-1807f9c

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