@logto/cloud 0.2.5-1116646 → 0.2.5-25a9c6d

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,77 @@ 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
+ name: string;
36
+ createdAt: Date;
37
+ id: string;
38
+ }, "id" | "createdAt", "id" | "createdAt">;
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").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/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
79
+ activeUsers: number;
80
+ }>;
55
81
  };
56
82
  post: {
57
83
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
58
84
  name?: string | undefined;
59
85
  tag?: TenantTag | undefined;
60
- }, TenantInfo>;
86
+ }, {
87
+ name: string;
88
+ id: string;
89
+ indicator: string;
90
+ tag: TenantTag;
91
+ }>;
61
92
  };
62
93
  put: {};
63
94
  head: {};
64
95
  delete: {
96
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
97
+ } & {
65
98
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
66
99
  };
67
100
  copy: {};
@@ -79,8 +112,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
79
112
  type: VerificationCodeType;
80
113
  to: string;
81
114
  payload: {
82
- fromName?: string | undefined;
83
- companyAddress?: string | undefined;
115
+ senderName?: string | undefined;
116
+ companyInformation?: string | undefined;
84
117
  appLogo?: string | undefined;
85
118
  code: string;
86
119
  };
@@ -92,8 +125,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
92
125
  type: VerificationCodeType;
93
126
  to: string;
94
127
  payload: {
95
- fromName?: string | undefined;
96
- companyAddress?: string | undefined;
128
+ senderName?: string | undefined;
129
+ companyInformation?: string | undefined;
97
130
  appLogo?: string | undefined;
98
131
  code: string;
99
132
  };
@@ -105,8 +138,8 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
105
138
  type: VerificationCodeType;
106
139
  to: string;
107
140
  payload: {
108
- fromName?: string | undefined;
109
- companyAddress?: string | undefined;
141
+ senderName?: string | undefined;
142
+ companyInformation?: string | undefined;
110
143
  appLogo?: string | undefined;
111
144
  code: string;
112
145
  };
@@ -124,20 +157,7 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
124
157
  "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
125
158
  id: string;
126
159
  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
160
  quota: {
140
- tenantLimit: number | null;
141
161
  mauLimit: number | null;
142
162
  applicationsLimit: number;
143
163
  machineToMachineLimit: number;
@@ -153,6 +173,18 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
153
173
  hooksLimit: number;
154
174
  auditLogsRetentionDays: number;
155
175
  };
176
+ stripeProducts: {
177
+ description?: string | undefined;
178
+ id: string;
179
+ name: string;
180
+ type: "flat" | "tier1" | "tier2" | "tier3";
181
+ price: {
182
+ quantity?: 1 | undefined;
183
+ unitAmount?: number | null | undefined;
184
+ id: string;
185
+ unitAmountDecimal: string;
186
+ };
187
+ }[];
156
188
  createdAt: Date;
157
189
  updatedAt: Date;
158
190
  }[]>;
@@ -162,10 +194,72 @@ declare const _default: import("@withtyped/server").Router<WithAuthContext, impo
162
194
  head: {};
163
195
  delete: {};
164
196
  copy: {};
197
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
198
+ options: {};
199
+ patch: {};
200
+ get: {
201
+ "/checkout-session/:id": import("@withtyped/server").PathGuard<"/:id", unknown, unknown, {
202
+ stripeCheckoutSession: {
203
+ id: string;
204
+ status: "open" | "complete" | "expired";
205
+ createdAt: Date;
206
+ updatedAt: Date;
207
+ userId: string;
208
+ tenantId: string | null;
209
+ planId: string;
210
+ };
211
+ }>;
212
+ };
213
+ post: {
214
+ "/checkout-session": import("@withtyped/server").PathGuard<"/", unknown, {
215
+ tenantId?: string | undefined;
216
+ tenantTag?: TenantTag | undefined;
217
+ tenantName?: string | undefined;
218
+ cancelCallbackUrl?: string | undefined;
219
+ planId: string;
220
+ successCallbackUrl: string;
221
+ }, {
222
+ redirectUri?: string | null | undefined;
223
+ sessionId: string;
224
+ }>;
225
+ };
226
+ put: {};
227
+ head: {};
228
+ delete: {};
229
+ copy: {};
230
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
231
+ options: {};
232
+ patch: {};
233
+ get: {
234
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, unknown, AffiliateData[]>;
235
+ };
236
+ post: {
237
+ "/affiliates": import("@withtyped/server").PathGuard<"/", unknown, {
238
+ name: string;
239
+ }, {
240
+ id: string;
241
+ name: string;
242
+ createdAt: Date;
243
+ }>;
244
+ } & {
245
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
246
+ type: "hostname" | "query";
247
+ value: string;
248
+ }, unknown>;
249
+ };
250
+ put: {};
251
+ head: {};
252
+ delete: {
253
+ "/affiliates/:id/properties": import("@withtyped/server").PathGuard<"/:id/properties", unknown, {
254
+ type: "hostname" | "query";
255
+ value: string;
256
+ }, unknown>;
257
+ };
258
+ copy: {};
165
259
  }, "/api">>, "/api">;
166
260
 
167
261
  export {
168
- _default as default,
262
+ router as default,
169
263
  };
170
264
 
171
265
  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-25a9c6d",
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
  }