@logto/cloud 0.2.5-1116646 → 0.2.5-2087c06

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,32 +24,97 @@ 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 enum ProductType {
40
- FlatRate = "FlatRate",
41
- Tier1 = "tier1",
42
- Tier2 = "tier2",
43
- Tier3 = "tier3"
44
- }
45
- 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<{
46
44
  options: {};
47
45
  patch: {
48
46
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
49
47
  name?: string | undefined;
50
48
  tag?: TenantTag | undefined;
51
- }, TenantInfo>;
49
+ }, {
50
+ name: string;
51
+ id: string;
52
+ indicator: string;
53
+ tag: TenantTag;
54
+ }>;
52
55
  };
53
56
  get: {
54
- "/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
+ }>;
55
101
  };
56
102
  post: {
57
103
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
58
104
  name?: string | undefined;
59
105
  tag?: TenantTag | undefined;
60
- }, TenantInfo>;
106
+ }, {
107
+ name: string;
108
+ id: string;
109
+ indicator: string;
110
+ tag: TenantTag;
111
+ }>;
61
112
  };
62
113
  put: {};
63
114
  head: {};
64
115
  delete: {
116
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
117
+ } & {
65
118
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
66
119
  };
67
120
  copy: {};
@@ -79,8 +132,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
79
132
  type: VerificationCodeType;
80
133
  to: string;
81
134
  payload: {
82
- fromName?: string | undefined;
83
- companyAddress?: string | undefined;
135
+ senderName?: string | undefined;
136
+ companyInformation?: string | undefined;
84
137
  appLogo?: string | undefined;
85
138
  code: string;
86
139
  };
@@ -92,8 +145,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
92
145
  type: VerificationCodeType;
93
146
  to: string;
94
147
  payload: {
95
- fromName?: string | undefined;
96
- companyAddress?: string | undefined;
148
+ senderName?: string | undefined;
149
+ companyInformation?: string | undefined;
97
150
  appLogo?: string | undefined;
98
151
  code: string;
99
152
  };
@@ -105,8 +158,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
105
158
  type: VerificationCodeType;
106
159
  to: string;
107
160
  payload: {
108
- fromName?: string | undefined;
109
- companyAddress?: string | undefined;
161
+ senderName?: string | undefined;
162
+ companyInformation?: string | undefined;
110
163
  appLogo?: string | undefined;
111
164
  code: string;
112
165
  };
@@ -122,22 +175,10 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
122
175
  patch: {};
123
176
  get: {
124
177
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
178
+ createdAt: Date;
125
179
  id: string;
126
180
  name: string;
127
- products: {
128
- description?: string | undefined;
129
- id: string;
130
- name: string;
131
- type: ProductType;
132
- price: {
133
- quantity?: 1 | undefined;
134
- unitAmount?: number | null | undefined;
135
- id: string;
136
- unitAmountDecimal: string;
137
- };
138
- }[];
139
181
  quota: {
140
- tenantLimit: number | null;
141
182
  mauLimit: number | null;
142
183
  applicationsLimit: number;
143
184
  machineToMachineLimit: number;
@@ -153,7 +194,18 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
153
194
  hooksLimit: number;
154
195
  auditLogsRetentionDays: number;
155
196
  };
156
- createdAt: Date;
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
+ }[];
157
209
  updatedAt: Date;
158
210
  }[]>;
159
211
  };
@@ -162,10 +214,96 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
162
214
  head: {};
163
215
  delete: {};
164
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: {};
165
303
  }, "/api">>, "/api">;
166
304
 
167
305
  export {
168
- _default as default,
306
+ router as default,
169
307
  };
170
308
 
171
309
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-1116646",
3
+ "version": "0.2.5-2087c06",
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
  }