@logto/cloud 0.2.5-cbbfdc2 → 0.2.5-cda36a9

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,324 @@
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
+ isSuspended: boolean;
54
+ planId: string;
55
+ tag: TenantTag;
56
+ }>;
57
+ };
58
+ get: {
59
+ "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
60
+ id: string;
61
+ name: string;
62
+ indicator: string;
63
+ isSuspended: boolean;
64
+ planId: string;
65
+ tag: TenantTag;
66
+ }[]>;
67
+ };
68
+ post: {
69
+ "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
70
+ name?: string | undefined;
71
+ tag?: TenantTag | undefined;
72
+ }, {
73
+ id: string;
74
+ name: string;
75
+ indicator: string;
76
+ isSuspended: boolean;
77
+ planId: string;
78
+ tag: TenantTag;
79
+ }>;
80
+ };
81
+ put: {};
82
+ head: {};
83
+ delete: {
84
+ "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
85
+ };
86
+ copy: {};
87
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
88
+ options: {};
89
+ patch: {};
90
+ get: {
91
+ "/tenants/my/subscription": import("@withtyped/server").PathGuard<"/my/subscription", unknown, unknown, {
92
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
93
+ planId: string;
94
+ currentPeriodStart: Date;
95
+ currentPeriodEnd: Date;
96
+ }>;
97
+ } & {
98
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, {
99
+ status: "incomplete" | "incomplete_expired" | "trialing" | "active" | "past_due" | "canceled" | "unpaid" | "paused";
100
+ planId: string;
101
+ currentPeriodStart: Date;
102
+ currentPeriodEnd: Date;
103
+ }>;
104
+ } & {
105
+ "/tenants/:tenantId/invoices": import("@withtyped/server").PathGuard<"/:tenantId/invoices", unknown, unknown, {
106
+ invoices: {
107
+ status: "void" | "open" | "draft" | "paid" | "uncollectible" | null;
108
+ createdAt: Date;
109
+ id: string;
110
+ updatedAt: Date;
111
+ customerId: string | null;
112
+ billingReason: string | null;
113
+ periodStart: Date;
114
+ periodEnd: Date;
115
+ amountDue: number;
116
+ amountPaid: number;
117
+ subscriptionId: string | null;
118
+ hostedInvoiceUrl: string | null;
119
+ invoicePdf: string | null;
120
+ planName: string | null;
121
+ }[];
122
+ }>;
123
+ } & {
124
+ "/tenants/:tenantId/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
125
+ activeUsers: number;
126
+ cost: number;
127
+ }>;
128
+ };
129
+ post: {
130
+ "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
131
+ callbackUrl?: string | undefined;
132
+ }, {
133
+ redirectUri: string;
134
+ }>;
135
+ };
136
+ put: {};
137
+ head: {};
138
+ delete: {
139
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
140
+ };
141
+ copy: {};
142
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
143
+ options: {};
144
+ patch: {};
145
+ get: {
146
+ "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
147
+ from?: string | undefined;
148
+ }, unknown, {
149
+ count: number;
150
+ }>;
151
+ };
152
+ post: {
153
+ "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
154
+ data: {
155
+ type: VerificationCodeType;
156
+ to: string;
157
+ payload: {
158
+ senderName?: string | undefined;
159
+ companyInformation?: string | undefined;
160
+ appLogo?: string | undefined;
161
+ code: string;
162
+ };
163
+ };
164
+ }, unknown>;
165
+ } & {
166
+ "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
167
+ data: {
168
+ type: VerificationCodeType;
169
+ to: string;
170
+ payload: {
171
+ senderName?: string | undefined;
172
+ companyInformation?: string | undefined;
173
+ appLogo?: string | undefined;
174
+ code: string;
175
+ };
176
+ };
177
+ }, unknown>;
178
+ };
179
+ put: {};
180
+ head: {};
181
+ delete: {};
182
+ copy: {};
183
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
184
+ options: {};
185
+ patch: {};
186
+ get: {
187
+ "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
188
+ createdAt: Date;
189
+ id: string;
190
+ name: string;
191
+ quota: {
192
+ mauLimit: number | null;
193
+ applicationsLimit: number | null;
194
+ machineToMachineLimit: number | null;
195
+ resourcesLimit: number | null;
196
+ scopesPerResourceLimit: number | null;
197
+ customDomainEnabled: boolean;
198
+ omniSignInEnabled: boolean;
199
+ builtInEmailConnectorEnabled: boolean;
200
+ socialConnectorsLimit: number | null;
201
+ standardConnectorsLimit: number | null;
202
+ rolesLimit: number | null;
203
+ scopesPerRoleLimit: number | null;
204
+ hooksLimit: number | null;
205
+ auditLogsRetentionDays: number | null;
206
+ };
207
+ stripeProducts: {
208
+ description?: string | undefined;
209
+ type: "flat" | "tier1" | "tier2" | "tier3";
210
+ id: string;
211
+ name: string;
212
+ price: {
213
+ quantity?: 1 | undefined;
214
+ unitAmount?: number | null | undefined;
215
+ id: string;
216
+ unitAmountDecimal: string;
217
+ };
218
+ }[];
219
+ updatedAt: Date;
220
+ }[]>;
221
+ };
222
+ post: {};
223
+ put: {};
224
+ head: {};
225
+ delete: {};
226
+ copy: {};
227
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
228
+ options: {};
229
+ patch: {};
230
+ get: {
231
+ "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
232
+ status: "open" | "complete" | "expired";
233
+ createdAt: Date;
234
+ id: string;
235
+ userId: string;
236
+ updatedAt: Date;
237
+ tenantId: string | null;
238
+ planId: string;
239
+ }>;
240
+ };
241
+ post: {
242
+ "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
243
+ tenantId?: string | undefined;
244
+ tenantTag?: TenantTag | undefined;
245
+ tenantName?: string | undefined;
246
+ cancelCallbackUrl?: string | undefined;
247
+ planId: string;
248
+ successCallbackUrl: string;
249
+ }, {
250
+ redirectUri?: string | null | undefined;
251
+ sessionId: string;
252
+ }>;
253
+ };
254
+ put: {};
255
+ head: {};
256
+ delete: {};
257
+ copy: {};
258
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
259
+ options: {};
260
+ patch: {};
261
+ get: {
262
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
263
+ };
264
+ post: {
265
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
266
+ name: string;
267
+ }, {
268
+ createdAt: Date;
269
+ id: string;
270
+ name: string;
271
+ }>;
272
+ } & {
273
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
274
+ value: string;
275
+ type: "hostname" | "query";
276
+ }, {
277
+ value: string;
278
+ type: "hostname" | "query";
279
+ createdAt: Date;
280
+ affiliateId: string;
281
+ }>;
282
+ };
283
+ put: {};
284
+ head: {};
285
+ delete: {
286
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
287
+ value: string;
288
+ type: "hostname" | "query";
289
+ }, unknown>;
290
+ };
291
+ copy: {};
292
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
293
+ options: {};
294
+ patch: {};
295
+ get: {};
296
+ post: {
297
+ "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
298
+ hostname?: string | undefined;
299
+ query?: string | undefined;
300
+ createdAt: string;
301
+ userId: string;
302
+ }, {
303
+ createdAt: Date;
304
+ id: string;
305
+ affiliateId: string | null;
306
+ userId: string;
307
+ createdVia: {
308
+ hostname?: string | undefined;
309
+ query?: string | undefined;
310
+ createdAt: string;
311
+ };
312
+ }>;
313
+ };
314
+ put: {};
315
+ head: {};
316
+ delete: {};
317
+ copy: {};
318
+ }, "/api">>, "/api">;
319
+
320
+ export {
321
+ router as default,
322
+ };
323
+
324
+ export {};
package/package.json CHANGED
@@ -1,24 +1,24 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-cbbfdc2",
3
+ "version": "0.2.5-cda36a9",
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": "4.0.1",
20
+ "@silverhand/jest-config": "4.0.0",
21
+ "@silverhand/ts-config": "4.0.0",
22
22
  "@types/accepts": "^1.3.5",
