@logto/cloud 0.2.5-31703ea → 0.2.5-4d5e389

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,7 +1,6 @@
1
1
  // Generated by dts-bundle-generator v8.0.1
2
2
 
3
3
  import { RequestContext } from '@withtyped/server';
4
- import { InferModelType } from '@withtyped/server/model';
5
4
 
6
5
  export type WithAuthContext<Context = RequestContext> = Context & {
7
6
  auth: {
@@ -14,18 +13,6 @@ declare enum TenantTag {
14
13
  Staging = "staging",
15
14
  Production = "production"
16
15
  }
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
16
  declare enum VerificationCodeType {
30
17
  SignIn = "SignIn",
31
18
  Register = "Register",
@@ -36,22 +23,69 @@ declare enum VerificationCodeType {
36
23
  /** @deprecated Use `Generic` type template for sending test sms/email use case */
37
24
  Test = "Test"
38
25
  }
39
- 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<{
26
+ 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").BaseRoutes, import("@withtyped/server").RoutesWithPrefix<{
40
27
  options: {};
41
28
  patch: {
42
29
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
43
30
  name?: string | undefined;
44
31
  tag?: TenantTag | undefined;
45
- }, TenantInfo>;
32
+ }, {
33
+ name: string;
34
+ id: string;
35
+ indicator: string;
36
+ tag: TenantTag;
37
+ }>;
46
38
  };
47
39
  get: {
48
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, TenantInfo[]>;
40
+ "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
41
+ name: string;
42
+ id: string;
43
+ indicator: string;
44
+ tag: TenantTag;
45
+ }[]>;
46
+ } & {
47
+ "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
48
+ id: string;
49
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid";
50
+ createdAt: Date;
51
+ updatedAt: Date;
52
+ tenantId: string;
53
+ planId: string;
54
+ currentPeriodStart: Date;
55
+ currentPeriodEnd: Date;
56
+ customerId: string;
57
+ latestInvoiceId: string | null;
58
+ canceledAt: Date | null;
59
+ }>;
60
+ } & {
61
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
62
+ id: string;
63
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid";
64
+ createdAt: Date;
65
+ updatedAt: Date;
66
+ tenantId: string;
67
+ planId: string;
68
+ currentPeriodStart: Date;
69
+ currentPeriodEnd: Date;
70
+ customerId: string;
71
+ latestInvoiceId: string | null;
72
+ canceledAt: Date | null;
73
+ }>;
74
+ } & {
75
+ "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
76
+ activeUsers: number;
77
+ }>;
49
78
  };
50
79
  post: {
51
80
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
52
81
  name?: string | undefined;
53
82
  tag?: TenantTag | undefined;
54
- }, TenantInfo>;
83
+ }, {
84
+ name: string;
85
+ id: string;
86
+ indicator: string;
87
+ tag: TenantTag;
88
+ }>;
55
89
  };
56
90
  put: {};
57
91
  head: {};
@@ -73,8 +107,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
73
107
  type: VerificationCodeType;
74
108
  to: string;
75
109
  payload: {
76
- fromName?: string | undefined;
77
- companyAddress?: string | undefined;
110
+ senderName?: string | undefined;
111
+ companyInformation?: string | undefined;
78
112
  appLogo?: string | undefined;
79
113
  code: string;
80
114
  };
@@ -86,8 +120,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
86
120
  type: VerificationCodeType;
87
121
  to: string;
88
122
  payload: {
89
- fromName?: string | undefined;
90
- companyAddress?: string | undefined;
123
+ senderName?: string | undefined;
124
+ companyInformation?: string | undefined;
91
125
  appLogo?: string | undefined;
92
126
  code: string;
93
127
  };
@@ -99,8 +133,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
99
133
  type: VerificationCodeType;
100
134
  to: string;
101
135
  payload: {
102
- fromName?: string | undefined;
103
- companyAddress?: string | undefined;
136
+ senderName?: string | undefined;
137
+ companyInformation?: string | undefined;
104
138
  appLogo?: string | undefined;
105
139
  code: string;
106
140
  };
@@ -118,20 +152,7 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
118
152
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
119
153
  id: string;
120
154
  name: string;
