@apex-pub/convector-storage-stub 1.4.1-4-alpha.808cd029 → 1.5.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/CHANGELOG.md ADDED
@@ -0,0 +1,27 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ <a name="1.5.0"></a>
7
+ # 1.5.0 (2024-07-29)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * add storageOptions parameter to query method ([91f8eaf](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/91f8eaf))
13
+ * error handlers for testing and chaincode ([ef9bae6](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/ef9bae6))
14
+ * patch theledger library for fabric-chaincode-utils ([ba4ddb0](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/ba4ddb0))
15
+ * replace fabric utils for apex one without caught exception on logs ([06af7c3](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/06af7c3))
16
+ * update access public to the packages (pull request [#27](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/issues/27)) ([f2eebde](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/f2eebde))
17
+
18
+
19
+ ### Features
20
+
21
+ * Add documentation (pull request [#28](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/issues/28)) ([fc8ddbc](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/fc8ddbc))
22
+ * group packages and update package.json's ([3971b44](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/3971b44))
23
+ * in-chaincode adapter with tests ([4b380af](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/4b380af))
24
+ * Preparing versions for stable release (pull request [#25](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/issues/25)) ([1f5a876](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/1f5a876))
25
+ * Production readiness (pull request [#48](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/issues/48)) ([5bb7287](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/5bb7287))
26
+ * Rename logically (pull request [#21](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/issues/21)) ([d1a78ad](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/d1a78ad))
27
+ * transient and private data features ([3fa0442](https://github.com/hyperledger-labs/convector/tree/develop/%40worldsibu/convector-storage-stub/commit/3fa0442))
package/dist/src/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const tslib_1 = require("tslib");
3
+ var tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./stub-storage"), exports);
5
5
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import { ChaincodeStub } from 'fabric-shim';
2
2
  import { BaseStorage } from '@apex-pub/convector-core';
3
- import { StubHelper } from '@apex-pub/fabric-chaincode-utils';
3
+ import { StubHelper } from '@theledger/fabric-chaincode-utils';
4
4
  export declare class StubStorage extends BaseStorage {
5
5
  stubHelper: StubHelper;
6
6
  constructor(stub: ChaincodeStub);
@@ -1,48 +1,80 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StubStorage = void 0;
4
- const tslib_1 = require("tslib");
5
- const convector_core_1 = require("@apex-pub/convector-core");
6
- const fabric_chaincode_utils_1 = require("@apex-pub/fabric-chaincode-utils");
7
- fabric_chaincode_utils_1.Transform.isObject = data => data !== null && typeof data === 'object';
8
- class StubStorage extends convector_core_1.BaseStorage {
9
- constructor(stub) {
10
- super();
11
- this.stubHelper = new fabric_chaincode_utils_1.StubHelper(stub);
3
+ var tslib_1 = require("tslib");
4
+ var convector_core_1 = require("@apex-pub/convector-core");
5
+ var fabric_chaincode_utils_1 = require("@theledger/fabric-chaincode-utils");
6
+ fabric_chaincode_utils_1.Transform.isObject = function (data) { return data !== null && typeof data === 'object'; };
7
+ var StubStorage = (function (_super) {
8
+ tslib_1.__extends(StubStorage, _super);
9
+ function StubStorage(stub) {
10
+ var _this = _super.call(this) || this;
11
+ _this.stubHelper = new fabric_chaincode_utils_1.StubHelper(stub);
12
+ return _this;
12
13
  }
13
- query(query, storageOptions) {
14
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
15
- return yield this.stubHelper.getQueryResultAsList(query, storageOptions);
14
+ StubStorage.prototype.query = function (query, storageOptions) {
15
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
16
+ return tslib_1.__generator(this, function (_a) {
17
+ switch (_a.label) {
18
+ case 0: return [4, this.stubHelper.getQueryResultAsList(query, storageOptions)];
19
+ case 1: return [2, _a.sent()];
20
+ }
21
+ });
16
22
  });
17
- }
18
- get(id, storageOptions) {
19
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
- convector_core_1.InvalidIdError.test(id);
21
- return yield this.stubHelper.getStateAsObject(id, storageOptions);
23
+ };
24
+ StubStorage.prototype.get = function (id, storageOptions) {
25
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
26
+ return tslib_1.__generator(this, function (_a) {
27
+ switch (_a.label) {
28
+ case 0:
29
+ convector_core_1.InvalidIdError.test(id);
30
+ return [4, this.stubHelper.getStateAsObject(id, storageOptions)];
31
+ case 1: return [2, _a.sent()];
32
+ }
33
+ });
22
34
  });
23
- }
24
- set(id, content, storageOptions) {
25
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
26
- convector_core_1.InvalidIdError.test(id);
27
- return yield this.stubHelper.putState(id, JSON.stringify(content), storageOptions);
35
+ };
36
+ StubStorage.prototype.set = function (id, content, storageOptions) {
37
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
38
+ return tslib_1.__generator(this, function (_a) {
39
+ switch (_a.label) {
40
+ case 0:
41
+ convector_core_1.InvalidIdError.test(id);
42
+ return [4, this.stubHelper.putState(id, JSON.stringify(content), storageOptions)];
43
+ case 1: return [2, _a.sent()];
44
+ }
45
+ });
28
46
  });
29
- }
30
- delete(id, storageOptions = {}) {
31
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
32
- convector_core_1.InvalidIdError.test(id);
33
- if (storageOptions.privateCollection) {
34
- return yield this.stubHelper.getStub()
35
- .deletePrivateData(storageOptions.privateCollection, id);
36
- }
37
- return yield this.stubHelper.getStub().deleteState(id);
47
+ };
48
+ StubStorage.prototype.delete = function (id, storageOptions) {
49
+ if (storageOptions === void 0) { storageOptions = {}; }
50
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
51
+ return tslib_1.__generator(this, function (_a) {
52
+ switch (_a.label) {
53
+ case 0:
54
+ convector_core_1.InvalidIdError.test(id);
55
+ if (!storageOptions.privateCollection) return [3, 2];
56
+ return [4, this.stubHelper.getStub()
57
+ .deletePrivateData(storageOptions.privateCollection, id)];
58
+ case 1: return [2, _a.sent()];
59
+ case 2: return [4, this.stubHelper.getStub().deleteState(id)];
60
+ case 3: return [2, _a.sent()];
61
+ }
62
+ });
38
63
  });
39
- }
40
- history(id) {
41
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
42
- convector_core_1.InvalidIdError.test(id);
43
- return yield this.stubHelper.getHistoryForKeyAsList(id);
64
+ };
65
+ StubStorage.prototype.history = function (id) {
66
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
67
+ return tslib_1.__generator(this, function (_a) {
68
+ switch (_a.label) {
69
+ case 0:
70
+ convector_core_1.InvalidIdError.test(id);
71
+ return [4, this.stubHelper.getHistoryForKeyAsList(id)];
72
+ case 1: return [2, _a.sent()];
73
+ }
74
+ });
44
75
  });
45
- }
46
- }
76
+ };
77
+ return StubStorage;
78
+ }(convector_core_1.BaseStorage));
47
79
  exports.StubStorage = StubStorage;
48
80
  //# sourceMappingURL=stub-storage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"stub-storage.js","sourceRoot":"","sources":["../../src/stub-storage.ts"],"names":[],"mappings":";;;;AAGA,6DAAuE;AACvE,6EAAyE;AAIzE,kCAAS,CAAC,QAAQ,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,CAAC;AAEvE,MAAa,WAAY,SAAQ,4BAAW;IAG1C,YAAY,IAAmB;QAC7B,KAAK,EAAE,CAAC;QAER,IAAI,CAAC,UAAU,GAAG,IAAI,mCAAU,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAEY,KAAK,CAAC,KAAU,EAAE,cAAoB;;YACjD,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,KAAK,EAAE,cAAc,CAAC,CAAC;QAC3E,CAAC;KAAA;IAMY,GAAG,CAAC,EAAU,EAAE,cAAoB;;YAC/C,+BAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACxB,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,EAAE,EAAE,cAAc,CAAC,CAAC;QACpE,CAAC;KAAA;IAEY,GAAG,CAAC,EAAU,EAAE,OAAY,EAAE,cAAoB;;YAC7D,+BAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACxB,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,CAAC;QACrF,CAAC;KAAA;IAEY,MAAM,CAAC,EAAU,EAAE,iBAAsB,EAAE;;YACtD,+BAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAExB,IAAI,cAAc,CAAC,iBAAiB,EAAE;gBACpC,OAAO,M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,EAAE,cAAoB;;;;;wBAC7D,+BAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wBACjB,WAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC,EAAA;4BAAlF,WAAO,SAA2E,EAAC;;;;KACpF;IAEY,4BAAM,GAAnB,UAAoB,EAAU,EAAE,cAAwB;QAAxB,+BAAA,EAAA,mBAAwB;;;;;wBACtD,+BAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;6BAEpB,cAAc,CAAC,iBAAiB,EAAhC,cAAgC;wBAC3B,WAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE;iCACnC,iBAAiB,CAAC,cAAc,CAAC,iBAAiB,EAAE,EAAE,CAAC,EAAA;4BAD1D,WAAO,SACmD,EAAC;4BAGtD,WAAM,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC,EAAA;4BAAtD,WAAO,SAA+C,EAAC;;;;KACxD;IAEY,6BAAO,GAApB,UAAqB,EAAU;;;;;wBAC7B,+BAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;wBACjB,WAAM,IAAI,CAAC,UAAU,CAAC,sBAAsB,CAAC,EAAE,CAAC,EAAA;4BAAvD,WAAO,SAAgD,EAAC;;;;KACzD;IACH,kBAAC;AAAD,CAAC,AA1CD,CAAiC,4BAAW,GA0C3C;AA1CY,kCAAW"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apex-pub/convector-storage-stub",
3
- "version": "1.4.1-4-alpha.808cd029",
3
+ "version": "1.5.0",
4
4
  "description": "Convector STUB Storage class",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -41,11 +41,24 @@
41
41
  "docs:serve": "http-server docs"
42
42
  },
43
43
  "dependencies": {
44
- "@apex-pub/convector-core": "1.4.1-4-alpha.808cd029",
45
- "@apex-pub/fabric-chaincode-utils": "1.4.1-4-alpha.808cd029",
46
- "@apex-pub/fabric-shim-crypto-types": "1.4.1-4-alpha.808cd029"
44
+ "@apex-pub/convector-core": "^1.5.0",
45
+ "@apex-pub/fabric-chaincode-utils": "^5.1.1",
46
+ "@theledger/fabric-shim-crypto-types": "^1.0.5",
47
+ "tslib": "^1.9.0"
47
48
  },
48
49
  "devDependencies": {
49
- "@apex-pub/fabric-mock-stub": "1.4.1-4-alpha.808cd029"
50
+ "@theledger/fabric-mock-stub": "^5.0.0",
51
+ "@types/glob": "^7.1.1",
52
+ "@types/google-protobuf": "^3.7.3",
53
+ "@types/minimatch": "3.0.3",
54
+ "@types/node": "^13.13.4",
55
+ "http-server": "^0.11.1",
56
+ "mocha": "^5.0.3",
57
+ "npm-scripts-watcher": "^1.0.2",
58
+ "rimraf": "^2.6.2",
59
+ "ts-node": "^6.0.3",
60
+ "tslint": "^5.9.1",
61
+ "typedoc": "^0.11.1",
62
+ "typescript": "2.8.3"
50
63
  }
51
64
  }