@decaf-ts/for-fabric 0.3.44 → 0.3.46
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/client/FabricClientAdapter.cjs +9 -5
- package/lib/client/FabricClientAdapter.d.ts +6 -4
- package/lib/client/FabricClientAdapter.js.map +1 -1
- package/lib/client/FabricClientDispatch.cjs +28 -15
- package/lib/client/FabricClientDispatch.d.ts +6 -1
- package/lib/client/FabricClientDispatch.js.map +1 -1
- package/lib/client/constants.cjs +1 -0
- package/lib/client/constants.js.map +1 -1
- package/lib/client/types.d.ts +1 -0
- package/lib/contract/OtherProductImageContract.cjs +30 -0
- package/lib/contract/OtherProductImageContract.d.ts +5 -0
- package/lib/contract/OtherProductImageContract.js.map +1 -0
- package/lib/contract/index.cjs +2 -0
- package/lib/contract/index.js.map +1 -1
- package/lib/contract/models/OtherLeaflet.cjs +115 -0
- package/lib/contract/models/OtherLeaflet.d.ts +16 -0
- package/lib/contract/models/OtherLeaflet.js.map +1 -0
- package/lib/contract/models/OtherLeafletFile.cjs +65 -0
- package/lib/contract/models/OtherLeafletFile.d.ts +10 -0
- package/lib/contract/models/OtherLeafletFile.js.map +1 -0
- package/lib/contract/models/OtherMarket.cjs +3 -2
- package/lib/contract/models/OtherMarket.js.map +1 -1
- package/lib/contract/models/OtherProductImage.cjs +9 -0
- package/lib/contract/models/OtherProductImage.d.ts +1 -0
- package/lib/contract/models/OtherProductImage.js.map +1 -1
- package/lib/contract/models/OtherProductShared.cjs +3 -0
- package/lib/contract/models/OtherProductShared.js.map +1 -1
- package/lib/contract/models/OtherProductStrength.cjs +3 -2
- package/lib/contract/models/OtherProductStrength.js.map +1 -1
- package/lib/contracts/ContractAdapter.cjs +49 -0
- package/lib/contracts/ContractAdapter.d.ts +9 -0
- package/lib/contracts/ContractAdapter.js.map +1 -1
- package/lib/contracts/FabricContractRepository.cjs +2 -1
- package/lib/contracts/FabricContractRepository.js.map +1 -1
- package/lib/contracts/crud/crud-contract.cjs +12 -0
- package/lib/contracts/crud/crud-contract.d.ts +1 -0
- package/lib/contracts/crud/crud-contract.js.map +1 -1
- package/lib/contracts/crud/serialized-crud-contract.cjs +11 -0
- package/lib/contracts/crud/serialized-crud-contract.d.ts +1 -0
- package/lib/contracts/crud/serialized-crud-contract.js.map +1 -1
- package/lib/esm/client/FabricClientAdapter.d.ts +6 -4
- package/lib/esm/client/FabricClientAdapter.js +9 -5
- package/lib/esm/client/FabricClientAdapter.js.map +1 -1
- package/lib/esm/client/FabricClientDispatch.d.ts +6 -1
- package/lib/esm/client/FabricClientDispatch.js +28 -15
- package/lib/esm/client/FabricClientDispatch.js.map +1 -1
- package/lib/esm/client/constants.js +1 -0
- package/lib/esm/client/constants.js.map +1 -1
- package/lib/esm/client/types.d.ts +1 -0
- package/lib/esm/contract/OtherProductImageContract.d.ts +5 -0
- package/lib/esm/contract/OtherProductImageContract.js +27 -0
- package/lib/esm/contract/OtherProductImageContract.js.map +1 -0
- package/lib/esm/contract/index.js +2 -0
- package/lib/esm/contract/index.js.map +1 -1
- package/lib/esm/contract/models/OtherLeaflet.d.ts +16 -0
- package/lib/esm/contract/models/OtherLeaflet.js +112 -0
- package/lib/esm/contract/models/OtherLeaflet.js.map +1 -0
- package/lib/esm/contract/models/OtherLeafletFile.d.ts +10 -0
- package/lib/esm/contract/models/OtherLeafletFile.js +62 -0
- package/lib/esm/contract/models/OtherLeafletFile.js.map +1 -0
- package/lib/esm/contract/models/OtherMarket.js +4 -3
- package/lib/esm/contract/models/OtherMarket.js.map +1 -1
- package/lib/esm/contract/models/OtherProductImage.d.ts +1 -0
- package/lib/esm/contract/models/OtherProductImage.js +10 -1
- package/lib/esm/contract/models/OtherProductImage.js.map +1 -1
- package/lib/esm/contract/models/OtherProductShared.js +4 -1
- package/lib/esm/contract/models/OtherProductShared.js.map +1 -1
- package/lib/esm/contract/models/OtherProductStrength.js +4 -3
- package/lib/esm/contract/models/OtherProductStrength.js.map +1 -1
- package/lib/esm/contracts/ContractAdapter.d.ts +9 -0
- package/lib/esm/contracts/ContractAdapter.js +51 -2
- package/lib/esm/contracts/ContractAdapter.js.map +1 -1
- package/lib/esm/contracts/FabricContractRepository.js +2 -1
- package/lib/esm/contracts/FabricContractRepository.js.map +1 -1
- package/lib/esm/contracts/crud/crud-contract.d.ts +1 -0
- package/lib/esm/contracts/crud/crud-contract.js +12 -0
- package/lib/esm/contracts/crud/crud-contract.js.map +1 -1
- package/lib/esm/contracts/crud/serialized-crud-contract.d.ts +1 -0
- package/lib/esm/contracts/crud/serialized-crud-contract.js +11 -0
- package/lib/esm/contracts/crud/serialized-crud-contract.js.map +1 -1
- package/lib/esm/shared/types.d.ts +7 -0
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/shared/types.d.ts +7 -0
- package/lib/version.cjs +1 -1
- package/lib/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Comparison, Model, type ModelArg } from "@decaf-ts/decorator-validation";
|
|
2
|
+
import { BaseIdentifiedModel } from "./BaseIdentifiedModel";
|
|
3
|
+
import { OtherLeafletFile } from "./OtherLeafletFile";
|
|
4
|
+
export declare class Leaflet extends BaseIdentifiedModel {
|
|
5
|
+
id: string;
|
|
6
|
+
productCode: string;
|
|
7
|
+
batchNumber?: string;
|
|
8
|
+
leafletType: string;
|
|
9
|
+
lang: string;
|
|
10
|
+
epiMarket: string;
|
|
11
|
+
xmlFileContent: string | OtherLeafletFile;
|
|
12
|
+
otherFilesContent: string[] | OtherLeafletFile[];
|
|
13
|
+
owner: string;
|
|
14
|
+
constructor(model?: ModelArg<Leaflet>);
|
|
15
|
+
compare<M extends Model>(other: M, ...exceptions: (keyof M)[]): Comparison<M> | undefined;
|
|
16
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { model, required } from "@decaf-ts/decorator-validation";
|
|
11
|
+
import { Cascade, column, defaultQueryAttr, index, oneToMany, oneToOne, OrderDirection, pk, table, } from "@decaf-ts/core";
|
|
12
|
+
import { composed, readonly } from "@decaf-ts/db-decorators";
|
|
13
|
+
import { description, uses } from "@decaf-ts/decoration";
|
|
14
|
+
import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
|
|
15
|
+
import { FabricFlavour, mirror, NamespaceCollection, ownedBy, sharedData, } from "./../../shared/index.js";
|
|
16
|
+
import { audit } from "./decorators-private.js";
|
|
17
|
+
import { historyDec } from "./history-dec.js";
|
|
18
|
+
import { gtin } from "./gtin.js";
|
|
19
|
+
import { OtherLeafletFile } from "./OtherLeafletFile.js";
|
|
20
|
+
let Leaflet = class Leaflet extends BaseIdentifiedModel {
|
|
21
|
+
constructor(model) {
|
|
22
|
+
super(model);
|
|
23
|
+
this.leafletType = "leaflet";
|
|
24
|
+
}
|
|
25
|
+
compare(other, ...exceptions) {
|
|
26
|
+
return super.compare(other, ...[
|
|
27
|
+
...new Set([
|
|
28
|
+
exceptions,
|
|
29
|
+
"updatedAt",
|
|
30
|
+
"updatedBy",
|
|
31
|
+
"otherFilesContent",
|
|
32
|
+
"xmlFileContent",
|
|
33
|
+
]).values(),
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
__decorate([
|
|
38
|
+
pk(),
|
|
39
|
+
historyDec(),
|
|
40
|
+
mirror("mirror-collection", "org-b"),
|
|
41
|
+
audit(Leaflet),
|
|
42
|
+
composed(["productCode", "batchNumber", "leafletType", "lang", "epiMarket"], ":", ["batchNumber", "epiMarket"]),
|
|
43
|
+
description("Unique identifier composed of product code, batch number, and language."),
|
|
44
|
+
__metadata("design:type", String)
|
|
45
|
+
], Leaflet.prototype, "id", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
gtin(),
|
|
48
|
+
column(),
|
|
49
|
+
required(),
|
|
50
|
+
readonly(),
|
|
51
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
52
|
+
description("GTIN code of the product associated with this leaflet."),
|
|
53
|
+
defaultQueryAttr(),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], Leaflet.prototype, "productCode", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
column(),
|
|
58
|
+
readonly(),
|
|
59
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
60
|
+
description("Batch number linked to the product, if applicable."),
|
|
61
|
+
defaultQueryAttr(),
|
|
62
|
+
__metadata("design:type", String)
|
|
63
|
+
], Leaflet.prototype, "batchNumber", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
column(),
|
|
66
|
+
required(),
|
|
67
|
+
readonly(),
|
|
68
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
69
|
+
description("Type category the leaflet belongs to."),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], Leaflet.prototype, "leafletType", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
column(),
|
|
74
|
+
required(),
|
|
75
|
+
readonly(),
|
|
76
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
77
|
+
description("Language code of the leaflet (e.g., 'en', 'pt', 'es')."),
|
|
78
|
+
__metadata("design:type", String)
|
|
79
|
+
], Leaflet.prototype, "lang", void 0);
|
|
80
|
+
__decorate([
|
|
81
|
+
column(),
|
|
82
|
+
readonly(),
|
|
83
|
+
__metadata("design:type", String)
|
|
84
|
+
], Leaflet.prototype, "epiMarket", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
column(),
|
|
87
|
+
required(),
|
|
88
|
+
description("Main XML content of the electronic leaflet."),
|
|
89
|
+
oneToOne(() => OtherLeafletFile, { update: Cascade.CASCADE, delete: Cascade.CASCADE }, false),
|
|
90
|
+
description("file with the xml content of the leaflet"),
|
|
91
|
+
__metadata("design:type", Object)
|
|
92
|
+
], Leaflet.prototype, "xmlFileContent", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
oneToMany(() => OtherLeafletFile, { update: Cascade.CASCADE, delete: Cascade.CASCADE }, false),
|
|
95
|
+
description("List of additional files linked to the leaflet, such as PDFs or images."),
|
|
96
|
+
__metadata("design:type", Array)
|
|
97
|
+
], Leaflet.prototype, "otherFilesContent", void 0);
|
|
98
|
+
__decorate([
|
|
99
|
+
ownedBy(),
|
|
100
|
+
description("the owner (msp) of the leaflet"),
|
|
101
|
+
__metadata("design:type", String)
|
|
102
|
+
], Leaflet.prototype, "owner", void 0);
|
|
103
|
+
Leaflet = __decorate([
|
|
104
|
+
description("Represents the ePI leaflet linked to a specific product, batch, and language."),
|
|
105
|
+
uses(FabricFlavour),
|
|
106
|
+
table("other_leaflet"),
|
|
107
|
+
sharedData(NamespaceCollection("decaf-namespace")),
|
|
108
|
+
model(),
|
|
109
|
+
__metadata("design:paramtypes", [Object])
|
|
110
|
+
], Leaflet);
|
|
111
|
+
export { Leaflet };
|
|
112
|
+
//# sourceMappingURL=OtherLeaflet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtherLeaflet.js","sourceRoot":"","sources":["../../../../src/contract/models/Ot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,CAAC,gBAAgB,EACtB,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,EAAE,EACpD,KAAK,CACN;IACA,WAAW,CACV,yEAAyE,CAC1E;;kDACiD;AAIlD;IAFC,OAAO,EAAE;IACT,WAAW,CAAC,gCAAgC,CAAC;;sCAC/B;AAxEJ,OAAO;IAPnB,WAAW,CACV,+EAA+E,CAChF;IACA,IAAI,CAAC,aAAa,CAAC;IACnB,KAAK,CAAC,eAAe,CAAC;IACtB,UAAU,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IAClD,KAAK,EAAE;;GACK,OAAO,CA+FnB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ModelArg } from "@decaf-ts/decorator-validation";
|
|
2
|
+
import { BaseIdentifiedModel } from "./BaseIdentifiedModel";
|
|
3
|
+
export declare class OtherLeafletFile extends BaseIdentifiedModel {
|
|
4
|
+
id: string;
|
|
5
|
+
leafletId: string;
|
|
6
|
+
fileName: string;
|
|
7
|
+
fileContent: string;
|
|
8
|
+
owner: string;
|
|
9
|
+
constructor(model?: ModelArg<OtherLeafletFile>);
|
|
10
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { model, required } from "@decaf-ts/decorator-validation";
|
|
11
|
+
import { column, index, OrderDirection, pk, table } from "@decaf-ts/core";
|
|
12
|
+
import { description, uses } from "@decaf-ts/decoration";
|
|
13
|
+
import { composed } from "@decaf-ts/db-decorators";
|
|
14
|
+
import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
|
|
15
|
+
import { FabricFlavour, mirror, NamespaceCollection, ownedBy, sharedData, } from "./../../shared/index.js";
|
|
16
|
+
let OtherLeafletFile = class OtherLeafletFile extends BaseIdentifiedModel {
|
|
17
|
+
constructor(model) {
|
|
18
|
+
super(model);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
__decorate([
|
|
22
|
+
pk(),
|
|
23
|
+
mirror("mirror-collection", "org-b"),
|
|
24
|
+
composed(["leafletId", "fileName"], ":"),
|
|
25
|
+
description("Unique identifier of the leaflet file."),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], OtherLeafletFile.prototype, "id", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
column(),
|
|
30
|
+
required(),
|
|
31
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
32
|
+
description("Identifier of the leaflet this file belongs to."),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], OtherLeafletFile.prototype, "leafletId", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
column(),
|
|
37
|
+
required(),
|
|
38
|
+
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
39
|
+
description("Name of the file, including its extension."),
|
|
40
|
+
__metadata("design:type", String)
|
|
41
|
+
], OtherLeafletFile.prototype, "fileName", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
column(),
|
|
44
|
+
required(),
|
|
45
|
+
description("Base64-encoded content of the file."),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], OtherLeafletFile.prototype, "fileContent", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
ownedBy(),
|
|
50
|
+
description("the owner (msp) of the leaflet"),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], OtherLeafletFile.prototype, "owner", void 0);
|
|
53
|
+
OtherLeafletFile = __decorate([
|
|
54
|
+
description("Represents an additional file associated with a leaflet, such as a PDF or image."),
|
|
55
|
+
uses(FabricFlavour),
|
|
56
|
+
table("other_leaflet_file"),
|
|
57
|
+
sharedData(NamespaceCollection("decaf-namespace")),
|
|
58
|
+
model(),
|
|
59
|
+
__metadata("design:paramtypes", [Object])
|
|
60
|
+
], OtherLeafletFile);
|
|
61
|
+
export { OtherLeafletFile };
|
|
62
|
+
//# sourceMappingURL=OtherLeafletFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OtherLeafletFile.js","sourceRoot":"","sources":["../../../../src/contract/models/OtherLeafletFile.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAC5D,OAAO,EACL,aAAa,EACb,MAAM,EACN,mBAAmB,EACnB,OAAO,EACP,UAAU,GACX,gCAA2B;AASrB,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,mBAAmB;IA4BvD,YAAY,KAAkC;QAC5C,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;CACF,CAAA;AA1BC;IAJC,EAAE,EAAE;IACJ,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,CAAC,WAAW,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC;IACxC,WAAW,CAAC,wCAAwC,CAAC;;4CAC1C;AAMZ;IAJC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,iDAAiD,CAAC;;mDAC5C;AAMnB;IAJC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,4CAA4C,CAAC;;kDACxC;AAKlB;IAHC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,WAAW,CAAC,qCAAqC,CAAC;;qDAC9B;AAIrB;IAFC,OAAO,EAAE;IACT,WAAW,CAAC,gCAAgC,CAAC;;+CAC/B;AA1BJ,gBAAgB;IAP5B,WAAW,CACV,kFAAkF,CACnF;IACA,IAAI,CAAC,aAAa,CAAC;IACnB,KAAK,CAAC,oBAAoB,CAAC;IAC3B,UAAU,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IAClD,KAAK,EAAE;;GACK,gBAAgB,CA+B5B"}
|
|
@@ -8,8 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { maxlength, minlength, model, required, } from "@decaf-ts/decorator-validation";
|
|
11
|
-
import {
|
|
12
|
-
import { column, index, OrderDirection, pk, table } from "@decaf-ts/core";
|
|
11
|
+
import { column, defaultQueryAttr, index, OrderDirection, pk, table, } from "@decaf-ts/core";
|
|
13
12
|
import { composed, version } from "@decaf-ts/db-decorators";
|
|
14
13
|
import { description, uses } from "@decaf-ts/decoration";
|
|
15
14
|
import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
|
|
@@ -32,6 +31,7 @@ __decorate([
|
|
|
32
31
|
__decorate([
|
|
33
32
|
column(),
|
|
34
33
|
required(),
|
|
34
|
+
defaultQueryAttr(),
|
|
35
35
|
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
36
36
|
description("Identifier of the market where the product is registered or sold."),
|
|
37
37
|
__metadata("design:type", String)
|
|
@@ -40,6 +40,7 @@ __decorate([
|
|
|
40
40
|
column(),
|
|
41
41
|
gtin(),
|
|
42
42
|
required(),
|
|
43
|
+
defaultQueryAttr(),
|
|
43
44
|
__metadata("design:type", String)
|
|
44
45
|
], OtherMarket.prototype, "productCode", void 0);
|
|
45
46
|
__decorate([
|
|
@@ -72,7 +73,7 @@ OtherMarket = __decorate([
|
|
|
72
73
|
sharedData(NamespaceCollection("decaf-namespace")),
|
|
73
74
|
description("Links a product to a specific market."),
|
|
74
75
|
uses(FabricFlavour),
|
|
75
|
-
table(
|
|
76
|
+
table("other_market"),
|
|
76
77
|
model(),
|
|
77
78
|
__metadata("design:paramtypes", [Object])
|
|
78
79
|
], OtherMarket);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtherMarket.js","sourceRoot":"","sources":["../../../../src/contract/models/OtherMarket.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EACL,SAAS,EACT,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"OtherMarket.js","sourceRoot":"","sources":["../../../../src/contract/models/OtherMarket.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EACL,SAAS,EACT,SAAS,EACT,KAAK,EACL,QAAQ,GACT,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,cAAc,EACd,EAAE,EACF,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;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U,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IAClD,WAAW,CAAC,uCAAuC,CAAC;IACpD,IAAI,CAAC,aAAa,CAAC;IACnB,KAAK,CAAC,cAAc,CAAC;IACrB,KAAK,EAAE;;GACK,WAAW,CAqDvB"}
|
|
@@ -8,10 +8,12 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { model, required } from "@decaf-ts/decorator-validation";
|
|
11
|
-
import { column, pk, table } from "@decaf-ts/core";
|
|
11
|
+
import { column, defaultQueryAttr, pk, table } from "@decaf-ts/core";
|
|
12
12
|
// import {BlockOperations, OperationKeys, readonly} from "@decaf-ts/db-decorators";
|
|
13
13
|
import { uses } from "@decaf-ts/decoration";
|
|
14
14
|
import { gtin } from "./gtin.js";
|
|
15
|
+
import { historyDec } from "./history-dec.js";
|
|
16
|
+
import { version } from "@decaf-ts/db-decorators";
|
|
15
17
|
import { FabricFlavour, mirror, NamespaceCollection, ownedBy, sharedData, } from "./../../shared/index.js";
|
|
16
18
|
import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
|
|
17
19
|
let OtherProductImage = class OtherProductImage extends BaseIdentifiedModel {
|
|
@@ -21,19 +23,26 @@ let OtherProductImage = class OtherProductImage extends BaseIdentifiedModel {
|
|
|
21
23
|
};
|
|
22
24
|
__decorate([
|
|
23
25
|
pk(),
|
|
26
|
+
historyDec(),
|
|
24
27
|
gtin(),
|
|
28
|
+
defaultQueryAttr(),
|
|
25
29
|
mirror("mirror-collection", "org-b"),
|
|
26
30
|
__metadata("design:type", String)
|
|
27
31
|
], OtherProductImage.prototype, "productCode", void 0);
|
|
28
32
|
__decorate([
|
|
29
33
|
column(),
|
|
30
34
|
required(),
|
|
35
|
+
defaultQueryAttr(),
|
|
31
36
|
__metadata("design:type", String)
|
|
32
37
|
], OtherProductImage.prototype, "content", void 0);
|
|
33
38
|
__decorate([
|
|
34
39
|
ownedBy(),
|
|
35
40
|
__metadata("design:type", String)
|
|
36
41
|
], OtherProductImage.prototype, "owner", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
version(),
|
|
44
|
+
__metadata("design:type", Number)
|
|
45
|
+
], OtherProductImage.prototype, "counter", void 0);
|
|
37
46
|
OtherProductImage = __decorate([
|
|
38
47
|
sharedData(NamespaceCollection("decaf-namespace")),
|
|
39
48
|
uses(FabricFlavour)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtherProductImage.js","sourceRoot":"","sources":["../../../../src/contract/models/OtherProductImage.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"OtherProductImage.js","sourceRoot":"","sources":["../../../../src/contract/models/OtherProductImage.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACrE,oFAAoF;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EAAE,UAAU,EAAE,yBAAsB;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EACL,aAAa,EACb,MAAM,EACN,mBAAmB,EACnB,OAAO,EACP,UAAU,GACX,gCAA2B;AAC5B,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAOrD,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,mBAAmB;IAmBxD,YAAY,KAAmC;QAC7C,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;CACF,CAAA;AAhBC;IALC,EAAE,EAAE;IACJ,UAAU,EAAE;IACZ,IAAI,EAAE;IACN,gBAAgB,EAAE;IAClB,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC;;sDAChB;AAKrB;IAHC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,gBAAgB,EAAE;;kDACF;AAGjB;IADC,OAAO,EAAE;;gDACK;AAGf;IADC,OAAO,EAAE;;kDACO;AAjBN,iBAAiB;IAL7B,UAAU,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IAClD,IAAI,CAAC,aAAa,CAAC;IACpB,2CAA2C;;IAC1C,KAAK,CAAC,qBAAqB,CAAC;IAC5B,KAAK,EAAE;;GACK,iBAAiB,CAsB7B"}
|
|
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { model, required } from "@decaf-ts/decorator-validation";
|
|
11
|
-
import { Cascade, column, index, oneToMany, oneToOne, OrderDirection, pk, table, } from "@decaf-ts/core";
|
|
11
|
+
import { Cascade, column, defaultQueryAttr, index, oneToMany, oneToOne, OrderDirection, pk, table, } from "@decaf-ts/core";
|
|
12
12
|
// import {BlockOperations, OperationKeys, readonly} from "@decaf-ts/db-decorators";
|
|
13
13
|
import { uses } from "@decaf-ts/decoration";
|
|
14
14
|
import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
|
|
@@ -34,17 +34,20 @@ __decorate([
|
|
|
34
34
|
assignProductOwner(),
|
|
35
35
|
mirror("mirror-collection", "org-b"),
|
|
36
36
|
audit(OtherProductShared),
|
|
37
|
+
defaultQueryAttr(),
|
|
37
38
|
__metadata("design:type", String)
|
|
38
39
|
], OtherProductShared.prototype, "productCode", void 0);
|
|
39
40
|
__decorate([
|
|
40
41
|
column(),
|
|
41
42
|
required(),
|
|
43
|
+
defaultQueryAttr(),
|
|
42
44
|
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
43
45
|
__metadata("design:type", String)
|
|
44
46
|
], OtherProductShared.prototype, "inventedName", void 0);
|
|
45
47
|
__decorate([
|
|
46
48
|
column(),
|
|
47
49
|
required(),
|
|
50
|
+
defaultQueryAttr(),
|
|
48
51
|
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
49
52
|
__metadata("design:type", String)
|
|
50
53
|
], OtherProductShared.prototype, "nameMedicinalProduct", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtherProductShared.js","sourceRoot":"","sources":["../../../../src/contract/models/OtherProductShared.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,OAAO,EACP,MAAM,EACN,KAAK,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,EAAE,EACF,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,oFAAoF;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAC5D,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EAAE,KAAK,EAAE,gCAA6B;AAC7C,OAAO,EACL,aAAa,EACb,MAAM,EACN,mBAAmB,EACnB,OAAO,EACP,UAAU,GACX,gCAA2B;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,kCAA+B;AAC9D,OAAO,EAAE,WAAW,EAAE,yBAAsB;AAC5C,OAAO,EAAE,kBAAkB,EAAE,wBAAqB;AAClD,OAAO,EAAE,UAAU,EAAE,yBAAsB;AAC3C,OAAO,EAAE,iBAAiB,EAAE,+BAA4B;AAOjD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,mBAAmB;
|
|
1
|
+
{"version":3,"file":"OtherProductShared.js","sourceRoot":"","sources":["../../../../src/contract/models/OtherProductShared.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,OAAO,EACP,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,cAAc,EACd,EAAE,EACF,KAAK,GACN,MAAM,gBAAgB,CAAC;AACxB,oFAAoF;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAC5D,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EAAE,KAAK,EAAE,gCAA6B;AAC7C,OAAO,EACL,aAAa,EACb,MAAM,EACN,mBAAmB,EACnB,OAAO,EACP,UAAU,GACX,gCAA2B;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,kCAA+B;AAC9D,OAAO,EAAE,WAAW,EAAE,yBAAsB;AAC5C,OAAO,EAAE,kBAAkB,EAAE,wBAAqB;AAClD,OAAO,EAAE,UAAU,EAAE,yBAAsB;AAC3C,OAAO,EAAE,iBAAiB,EAAE,+BAA4B;AAOjD,IAAM,kBAAkB,GAAxB,MAAM,kBAAmB,SAAQ,mBAAmB;IA+EzD,YAAY,IAAmC;QAC7C,KAAK,CAAC,IAAI,CAAC,CAAC;QArDd,kBAAa,GAAY,KAAK,CAAC;IAsD/B,CAAC;CACF,CAAA;AA1EC;IAPC,EAAE,EAAE;IACJ,IAAI,EAAE;IACN,UAAU,EAAE;IACZ,kBAAkB,EAAE;IACpB,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACpC,KAAK,CAAC,kBAAkB,CAAC;IACzB,gBAAgB,EAAE;;uDACE;AAMrB;IAJC,MAAM,EAAE;IACR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if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { model, required } from "@decaf-ts/decorator-validation";
|
|
11
|
-
import { column, index, OrderDirection, pk, table, uuid } from "@decaf-ts/core";
|
|
12
|
-
import { TableNames } from "./constants.js";
|
|
11
|
+
import { column, defaultQueryAttr, index, OrderDirection, pk, table, uuid, } from "@decaf-ts/core";
|
|
13
12
|
import { description, uses } from "@decaf-ts/decoration";
|
|
14
13
|
import { BaseIdentifiedModel } from "./BaseIdentifiedModel.js";
|
|
15
14
|
import { FabricFlavour, mirror, NamespaceCollection, sharedData, } from "./../../shared/index.js";
|
|
@@ -45,6 +44,7 @@ __decorate([
|
|
|
45
44
|
], OtherProductStrength.prototype, "uuid", void 0);
|
|
46
45
|
__decorate([
|
|
47
46
|
gtin(),
|
|
47
|
+
defaultQueryAttr(),
|
|
48
48
|
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
49
49
|
description("Product code associated with this strength entry."),
|
|
50
50
|
__metadata("design:type", String)
|
|
@@ -52,6 +52,7 @@ __decorate([
|
|
|
52
52
|
__decorate([
|
|
53
53
|
column(),
|
|
54
54
|
required(),
|
|
55
|
+
defaultQueryAttr(),
|
|
55
56
|
index([OrderDirection.ASC, OrderDirection.DSC]),
|
|
56
57
|
description("Product concentration or dosage (e.g., 500mg, 10%)."),
|
|
57
58
|
__metadata("design:type", String)
|
|
@@ -74,7 +75,7 @@ __decorate([
|
|
|
74
75
|
OtherProductStrength = __decorate([
|
|
75
76
|
sharedData(NamespaceCollection("decaf-namespace")),
|
|
76
77
|
uses(FabricFlavour),
|
|
77
|
-
table(
|
|
78
|
+
table("other_product_strength"),
|
|
78
79
|
model(),
|
|
79
80
|
description("Represents the product’s strength and composition details."),
|
|
80
81
|
__metadata("design:paramtypes", [Object])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OtherProductStrength.js","sourceRoot":"","sources":["../../../../src/contract/models/OtherProductStrength.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,
|
|
1
|
+
{"version":3,"file":"OtherProductStrength.js","sourceRoot":"","sources":["../../../../src/contract/models/OtherProductStrength.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EACL,MAAM,EACN,gBAAgB,EAChB,KAAK,EACL,cAAc,EACd,EAAE,EACF,KAAK,EACL,IAAI,GACL,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAE,iCAA8B;AAE5D,OAAO,EACL,aAAa,EACb,MAAM,EACN,mBAAmB,EACnB,UAAU,GACX,gCAA2B;AAC5B,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,kBAAe;AAC9B,OAAO,EAAE,UAAU,EAAE,yBAAsB;AAE3C,SAAS,YAAY,CAAC,CAAuB;IAC3C,IAAI,CAAC;QACH,OAAO,GAAG,CAAC,CAAC,WAAW,GAAG,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAC1E,CAAC;IAAC,OAAO,CAAU,EAAE,CAAC;QACpB,MAAM,IAAI,aAAa,CAAC,0CAA0C,CAAC,EAAE,CAAC,CAAC;IACzE,CAAC;AACH,CAAC;AAOM,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,mBAAmB;IA2C3D,YAAY,KAAsC;QAChD,KAAK,CAAC,KAAK,CAAC,CAAC;IACf,CAAC;CACF,CAAA;AAxCC;IALC,EAAE,EAAE;IACJ,UAAU,EAAE;IACZ,MAAM,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACpC,QAAQ,CAAC,CAAC,aAAa,EAAE,MAAM,CAAC,EAAE,GAAG,CAAC;IACtC,WAAW,CAAC,4CAA4C,CAAC;;gDAC9C;AAKZ;IAHC,IAAI,CAAC,YAAY,CAAC;IAClB,QAAQ,EAAE;IACV,WAAW,CAAC,wCAAwC,CAAC;;kDACxC;AAWd;IAJC,IAAI,EAAE;IACN,gBAAgB,EAAE;IAClB,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,mDAAmD,CAAC;;yDAC5C;AAOrB;IALC,MAAM,EAAE;IACR,QAAQ,EAAE;IACV,gBAAgB,EAAE;IAClB,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,qDAAqD,CAAC;;sDACjD;AAKlB;IAHC,MAAM,EAAE;IACR,KAAK,CAAC,CAAC,cAAc,CAAC,GAAG,EAAE,cAAc,CAAC,GAAG,CAAC,CAAC;IAC/C,WAAW,CAAC,oDAAoD,CAAC;;uDAC/C;AAInB;IAFC,MAAM,EAAE;IACR,WAAW,CAAC,gDAAgD,CAAC;;6DACrC;AAGzB;IADC,OAAO,EAAE;;qDACO;AAzCN,oBAAoB;IALhC,UAAU,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,CAAC;IAClD,IAAI,CAAC,aAAa,CAAC;IACnB,KAAK,CAAC,wBAAwB,CAAC;IAC/B,KAAK,EAAE;IACP,WAAW,CAAC,4DAA4D,CAAC;;GAC7D,oBAAoB,CA8ChC"}
|
|
@@ -131,6 +131,15 @@ export declare class FabricContractAdapter extends CouchDBAdapter<any, void, Fab
|
|
|
131
131
|
* @return {Promise<Record<string, any>>} Promise resolving to the retrieved record
|
|
132
132
|
*/
|
|
133
133
|
read<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType, ...args: ContextualArgs<Context<FabricContractFlags>>): Promise<Record<string, any>>;
|
|
134
|
+
/**
|
|
135
|
+
* @description Retrieves multiple records from the database
|
|
136
|
+
* @summary Fetches multiple records with the given IDs from the specified table
|
|
137
|
+
* @param {string} tableName - The name of the table to read from
|
|
138
|
+
* @param id - The identifiers of the records to retrieve
|
|
139
|
+
* @param {...any[]} args - Additional arguments specific to the adapter implementation
|
|
140
|
+
* @return A promise that resolves to an array of retrieved records
|
|
141
|
+
*/
|
|
142
|
+
readAll<M extends Model>(clazz: Constructor<M>, id: PrimaryKeyType[], ...args: ContextualArgs<Context<FabricContractFlags>>): Promise<Record<string, any>[]>;
|
|
134
143
|
/**
|
|
135
144
|
* @description Updates a record in the state database
|
|
136
145
|
* @summary Serializes a model and updates it in the Fabric state database
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { CouchDBAdapter, CouchDBKeys, } from "@decaf-ts/for-couchdb";
|
|
2
2
|
import { Model, ValidationKeys } from "@decaf-ts/decorator-validation";
|
|
3
3
|
import { FabricContractContext } from "./ContractContext.js";
|
|
4
|
-
import { BadRequestError, ConflictError, InternalError, NotFoundError, onCreate, onCreateUpdate, SerializationError, } from "@decaf-ts/db-decorators";
|
|
4
|
+
import { BadRequestError, BulkCrudOperationKeys, ConflictError, InternalError, NotFoundError, onCreate, onCreateUpdate, SerializationError, } from "@decaf-ts/db-decorators";
|
|
5
5
|
import { Object as FabricObject, Property, Property as FabricProperty, } from "fabric-contract-api";
|
|
6
6
|
import { Logging } from "@decaf-ts/logging";
|
|
7
|
-
import { PersistenceKeys, UnsupportedError, Adapter, QueryError, PagingError, MigrationError, ObserverError, AuthorizationError, ForbiddenError, ConnectionError, TransactionOperationKeys, } from "@decaf-ts/core";
|
|
7
|
+
import { PersistenceKeys, UnsupportedError, Adapter, QueryError, PagingError, MigrationError, ObserverError, AuthorizationError, ForbiddenError, ConnectionError, TransactionOperationKeys, promiseSequence, resolveBulkSequenceResult, } from "@decaf-ts/core";
|
|
8
8
|
import { FabricContractRepository } from "./FabricContractRepository.js";
|
|
9
9
|
import { FabricStatement } from "./FabricContractStatement.js";
|
|
10
10
|
import { FabricContractSequence } from "./FabricContractSequence.js";
|
|
@@ -257,6 +257,55 @@ export class FabricContractAdapter extends CouchDBAdapter {
|
|
|
257
257
|
Object.assign(model, await this.forPrivate(col).readState(composedKey, ctx));
|
|
258
258
|
return model;
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* @description Retrieves multiple records from the database
|
|
262
|
+
* @summary Fetches multiple records with the given IDs from the specified table
|
|
263
|
+
* @param {string} tableName - The name of the table to read from
|
|
264
|
+
* @param id - The identifiers of the records to retrieve
|
|
265
|
+
* @param {...any[]} args - Additional arguments specific to the adapter implementation
|
|
266
|
+
* @return A promise that resolves to an array of retrieved records
|
|
267
|
+
*/
|
|
268
|
+
async readAll(clazz, id, ...args) {
|
|
269
|
+
const { log, ctx } = this.logCtx(args, this.readAll);
|
|
270
|
+
const tableName = Model.tableName(clazz);
|
|
271
|
+
log.debug(`Reading ${id.length} entries ${tableName} table`);
|
|
272
|
+
const breakOnSingleFailure = ctx.get("breakOnSingleFailureInBulk") ?? true;
|
|
273
|
+
const continueOnError = !breakOnSingleFailure;
|
|
274
|
+
const mirrorCollection = ctx.getOrUndefined("mirrorCollection");
|
|
275
|
+
const isMirror = ctx.getOrUndefined("mirror");
|
|
276
|
+
const readMirror = async (clazz, id, ...args) => {
|
|
277
|
+
if (!mirrorCollection)
|
|
278
|
+
throw new BadRequestError("Missing mirror collection for mirror read");
|
|
279
|
+
try {
|
|
280
|
+
const { ctx, log } = this.logCtx(args, readMirror);
|
|
281
|
+
log.info(`in ADAPTER read with args ${args}`);
|
|
282
|
+
const tableName = Model.tableName(clazz);
|
|
283
|
+
const composedKey = ctx.stub.createCompositeKey(tableName, [
|
|
284
|
+
String(id),
|
|
285
|
+
]);
|
|
286
|
+
return await this.forPrivate(mirrorCollection).readState(composedKey, ctx);
|
|
287
|
+
}
|
|
288
|
+
catch (e) {
|
|
289
|
+
throw this.parseError(e);
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
try {
|
|
293
|
+
const tasks = id.map((i) => () => isMirror && mirrorCollection
|
|
294
|
+
? readMirror(clazz, i, ...args, ctx.override({ noEmitSingle: true }))
|
|
295
|
+
: this.read(clazz, i, ...args, ctx.override({ noEmitSingle: true })));
|
|
296
|
+
const rawResult = continueOnError
|
|
297
|
+
? await promiseSequence(tasks, true)
|
|
298
|
+
: await promiseSequence(tasks);
|
|
299
|
+
return resolveBulkSequenceResult(rawResult, continueOnError, log, BulkCrudOperationKeys.READ_ALL);
|
|
300
|
+
}
|
|
301
|
+
catch (e) {
|
|
302
|
+
throw this.parseError(e);
|
|
303
|
+
}
|
|
304
|
+
finally {
|
|
305
|
+
ctx.put("mirror", undefined);
|
|
306
|
+
ctx.put("mirrorCollection", undefined);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
260
309
|
/**
|
|
261
310
|
* @description Updates a record in the state database
|
|
262
311
|
* @summary Serializes a model and updates it in the Fabric state database
|