@logto/cloud 0.2.5-8065345 → 0.2.5-81f06ea

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