@decaf-ts/for-fabric 0.1.74 → 0.1.76
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/for-fabric.cjs +1 -1
- package/dist/for-fabric.cjs.map +1 -1
- package/dist/for-fabric.js +1 -1
- package/dist/for-fabric.js.map +1 -1
- package/lib/cli-module.cjs +43 -13
- package/lib/cli-module.js.map +1 -1
- package/lib/cli-utils.cjs +10 -4
- package/lib/cli-utils.d.ts +2 -2
- package/lib/cli-utils.js.map +1 -1
- package/lib/client/FabricClientAdapter.cjs +36 -1
- package/lib/client/FabricClientAdapter.d.ts +12 -1
- package/lib/client/FabricClientAdapter.js.map +1 -1
- package/lib/client/FabricClientRepository.cjs +36 -0
- package/lib/client/FabricClientRepository.d.ts +7 -0
- package/lib/client/FabricClientRepository.js.map +1 -1
- package/lib/client/FabricClientStatement.cjs +321 -18
- package/lib/client/FabricClientStatement.d.ts +52 -1
- package/lib/client/FabricClientStatement.js.map +1 -1
- package/lib/client/collections/generation.cjs +7 -0
- package/lib/client/collections/generation.d.ts +2 -0
- package/lib/client/collections/generation.js.map +1 -1
- package/lib/client/fabric-fs.d.ts +1 -1
- package/lib/client/indexes/generation.cjs +37 -79
- package/lib/client/indexes/generation.d.ts +5 -12
- package/lib/client/indexes/generation.js.map +1 -1
- package/lib/client/utils.d.ts +1 -1
- package/lib/contract/Product.cjs +1 -1
- package/lib/contract/Product.js.map +1 -1
- package/lib/contract/SegregatedPrivateDocumentContract.cjs +30 -0
- package/lib/contract/SegregatedPrivateDocumentContract.d.ts +5 -0
- package/lib/contract/SegregatedPrivateDocumentContract.js.map +1 -0
- package/lib/contract/SegregatedSharedDocumentContract.cjs +30 -0
- package/lib/contract/SegregatedSharedDocumentContract.d.ts +5 -0
- package/lib/contract/SegregatedSharedDocumentContract.js.map +1 -0
- package/lib/contract/User.cjs +1 -1
- package/lib/contract/User.js.map +1 -1
- package/lib/contract/index.cjs +4 -0
- package/lib/contract/index.js.map +1 -1
- package/lib/contract/models/Market.cjs +1 -1
- package/lib/contract/models/Market.js.map +1 -1
- package/lib/contract/models/OtherProductShared.cjs +2 -2
- package/lib/contract/models/OtherProductShared.js.map +1 -1
- package/lib/contract/models/SegregatedDocument.cjs +94 -0
- package/lib/contract/models/SegregatedDocument.d.ts +18 -0
- package/lib/contract/models/SegregatedDocument.js.map +1 -0
- package/lib/contracts/ContractAdapter.cjs +177 -25
- package/lib/contracts/ContractAdapter.d.ts +8 -1
- package/lib/contracts/ContractAdapter.js.map +1 -1
- package/lib/contracts/ContractContext.cjs +29 -0
- package/lib/contracts/ContractContext.d.ts +16 -0
- package/lib/contracts/ContractContext.js.map +1 -1
- package/lib/contracts/FabricContractSequence.cjs +44 -0
- package/lib/contracts/FabricContractSequence.d.ts +10 -0
- package/lib/contracts/FabricContractSequence.js.map +1 -1
- package/lib/contracts/FabricContractStatement.cjs +1 -86
- package/lib/contracts/FabricContractStatement.d.ts +2 -4
- package/lib/contracts/FabricContractStatement.js.map +1 -1
- package/lib/contracts/crud/crud-contract.cjs +35 -0
- package/lib/contracts/crud/crud-contract.d.ts +7 -0
- package/lib/contracts/crud/crud-contract.js.map +1 -1
- package/lib/contracts/crud/serialized-crud-contract.cjs +63 -0
- package/lib/contracts/crud/serialized-crud-contract.d.ts +7 -0
- package/lib/contracts/crud/serialized-crud-contract.js.map +1 -1
- package/lib/contracts/types.d.ts +2 -1
- package/lib/esm/cli-module.js +45 -15
- package/lib/esm/cli-module.js.map +1 -1
- package/lib/esm/cli-utils.d.ts +2 -2
- package/lib/esm/cli-utils.js +10 -4
- package/lib/esm/cli-utils.js.map +1 -1
- package/lib/esm/client/FabricClientAdapter.d.ts +12 -1
- package/lib/esm/client/FabricClientAdapter.js +36 -1
- package/lib/esm/client/FabricClientAdapter.js.map +1 -1
- package/lib/esm/client/FabricClientRepository.d.ts +7 -0
- package/lib/esm/client/FabricClientRepository.js +36 -0
- package/lib/esm/client/FabricClientRepository.js.map +1 -1
- package/lib/esm/client/FabricClientStatement.d.ts +52 -1
- package/lib/esm/client/FabricClientStatement.js +323 -20
- package/lib/esm/client/FabricClientStatement.js.map +1 -1
- package/lib/esm/client/collections/generation.d.ts +2 -0
- package/lib/esm/client/collections/generation.js +6 -0
- package/lib/esm/client/collections/generation.js.map +1 -1
- package/lib/esm/client/fabric-fs.d.ts +1 -1
- package/lib/esm/client/indexes/generation.d.ts +5 -12
- package/lib/esm/client/indexes/generation.js +36 -80
- package/lib/esm/client/indexes/generation.js.map +1 -1
- package/lib/esm/client/utils.d.ts +1 -1
- package/lib/esm/contract/Product.js +1 -1
- package/lib/esm/contract/Product.js.map +1 -1
- package/lib/esm/contract/SegregatedPrivateDocumentContract.d.ts +5 -0
- package/lib/esm/contract/SegregatedPrivateDocumentContract.js +27 -0
- package/lib/esm/contract/SegregatedPrivateDocumentContract.js.map +1 -0
- package/lib/esm/contract/SegregatedSharedDocumentContract.d.ts +5 -0
- package/lib/esm/contract/SegregatedSharedDocumentContract.js +27 -0
- package/lib/esm/contract/SegregatedSharedDocumentContract.js.map +1 -0
- package/lib/esm/contract/User.js +1 -1
- package/lib/esm/contract/User.js.map +1 -1
- package/lib/esm/contract/index.js +4 -0
- package/lib/esm/contract/index.js.map +1 -1
- package/lib/esm/contract/models/Market.js +1 -1
- package/lib/esm/contract/models/Market.js.map +1 -1
- package/lib/esm/contract/models/OtherProductShared.js +4 -4
- package/lib/esm/contract/models/OtherProductShared.js.map +1 -1
- package/lib/esm/contract/models/SegregatedDocument.d.ts +18 -0
- package/lib/esm/contract/models/SegregatedDocument.js +91 -0
- package/lib/esm/contract/models/SegregatedDocument.js.map +1 -0
- package/lib/esm/contracts/ContractAdapter.d.ts +8 -1
- package/lib/esm/contracts/ContractAdapter.js +178 -26
- package/lib/esm/contracts/ContractAdapter.js.map +1 -1
- package/lib/esm/contracts/ContractContext.d.ts +16 -0
- package/lib/esm/contracts/ContractContext.js +29 -0
- package/lib/esm/contracts/ContractContext.js.map +1 -1
- package/lib/esm/contracts/FabricContractSequence.d.ts +10 -0
- package/lib/esm/contracts/FabricContractSequence.js +44 -0
- package/lib/esm/contracts/FabricContractSequence.js.map +1 -1
- package/lib/esm/contracts/FabricContractStatement.d.ts +2 -4
- package/lib/esm/contracts/FabricContractStatement.js +1 -86
- package/lib/esm/contracts/FabricContractStatement.js.map +1 -1
- package/lib/esm/contracts/crud/crud-contract.d.ts +7 -0
- package/lib/esm/contracts/crud/crud-contract.js +35 -0
- package/lib/esm/contracts/crud/crud-contract.js.map +1 -1
- package/lib/esm/contracts/crud/serialized-crud-contract.d.ts +7 -0
- package/lib/esm/contracts/crud/serialized-crud-contract.js +63 -0
- package/lib/esm/contracts/crud/serialized-crud-contract.js.map +1 -1
- package/lib/esm/contracts/types.d.ts +2 -1
- package/lib/esm/shared/decorators.d.ts +23 -4
- package/lib/esm/shared/decorators.js +147 -53
- package/lib/esm/shared/decorators.js.map +1 -1
- package/lib/esm/shared/overrides/overrides.js +20 -13
- package/lib/esm/shared/overrides/overrides.js.map +1 -1
- package/lib/esm/shared/types.d.ts +2 -0
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/shared/decorators.cjs +149 -53
- package/lib/shared/decorators.d.ts +23 -4
- package/lib/shared/decorators.js.map +1 -1
- package/lib/shared/overrides/overrides.cjs +20 -13
- package/lib/shared/overrides/overrides.js.map +1 -1
- package/lib/shared/types.d.ts +2 -0
- package/lib/version.cjs +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +3 -5
|
@@ -1,85 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.generateModelIndexes = generateModelIndexes;
|
|
4
|
+
exports.generateModelDesignDocs = generateModelDesignDocs;
|
|
4
5
|
exports.readModelFile = readModelFile;
|
|
5
6
|
exports.readModelFolders = readModelFolders;
|
|
6
7
|
exports.writeIndexes = writeIndexes;
|
|
7
|
-
|
|
8
|
+
exports.writeDesignDocs = writeDesignDocs;
|
|
8
9
|
const for_couchdb_1 = require("@decaf-ts/for-couchdb");
|
|
9
10
|
const decorator_validation_1 = require("@decaf-ts/decorator-validation");
|
|
10
|
-
function
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
function addIndex(accum, fields, direction, compositions) {
|
|
19
|
-
const tableField = fields.pop();
|
|
20
|
-
if (tableField && tableField !== for_couchdb_1.CouchDBKeys.TABLE) {
|
|
21
|
-
fields.push(tableField);
|
|
22
|
-
}
|
|
23
|
-
else if (tableField === for_couchdb_1.CouchDBKeys.TABLE) {
|
|
24
|
-
fields.unshift(tableField);
|
|
11
|
+
function ensureDirectoryExistence(filePath) {
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
13
|
+
const fs = require("fs");
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
15
|
+
const path = require("path");
|
|
16
|
+
const dirname = path.dirname(filePath);
|
|
17
|
+
if (fs.existsSync(dirname)) {
|
|
18
|
+
return true;
|
|
25
19
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
...fields,
|
|
29
|
-
...(compositions || []),
|
|
30
|
-
];
|
|
31
|
-
if (direction)
|
|
32
|
-
f = f.reduce((accum, el) => {
|
|
33
|
-
const entry = {};
|
|
34
|
-
entry[el] = direction;
|
|
35
|
-
accum.push(entry);
|
|
36
|
-
return accum;
|
|
37
|
-
}, []);
|
|
38
|
-
const index = {
|
|
39
|
-
index: {
|
|
40
|
-
fields: f,
|
|
41
|
-
},
|
|
42
|
-
name: name,
|
|
43
|
-
ddoc: name,
|
|
44
|
-
type: "json",
|
|
45
|
-
};
|
|
46
|
-
accum[name] = index;
|
|
20
|
+
ensureDirectoryExistence(dirname);
|
|
21
|
+
fs.mkdirSync(dirname);
|
|
47
22
|
}
|
|
48
|
-
function generateModelIndexes(m
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
ddoc: tableName,
|
|
57
|
-
type: "json",
|
|
58
|
-
};
|
|
59
|
-
const result = {};
|
|
60
|
-
const modelIndexes = decorator_validation_1.Model.indexes(m);
|
|
61
|
-
for (const prop of Object.keys(modelIndexes)) {
|
|
62
|
-
for (const [, dec] of Object.entries(modelIndexes[prop])) {
|
|
63
|
-
const directions = dec
|
|
64
|
-
.directions;
|
|
65
|
-
const compositions = dec.compositions;
|
|
66
|
-
const fields = [prop, for_couchdb_1.CouchDBKeys.TABLE];
|
|
67
|
-
addIndex(result, fields);
|
|
68
|
-
if (compositions && compositions.length)
|
|
69
|
-
addIndex(result, fields, undefined, compositions);
|
|
70
|
-
if (directions && directions.length) {
|
|
71
|
-
directions.forEach((d) => {
|
|
72
|
-
addIndex(result, fields, d);
|
|
73
|
-
if (compositions && compositions.length)
|
|
74
|
-
addIndex(result, fields, d, compositions);
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
Object.entries(result).forEach(([key, value]) => {
|
|
80
|
-
indexes[key] = value;
|
|
23
|
+
function generateModelIndexes(m) {
|
|
24
|
+
return (0, for_couchdb_1.generateIndexes)([m]);
|
|
25
|
+
}
|
|
26
|
+
function generateModelDesignDocs(m, accum) {
|
|
27
|
+
const views = (0, for_couchdb_1.generateViews)([m]);
|
|
28
|
+
const storage = accum || {};
|
|
29
|
+
views.forEach((doc) => {
|
|
30
|
+
storage[doc._id] = doc;
|
|
81
31
|
});
|
|
82
|
-
return
|
|
32
|
+
return views;
|
|
83
33
|
}
|
|
84
34
|
function readModelFile(file) {
|
|
85
35
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
@@ -120,18 +70,26 @@ function writeIndexes(indexes, p = process.cwd(), collection) {
|
|
|
120
70
|
const fs = require("fs");
|
|
121
71
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
122
72
|
const path = require("path");
|
|
123
|
-
function ensureDirectoryExistence(filePath) {
|
|
124
|
-
const dirname = path.dirname(filePath);
|
|
125
|
-
if (fs.existsSync(dirname)) {
|
|
126
|
-
return true;
|
|
127
|
-
}
|
|
128
|
-
ensureDirectoryExistence(dirname);
|
|
129
|
-
fs.mkdirSync(dirname);
|
|
130
|
-
}
|
|
131
73
|
indexes.forEach((index) => {
|
|
132
74
|
const file = path.resolve(path.join(p, `./META-INF/statedb/couchdb/${collection ? `collections/${collection}/` : ""}indexes/${index.name}.json`));
|
|
133
75
|
ensureDirectoryExistence(file);
|
|
134
76
|
fs.writeFileSync(file, JSON.stringify(index, undefined, 2));
|
|
135
77
|
});
|
|
136
78
|
}
|
|
79
|
+
function writeDesignDocs(designDocs, p = process.cwd(), collection) {
|
|
80
|
+
if (!designDocs.length)
|
|
81
|
+
return;
|
|
82
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
83
|
+
const fs = require("fs");
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
85
|
+
const path = require("path");
|
|
86
|
+
designDocs.forEach((doc) => {
|
|
87
|
+
const docId = doc._id.replace(/^_design\//, "");
|
|
88
|
+
const file = path.resolve(path.join(p, `./META-INF/statedb/couchdb/${collection ? `collections/${collection}/` : ""}design_docs/${docId}.json`));
|
|
89
|
+
ensureDirectoryExistence(file);
|
|
90
|
+
const payload = { ...doc };
|
|
91
|
+
delete payload._rev;
|
|
92
|
+
fs.writeFileSync(file, JSON.stringify(payload, undefined, 2));
|
|
93
|
+
});
|
|
94
|
+
}
|
|
137
95
|
//# sourceMappingURL=generation.js.map
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { OrderDirection } from "@decaf-ts/core";
|
|
2
1
|
import { Constructor } from "@decaf-ts/decoration";
|
|
2
|
+
import { CreateIndexRequest, CouchDBDesignDoc } from "@decaf-ts/for-couchdb";
|
|
3
3
|
import { Model, ModelConstructor } from "@decaf-ts/decorator-validation";
|
|
4
|
-
export type Index =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[k: string]: OrderDirection;
|
|
8
|
-
};
|
|
9
|
-
};
|
|
10
|
-
ddoc?: string;
|
|
11
|
-
name: string;
|
|
12
|
-
type: "json";
|
|
13
|
-
};
|
|
14
|
-
export declare function generateModelIndexes<M extends Model>(m: Constructor<M>, accum?: Record<string, any>): Index[];
|
|
4
|
+
export type Index = CreateIndexRequest;
|
|
5
|
+
export declare function generateModelIndexes<M extends Model>(m: Constructor<M>): Index[];
|
|
6
|
+
export declare function generateModelDesignDocs<M extends Model>(m: Constructor<M>, accum?: Record<string, CouchDBDesignDoc>): CouchDBDesignDoc[];
|
|
15
7
|
export declare function readModelFile(file: any): ModelConstructor<any>[];
|
|
16
8
|
export declare function readModelFolders(...folders: string[]): Promise<ModelConstructor<any>[]>;
|
|
17
9
|
export declare function writeIndexes(indexes: Index[], p?: string, collection?: string): void;
|
|
10
|
+
export declare function writeDesignDocs(designDocs: CouchDBDesignDoc[], p?: string, collection?: string): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generation.js","sourceRoot":"","sources":["../../../src/client/indexes/generation.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"generation.js","sourceRoot":"","sources":["../../../src/client/indexes/generation.ts"],"names":[],"mappings":";;AAwBA,oDAIC;AAED,0DAUC;AAED,sCAgBC;AAED,4CAoBC;AAED,oCAoBC;AAED,0CAwBC;AA/HD,uDAK+B;AAC/B,yEAAyE;AAIzE,SAAS,wBAAwB,CAAC,QAAgB;IAChD,iEAAiE;IACjE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,iEAAiE;IACjE,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC7B,MAAM,OAAO,GAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC/C,IAAI,EAAE,CAAC,UAAU,CA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,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAgB,eAAe,CAC7B,UAA8B,EAC9B,IAAY,OAAO,CAAC,GAAG,EAAE,EACzB,UAAmB;IAEnB,IAAI,CAAC,UAAU,CAAC,MAAM;QAAE,OAAO;IAC/B,iEAAiE;IACjE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACzB,iEAAiE;IACjE,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAE7B,UAAU,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACzB,MAAM,KAAK,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC;QAChD,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CACvB,IAAI,CAAC,IAAI,CACP,CAAC,EACD,8BAA8B,UAAU,CAAC,CAAC,CAAC,eAAe,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,eAAe,KAAK,OAAO,CACxG,CACF,CAAC;QACF,wBAAwB,CAAC,IAAI,CAAC,CAAC;QAC/B,MAAM,OAAO,GAAG,EAAE,GAAG,GAAG,EAAE,CAAC;QAC3B,OAAO,OAAO,CAAC,IAAI,CAAC;QACpB,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,CAAC;IAChE,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/lib/client/utils.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export declare class CoreUtils {
|
|
|
30
30
|
* @param {string|Buffer} contentOrPath - Path to a file on disk or an already-loaded Buffer
|
|
31
31
|
* @return {Promise<string|Uint8Array|Buffer>} The file content as a Buffer/string depending on reader
|
|
32
32
|
*/
|
|
33
|
-
static readFile(contentOrPath: string | Buffer): Promise<
|
|
33
|
+
static readFile(contentOrPath: string | Buffer): Promise<NonSharedBuffer>;
|
|
34
34
|
/**
|
|
35
35
|
* @description Create a Fabric CA User object with enrollment
|
|
36
36
|
* @summary Constructs a fabric-common User, sets a crypto suite, imports the provided private key, and sets enrollment with certificate and MSP ID.
|
package/lib/contract/Product.cjs
CHANGED
|
@@ -23,7 +23,7 @@ let Product = class Product extends FabricIdentifiedBaseModel_1.FabricIdentified
|
|
|
23
23
|
};
|
|
24
24
|
exports.Product = Product;
|
|
25
25
|
__decorate([
|
|
26
|
-
(0, core_1.pk)({ type:
|
|
26
|
+
(0, core_1.pk)({ type: Number, generated: true }),
|
|
27
27
|
__metadata("design:type", Number)
|
|
28
28
|
], Product.prototype, "productCode", void 0);
|
|
29
29
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Product.js","sourceRoot":"","sources":["../../src/contract/Product.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yEAAyE;AACzE,yEAAuD;AACvD,yCAAmD;AACnD,yDAAoD;AACpD,+FAAsF;AACtF,qDAA4C;AAKrC,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,qDAAyB;IAQpD,YAAY,IAAwB;QAClC,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;CACF,CAAA;AAXY,0BAAO;AAElB;IADC,IAAA,SAAE,EAAC,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"Product.js","sourceRoot":"","sources":["../../src/contract/Product.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yEAAyE;AACzE,yEAAuD;AACvD,yCAAmD;AACnD,yDAAoD;AACpD,+FAAsF;AACtF,qDAA4C;AAKrC,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,qDAAyB;IAQpD,YAAY,IAAwB;QAClC,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;CACF,CAAA;AAXY,0BAAO;AAElB;IADC,IAAA,SAAE,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;4CACjB;AAIrB;IAFC,IAAA,aAAM,GAAE;IACR,IAAA,+BAAQ,GAAE;;6CACW;kBANX,OAAO;IAHnB,IAAA,iBAAI,EAAC,yBAAa,CAAC;IACnB,IAAA,YAAK,GAAE;IACP,IAAA,4BAAK,GAAE;;GACK,OAAO,CAWnB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var SegregatedPrivateDocumentContract_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SegregatedPrivateDocumentContract = void 0;
|
|
14
|
+
const fabric_contract_api_1 = require("fabric-contract-api");
|
|
15
|
+
const serialized_crud_contract_1 = require("./../contracts/crud/serialized-crud-contract.cjs");
|
|
16
|
+
const SegregatedDocument_1 = require("./models/SegregatedDocument.cjs");
|
|
17
|
+
let SegregatedPrivateDocumentContract = SegregatedPrivateDocumentContract_1 = class SegregatedPrivateDocumentContract extends serialized_crud_contract_1.SerializedCrudContract {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(SegregatedPrivateDocumentContract_1.name, SegregatedDocument_1.SegregatedPrivateDocument);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.SegregatedPrivateDocumentContract = SegregatedPrivateDocumentContract;
|
|
23
|
+
exports.SegregatedPrivateDocumentContract = SegregatedPrivateDocumentContract = SegregatedPrivateDocumentContract_1 = __decorate([
|
|
24
|
+
(0, fabric_contract_api_1.Info)({
|
|
25
|
+
title: "SegregatedPrivateDocumentContract",
|
|
26
|
+
description: "Handles CRUD for documents split across segregated private collections.",
|
|
27
|
+
}),
|
|
28
|
+
__metadata("design:paramtypes", [])
|
|
29
|
+
], SegregatedPrivateDocumentContract);
|
|
30
|
+
//# sourceMappingURL=SegregatedPrivateDocumentContract.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SerializedCrudContract } from "../contracts/crud/serialized-crud-contract";
|
|
2
|
+
import { SegregatedPrivateDocument } from "./models/SegregatedDocument";
|
|
3
|
+
export declare class SegregatedPrivateDocumentContract extends SerializedCrudContract<SegregatedPrivateDocument> {
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegregatedPrivateDocumentContract.js","sourceRoot":"","sources":["../../src/contract/SegregatedPrivateDocumentContract.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,+FAAoF;AACpF,wEAAwE;AAMjE,IAAM,iCAAiC,yCAAvC,MAAM,iCAAkC,SAAQ,iDAEtD;IACC;QACE,KAAK,CACH,mCAAiC,CAAC,IAAI,EACtC,8CAAyB,CAC1B,CAAC;IACJ,CAAC;CACF,CAAA;AATY,8EAAiC;4CAAjC,iCAAiC;IAJ7C,IAAA,0BAAI,EAAC;QACJ,KAAK,EAAE,mCAAmC;QAC1C,WAAW,EAAE,yEAAyE;KACvF,CAAC;;GACW,iCAAiC,CAS7C"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var SegregatedSharedDocumentContract_1;
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.SegregatedSharedDocumentContract = void 0;
|
|
14
|
+
const fabric_contract_api_1 = require("fabric-contract-api");
|
|
15
|
+
const serialized_crud_contract_1 = require("./../contracts/crud/serialized-crud-contract.cjs");
|
|
16
|
+
const SegregatedDocument_1 = require("./models/SegregatedDocument.cjs");
|
|
17
|
+
let SegregatedSharedDocumentContract = SegregatedSharedDocumentContract_1 = class SegregatedSharedDocumentContract extends serialized_crud_contract_1.SerializedCrudContract {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(SegregatedSharedDocumentContract_1.name, SegregatedDocument_1.SegregatedSharedDocument);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
exports.SegregatedSharedDocumentContract = SegregatedSharedDocumentContract;
|
|
23
|
+
exports.SegregatedSharedDocumentContract = SegregatedSharedDocumentContract = SegregatedSharedDocumentContract_1 = __decorate([
|
|
24
|
+
(0, fabric_contract_api_1.Info)({
|
|
25
|
+
title: "SegregatedSharedDocumentContract",
|
|
26
|
+
description: "Handles CRUD for documents split across segregated shared collections.",
|
|
27
|
+
}),
|
|
28
|
+
__metadata("design:paramtypes", [])
|
|
29
|
+
], SegregatedSharedDocumentContract);
|
|
30
|
+
//# sourceMappingURL=SegregatedSharedDocumentContract.js.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { SerializedCrudContract } from "../contracts/crud/serialized-crud-contract";
|
|
2
|
+
import { SegregatedSharedDocument } from "./models/SegregatedDocument";
|
|
3
|
+
export declare class SegregatedSharedDocumentContract extends SerializedCrudContract<SegregatedSharedDocument> {
|
|
4
|
+
constructor();
|
|
5
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegregatedSharedDocumentContract.js","sourceRoot":"","sources":["../../src/contract/SegregatedSharedDocumentContract.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,+FAAoF;AACpF,wEAAuE;AAMhE,IAAM,gCAAgC,wCAAtC,MAAM,gCAAiC,SAAQ,iDAErD;IACC;QACE,KAAK,CACH,kCAAgC,CAAC,IAAI,EACrC,6CAAwB,CACzB,CAAC;IACJ,CAAC;CACF,CAAA;AATY,4EAAgC;2CAAhC,gCAAgC;IAJ5C,IAAA,0BAAI,EAAC;QACJ,KAAK,EAAE,kCAAkC;QACzC,WAAW,EAAE,wEAAwE;KACtF,CAAC;;GACW,gCAAgC,CAS5C"}
|
package/lib/contract/User.cjs
CHANGED
|
@@ -21,7 +21,7 @@ let User = class User extends decorator_validation_1.Model {
|
|
|
21
21
|
};
|
|
22
22
|
exports.User = User;
|
|
23
23
|
__decorate([
|
|
24
|
-
(0, core_1.pk)({ type:
|
|
24
|
+
(0, core_1.pk)({ type: Number, generated: true }),
|
|
25
25
|
__metadata("design:type", Number)
|
|
26
26
|
], User.prototype, "id", void 0);
|
|
27
27
|
__decorate([
|
package/lib/contract/User.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../src/contract/User.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yEAA8D;AAC9D,yCAAmD;AACnD,yDAAoD;AACpD,qDAA4C;AAKrC,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,4BAAK;IAO7B,YAAY,IAAqB;QAC/B,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;CACF,CAAA;AAVY,oBAAI;AAEf;IADC,IAAA,SAAE,EAAC,EAAE,IAAI,EAAE,
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../src/contract/User.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yEAA8D;AAC9D,yCAAmD;AACnD,yDAAoD;AACpD,qDAA4C;AAKrC,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,4BAAK;IAO7B,YAAY,IAAqB;QAC/B,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;CACF,CAAA;AAVY,oBAAI;AAEf;IADC,IAAA,SAAE,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;;gCAC1B;AAGZ;IADC,IAAA,aAAM,GAAE;;kCACK;eALH,IAAI;IAHhB,IAAA,iBAAI,EAAC,yBAAa,CAAC;IACnB,IAAA,YAAK,GAAE;IACP,IAAA,4BAAK,GAAE;;GACK,IAAI,CAUhB"}
|
package/lib/contract/index.cjs
CHANGED
|
@@ -8,11 +8,15 @@ const BatchContract_1 = require("./BatchContract.cjs");
|
|
|
8
8
|
const UserContract_1 = require("./UserContract.cjs");
|
|
9
9
|
const AddressContract_1 = require("./AddressContract.cjs");
|
|
10
10
|
const OtherProductSharedContract_1 = require("./OtherProductSharedContract.cjs");
|
|
11
|
+
const SegregatedPrivateDocumentContract_1 = require("./SegregatedPrivateDocumentContract.cjs");
|
|
12
|
+
const SegregatedSharedDocumentContract_1 = require("./SegregatedSharedDocumentContract.cjs");
|
|
11
13
|
exports.contracts = [
|
|
12
14
|
ProductContract_1.ProductContract,
|
|
13
15
|
BatchContract_1.BatchContract,
|
|
14
16
|
UserContract_1.UserContract,
|
|
15
17
|
AddressContract_1.AddressContract,
|
|
16
18
|
OtherProductSharedContract_1.OtherProductSharedContract,
|
|
19
|
+
SegregatedPrivateDocumentContract_1.SegregatedPrivateDocumentContract,
|
|
20
|
+
SegregatedSharedDocumentContract_1.SegregatedSharedDocumentContract,
|
|
17
21
|
];
|
|
18
22
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":";;;AAAA,yEAAqE;AACrE,OAAO,CAAC,GAAG,CAAC,kCAAkB,CAAC,IAAI,CAAC,CAAC;AAErC,2DAAoD;AACpD,uDAAgD;AAChD,qDAA8C;AAC9C,2DAAoD;AACpD,iFAA0E;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/contract/index.ts"],"names":[],"mappings":";;;AAAA,yEAAqE;AACrE,OAAO,CAAC,GAAG,CAAC,kCAAkB,CAAC,IAAI,CAAC,CAAC;AAErC,2DAAoD;AACpD,uDAAgD;AAChD,qDAA8C;AAC9C,2DAAoD;AACpD,iFAA0E;AAC1E,+FAAwF;AACxF,6FAAsF;AAEzE,QAAA,SAAS,GAAwB;IAC5C,iCAAe;IACf,6BAAa;IACb,2BAAY;IACZ,iCAAe;IACf,uDAA0B;IAC1B,qEAAiC;IACjC,mEAAgC;CACjC,CAAC"}
|
|
@@ -25,7 +25,7 @@ let Market = class Market extends BaseIdentifiedModel_1.BaseIdentifiedModel {
|
|
|
25
25
|
};
|
|
26
26
|
exports.Market = Market;
|
|
27
27
|
__decorate([
|
|
28
|
-
(0, core_1.pk)({ type:
|
|
28
|
+
(0, core_1.pk)({ type: String, generated: false }),
|
|
29
29
|
(0, db_decorators_1.composed)(["productCode", "marketId"], ":", true),
|
|
30
30
|
(0, decoration_1.description)("Unique identifier composed of product code and market ID."),
|
|
31
31
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Market.js","sourceRoot":"","sources":["../../../src/contract/models/Market.ts"],"names":[],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,IAAA,gCAAS,EAAC,CAAC,CAAC;IACZ,IAAA,gCAAS,EAAC,CAAC,CAAC;IACZ,IAAA,wBAAW,EACV,0EAA0E,CAC3E;;4CACqB;AAItB;IAFC,IAAA,aAAM,GAAE;IACR,IAAA,wBAAW,EAAC,mDAAmD,CAAC;;uCAChD;AAMjB;IAJC,IAAA,aAAM,GAAE;IACR,IAAA,wBAAW,EACV,sEAAsE,CACvE;;+CACwB;AAMzB;IAJC,IAAA,aAAM,GAAE;IACR,IAAA,wBAAW,EACV,4EAA4E,CAC7E;;0CACmB;iBAzCT,MAAM;IAJlB,IAAA,wBAAW,EAAC,uCAAuC,CAAC;IACpD,IAAA,iBAAI,EAAC,qBAAa,CAAC;IACnB,IAAA,YAAK,EAAC,sBAAU,CAAC,MAAM,CAAC;IACxB,IAAA,4BAAK,GAAE;;GACK,MAAM,CA8ClB"}
|
|
@@ -29,7 +29,7 @@ exports.OtherProductShared = OtherProductShared;
|
|
|
29
29
|
__decorate([
|
|
30
30
|
(0, core_1.pk)(),
|
|
31
31
|
(0, gtin_1.gtin)(),
|
|
32
|
-
(0, index_1.mirror)("
|
|
32
|
+
(0, index_1.mirror)("mirror-collection", (mspId) => mspId === "main-org"),
|
|
33
33
|
(0, decorators_1.audit)(OtherProductShared),
|
|
34
34
|
__metadata("design:type", String)
|
|
35
35
|
], OtherProductShared.prototype, "productCode", void 0);
|
|
@@ -64,7 +64,7 @@ __decorate([
|
|
|
64
64
|
__metadata("design:type", String)
|
|
65
65
|
], OtherProductShared.prototype, "ownedBy", void 0);
|
|
66
66
|
exports.OtherProductShared = OtherProductShared = __decorate([
|
|
67
|
-
(0, index_1.sharedData)(index_1.
|
|
67
|
+
(0, index_1.sharedData)((0, index_1.NamespaceCollection)("decaf-namespace")),
|
|
68
68
|
(0, decoration_1.uses)(index_1.FabricFlavour)
|
|
69
69
|
// @BlockOperations([OperationKeys.DELETE])
|
|
70
70
|
,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtherProductShared.js","sourceRoot":"","sources":["../../../src/contract/models/OtherProductShared.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yEAAiE;AACjE,
|
|
1
|
+
{"version":3,"file":"OtherProductShared.js","sourceRoot":"","sources":["../../../src/contract/models/OtherProductShared.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yEAAiE;AACjE,yCAA0E;AAC1E,oFAAoF;AACpF,qDAA4C;AAC5C,mEAA4D;AAC5D,qCAA8B;AAC9B,iDAAqC;AACrC,oDAM4B;AAC5B,2DAAkD;AAO3C,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,yCAAmB;IAgEzD,YAAY,IAAmC;QAC7C,KAAK,CAAC,IAAI,CAAC,CAAC;QA3Cd,kBAAa,GAAY,KAAK,CAAC;IA4C/B,CAAC;CACF,CAAA;AAnEY,gDAAkB;AAK7B;IAJC,IAAA,SAAE,GAAE;IACJ,IAAA,WAAI,GAAE;IACN,IAAA,cAAM,EAAC,mBAAmB,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,KAAK,UAAU,CAAC;IACpE,IAAA,kBAAK,EAAC,kBAAkB,CAAC;;uDACL;AAKrB;IAHC,IAAA,aAAM,GAAE;IACR,IAAA,+BAAQ,GAAE;IACV,IAAA,YAAK,EAAC,CAAC,qBAAc,CAAC,GAAG,EAAE,qBAAc,CAAC,GAAG,CAAC,CAAC;;wDAC1B;AAKtB;IAHC,IAAA,aAAM,GAAE;IACR,IAAA,+BAAQ,GAAE;IACV,IAAA,YAAK,EAAC,CAAC,qBAAc,CAAC,GAAG,EAAE,qBAAc,CAAC,GAAG,CAAC,CAAC;;gEAClB;AAG9B;IADC,IAAA,aAAM,GAAE;;gEACqB;AAI9B;IAFC,IAAA,aAAM,GAAE;IACR,IAAA,YAAK,EAAC,CAAC,qBAAc,CAAC,GAAG,EAAE,qBAAc,CAAC,GAAG,CAAC,CAAC;;yDACjB;AAsB/B;IADC,IAAA,uBAAO,GAAE;;mDACO;AAkBjB;IAFC,IAAA,aAAM,GAAE;IACR,IAAA,eAAO,GAAE;;mDACO;6BA9DN,kBAAkB;IAL9B,IAAA,kBAAU,EAAC,IAAA,2BAAmB,EAAC,iBAAiB,CAAC,CAAC;IAClD,IAAA,iBAAI,EAAC,qBAAa,CAAC;IACpB,2CAA2C;;IAC1C,IAAA,YAAK,EAAC,sBAAsB,CAAC;IAC7B,IAAA,4BAAK,GAAE;;GACK,kBAAkB,CAmE9B"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.SegregatedSharedDocument = exports.SegregatedPrivateDocument = void 0;
|
|
13
|
+
const decorator_validation_1 = require("@decaf-ts/decorator-validation");
|
|
14
|
+
const core_1 = require("@decaf-ts/core");
|
|
15
|
+
const decoration_1 = require("@decaf-ts/decoration");
|
|
16
|
+
const index_1 = require("./../../shared/index.cjs");
|
|
17
|
+
const BaseIdentifiedModel_1 = require("./BaseIdentifiedModel.cjs");
|
|
18
|
+
const PRIVATE_COLLECTION_A = "segregatedPrivateCollectionA";
|
|
19
|
+
const PRIVATE_COLLECTION_B = "segregatedPrivateCollectionB";
|
|
20
|
+
const SHARED_COLLECTION_A = "segregatedSharedCollectionA";
|
|
21
|
+
const SHARED_COLLECTION_B = "segregatedSharedCollectionB";
|
|
22
|
+
let SegregatedPrivateDocument = class SegregatedPrivateDocument extends BaseIdentifiedModel_1.BaseIdentifiedModel {
|
|
23
|
+
constructor(args) {
|
|
24
|
+
super(args);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
exports.SegregatedPrivateDocument = SegregatedPrivateDocument;
|
|
28
|
+
__decorate([
|
|
29
|
+
(0, core_1.pk)(),
|
|
30
|
+
__metadata("design:type", String)
|
|
31
|
+
], SegregatedPrivateDocument.prototype, "id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
(0, core_1.column)(),
|
|
34
|
+
(0, decorator_validation_1.required)(),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], SegregatedPrivateDocument.prototype, "title", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, core_1.column)(),
|
|
39
|
+
(0, index_1.privateData)(PRIVATE_COLLECTION_A),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], SegregatedPrivateDocument.prototype, "privateNoteA", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
(0, core_1.column)(),
|
|
44
|
+
(0, index_1.privateData)(PRIVATE_COLLECTION_B),
|
|
45
|
+
__metadata("design:type", String)
|
|
46
|
+
], SegregatedPrivateDocument.prototype, "privateNoteB", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, core_1.column)(),
|
|
49
|
+
(0, index_1.ownedBy)(),
|
|
50
|
+
__metadata("design:type", String)
|
|
51
|
+
], SegregatedPrivateDocument.prototype, "owner", void 0);
|
|
52
|
+
exports.SegregatedPrivateDocument = SegregatedPrivateDocument = __decorate([
|
|
53
|
+
(0, decoration_1.uses)(index_1.FabricFlavour),
|
|
54
|
+
(0, core_1.table)("segregated_private_document"),
|
|
55
|
+
(0, decorator_validation_1.model)(),
|
|
56
|
+
__metadata("design:paramtypes", [Object])
|
|
57
|
+
], SegregatedPrivateDocument);
|
|
58
|
+
let SegregatedSharedDocument = class SegregatedSharedDocument extends BaseIdentifiedModel_1.BaseIdentifiedModel {
|
|
59
|
+
constructor(args) {
|
|
60
|
+
super(args);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
exports.SegregatedSharedDocument = SegregatedSharedDocument;
|
|
64
|
+
__decorate([
|
|
65
|
+
(0, core_1.pk)(),
|
|
66
|
+
__metadata("design:type", String)
|
|
67
|
+
], SegregatedSharedDocument.prototype, "id", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, core_1.column)(),
|
|
70
|
+
(0, decorator_validation_1.required)(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], SegregatedSharedDocument.prototype, "name", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, core_1.column)(),
|
|
75
|
+
(0, index_1.sharedData)(SHARED_COLLECTION_A),
|
|
76
|
+
__metadata("design:type", String)
|
|
77
|
+
], SegregatedSharedDocument.prototype, "sharedNoteA", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, core_1.column)(),
|
|
80
|
+
(0, index_1.sharedData)(SHARED_COLLECTION_B),
|
|
81
|
+
__metadata("design:type", String)
|
|
82
|
+
], SegregatedSharedDocument.prototype, "sharedNoteB", void 0);
|
|
83
|
+
__decorate([
|
|
84
|
+
(0, core_1.column)(),
|
|
85
|
+
(0, index_1.ownedBy)(),
|
|
86
|
+
__metadata("design:type", String)
|
|
87
|
+
], SegregatedSharedDocument.prototype, "owner", void 0);
|
|
88
|
+
exports.SegregatedSharedDocument = SegregatedSharedDocument = __decorate([
|
|
89
|
+
(0, decoration_1.uses)(index_1.FabricFlavour),
|
|
90
|
+
(0, core_1.table)("segregated_shared_document"),
|
|
91
|
+
(0, decorator_validation_1.model)(),
|
|
92
|
+
__metadata("design:paramtypes", [Object])
|
|
93
|
+
], SegregatedSharedDocument);
|
|
94
|
+
//# sourceMappingURL=SegregatedDocument.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ModelArg } from "@decaf-ts/decorator-validation";
|
|
2
|
+
import { BaseIdentifiedModel } from "./BaseIdentifiedModel";
|
|
3
|
+
export declare class SegregatedPrivateDocument extends BaseIdentifiedModel {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
privateNoteA?: string;
|
|
7
|
+
privateNoteB?: string;
|
|
8
|
+
owner?: string;
|
|
9
|
+
constructor(args?: ModelArg<SegregatedPrivateDocument>);
|
|
10
|
+
}
|
|
11
|
+
export declare class SegregatedSharedDocument extends BaseIdentifiedModel {
|
|
12
|
+
id: string;
|
|
13
|
+
name: string;
|
|
14
|
+
sharedNoteA?: string;
|
|
15
|
+
sharedNoteB?: string;
|
|
16
|
+
owner?: string;
|
|
17
|
+
constructor(args?: ModelArg<SegregatedSharedDocument>);
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SegregatedDocument.js","sourceRoot":"","sources":["../../../src/contract/models/SegregatedDocument.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,yEAAiE;AACjE,yCAAmD;AACnD,qDAA4C;AAC5C,oDAK4B;AAC5B,mEAA4D;AAE5D,MAAM,oBAAoB,GAAG,8BAA8B,CAAC;AAC5D,MAAM,oBAAoB,GAAG,8BAA8B,CAAC;AAC5D,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AAC1D,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AAKnD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,yCAAmB;IAoBhE,YAAY,IAA0C;QACpD,KAAK,CAAC,IAAI,CAAC,CAAC;IACd,CAAC;CACF,CAAA;AAvBY,8DAAyB;AAEpC;IADC,IAAA,SAAE,GAAE;;qDACO;AAIZ;IAFC,IAAA,aAAM,GAAE;IACR,IAAA,+BAAQ,GAAE;;wDACI;AAIf;IAFC,IAAA,aAAM,G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