@logto/cloud 0.2.5-1a68662 → 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,30 +24,82 @@ 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
+ 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<{
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/usage": import("@withtyped/server").PathGuard<"/:tenantId/usage", unknown, unknown, {
79
+ activeUsers: number;
80
+ }>;
48
81
  };
49
82
  post: {
50
83
  "/tenants": import("@withtyped/server").PathGuard<"/", unknown, {
51
84
  name?: string | undefined;
52
85
  tag?: TenantTag | undefined;
53
- }, TenantInfo>;
86
+ }, {
87
+ name: string;
88
+ id: string;
89
+ indicator: string;
90
+ tag: TenantTag;
91
+ }>;
54
92
  };
55
93
  put: {};
56
94
  head: {};
57
95
  delete: {
96
+ "/tenants/:tenantId/subscription": import("@withtyped/server").PathGuard<"/:tenantId/subscription", unknown, unknown, unknown>;
97
+ } & {
58
98
  "/tenants/:tenantId": import("@withtyped/server").PathGuard<"/:tenantId", unknown, unknown, unknown>;
59
99
  };
60
- options: {};
61
100
  copy: {};
62
101
  }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
102
+ options: {};
63
103
  patch: {};
64
104
  get: {
65
105
  "/services/mails/usage": import("@withtyped/server").PathGuard<"/mails/usage", {
@@ -72,8 +112,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
72
112
  type: VerificationCodeType;
73
113
  to: string;
74
114
  payload: {
75
- fromName?: string | undefined;
76
- companyAddress?: string | undefined;
115
+ senderName?: string | undefined;
116
+ companyInformation?: string | undefined;
77
117
  appLogo?: string | undefined;
78
118
  code: string;
79
119
  };
@@ -85,8 +125,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
85
125
  type: VerificationCodeType;
86
126
  to: string;
87
127
  payload: {
88
- fromName?: string | undefined;
89
- companyAddress?: string | undefined;
128
+ senderName?: string | undefined;
129
+ companyInformation?: string | undefined;
90
130
  appLogo?: string | undefined;
91
131
  code: string;
92
132
  };
@@ -98,8 +138,8 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
98
138
  type: VerificationCodeType;
99
139
  to: string;
100
140
  payload: {
101
- fromName?: string | undefined;
102
- companyAddress?: string | undefined;
141
+ senderName?: string | undefined;
142
+ companyInformation?: string | undefined;
103
143
  appLogo?: string | undefined;
104
144
  code: string;
105
145
  };
@@ -109,7 +149,112 @@ declare const router: import("@withtyped/server").Router<WithAuthContext, import
109
149
  put: {};
110
150
  head: {};
111
151
  delete: {};
152
+ copy: {};
153
+ }, "/api">>, import("@withtyped/server").RoutesWithPrefix<{
112
154
  options: {};
155
+ patch: {};
156
+ get: {
157
+ "/subscription-plans": import("@withtyped/server").PathGuard<"/", unknown, unknown, {
158
+ id: string;
159
+ name: string;
160
+ quota: {
161
+ mauLimit: number | null;
162
+ applicationsLimit: number;
163
+ machineToMachineLimit: number;
164
+ resourcesLimit: number;
165
+ scopesPerResourceLimit: number;
166
+ customDomainEnabled: boolean;
167
+ omniSignInEnabled: boolean;
168
+ builtInEmailConnectorEnabled: boolean;
169
+ socialConnectorsLimit: number | null;
170
+ standardConnectorsLimit: number;
171
+ rolesLimit: number;
172
+ scopesPerRoleLimit: number | null;
173
+ hooksLimit: number;
174
+ auditLogsRetentionDays: number;
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
+ }[];
188
+ createdAt: Date;
189
+ updatedAt: Date;
190
+ }[]>;
191
+ };
192
+ post: {};
193
+ put: {};
194
+ head: {};
195
+ delete: {};
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
+ };
113
258
  copy: {};
114
259
  }, "/api">>, "/api">;
115
260
 
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-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
  }