@wirechunk/cli 0.0.6 → 0.0.7
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.
- package/build/main.js +26242 -21975
- package/package.json +9 -8
- package/src/commands/create-extension-version.ts +0 -2
- package/src/commands/create-user.ts +10 -1
- package/src/commands/ext-dev/init-db.ts +4 -3
- package/src/core-api/api.ts +2018 -407
- package/src/util.ts +1 -1
- package/tsconfig.json +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirechunk/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"format:check": "prettier --check .",
|
|
11
11
|
"typecheck": "tsc",
|
|
12
12
|
"typecheck-src": "tsc --skipLibCheck",
|
|
13
|
+
"typecheck-src:tsgo": "tsgo --skipLibCheck",
|
|
13
14
|
"test": "echo 'no tests yet'",
|
|
14
15
|
"build": "npm run build:clean && npm run build:cli",
|
|
15
16
|
"build:clean": "rm -rf build",
|
|
@@ -23,21 +24,21 @@
|
|
|
23
24
|
"#api": "./src/core-api/api.ts"
|
|
24
25
|
},
|
|
25
26
|
"dependencies": {
|
|
26
|
-
"argon2": "^0.
|
|
27
|
+
"argon2": "^0.44.0"
|
|
27
28
|
},
|
|
28
29
|
"devDependencies": {
|
|
29
|
-
"@commander-js/extra-typings": "^
|
|
30
|
+
"@commander-js/extra-typings": "^14.0.0",
|
|
30
31
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
31
32
|
"@types/archiver": "^6.0.3",
|
|
32
33
|
"@wirechunk/backend-lib": "0.0.0",
|
|
33
34
|
"@wirechunk/lib": "0.0.0",
|
|
34
35
|
"archiver": "^7.0.1",
|
|
35
|
-
"chalk": "^5.
|
|
36
|
-
"commander": "^
|
|
36
|
+
"chalk": "^5.6.2",
|
|
37
|
+
"commander": "^14.0.2",
|
|
37
38
|
"graphql-request": "^7.1.2",
|
|
38
|
-
"slonik": "^
|
|
39
|
-
"slonik-interceptor-query-logging": "^
|
|
40
|
-
"zod": "^
|
|
39
|
+
"slonik": "^48.8.7",
|
|
40
|
+
"slonik-interceptor-query-logging": "^48.8.7",
|
|
41
|
+
"zod": "^4.1.13"
|
|
41
42
|
},
|
|
42
43
|
"publishConfig": {
|
|
43
44
|
"access": "public"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { hashPassword, validatePasswordComplexity } from '@wirechunk/backend-lib/passwords.ts';
|
|
2
|
-
import { rolesSchema } from '@wirechunk/backend-lib/roles.ts';
|
|
3
2
|
import { cleanSmallId } from '@wirechunk/lib/clean-small-id.ts';
|
|
4
3
|
import { normalizeEmailAddress } from '@wirechunk/lib/emails.ts';
|
|
5
4
|
import { createPool, sql, UniqueIntegrityConstraintViolationError } from 'slonik';
|
|
@@ -14,6 +13,16 @@ const findOrgResult = z.object({
|
|
|
14
13
|
platformId: z.string(),
|
|
15
14
|
});
|
|
16
15
|
|
|
16
|
+
// Copied from backend-lib/roles.ts for now because different zod versions.
|
|
17
|
+
const roleSchema = z.object({
|
|
18
|
+
id: z.string(),
|
|
19
|
+
name: z.string(),
|
|
20
|
+
default: z.boolean().optional().default(false),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
// The schema for the platform roles configuration.
|
|
24
|
+
const rolesSchema = z.array(roleSchema);
|
|
25
|
+
|
|
17
26
|
const findPlatformResult = z.object({
|
|
18
27
|
id: z.string(),
|
|
19
28
|
name: z.string(),
|
|
@@ -37,6 +37,7 @@ const initExtDb = async ({
|
|
|
37
37
|
|
|
38
38
|
const extRoleIdent = sql.identifier([extensionRoleName]);
|
|
39
39
|
|
|
40
|
+
// Note the password_required 'false' option is needed for local development environments without passwords.
|
|
40
41
|
await db.query(sql.unsafe`
|
|
41
42
|
create user mapping if not exists for ${extRoleIdent} server wirechunk
|
|
42
43
|
options (user ${sql.literalValue(extensionRoleName)}, password_required 'false')
|
|
@@ -217,11 +218,11 @@ export const initDb = async (
|
|
|
217
218
|
db,
|
|
218
219
|
});
|
|
219
220
|
|
|
220
|
-
const
|
|
221
|
-
|
|
221
|
+
const superExtDb = new URL(extDb.url);
|
|
222
|
+
superExtDb.username = coreDbUrlObject.username;
|
|
222
223
|
|
|
223
224
|
await initExtDb({
|
|
224
|
-
db: await createPool(
|
|
225
|
+
db: await createPool(superExtDb.toString(), dbPoolOptions(opts)),
|
|
225
226
|
extensionRoleName: extRole,
|
|
226
227
|
coreDbUrl: coreDbUrlObject,
|
|
227
228
|
});
|