23
23
  "@types/http-proxy": "^1.17.9",
24
24
  "@types/jest": "^29.4.0",
@@ -26,11 +26,11 @@
26
26
  "@types/node": "^18.11.18",
27
27
  "@types/yargs": "^17.0.24",
28
28
  "dts-bundle-generator": "^8.0.1",
29
- "eslint": "^8.21.0",
29
+ "eslint": "^8.44.0",
30
30
  "jest": "^29.5.0",
31
- "lint-staged": "^13.0.0",
31
+ "lint-staged": "^14.0.0",
32
32
  "nodemon": "^3.0.0",
33
- "prettier": "^2.8.1",
33
+ "prettier": "^3.0.0",
34
34
  "typescript": "^5.0.0"
35
35
  },
36
36
  "engines": {
@@ -38,6 +38,9 @@
38
38
  },
39
39
  "eslintConfig": {
40
40
  "extends": "@silverhand",
41
+ "rules": {
42
+ "no-console": "error"
43
+ },
41
44
  "ignorePatterns": [
42
45
  "types.test.ts"
43
46
  ]
@@ -47,14 +50,14 @@
47
50
  "access": "public"
48
51
  },
49
52
  "dependencies": {
50
- "@silverhand/essentials": "^2.7.0",
51
- "@withtyped/server": "^0.12.4"
53
+ "@silverhand/essentials": "^2.8.2",
54
+ "@withtyped/server": "^0.12.7"
52
55
  },
