@logto/cloud 0.2.5-31703ea → 0.2.5-4686b84

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.
@@ -14,18 +14,6 @@ declare enum TenantTag {
14
14
  Staging = "staging",
15
15
  Production = "production"
16
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
17
  declare enum VerificationCodeType {
30
18
  SignIn = "SignIn",
31
19
  Register = "Register",
@@ -36,26 +24,103 @@ declare enum VerificationCodeType {
36
24
  /** @deprecated Use `Generic` type template for sending test sms/email use case */
37
25
  Test = "Test"
38
26
  }
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<{
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<{
40
44
  options: {};
41
45
  patch: {
42
46
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
43
47
  name?: string | undefined;
44
48
  tag?: TenantTag | undefined;
45
- }, TenantInfo>;
49
+ }, {
50
+ name: string;
51
+ id: string;
52
+ indicator: string;
53
+ tag: TenantTag;
54
+ }>;
46
55
  };
47
56
  get: {
48
- "/tenants": import("@withtyped/server").PathGuard<"/", unknown, unknown, TenantInfo[]>;
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
+ }>;
49
101
  };
50
102
  post: {
51
103
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
52
104
  name?: string | undefined;
53
105
  tag?: TenantTag | undefined;
54
- }, TenantInfo>;
106
+ }, {
107
+ name: string;
108
+ id: string;
109
+ indicator: string;
110
+ tag: TenantTag;
111
+ }>;
112
+ } & {
113
+ "/tenants/:tenantId/stripe-customer-portal": import("@withtyped/server").PathGuard<"/:tenantId/stripe-customer-portal", unknown, {
114
+ callbackUrl?: string | undefined;
115
+ } | undefined, {
116
+ redirectUri: string;
117
+ }>;
55
118
  };
56
119
  put: {};
57
120
  head: {};
58
121
  delete: {
122
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
123
+ } & {
59
124
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
60
125
  };
61
126
  copy: {};
@@ -65,7 +130,9 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
65
130
  get: {
66
131
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
67
132
  from?: string | undefined;
68
- }, unknown, unknown>;
133
+ }, unknown, {
134
+ count: number;
135
+ }>;
69
136
  };
