@logto/cloud 0.2.5-d28a065 → 0.2.5-d9576f9

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.
@@ -1,11 +1,13 @@
1
- // Generated by dts-bundle-generator v9.0.0
1
+ // Generated by dts-bundle-generator v9.3.1
2
2
 
3
- import { RequestContext } from '@withtyped/server';
3
+ import { Json, JsonObject, RequestContext } from '@withtyped/server';
4
4
  import { InferModelType } from '@withtyped/server/model';
5
5
 
6
6
  export type WithAuthContext<Context = RequestContext> = Context & {
7
7
  auth: {
8
+ /** The ID of the authenticated subject (`sub`). */
8
9
  id: string;
10
+ /** The scopes that the subject has (`scope`). */
9
11
  scopes: string[];
10
12
  };
11
13
  };
@@ -17,11 +19,42 @@ declare enum VerificationCodeType {
17
19
  /** @deprecated Use `Generic` type template for sending test sms/email use case */
18
20
  Test = "Test"
19
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
+ };
20
48
  declare enum TenantTag {
21
49
  Development = "development",
22
- Staging = "staging",
23
50
  Production = "production"
24
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
+ }
25
58
  declare const AffiliateProperties: import("@withtyped/server/lib/model/index.js").default<"affiliate_properties", {
26
59
  createdAt: Date;
27
60
  affiliateId: string;
@@ -38,7 +71,24 @@ export type Affiliate = InferModelType<typeof Affiliates>;
38
71
  export type AffiliateData = Affiliate & {
39
72
  properties: Array<Pick<AffiliateProperty, "type" | "value">>;
40
73
  };
41
- 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").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
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").MergeRoutes<import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
42
92
  options: {};
43
93
  patch: {
44
94
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
@@ -232,9 +282,10 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
232
282
  post: {
233
283
  "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
234
284
  data: {
235
- type: VerificationCodeType;
285
+ type: TemplateType | VerificationCodeType;
236
286
  payload: {
237
- code: string;
287
+ code?: string | undefined;
288
+ link?: string | undefined;
238
289
  senderName?: string | undefined;
239
290
  companyInformation?: string | undefined;
240
291
  appLogo?: string | undefined;
@@ -245,10 +296,11 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
245
296
  } & {
246
297
  "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
247
298
  data: {
248
- type: VerificationCodeType;
299
+ type: TemplateType | VerificationCodeType;
249
300
  to: string;
250
301
  payload: {
251
- code: string;
302
+ code?: string | undefined;
303
+ link?: string | undefined;
252
304
  };
253
305
  };
254
306
  }, unknown>;
@@ -285,6 +337,7 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
285
337
  mfaEnabled: boolean;
286
338
  organizationsEnabled: boolean;
287
339
  ssoEnabled: boolean;
340
+ thirdPartyApplicationsLimit: number | null;
288
341
  };
289
342
  stripeProducts: {
290
343
  type: "flat" | "tier1" | "tier2" | "tier3";
@@ -414,7 +467,120 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
414
467
  delete: {};
415
468
  copy: {};
416
469
  head: {};
470
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
471
+ options: {};
472
+ patch: {};
473
+ get: {};
474
+ post: {};
475
+ put: {};
476
+ delete: {
477
+ "/logs/expired": import("@withtyped/server").PathGuard<"/expired", {
478
+ dryRun?: string | undefined;
479
+ }, unknown, {
480
+ affectedRows: number;
481
+ }>;
482
+ };
483
+ copy: {};
484
+ head: {};
485
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
486
+ options: {};
487
+ patch: {
488
+ "/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:invitationId/status", unknown, {
489
+ status: OrganizationInvitationStatus.Accepted;
490
+ }, unknown>;
491
+ };
492
+ get: {};
493
+ post: {};
494
+ put: {};
495
+ delete: {};
496
+ copy: {};
497
+ head: {};
417
498
  }, "/api">>, "/api">;
499
+ export declare const tenantAuthRouter: import("@withtyped/server").Router<RequestContext, import("@withtyped/server").WithBodyContext<import("@withtyped/server").BaseContext & {
500
+ request: {
501
+ method?: import("@withtyped/server").RequestMethod | undefined;
502
+ headers: import("http").IncomingHttpHeaders;
503
+ url: URL;
504
+ body?: unknown;
505
+ };
506
+ }>, import("@withtyped/server").MergeRoutes<import("@withtyped/server").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
507
+ options: {};
508
+ patch: {
509
+ "/:tenantId/invitations/:invitationId/status": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/status", unknown, {
510
+ status: OrganizationInvitationStatus.Revoked;
511
+ }, {
512
+ status: OrganizationInvitationStatus;
513
+ createdAt: number;
514
+ id: string;
515
+ updatedAt: number;
516
+ tenantId: string;
517
+ organizationId: string;
518
+ inviterId: string | null;
519
+ expiresAt: number;
520
+ organizationRoles: OrganizationRoleEntity[];
521
+ invitee: string;
522
+ acceptedUserId: string | null;
523
+ }>;
524
+ };
525
+ get: {
526
+ "/:tenantId/members": import("@withtyped/server").PathGuard<"/:tenantId/members", unknown, unknown, {
527
+ id: string;
528
+ name: string | null;
529
+ username: string | null;
530
+ primaryEmail: string | null;
531
+ primaryPhone: string | null;
532
+ avatar: string | null;
533
+ organizationRoles: OrganizationRoleEntity[];
534
+ }[]>;
535
+ } & {
536
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, unknown, {
537
+ status: OrganizationInvitationStatus;
538
+ createdAt: number;
539
+ id: string;
540
+ updatedAt: number;
541
+ tenantId: string;
542
+ organizationId: string;
543
+ inviterId: string | null;
544
+ expiresAt: number;
545
+ organizationRoles: OrganizationRoleEntity[];
546
+ invitee: string;
547
+ acceptedUserId: string | null;
548
+ }[]>;
549
+ };
550
+ post: {
551
+ "/:tenantId/invitations": import("@withtyped/server").PathGuard<"/:tenantId/invitations", unknown, {
552
+ roleName: TenantRole;
553
+ invitee: string;
554
+ expiresAt?: number | undefined;
555
+ }, {
556
+ status: OrganizationInvitationStatus;
557
+ createdAt: number;
558
+ id: string;
559
+ updatedAt: number;
560
+ tenantId: string;
561
+ organizationId: string;
562
+ inviterId: string | null;
563
+ expiresAt: number;
564
+ organizationRoles: OrganizationRoleEntity[];
565
+ invitee: string;
566
+ acceptedUserId: string | null;
567
+ }>;
568
+ } & {
569
+ "/:tenantId/invitations/:invitationId/message": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId/message", unknown, unknown, unknown>;
570
+ };
571
+ put: {
572
+ "/:tenantId/members/:userId/roles": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId/roles", unknown, {
573
+ roleName: TenantRole;
574
+ }, unknown>;
575
+ };
576
+ delete: {
577
+ "/:tenantId/members/:userId": import("@withtyped/server").PathGuard<"/:tenantId/members/:userId", unknown, unknown, unknown>;
578
+ } & {
579
+ "/:tenantId/invitations/:invitationId": import("@withtyped/server").PathGuard<"/:tenantId/invitations/:invitationId", unknown, unknown, unknown>;
580
+ };
581
+ copy: {};
582
+ head: {};
583
+ }, "/api/tenants">>, "/api/tenants">;
418
584
 
