@logto/cloud 0.2.5-1a68662 → 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,30 +24,102 @@ 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 router: import("@withtyped/server").Router<WithAuthContext, 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<{
44
+ options: {};
40
45
  patch: {
41
46
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, {
42
47
  name?: string | undefined;
43
48
  tag?: TenantTag | undefined;
44
- }, TenantInfo>;
49
+ }, {
50
+ name: string;
51
+ id: string;
52
+ indicator: string;
53
+ tag: TenantTag;
54
+ }>;
45
55
  };
46
56
  get: {
47
- "/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
+ }>;
48
101
  };
49
102
  post: {
50
103
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
51
104
  name?: string | undefined;
52
105
  tag?: TenantTag | undefined;
53
- }, TenantInfo>;
106
+ }, {
107
+ name: string;
108
+ id: string;
109
+ indicator: string;
110
+ tag: TenantTag;
111
+ }>;
54
112
  };
55
113
  put: {};
56
114
  head: {};
57
115
  delete: {
116
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
117
+ } & {
58
118
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
59
119
  };
60
- options: {};
61
120
  copy: {};
62
121
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
122
+ options: {};
63
123
  patch: {};
64
124
  get: {
65
125
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
@@ -72,8 +132,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
72
132
  type: VerificationCodeType;
73
133
  to: string;
74
134
  payload: {
75
- fromName?: string | undefined;
76
- companyAddress?: string | undefined;
135
+ senderName?: string | undefined;
136
+ companyInformation?: string | undefined;
77
137
  appLogo?: string | undefined;
78
138
  code: string;
79
139
  };
@@ -85,8 +145,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
85
145
  type: VerificationCodeType;
86
146
  to: string;
87
147
  payload: {
88
- fromName?: string | undefined;
89
- companyAddress?: string | undefined;
148
+ senderName?: string | undefined;
149
+ companyInformation?: string | undefined;
90
150
  appLogo?: string | undefined;
91
151
  code: string;
92
152
  };
@@ -98,8 +158,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
98
158
  type: VerificationCodeType;
99
159
  to: string;
100
160
  payload: {
101
- fromName?: string | undefined;
102
- companyAddress?: string | undefined;
161
+ senderName?: string | undefined;
162
+ companyInformation?: string | undefined;
103
163
  appLogo?: string | undefined;
104
164
  code: string;
105
165
  };
@@ -109,7 +169,136 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
109
169
  put: {};
110
170
  head: {};
111
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<{
112
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: {};
113
302
  copy: {};
114
303
  }, "/api">>, "/api">;
115
304
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@logto/cloud",
3
- "version": "0.2.5-1a68662",
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
  }