@cobol-ts/project-crypto-local 0.0.0-stage → 0.0.57

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/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # @cobol-ts/project-crypto-local
2
+
3
+ Selects local key providers, sodium, ZIP, YAML, text storage and recovery workspace. Application configuration is parsed through injected ports.
@@ -0,0 +1,2 @@
1
+ export * from './src/crypto.project.local';
2
+ export * from './src/crypto.providers';
package/dist/index.js ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/crypto.project.local"), exports);
18
+ __exportStar(require("./src/crypto.providers"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA0C;AAC1C,yDAAsC"}
@@ -0,0 +1,31 @@
1
+ import type { ObjectStore } from '@cobol-ts/files';
2
+ import type { ProjectOptions, ProjectPaths, ResolveProjectPaths } from '@cobol-ts/project-context';
3
+ import { type CryptoProjectProviders } from '@cobol-ts/project-crypto';
4
+ export declare function initializeCrypto(services: {
5
+ readonly paths: ResolveProjectPaths;
6
+ }, options: ProjectOptions, cryptoConfig: string, storageRoot?: string, store?: ObjectStore, providers?: CryptoProjectProviders): Promise<{
7
+ packager: import("@cobol-ts/crypto-packager").StreamingCryptoPackager;
8
+ fileKeys: import("@cobol-ts/crypto-stream").FileKeyProvider;
9
+ signer: import("@cobol-ts/crypto-stream").ManifestSigner;
10
+ keyFiles: {
11
+ recipientPublic: string;
12
+ recipientPrivate: string;
13
+ signerPublic: string;
14
+ signerPrivate: string;
15
+ };
16
+ filename: string;
17
+ zipEntries: import("@cobol-ts/zip").ZipReader & import("@cobol-ts/zip").ZipWriter & import("@cobol-ts/zip").ZipEntries;
18
+ }>;
19
+ export declare function initializeCryptoFromPaths(paths: ProjectPaths, cryptoConfig: string, storageRoot?: string, store?: ObjectStore, providers?: CryptoProjectProviders): Promise<{
20
+ packager: import("@cobol-ts/crypto-packager").StreamingCryptoPackager;
21
+ fileKeys: import("@cobol-ts/crypto-stream").FileKeyProvider;
22
+ signer: import("@cobol-ts/crypto-stream").ManifestSigner;
23
+ keyFiles: {
24
+ recipientPublic: string;
25
+ recipientPrivate: string;
26
+ signerPublic: string;
27
+ signerPrivate: string;
28
+ };
29
+ filename: string;
30
+ zipEntries: import("@cobol-ts/zip").ZipReader & import("@cobol-ts/zip").ZipWriter & import("@cobol-ts/zip").ZipEntries;
31
+ }>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initializeCrypto = initializeCrypto;
4
+ exports.initializeCryptoFromPaths = initializeCryptoFromPaths;
5
+ const project_crypto_1 = require("@cobol-ts/project-crypto");
6
+ const crypto_providers_1 = require("./crypto.providers");
7
+ function initializeCrypto(services, options, cryptoConfig, storageRoot, store, providers = crypto_providers_1.localCryptoProjectProviders) {
8
+ return (0, project_crypto_1.initializeCrypto)(services, options, cryptoConfig, storageRoot, store, providers);
9
+ }
10
+ function initializeCryptoFromPaths(paths, cryptoConfig, storageRoot, store, providers = crypto_providers_1.localCryptoProjectProviders) {
11
+ return (0, project_crypto_1.initializeCryptoFromPaths)(paths, cryptoConfig, storageRoot, store, providers);
12
+ }
13
+ //# sourceMappingURL=crypto.project.local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.project.local.js","sourceRoot":"","sources":["../../src/crypto.project.local.ts"],"names":[],"mappings":";;AAKA,4CAEC;AACD,8DAEC;AARD,6DAA4J;AAC5J,yDAA8D;AAE9D,SAAgB,gBAAgB,CAAC,QAA6C,EAAC,OAAsB,EAAC,YAAmB,EAAC,WAAmB,EAAC,KAAkB,EAAC,YAAiC,8CAA2B;IACzN,OAAO,IAAA,iCAAc,EAAC,QAAQ,EAAC,OAAO,EAAC,YAAY,EAAC,WAAW,EAAC,KAAK,EAAC,SAAS,CAAC,CAAA;AACpF,CAAC;AACD,SAAgB,yBAAyB,CAAC,KAAkB,EAAC,YAAmB,EAAC,WAAmB,EAAC,KAAkB,EAAC,YAAiC,8CAA2B;IAChL,OAAO,IAAA,0CAAuB,EAAC,KAAK,EAAC,YAAY,EAAC,WAAW,EAAC,KAAK,EAAC,SAAS,CAAC,CAAA;AAClF,CAAC"}
@@ -0,0 +1,3 @@
1
+ import type { CryptoProjectProviders } from '@cobol-ts/project-crypto';
2
+ /** Native provider selection for the existing CLI configuration. */
3
+ export declare const localCryptoProjectProviders: CryptoProjectProviders;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.localCryptoProjectProviders = void 0;
4
+ const files_node_1 = require("@cobol-ts/files-node");
5
+ const crypto_stream_sodium_1 = require("@cobol-ts/crypto-stream-sodium");
6
+ const zip_yauzl_yazl_1 = require("@cobol-ts/zip-yauzl-yazl");
7
+ const yaml_jsyaml_1 = require("@cobol-ts/yaml-jsyaml");
8
+ /** Native provider selection for the existing CLI configuration. */
9
+ exports.localCryptoProjectProviders = {
10
+ text: files_node_1.nodeTextFiles,
11
+ yaml: yaml_jsyaml_1.jsYamlParser,
12
+ workspace: files_node_1.fileWorkspace,
13
+ store: root => new files_node_1.FileSystemObjectStore(root),
14
+ keys: (config, locations) => ({
15
+ fileKeys: new crypto_stream_sodium_1.LocalSealedBoxFileKeyProvider(locations.recipientPublic, locations.recipientPrivate, config.security.fileKeys.recipientKeyId),
16
+ signer: new crypto_stream_sodium_1.LocalEd25519ManifestSigner(config.security.signer.keyId, locations.signerPublic, locations.signerPrivate)
17
+ }),
18
+ zip: zip_yauzl_yazl_1.yauzlYazlZip,
19
+ cipher: crypto_stream_sodium_1.sodiumContentCipher
20
+ };
21
+ //# sourceMappingURL=crypto.providers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.providers.js","sourceRoot":"","sources":["../../src/crypto.providers.ts"],"names":[],"mappings":";;;AAAA,qDAAwF;AACxF,yEAA6H;AAC7H,6DAAqD;AAGrD,uDAAkD;AAClD,oEAAoE;AACvD,QAAA,2BAA2B,GAA2B;IAC/D,IAAI,EAAE,0BAAa;IACnB,IAAI,EAAE,0BAAY;IAClB,SAAS,EAAE,0BAAa;IACxB,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,kCAAqB,CAAC,IAAI,CAAC;IAC9C,IAAI,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;QAC1B,QAAQ,EAAE,IAAI,oDAA6B,CAAC,SAAS,CAAC,eAAe,EAAE,SAAS,CAAC,gBAAgB,EAC7F,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC;QAC5C,MAAM,EAAE,IAAI,iDAA0B,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,CAAC,YAAY,EAAE,SAAS,CAAC,aAAa,CAAC;KACxH,CAAC;IACF,GAAG,EAAE,6BAAY;IACjB,MAAM,EAAE,0CAAmB;CAC9B,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const files_node_1 = require("@cobol-ts/files-node");
4
+ const yaml_jsyaml_1 = require("@cobol-ts/yaml-jsyaml");
5
+ const crypto_providers_1 = require("./crypto.providers");
6
+ test('local assembly explicitly selects its storage, parser and recovery providers', () => {
7
+ expect(crypto_providers_1.localCryptoProjectProviders.text).toBe(files_node_1.nodeTextFiles);
8
+ expect(crypto_providers_1.localCryptoProjectProviders.yaml).toBe(yaml_jsyaml_1.jsYamlParser);
9
+ expect(crypto_providers_1.localCryptoProjectProviders.workspace).toBe(files_node_1.fileWorkspace);
10
+ expect(crypto_providers_1.localCryptoProjectProviders.store('unused-test-root')).toBeInstanceOf(files_node_1.FileSystemObjectStore);
11
+ });
12
+ //# sourceMappingURL=crypto.providers.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"crypto.providers.spec.js","sourceRoot":"","sources":["../../src/crypto.providers.spec.ts"],"names":[],"mappings":";;AAAA,qDAAwF;AACxF,uDAAkD;AAClD,yDAA8D;AAE9D,IAAI,CAAC,8EAA8E,EAAE,GAAG,EAAE;IACtF,MAAM,CAAC,8CAA2B,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,0BAAa,CAAC,CAAA;IAC5D,MAAM,CAAC,8CAA2B,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,0BAAY,CAAC,CAAA;IAC3D,MAAM,CAAC,8CAA2B,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,0BAAa,CAAC,CAAA;IACjE,MAAM,CAAC,8CAA2B,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,cAAc,CAAC,kCAAqB,CAAC,CAAA;AACvG,CAAC,CAAC,CAAA"}
package/index.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './src/crypto.project.local'
2
+ export * from './src/crypto.providers'
package/package.json CHANGED
@@ -1,6 +1,70 @@
1
1
  {
2
2
  "name": "@cobol-ts/project-crypto-local",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "description": "Local crypto project provider assembly",
4
+ "version": "0.0.57",
5
+ "main": "dist/index",
6
+ "types": "dist/index",
7
+ "browserslist": {
8
+ "development": [
9
+ "last 1 chrome version",
10
+ "last 1 firefox version",
11
+ "last 1 safari version"
12
+ ],
13
+ "production": [
14
+ ">0.2%",
15
+ "not dead",
16
+ "not op_mini all"
17
+ ]
18
+ },
19
+ "dependencies": {
20
+ "@cobol-ts/project-crypto": "0.0.57",
21
+ "@cobol-ts/crypto-stream-sodium": "0.0.57",
22
+ "@cobol-ts/project-context": "0.0.57",
23
+ "@cobol-ts/yaml-jsyaml": "0.0.57",
24
+ "@cobol-ts/zip-yauzl-yazl": "0.0.57",
25
+ "@cobol-ts/files": "0.0.57",
26
+ "@cobol-ts/zip": "0.0.57",
27
+ "@cobol-ts/files-node": "0.0.57"
28
+ },
29
+ "devDependencies": {
30
+ "typescript": "^5.2.2",
31
+ "@testing-library/jest-dom": "^6.1.4",
32
+ "@types/jest": "^29.0.0",
33
+ "@types/node": "^20.0.0",
34
+ "jest": "^29.0.0",
35
+ "ts-jest": "^29.0.0"
36
+ },
37
+ "eslintConfig": {
38
+ "extends": [
39
+ "react-app",
40
+ "react-app/jest"
41
+ ],
42
+ "overrides": [
43
+ {
44
+ "files": [
45
+ "**/*.stories.*"
46
+ ],
47
+ "rules": {
48
+ "import/no-anonymous-default-export": "off"
49
+ }
50
+ }
51
+ ]
52
+ },
53
+ "files": [
54
+ "dist/index.js",
55
+ "dist/index.d.ts",
56
+ "dist/src/",
57
+ "dist/",
58
+ "dist/**/*"
59
+ ],
60
+ "keywords": [
61
+ "indexing"
62
+ ],
63
+ "license": "MIT",
64
+ "module": "./index.ts",
65
+ "repository": "git@github.com:intellimaintain/intellimaintain.git",
66
+ "scripts": {
67
+ "test": "jest --config jest.config.json --env node",
68
+ "test:watch": "npm run test -- --watch"
69
+ }
6
70
  }