@logto/cloud 0.2.5-2087c06 → 0.2.5-2553f41

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.
package/package.json CHANGED
@@ -1,40 +1,39 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-2087c06",
3
+ "version": "0.2.5-2553f41",
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",
24
+ "@types/node": "^22.14.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.57.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": "^5.0.0",
33
+ "vitest": "^3.2.4"
35
34
  },
36
35
  "engines": {
37
- "node": "^18.12.0"
36
+ "node": "^22.14.0"
38
37
  },
39
38
  "eslintConfig": {
40
39
  "extends": "@silverhand",
@@ -50,23 +49,22 @@
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.2",
53
+ "@withtyped/server": "^0.14.0"
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",
66
+ "typecheck": "tsc -p tsconfig.json --noEmit",
67
+ "test:only": "vitest",
70
68
  "cli": "node ./build/cli/index.js"
71
69
  }
72
70
  }
@@ -1,309 +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").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
- name: string;
51
- id: string;
52
- indicator: string;
53
- tag: TenantTag;
54
- }>;
55
- };
56
- get: {
57
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
58
- name: string;
59
- id: string;
60
- indicator: string;
61
- tag: TenantTag;
62
- }[]>;
63
- } & {
64
- "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
65
- status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
66
- planId: string;
67
- currentPeriodStart: Date;
68
- currentPeriodEnd: Date;
69
- }>;
70
- } & {
71
- "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
72
- status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
73
- planId: string;
74
- currentPeriodStart: Date;
75
- currentPeriodEnd: Date;
76
- }>;
77
- } & {
78
- "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
79
- invoices: {
80
- status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
81
- createdAt: Date;
82
- id: string;
83
- updatedAt: Date;
84
- customerId: string | null;
85
- billingReason: string | null;
86
- periodStart: Date;
87
- periodEnd: Date;
88
- amountDue: number;
89
- amountPaid: number;
90
- subscriptionId: string | null;
91
- hostedInvoiceUrl: string | null;
92
- invoicePdf: string | null;
93
- planName: string | null;
94
- }[];
95
- }>;
96
- } & {
97
- "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
98
- activeUsers: number;
99
- cost: number;
100
- }>;
101
- };
102
- post: {
103
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
104
- name?: string | undefined;
105
- tag?: TenantTag | undefined;
106
- }, {
107
- name: string;
108
- id: string;
109
- indicator: string;
110
- tag: TenantTag;
111
- }>;
112
- };
113
- put: {};
114
- head: {};
115
- delete: {
116
- "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
117
- } & {
118
- "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
119
- };
120
- copy: {};
121
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
122
- options: {};
123
- patch: {};
124
- get: {
125
- "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
126
- from?: string | undefined;
127
- }, unknown, unknown>;
128
- };
129
- post: {
130
- "/services/send-email": import("@withtyped/server").PathGuard<"/send-email", unknown, {
131
- data: {
132
- type: VerificationCodeType;
133
- to: string;
134
- payload: {
135
- senderName?: string | undefined;
136
- companyInformation?: string | undefined;
137
- appLogo?: string | undefined;
138
- code: string;
139
- };
140
- };
141
- }, unknown>;
142
- } & {
143
- "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
144
- data: {
145
- type: VerificationCodeType;
146
- to: string;
147
- payload: {
148
- senderName?: string | undefined;
149
- companyInformation?: string | undefined;
150
- appLogo?: string | undefined;
151
- code: string;
152
- };
153
- };
154
- }, unknown>;
155
- } & {
156
- "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
157
- data: {
158
- type: VerificationCodeType;
159
- to: string;
160
- payload: {
161
- senderName?: string | undefined;
162
- companyInformation?: string | undefined;
163
- appLogo?: string | undefined;
164
- code: string;
165
- };
166
- };
167
- }, unknown>;
168
- };
169
- put: {};
170
- head: {};
171
- delete: {};
172
- copy: {};
173
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
174
- options: {};
175
- patch: {};
176
- get: {
177
- "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
178
- createdAt: Date;
179
- id: string;
180
- name: string;
181
- quota: {
182
- mauLimit: number | null;
183
- applicationsLimit: number;
184
- machineToMachineLimit: number;
185
- resourcesLimit: number;
186
- scopesPerResourceLimit: number;
187
- customDomainEnabled: boolean;
188
- omniSignInEnabled: boolean;
189
- builtInEmailConnectorEnabled: boolean;
190
- socialConnectorsLimit: number | null;
191
- standardConnectorsLimit: number;
192
- rolesLimit: number;
193
- scopesPerRoleLimit: number | null;
194
- hooksLimit: number;
195
- auditLogsRetentionDays: number;
196
- };
197
- stripeProducts: {
198
- description?: string | undefined;
199
- type: "flat" | "tier1" | "tier2" | "tier3";
200
- id: string;
201
- name: string;
202
- price: {
203
- quantity?: 1 | undefined;
204
- unitAmount?: number | null | undefined;
205
- id: string;
206
- unitAmountDecimal: string;
207
- };
208
- }[];
209
- updatedAt: Date;
210
- }[]>;
211
- };
212
- post: {};
213
- put: {};
214
- head: {};
215
- delete: {};
216
- copy: {};
217
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
218
- options: {};
219
- patch: {};
220
- get: {
221
- "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
222
- status: "open" | "complete" | "expired";
223
- createdAt: Date;
224
- id: string;
225
- userId: string;
226
- updatedAt: Date;
227
- tenantId: string | null;
228
- planId: string;
229
- }>;
230
- };
231
- post: {
232
- "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
233
- tenantId?: string | undefined;
234
- tenantTag?: TenantTag | undefined;
235
- tenantName?: string | undefined;
236
- cancelCallbackUrl?: string | undefined;
237
- planId: string;
238
- successCallbackUrl: string;
239
- }, {
240
- redirectUri?: string | null | undefined;
241
- sessionId: string;
242
- }>;
243
- };
244
- put: {};
245
- head: {};
246
- delete: {};
247
- copy: {};
248
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
249
- options: {};
250
- patch: {};
251
- get: {
252
- "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
253
- };
254
- post: {
255
- "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
256
- name: string;
257
- }, {
258
- createdAt: Date;
259
- id: string;
260
- name: string;
261
- }>;
262
- } & {
263
- "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
264
- value: string;
265
- type: "hostname" | "query";
266
- }, unknown>;
267
- };
268
- put: {};
269
- head: {};
270
- delete: {
271
- "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
272
- value: string;
273
- type: "hostname" | "query";
274
- }, unknown>;
275
- };
276
- copy: {};
277
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
278
- options: {};
279
- patch: {};
280
- get: {};
281
- post: {
282
- "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
283
- hostname?: string | undefined;
284
- query?: string | undefined;
285
- createdAt: string;
286
- userId: string;
287
- }, {
288
- createdAt: Date;
289
- id: string;
290
- affiliateId: string | null;
291
- userId: string;
292
- createdVia: {
293
- hostname?: string | undefined;
294
- query?: string | undefined;
295
- createdAt: string;
296
- };
297
- }>;
298
- };
299
- put: {};
300
- head: {};
301
- delete: {};
302
- copy: {};
303
- }, "/api">>, "/api">;
304
-
305
- export {
306
- router as default,
307
- };
308
-
309
- export {};