@hotfusion/modeller 0.0.19 → 0.0.20

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hotfusion/modeller",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/types/index.d.ts",
@@ -1,51 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CipherAdapter = void 0;
4
- const core_1 = require("../core");
5
- const cipher_1 = require("@hotfusion/cipher");
6
- class CipherAdapter extends core_1.Adapter {
7
- cipher;
8
- ready;
9
- id;
10
- constructor(id) {
11
- super(id);
12
- this.id = id;
13
- // Password resolved inside Cipher from:
14
- // 1. VAULT_PASSWORD env var
15
- // 2. --password=xxx CLI arg
16
- this.cipher = new cipher_1.Cipher({
17
- path: `./vault/${id}`,
18
- password: process.env.VAULT_PASSWORD || '',
19
- //@ts-ignore
20
- locked: false,
21
- readonly: false,
22
- }, [{ name: id, schema: {} }, { name: 'trash', schema: {} }]);
23
- this.ready = this.cipher.ready();
24
- }
25
- async sync(id, doc) {
26
- await this.ready;
27
- const col = this.cipher.collection(id);
28
- const key = { id: doc._id.toString() };
29
- const existing = col.find(key);
30
- if (existing) {
31
- await col.update(key, doc);
32
- }
33
- else {
34
- await col.insert(key, doc);
35
- }
36
- }
37
- async pull() {
38
- await this.ready;
39
- const col = this.cipher.collection(this.id);
40
- return col.list()
41
- .map((entry) => {
42
- const id = Object.values(entry.key)[0];
43
- if (!id)
44
- return null;
45
- return col.unseal(id);
46
- })
47
- .filter(Boolean);
48
- }
49
- }
50
- exports.CipherAdapter = CipherAdapter;
51
- //# sourceMappingURL=cipher.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cipher.js","sourceRoot":"","sources":["../../src/adapters/cipher.ts"],"names":[],"mappings":";;;AAAA,kCA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AC;IAED,KAAK,CAAC,IAAI;QACN,MAAM,IAAI,CAAC,KAAK,CAAC;QACjB,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5C,OAAO,GAAG,CAAC,IAAI,EAAE;aACZ,GAAG,CAAC,CAAC,KAAS,EAAE,EAAE;YACf,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACvC,IAAI,CAAC,EAAE;gBAAE,OAAO,IAAI,CAAC;YACrB,OAAO,GAAG,CAAC,MAAM,CAAC,EAAS,CAAC,CAAC;QACjC,CAAC,CAAC;aACD,MAAM,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;CACJ;AA7CD,sCA6CC"}
@@ -1,16 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
4
- "properties": {
5
- "jti": { "type": "string" },
6
- "kind": { "type": "string" },
7
- "accountId": { "type": "string" },
8
- "clientId": { "type": "string" },
9
- "scope": { "type": "string" },
10
- "grantId": { "type": "string" },
11
- "expiresAt": { "type": "string" },
12
- "consumed": { "type": "boolean" },
13
- "payload": { "type": "string", "private": true }
14
- },
15
- "required": ["jti"]
16
- }
@@ -1,12 +0,0 @@
1
- import { Adapter } from '../core';
2
- export declare class CipherAdapter extends Adapter {
3
- private cipher;
4
- private ready;
5
- private id;
6
- constructor(id: string);
7
- sync(id: string, doc: Record<string, any> & {
8
- _id: string;
9
- }): Promise<void>;
10
- pull(): Promise<any[]>;
11
- }
12
- //# sourceMappingURL=cipher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cipher.d.ts","sourceRoot":"","sources":["../../../src/adapters/cipher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAKlC,qBAAa,aAAc,SAAQ,OAAO;IACtC,OAAO,CAAC,MAAM,CAAU;IACxB,OAAO,CAAC,KAAK,CAAkB;IAC/B,OAAO,CAAC,EAAE,CAAc;gBAEZ,EAAE,EAAE,MAAM;IAgBhB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAa3E,IAAI,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;CAW/B"}
@@ -1 +0,0 @@
1
- HgQ9tG/kAFKEAtisaBai8QDLFYPeZYCUHlaYbrRuTds=