419
585
  export {
420
586
  router as default,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-d28a065",
3
+ "version": "0.2.5-d9576f9",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -17,19 +17,20 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@silverhand/eslint-config": "5.0.0",
20
- "@silverhand/jest-config": "4.0.0",
20
+ "@silverhand/jest-config": "5.0.0",
21
21
  "@silverhand/ts-config": "5.0.0",
22
22
  "@types/accepts": "^1.3.5",
23
23
  "@types/http-proxy": "^1.17.9",
24
24
  "@types/jest": "^29.4.0",
25
25
  "@types/mime-types": "^2.1.1",
26
- "@types/node": "^18.11.18",
26
+ "@types/node": "^20.0.0",
27
27
  "@types/yargs": "^17.0.24",
28
- "dts-bundle-generator": "^9.0.0",
28
+ "dts-bundle-generator": "^9.3.1",
29
29
  "eslint": "^8.44.0",
30
30
  "jest": "^29.5.0",
31
31
  "lint-staged": "^15.0.0",
32
32
  "nodemon": "^3.0.0",
33
+ "p-map": "^7.0.1",
33
34
  "prettier": "^3.0.0",
34
35
  "typescript": "^5.3.3"
35
36
  },
@@ -50,8 +51,8 @@
50
51
  "access": "public"
51
52
  },
52
53
  "dependencies": {
53
- "@silverhand/essentials": "^2.8.6",
54
- "@withtyped/server": "^0.12.7"
54
+ "@silverhand/essentials": "^2.9.0",
55
+ "@withtyped/server": "^0.13.3"
55
56
  },
56
57
  "scripts": {
57
58
  "precommit": "lint-staged",