121
- products: {
122
- description?: string | undefined;
123
- type: "flat" | "tier1" | "tier2" | "tier3";
124
- id: string;
125
- name: string;
126
- price: {
127
- quantity?: 1 | undefined;
128
- unitAmount?: number | null | undefined;
129
- id: string;
130
- unitAmountDecimal: string;
131
- };
132
- }[];
133
155
  quota: {
134
- tenantLimit: number | null;
135
156
  mauLimit: number | null;
136
157
  applicationsLimit: number;
137
158
  machineToMachineLimit: number;
@@ -147,6 +168,18 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
147
168
  hooksLimit: number;
148
169
  auditLogsRetentionDays: number;
149
170
  };
171
+ stripeProducts: {
172
+ description?: string | undefined;
173
+ id: string;
174
+ name: string;
175
+ type: "flat" | "tier1" | "tier2" | "tier3";
176
+ price: {
177
+ quantity?: 1 | undefined;
178
+ unitAmount?: number | null | undefined;
179
+ id: string;
180
+ unitAmountDecimal: string;
181
+ };
182
+ }[];
150
183
  createdAt: Date;
151
184
  updatedAt: Date;
152
185
  }[]>;
@@ -156,10 +189,26 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
156
189
  head: {};
157
190
  delete: {};
158
191
  copy: {};
192
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
193
+ options: {};
194
+ patch: {};
195
+ get: {};
196
+ post: {
197
+ "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
198
+ tenantId?: string | undefined;
199
+ cancelCallbackUrl?: string | undefined;
200
+ planId: string;
201
+ successCallbackUrl: string;
202
+ }, unknown>;
203
+ };
204
+ put: {};
205
+ head: {};
206
+ delete: {};
207
+ copy: {};
159
208
  }, "/api">>, "/api">;
160
209
 
161
210
  export {
162
- _default as default,
211
+ router as default,
163
212
  };
164
213
 
165
214
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-31703ea",
3
+ "version": "0.2.5-4d5e389",
4
4
  "description": "Logto Cloud service.",
5
5
  "main": "build/index.js",
6
6
  "author": "Silverhand Inc. <contact@silverhand.io>",
@@ -24,11 +24,12 @@
24
24
  "@types/jest": "^29.4.0",
25
25
  "@types/mime-types": "^2.1.1",
26
26
  "@types/node": "^18.11.18",
27
+ "@types/yargs": "^17.0.24",
27
28
  "dts-bundle-generator": "^8.0.1",
28
29
  "eslint": "^8.21.0",
29
30
  "jest": "^29.5.0",
30
31
  "lint-staged": "^13.0.0",
31
- "nodemon": "^2.0.19",
32
+ "nodemon": "^3.0.0",
32
33
  "prettier": "^2.8.1",
33
34
  "typescript": "^5.0.0"
34
35
  },
@@ -36,14 +37,31 @@
36
37
  "node": "^18.12.0"
37
38
  },
38
39
  "eslintConfig": {
39
- "extends": "@silverhand"
40
+ "extends": "@silverhand",
41
+ "rules": {
42
+ "no-console": "error"
43
+ },
44
+ "overrides": [
45
+ {
46
+ "files": [
47
+ "src/cli/**/*"
48
+ ],
49
+ "rules": {
50
+ "no-console": "off"
51
+ }
52
+ }
53
+ ],
54
+ "ignorePatterns": [
55
+ "types.test.ts"
56
+ ]
40
57
  },
41
58
  "prettier": "@silverhand/eslint-config/.prettierrc",
42
59
  "publishConfig": {
43
60
  "access": "public"
44
61
  },
45
62
  "dependencies": {
46
- "@withtyped/server": "^0.12.0"
63
+ "@silverhand/essentials": "^2.7.0",
64
+ "@withtyped/server": "^0.12.7"
47
65
  },
48
66
  "scripts": {
49
67
  "precommit": "lint-staged",
@@ -56,8 +74,9 @@
56
74
  "dev": "rm -rf build/ && nodemon",
57
75
  "start": "NODE_ENV=production node .",
58
76
  "test:only": "NODE_OPTIONS=\"--experimental-vm-modules --max_old_space_size=4096\" jest --logHeapUsage",
59
- "test": "pnpm build:test && pnpm test:only",
77
+ "test": "pnpm build:test && pnpm test:only && pnpm build:lib && pnpm test:types",
60
78
  "test:ci": "pnpm test:only --coverage --silent",
61
- "test:types": "tsc -p tsconfig.test.types.json"
79
+ "test:types": "tsc -p tsconfig.test.types.json",
80
+ "cli": "node ./build/cli/index.js"
62
81
  }
63
82
  }