70
137
  post: {
71
138
  "/services/send-email": import("@withtyped/server").PathGuard<"/send-email", unknown, {
@@ -73,8 +140,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
73
140
  type: VerificationCodeType;
74
141
  to: string;
75
142
  payload: {
76
- fromName?: string | undefined;
77
- companyAddress?: string | undefined;
143
+ senderName?: string | undefined;
144
+ companyInformation?: string | undefined;
78
145
  appLogo?: string | undefined;
79
146
  code: string;
80
147
  };
@@ -86,8 +153,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
86
153
  type: VerificationCodeType;
87
154
  to: string;
88
155
  payload: {
89
- fromName?: string | undefined;
90
- companyAddress?: string | undefined;
156
+ senderName?: string | undefined;
157
+ companyInformation?: string | undefined;
91
158
  appLogo?: string | undefined;
92
159
  code: string;
93
160
  };
@@ -99,8 +166,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
99
166
  type: VerificationCodeType;
100
167
  to: string;
101
168
  payload: {
102
- fromName?: string | undefined;
103
- companyAddress?: string | undefined;
169
+ senderName?: string | undefined;
170
+ companyInformation?: string | undefined;
104
171
  appLogo?: string | undefined;
105
172
  code: string;
106
173
  };
@@ -116,22 +183,10 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
116
183
  patch: {};
117
184
  get: {
118
185
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
186
+ createdAt: Date;
119
187
  id: string;
120
188
  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
189
  quota: {
134
- tenantLimit: number | null;
135
190
  mauLimit: number | null;
136
191
  applicationsLimit: number;
137
192
  machineToMachineLimit: number;
@@ -147,7 +202,18 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
147
202
  hooksLimit: number;
148
203
  auditLogsRetentionDays: number;
149
204
  };
150
- createdAt: Date;
205
+ stripeProducts: {
206
+ description?: string | undefined;
207
+ type: "flat" | "tier1" | "tier2" | "tier3";
208
+ id: string;
209
+ name: string;
210
+ price: {
211
+ quantity?: 1 | undefined;
212
+ unitAmount?: number | null | undefined;
213
+ id: string;
214
+ unitAmountDecimal: string;
215
+ };
216
+ }[];
151
217
  updatedAt: Date;
152
218
  }[]>;
153
219
  };
@@ -156,10 +222,101 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
156
222
  head: {};
157
223
  delete: {};
158
224
  copy: {};
225
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
226
+ options: {};
227
+ patch: {};
228
+ get: {
229
+ "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
230
+ status: "open" | "complete" | "expired";
231
+ createdAt: Date;
232
+ id: string;
233
+ userId: string;
234
+ updatedAt: Date;
235
+ tenantId: string | null;
236
+ planId: string;
237
+ }>;
238
+ };
239
+ post: {
240
+ "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
241
+ tenantId?: string | undefined;
242
+ tenantTag?: TenantTag | undefined;
243
+ tenantName?: string | undefined;
244
+ cancelCallbackUrl?: string | undefined;
245
+ planId: string;
246
+ successCallbackUrl: string;
247
+ }, {
248
+ redirectUri?: string | null | undefined;
249
+ sessionId: string;
250
+ }>;
251
+ };
252
+ put: {};
253
+ head: {};
254
+ delete: {};
255
+ copy: {};
256
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
257
+ options: {};
258
+ patch: {};
259
+ get: {
260
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
261
+ };
262
+ post: {
263
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
264
+ name: string;
265
+ }, {
266
+ createdAt: Date;
267
+ id: string;
268
+ name: string;
269
+ }>;
270
+ } & {
271
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
272
+ value: string;
273
+ type: "hostname" | "query";
274
+ }, {
275
+ value: string;
276
+ type: "hostname" | "query";
277
+ createdAt: Date;
278
+ affiliateId: string;
279
+ }>;
280
+ };
281
+ put: {};
282
+ head: {};
283
+ delete: {
284
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
285
+ value: string;
286
+ type: "hostname" | "query";
287
+ }, unknown>;
288
+ };
289
+ copy: {};
290
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
291
+ options: {};
292
+ patch: {};
293
+ get: {};
294
+ post: {
295
+ "/affiliate-logs": import("@withtyped/server").PathGuard<"/", unknown, {
296
+ hostname?: string | undefined;
297
+ query?: string | undefined;
298
+ createdAt: string;
299
+ userId: string;
300
+ }, {
301
+ createdAt: Date;
302
+ id: string;
303
+ affiliateId: string | null;
304
+ userId: string;
305
+ createdVia: {
306
+ hostname?: string | undefined;
307
+ query?: string | undefined;
308
+ createdAt: string;
309
+ };
310
+ }>;
311
+ };
312
+ put: {};
313
+ head: {};
314
+ delete: {};
315
+ copy: {};
159
316
  }, "/api">>, "/api">;
160
317
 
161
318
  export {
162
- _default as default,
319
+ router as default,
163
320
  };
164
321
 
165
322
  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-4686b84",
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,21 @@
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
+ "ignorePatterns": [
45
+ "types.test.ts"
46
+ ]
40
47
  },
41
48
  "prettier": "@silverhand/eslint-config/.prettierrc",
42
49
  "publishConfig": {
43
50
  "access": "public"
44
51
  },
45
52
  "dependencies": {
46
- "@withtyped/server": "^0.12.0"
53
+ "@silverhand/essentials": "^2.7.0",
54
+ "@withtyped/server": "^0.12.7"
47
55
  },
48
56
  "scripts": {
49
57
  "precommit": "lint-staged",
@@ -56,8 +64,9 @@
56
64
  "dev": "rm -rf build/ && nodemon",
57
65
  "start": "NODE_ENV=production node .",
58
66
  "test:only": "NODE_OPTIONS=\"--experimental-vm-modules --max_old_space_size=4096\" jest --logHeapUsage",
59
- "test": "pnpm build:test && pnpm test:only",
67
+ "test": "pnpm build:test && pnpm test:only && pnpm build:lib && pnpm test:types",
60
68
  "test:ci": "pnpm test:only --coverage --silent",
61
- "test:types": "tsc -p tsconfig.test.types.json"
69
+ "test:types": "tsc -p tsconfig.test.types.json",
70
+ "cli": "node ./build/cli/index.js"
62
71
  }
63
72
  }