@snowplow/snowtype 0.1.0

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/dist/index.js ADDED
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const commands_1 = require("./commands");
4
+ (0, commands_1.main)()
5
+ .then(() => {
6
+ return undefined;
7
+ })
8
+ .catch(() => {
9
+ process.exitCode = 1;
10
+ });
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.replaceIgluSchemaPart = exports.splitIgluSchemaUrlParts = exports.hashSHA256 = void 0;
4
+ const js_sha256_1 = require("js-sha256");
5
+ function hashSHA256(content) {
6
+ const hash = js_sha256_1.sha256.create();
7
+ hash.update(content);
8
+ const hashHex = hash.hex();
9
+ return hashHex;
10
+ }
11
+ exports.hashSHA256 = hashSHA256;
12
+ function splitIgluSchemaUrlParts(schema) {
13
+ /* Remove iglu: prefix to allow for it to be either included or not */
14
+ const schemaFormat = schema.replace("iglu:", "");
15
+ const [vendor, name, format, version] = schemaFormat.split("/");
16
+ return { vendor, name, format, version };
17
+ }
18
+ exports.splitIgluSchemaUrlParts = splitIgluSchemaUrlParts;
19
+ function replaceIgluSchemaPart(schema, { vendor, name, format, version }) {
20
+ const schemaFormat = schema.replace("iglu:", "");
21
+ const [initialVendor, initialName, initialFormat, initialVersion] = schemaFormat.split("/");
22
+ return `iglu:${vendor || initialVendor}/${name || initialName}/${format || initialFormat}/${version || initialVersion}`;
23
+ }
24
+ exports.replaceIgluSchemaPart = replaceIgluSchemaPart;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PKG_VERSION = void 0;
4
+ exports.PKG_VERSION = "0.1.0";
package/package.json ADDED
@@ -0,0 +1,57 @@
1
+ {
2
+ "name": "@snowplow/snowtype",
3
+ "version": "0.1.0",
4
+ "description": "A code generator CLI for faster and type-safe Snowplow tracking code",
5
+ "author": "Peter Perlepes <peter@snowplowanalytics.com>",
6
+ "homepage": "https://snowplow.io/",
7
+ "license": "SEE LICENSE IN LICENSE",
8
+ "main": "dist/index.js",
9
+ "files": [
10
+ "dist",
11
+ "bin"
12
+ ],
13
+ "dependencies": {
14
+ "@commander-js/extra-typings": "^11.1.0",
15
+ "@inquirer/prompts": "^3.3.0",
16
+ "@snowplow/snowtype-core": "^0.1.0",
17
+ "chalk": "^4.1.2",
18
+ "cli-spinner": "^0.2.10",
19
+ "dotenv": "^16.3.1",
20
+ "got": "^11",
21
+ "joi": "^17.6.0",
22
+ "js-sha256": "^0.10.1",
23
+ "mkdirp": "^3.0.1"
24
+ },
25
+ "devDependencies": {
26
+ "@types/cli-spinner": "^0.2.3",
27
+ "@types/debug": "^4.1.7",
28
+ "@types/got": "^9.6.12",
29
+ "@types/jest": "^29.5.8",
30
+ "@types/node": "^20.9.0",
31
+ "jest": "^29.7.0",
32
+ "rimraf": "^5.0.5",
33
+ "ts-jest": "^29.1.1",
34
+ "ts-node": "^10.7",
35
+ "tslib": "^2.4",
36
+ "typescript": "5.2.2"
37
+ },
38
+ "scripts": {
39
+ "prebuild": "node ./scripts/version.js",
40
+ "build": "tsc",
41
+ "lint": "eslint",
42
+ "lint:fix": "eslint --fix",
43
+ "prepack": "npm run build",
44
+ "test": "jest"
45
+ },
46
+ "engines": {
47
+ "node": ">=18"
48
+ },
49
+ "keywords": [
50
+ "snowplow",
51
+ "analytics"
52
+ ],
53
+ "types": "dist/index.d.ts",
54
+ "bin": {
55
+ "snowtype": "bin/bin"
56
+ }
57
+ }