53
56
  "scripts": {
54
57
  "precommit": "lint-staged",
55
- "build": "rm -rf build/ && tsc -p tsconfig.build.json",
58
+ "build": "rm -rf build/ && tsc -p tsconfig.build.json && pnpm build:lib",
56
59
  "//": "It is not used to build the service itself.",
57
- "build:lib": "rm -rf build/ && dts-bundle-generator src/routes/index.ts --project tsconfig.build.json -o build/routes/index.d.ts",
60
+ "build:lib": "rm -rf lib/ && dts-bundle-generator src/routes/index.ts --project tsconfig.build.json -o lib/routes/index.d.ts",
58
61
  "build:test": "rm -rf build/ && tsc -p tsconfig.test.json --sourcemap",
59
62
  "lint": "eslint --ext .ts src",
60
63
  "lint:report": "pnpm lint --format json --output-file report.json",
@@ -1,165 +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 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<{
40
- options: {};
41
- patch: {
42
- "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
43
- name?: string | undefined;
44
- tag?: TenantTag | undefined;
45
- }, TenantInfo>;
46
- };
47
- get: {
48
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, TenantInfo[]>;
49
- };
50
- post: {
51
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
52
- name?: string | undefined;
53
- tag?: TenantTag | undefined;
54
- }, TenantInfo>;
55
- };
56
- put: {};
57
- head: {};
58
- delete: {
59
- "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
60
- };
61
- copy: {};
62
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
63
- options: {};
64
- patch: {};
65
- get: {
66
- "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
67
- from?: string | undefined;
68
- }, unknown, unknown>;
69
- };
70
- post: {
71
- "/services/send-email": import("@withtyped/server").PathGuard<"/send-email", unknown, {
72
- data: {
73
- type: VerificationCodeType;
74
- to: string;
75
- payload: {
76
- fromName?: string | undefined;
77
- companyAddress?: string | undefined;
78
- appLogo?: string | undefined;
79
- code: string;
80
- };
81
- };
82
- }, unknown>;
83
- } & {
84
- "/services/mails": import("@withtyped/server").PathGuard<"/mails", unknown, {
85
- data: {
86
- type: VerificationCodeType;
87
- to: string;
88
- payload: {
89
- fromName?: string | undefined;
90
- companyAddress?: string | undefined;
91
- appLogo?: string | undefined;
92
- code: string;
93
- };
94
- };
95
- }, unknown>;
96
- } & {
97
- "/services/send-sms": import("@withtyped/server").PathGuard<"/send-sms", unknown, {
98
- data: {
99
- type: VerificationCodeType;
100
- to: string;
101
- payload: {
102
- fromName?: string | undefined;
103
- companyAddress?: string | undefined;
104
- appLogo?: string | undefined;
105
- code: string;
106
- };
107
- };
108
- }, unknown>;
109
- };
110
- put: {};
111
- head: {};
112
- delete: {};
113
- copy: {};
114
- }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
115
- options: {};
116
- patch: {};
117
- get: {
118
- "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
119
- id: string;
120
- 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
- quota: {
134
- tenantLimit: number | null;
135
- mauLimit: number | null;
136
- applicationsLimit: number;
137
- machineToMachineLimit: number;
138
- resourcesLimit: number;
139
- scopesPerResourceLimit: number;
140
- customDomainEnabled: boolean;
141
- omniSignInEnabled: boolean;
142
- builtInEmailConnectorEnabled: boolean;
143
- socialConnectorsLimit: number | null;
144
- standardConnectorsLimit: number;
145
- rolesLimit: number;
146
- scopesPerRoleLimit: number | null;
147
- hooksLimit: number;
148
- auditLogsRetentionDays: number;
149
- };
150
- createdAt: Date;
151
- updatedAt: Date;
152
- }[]>;
153
- };
154
- post: {};
155
- put: {};
156
- head: {};
157
- delete: {};
158
- copy: {};
159
- }, "/api">>, "/api">;
160
-
161
- export {
162
- _default as default,
163
- };
164
-
165
- export {};