@xyo-network/payload-mongodb 2.86.0 → 2.86.1
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/browser/Mappings/fromDbRepresentation.d.cts +2 -2
- package/dist/browser/Mappings/fromDbRepresentation.d.cts.map +1 -1
- package/dist/browser/Mappings/fromDbRepresentation.d.mts +2 -2
- package/dist/browser/Mappings/fromDbRepresentation.d.mts.map +1 -1
- package/dist/browser/Mappings/fromDbRepresentation.d.ts +2 -2
- package/dist/browser/Mappings/fromDbRepresentation.d.ts.map +1 -1
- package/dist/browser/Mappings/toDbRepresentation.d.cts +3 -3
- package/dist/browser/Mappings/toDbRepresentation.d.cts.map +1 -1
- package/dist/browser/Mappings/toDbRepresentation.d.mts +3 -3
- package/dist/browser/Mappings/toDbRepresentation.d.mts.map +1 -1
- package/dist/browser/Mappings/toDbRepresentation.d.ts +3 -3
- package/dist/browser/Mappings/toDbRepresentation.d.ts.map +1 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/node/Mappings/fromDbRepresentation.d.cts +2 -2
- package/dist/node/Mappings/fromDbRepresentation.d.cts.map +1 -1
- package/dist/node/Mappings/fromDbRepresentation.d.mts +2 -2
- package/dist/node/Mappings/fromDbRepresentation.d.mts.map +1 -1
- package/dist/node/Mappings/fromDbRepresentation.d.ts +2 -2
- package/dist/node/Mappings/fromDbRepresentation.d.ts.map +1 -1
- package/dist/node/Mappings/toDbRepresentation.d.cts +3 -3
- package/dist/node/Mappings/toDbRepresentation.d.cts.map +1 -1
- package/dist/node/Mappings/toDbRepresentation.d.mts +3 -3
- package/dist/node/Mappings/toDbRepresentation.d.mts.map +1 -1
- package/dist/node/Mappings/toDbRepresentation.d.ts +3 -3
- package/dist/node/Mappings/toDbRepresentation.d.ts.map +1 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +10 -10
- package/src/Mappings/toDbRepresentation.ts +1 -1
|
@@ -4,9 +4,9 @@ import { BoundWitnessWithMongoMeta } from '../BoundWitness';
|
|
|
4
4
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
5
5
|
export declare const payloadFromDbRepresentation: (value: PayloadWithMongoMeta) => Payload<PayloadMetaFields>;
|
|
6
6
|
export declare const boundWitnessFromDbRepresentation: (value: BoundWitnessWithMongoMeta) => BoundWitness<BoundWitnessFields>;
|
|
7
|
-
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields &
|
|
7
|
+
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & BoundWitnessFields & {
|
|
8
8
|
schema: "network.xyo.boundwitness";
|
|
9
|
-
}) | (import("@xyo-network/payload-model").SchemaFields &
|
|
9
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & PayloadMetaFields<void> & {
|
|
10
10
|
schema: string;
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=fromDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;
|
|
1
|
+
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB,gEAAiE,CAAC;;;;EAIlG,CAAA"}
|
|
@@ -4,9 +4,9 @@ import { BoundWitnessWithMongoMeta } from '../BoundWitness';
|
|
|
4
4
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
5
5
|
export declare const payloadFromDbRepresentation: (value: PayloadWithMongoMeta) => Payload<PayloadMetaFields>;
|
|
6
6
|
export declare const boundWitnessFromDbRepresentation: (value: BoundWitnessWithMongoMeta) => BoundWitness<BoundWitnessFields>;
|
|
7
|
-
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields &
|
|
7
|
+
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & BoundWitnessFields & {
|
|
8
8
|
schema: "network.xyo.boundwitness";
|
|
9
|
-
}) | (import("@xyo-network/payload-model").SchemaFields &
|
|
9
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & PayloadMetaFields<void> & {
|
|
10
10
|
schema: string;
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=fromDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;
|
|
1
|
+
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB,gEAAiE,CAAC;;;;EAIlG,CAAA"}
|
|
@@ -4,9 +4,9 @@ import { BoundWitnessWithMongoMeta } from '../BoundWitness';
|
|
|
4
4
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
5
5
|
export declare const payloadFromDbRepresentation: (value: PayloadWithMongoMeta) => Payload<PayloadMetaFields>;
|
|
6
6
|
export declare const boundWitnessFromDbRepresentation: (value: BoundWitnessWithMongoMeta) => BoundWitness<BoundWitnessFields>;
|
|
7
|
-
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields &
|
|
7
|
+
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & BoundWitnessFields & {
|
|
8
8
|
schema: "network.xyo.boundwitness";
|
|
9
|
-
}) | (import("@xyo-network/payload-model").SchemaFields &
|
|
9
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & PayloadMetaFields<void> & {
|
|
10
10
|
schema: string;
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=fromDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;
|
|
1
|
+
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB,gEAAiE,CAAC;;;;EAIlG,CAAA"}
|
|
@@ -2,13 +2,13 @@ import { BoundWitnessMongoMeta } from '../BoundWitness';
|
|
|
2
2
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
3
3
|
export declare const payloadToDbRepresentation: <T extends {
|
|
4
4
|
schema: string;
|
|
5
|
-
} &
|
|
6
|
-
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields &
|
|
5
|
+
} & import("@xyo-network/payload-model").PayloadFields>(payload: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
6
|
+
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
7
7
|
schema: "network.xyo.boundwitness";
|
|
8
8
|
}>(payload: T) => Promise<BoundWitnessMongoMeta<T>>;
|
|
9
9
|
export declare const toDbRepresentation: <T extends ({
|
|
10
10
|
schema: string;
|
|
11
|
-
} &
|
|
11
|
+
} & import("@xyo-network/payload-model").PayloadFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
12
12
|
schema: "network.xyo.boundwitness";
|
|
13
13
|
})>(value: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
14
14
|
//# sourceMappingURL=toDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;
|
|
1
|
+
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;iEAAsC,CAAC,KAAG,QAAQ,qBAAqB,CAAC,CAAC,CAK9G,CAAA;AAED,eAAO,MAAM,8BAA8B;;YAA2C,CAAC,KAAG,QAAQ,sBAAsB,CAAC,CAAC,CAKzH,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;WAA6C,CAAC,qCAE5E,CAAA"}
|
|
@@ -2,13 +2,13 @@ import { BoundWitnessMongoMeta } from '../BoundWitness';
|
|
|
2
2
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
3
3
|
export declare const payloadToDbRepresentation: <T extends {
|
|
4
4
|
schema: string;
|
|
5
|
-
} &
|
|
6
|
-
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields &
|
|
5
|
+
} & import("@xyo-network/payload-model").PayloadFields>(payload: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
6
|
+
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
7
7
|
schema: "network.xyo.boundwitness";
|
|
8
8
|
}>(payload: T) => Promise<BoundWitnessMongoMeta<T>>;
|
|
9
9
|
export declare const toDbRepresentation: <T extends ({
|
|
10
10
|
schema: string;
|
|
11
|
-
} &
|
|
11
|
+
} & import("@xyo-network/payload-model").PayloadFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
12
12
|
schema: "network.xyo.boundwitness";
|
|
13
13
|
})>(value: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
14
14
|
//# sourceMappingURL=toDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;
|
|
1
|
+
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;iEAAsC,CAAC,KAAG,QAAQ,qBAAqB,CAAC,CAAC,CAK9G,CAAA;AAED,eAAO,MAAM,8BAA8B;;YAA2C,CAAC,KAAG,QAAQ,sBAAsB,CAAC,CAAC,CAKzH,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;WAA6C,CAAC,qCAE5E,CAAA"}
|
|
@@ -2,13 +2,13 @@ import { BoundWitnessMongoMeta } from '../BoundWitness';
|
|
|
2
2
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
3
3
|
export declare const payloadToDbRepresentation: <T extends {
|
|
4
4
|
schema: string;
|
|
5
|
-
} &
|
|
6
|
-
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields &
|
|
5
|
+
} & import("@xyo-network/payload-model").PayloadFields>(payload: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
6
|
+
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
7
7
|
schema: "network.xyo.boundwitness";
|
|
8
8
|
}>(payload: T) => Promise<BoundWitnessMongoMeta<T>>;
|
|
9
9
|
export declare const toDbRepresentation: <T extends ({
|
|
10
10
|
schema: string;
|
|
11
|
-
} &
|
|
11
|
+
} & import("@xyo-network/payload-model").PayloadFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
12
12
|
schema: "network.xyo.boundwitness";
|
|
13
13
|
})>(value: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
14
14
|
//# sourceMappingURL=toDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;
|
|
1
|
+
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;iEAAsC,CAAC,KAAG,QAAQ,qBAAqB,CAAC,CAAC,CAK9G,CAAA;AAED,eAAO,MAAM,8BAA8B;;YAA2C,CAAC,KAAG,QAAQ,sBAAsB,CAAC,CAAC,CAKzH,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;WAA6C,CAAC,qCAE5E,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Mappings/fromDbRepresentation.ts","../../src/Mappings/toDbRepresentation.ts"],"sourcesContent":["export * from './BoundWitness'\nexport * from './Mappings'\nexport * from './Payload'\n","import { BoundWitness, BoundWitnessFields, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { deepOmitPrefixedFields } from '@xyo-network/hash'\nimport { Payload, PayloadMetaFields } from '@xyo-network/payload-model'\n\nimport { BoundWitnessWithMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadFromDbRepresentation = (value: PayloadWithMongoMeta): Payload<PayloadMetaFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta }\n}\n\nexport const boundWitnessFromDbRepresentation = (value: BoundWitnessWithMongoMeta): BoundWitness<BoundWitnessFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta } as unknown as BoundWitness<BoundWitnessFields>\n}\n\nexport const fromDbRepresentation = <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => {\n return isBoundWitness(value) ?\n (boundWitnessFromDbRepresentation(value as unknown as BoundWitnessWithMongoMeta) as BoundWitness<BoundWitnessFields>)\n : (payloadFromDbRepresentation(value as PayloadWithMongoMeta) as Payload<PayloadMetaFields>)\n}\n","import { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { BoundWitnessMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadToDbRepresentation = async <T extends Payload>(payload: T): Promise<PayloadWithMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as PayloadWithMongoMeta<T>\n}\n\nexport const boundWitnessToDbRepresentation = async <T extends BoundWitness>(payload: T): Promise<BoundWitnessMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as BoundWitnessMongoMeta<T>\n}\n\nexport const toDbRepresentation = <T extends Payload | BoundWitness>(value: T) => {\n return isBoundWitness(value) ? boundWitnessToDbRepresentation(value) : payloadToDbRepresentation(value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACAA,gCAAiE;AACjE,kBAAuC;AAMhC,IAAMA,8BAA8B,wBAACC,UAAAA;AAC1C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,gBAAYC,oCAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJ2C;AAMpC,IAAMM,mCAAmC,wBAACR,UAAAA;AAC/C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,gBAAYC,oCAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJgD;AAMzC,IAAMO,uBAAuB,wBAAuDT,UAAAA;AACzF,aAAOU,0CAAeV,KAAAA,IACjBQ,iCAAiCR,KAAAA,IACjCD,4BAA4BC,KAAAA;AACnC,GAJoC;;;ACnBpC,IAAAW,6BAA6C;AAC7C,6BAA+B;AAMxB,IAAMC,4BAA4B,8BAA0BC,YAAAA;AACjE,QAAMC,QAAQ,MAAMC,sCAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,sCAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GALyC;AAOlC,IAAMC,iCAAiC,8BAA+Bd,YAAAA;AAC3E,QAAMC,QAAQ,MAAMC,sCAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,sCAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GAL8C;AAOvC,IAAME,qBAAqB,wBAAmCC,UAAAA;AACnE,aAAOC,2CAAeD,KAAAA,IAASF,+BAA+BE,KAAAA,IAASjB,0BAA0BiB,KAAAA;AACnG,GAFkC;","names":["payloadFromDbRepresentation","value","_$hash","_$meta","other","sanitized","deepOmitPrefixedFields","$hash","$meta","boundWitnessFromDbRepresentation","fromDbRepresentation","isBoundWitness","import_boundwitness_model","payloadToDbRepresentation","payload","built","PayloadBuilder","build","_hash","hash","$hash","$meta","fields","_$hash","_$meta","_timestamp","Date","now","boundWitnessToDbRepresentation","toDbRepresentation","value","isBoundWitness"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Mappings/fromDbRepresentation.ts","../../src/Mappings/toDbRepresentation.ts"],"sourcesContent":["export * from './BoundWitness'\nexport * from './Mappings'\nexport * from './Payload'\n","import { BoundWitness, BoundWitnessFields, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { deepOmitPrefixedFields } from '@xyo-network/hash'\nimport { Payload, PayloadMetaFields } from '@xyo-network/payload-model'\n\nimport { BoundWitnessWithMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadFromDbRepresentation = (value: PayloadWithMongoMeta): Payload<PayloadMetaFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta }\n}\n\nexport const boundWitnessFromDbRepresentation = (value: BoundWitnessWithMongoMeta): BoundWitness<BoundWitnessFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta } as unknown as BoundWitness<BoundWitnessFields>\n}\n\nexport const fromDbRepresentation = <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => {\n return isBoundWitness(value) ?\n (boundWitnessFromDbRepresentation(value as unknown as BoundWitnessWithMongoMeta) as BoundWitness<BoundWitnessFields>)\n : (payloadFromDbRepresentation(value as PayloadWithMongoMeta) as Payload<PayloadMetaFields>)\n}\n","import { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { BoundWitnessMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadToDbRepresentation = async <T extends Payload>(payload: T): Promise<PayloadWithMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as PayloadWithMongoMeta<T>\n}\n\nexport const boundWitnessToDbRepresentation = async <T extends BoundWitness>(payload: T): Promise<BoundWitnessMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as BoundWitnessMongoMeta<T>\n}\n\nexport const toDbRepresentation = <T extends Payload | BoundWitness>(value: T) => {\n return isBoundWitness(value) ? boundWitnessToDbRepresentation(value) : payloadToDbRepresentation(value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACAA,gCAAiE;AACjE,kBAAuC;AAMhC,IAAMA,8BAA8B,wBAACC,UAAAA;AAC1C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,gBAAYC,oCAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJ2C;AAMpC,IAAMM,mCAAmC,wBAACR,UAAAA;AAC/C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,gBAAYC,oCAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJgD;AAMzC,IAAMO,uBAAuB,wBAAuDT,UAAAA;AACzF,aAAOU,0CAAeV,KAAAA,IACjBQ,iCAAiCR,KAAAA,IACjCD,4BAA4BC,KAAAA;AACnC,GAJoC;;;ACnBpC,IAAAW,6BAA6C;AAC7C,6BAA+B;AAMxB,IAAMC,4BAA4B,8BAA0BC,YAAAA;AACjE,QAAMC,QAAQ,MAAMC,sCAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,sCAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GALyC;AAOlC,IAAMC,iCAAiC,8BAA+Bd,YAAAA;AAC3E,QAAMC,QAAQ,MAAMC,sCAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,sCAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GAL8C;AAOvC,IAAME,qBAAqB,wBAAmCC,UAAAA;AACnE,aAAOC,2CAAeD,KAAAA,IAASF,+BAA+BE,KAAAA,IAASjB,0BAA0BiB,KAAAA;AACnG,GAFkC;","names":["payloadFromDbRepresentation","value","_$hash","_$meta","other","sanitized","deepOmitPrefixedFields","$hash","$meta","boundWitnessFromDbRepresentation","fromDbRepresentation","isBoundWitness","import_boundwitness_model","payloadToDbRepresentation","payload","built","PayloadBuilder","build","_hash","hash","$hash","$meta","fields","_$hash","_$meta","_timestamp","Date","now","boundWitnessToDbRepresentation","toDbRepresentation","value","isBoundWitness"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Mappings/fromDbRepresentation.ts","../../src/Mappings/toDbRepresentation.ts"],"sourcesContent":["import { BoundWitness, BoundWitnessFields, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { deepOmitPrefixedFields } from '@xyo-network/hash'\nimport { Payload, PayloadMetaFields } from '@xyo-network/payload-model'\n\nimport { BoundWitnessWithMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadFromDbRepresentation = (value: PayloadWithMongoMeta): Payload<PayloadMetaFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta }\n}\n\nexport const boundWitnessFromDbRepresentation = (value: BoundWitnessWithMongoMeta): BoundWitness<BoundWitnessFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta } as unknown as BoundWitness<BoundWitnessFields>\n}\n\nexport const fromDbRepresentation = <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => {\n return isBoundWitness(value) ?\n (boundWitnessFromDbRepresentation(value as unknown as BoundWitnessWithMongoMeta) as BoundWitness<BoundWitnessFields>)\n : (payloadFromDbRepresentation(value as PayloadWithMongoMeta) as Payload<PayloadMetaFields>)\n}\n","import { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { BoundWitnessMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadToDbRepresentation = async <T extends Payload>(payload: T): Promise<PayloadWithMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as PayloadWithMongoMeta<T>\n}\n\nexport const boundWitnessToDbRepresentation = async <T extends BoundWitness>(payload: T): Promise<BoundWitnessMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as BoundWitnessMongoMeta<T>\n}\n\nexport const toDbRepresentation = <T extends Payload | BoundWitness>(value: T) => {\n return isBoundWitness(value) ? boundWitnessToDbRepresentation(value) : payloadToDbRepresentation(value)\n}\n"],"mappings":";;;;AAAA,SAA2CA,sBAAsB;AACjE,SAASC,8BAA8B;AAMhC,IAAMC,8BAA8B,wBAACC,UAAAA;AAC1C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,YAAYC,uBAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJ2C;AAMpC,IAAMM,mCAAmC,wBAACR,UAAAA;AAC/C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,YAAYC,uBAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJgD;AAMzC,IAAMO,uBAAuB,wBAAuDT,UAAAA;AACzF,SAAOU,eAAeV,KAAAA,IACjBQ,iCAAiCR,KAAAA,IACjCD,4BAA4BC,KAAAA;AACnC,GAJoC;;;ACnBpC,SAAuBW,kBAAAA,uBAAsB;AAC7C,SAASC,sBAAsB;AAMxB,IAAMC,4BAA4B,8BAA0BC,YAAAA;AACjE,QAAMC,QAAQ,MAAMC,eAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,eAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GALyC;AAOlC,IAAMC,iCAAiC,8BAA+Bd,YAAAA;AAC3E,QAAMC,QAAQ,MAAMC,eAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,eAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GAL8C;AAOvC,IAAME,qBAAqB,wBAAmCC,UAAAA;AACnE,SAAOC,gBAAeD,KAAAA,IAASF,+BAA+BE,KAAAA,IAASjB,0BAA0BiB,KAAAA;AACnG,GAFkC;","names":["isBoundWitness","deepOmitPrefixedFields","payloadFromDbRepresentation","value","_$hash","_$meta","other","sanitized","deepOmitPrefixedFields","$hash","$meta","boundWitnessFromDbRepresentation","fromDbRepresentation","isBoundWitness","isBoundWitness","PayloadBuilder","payloadToDbRepresentation","payload","built","PayloadBuilder","build","_hash","hash","$hash","$meta","fields","_$hash","_$meta","_timestamp","Date","now","boundWitnessToDbRepresentation","toDbRepresentation","value","isBoundWitness"]}
|
|
1
|
+
{"version":3,"sources":["../../src/Mappings/fromDbRepresentation.ts","../../src/Mappings/toDbRepresentation.ts"],"sourcesContent":["import { BoundWitness, BoundWitnessFields, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { deepOmitPrefixedFields } from '@xyo-network/hash'\nimport { Payload, PayloadMetaFields } from '@xyo-network/payload-model'\n\nimport { BoundWitnessWithMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadFromDbRepresentation = (value: PayloadWithMongoMeta): Payload<PayloadMetaFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta }\n}\n\nexport const boundWitnessFromDbRepresentation = (value: BoundWitnessWithMongoMeta): BoundWitness<BoundWitnessFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta } as unknown as BoundWitness<BoundWitnessFields>\n}\n\nexport const fromDbRepresentation = <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => {\n return isBoundWitness(value) ?\n (boundWitnessFromDbRepresentation(value as unknown as BoundWitnessWithMongoMeta) as BoundWitness<BoundWitnessFields>)\n : (payloadFromDbRepresentation(value as PayloadWithMongoMeta) as Payload<PayloadMetaFields>)\n}\n","import { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { BoundWitnessMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadToDbRepresentation = async <T extends Payload>(payload: T): Promise<PayloadWithMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as PayloadWithMongoMeta<T>\n}\n\nexport const boundWitnessToDbRepresentation = async <T extends BoundWitness>(payload: T): Promise<BoundWitnessMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as BoundWitnessMongoMeta<T>\n}\n\nexport const toDbRepresentation = <T extends Payload | BoundWitness>(value: T) => {\n return isBoundWitness(value) ? boundWitnessToDbRepresentation(value) : payloadToDbRepresentation(value)\n}\n"],"mappings":";;;;AAAA,SAA2CA,sBAAsB;AACjE,SAASC,8BAA8B;AAMhC,IAAMC,8BAA8B,wBAACC,UAAAA;AAC1C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,YAAYC,uBAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJ2C;AAMpC,IAAMM,mCAAmC,wBAACR,UAAAA;AAC/C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,YAAYC,uBAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJgD;AAMzC,IAAMO,uBAAuB,wBAAuDT,UAAAA;AACzF,SAAOU,eAAeV,KAAAA,IACjBQ,iCAAiCR,KAAAA,IACjCD,4BAA4BC,KAAAA;AACnC,GAJoC;;;ACnBpC,SAAuBW,kBAAAA,uBAAsB;AAC7C,SAASC,sBAAsB;AAMxB,IAAMC,4BAA4B,8BAA0BC,YAAAA;AACjE,QAAMC,QAAQ,MAAMC,eAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,eAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GALyC;AAOlC,IAAMC,iCAAiC,8BAA+Bd,YAAAA;AAC3E,QAAMC,QAAQ,MAAMC,eAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,eAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GAL8C;AAOvC,IAAME,qBAAqB,wBAAmCC,UAAAA;AACnE,SAAOC,gBAAeD,KAAAA,IAASF,+BAA+BE,KAAAA,IAASjB,0BAA0BiB,KAAAA;AACnG,GAFkC;","names":["isBoundWitness","deepOmitPrefixedFields","payloadFromDbRepresentation","value","_$hash","_$meta","other","sanitized","deepOmitPrefixedFields","$hash","$meta","boundWitnessFromDbRepresentation","fromDbRepresentation","isBoundWitness","isBoundWitness","PayloadBuilder","payloadToDbRepresentation","payload","built","PayloadBuilder","build","_hash","hash","$hash","$meta","fields","_$hash","_$meta","_timestamp","Date","now","boundWitnessToDbRepresentation","toDbRepresentation","value","isBoundWitness"]}
|
|
@@ -4,9 +4,9 @@ import { BoundWitnessWithMongoMeta } from '../BoundWitness';
|
|
|
4
4
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
5
5
|
export declare const payloadFromDbRepresentation: (value: PayloadWithMongoMeta) => Payload<PayloadMetaFields>;
|
|
6
6
|
export declare const boundWitnessFromDbRepresentation: (value: BoundWitnessWithMongoMeta) => BoundWitness<BoundWitnessFields>;
|
|
7
|
-
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields &
|
|
7
|
+
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & BoundWitnessFields & {
|
|
8
8
|
schema: "network.xyo.boundwitness";
|
|
9
|
-
}) | (import("@xyo-network/payload-model").SchemaFields &
|
|
9
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & PayloadMetaFields<void> & {
|
|
10
10
|
schema: string;
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=fromDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;
|
|
1
|
+
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB,gEAAiE,CAAC;;;;EAIlG,CAAA"}
|
|
@@ -4,9 +4,9 @@ import { BoundWitnessWithMongoMeta } from '../BoundWitness';
|
|
|
4
4
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
5
5
|
export declare const payloadFromDbRepresentation: (value: PayloadWithMongoMeta) => Payload<PayloadMetaFields>;
|
|
6
6
|
export declare const boundWitnessFromDbRepresentation: (value: BoundWitnessWithMongoMeta) => BoundWitness<BoundWitnessFields>;
|
|
7
|
-
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields &
|
|
7
|
+
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & BoundWitnessFields & {
|
|
8
8
|
schema: "network.xyo.boundwitness";
|
|
9
|
-
}) | (import("@xyo-network/payload-model").SchemaFields &
|
|
9
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & PayloadMetaFields<void> & {
|
|
10
10
|
schema: string;
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=fromDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;
|
|
1
|
+
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB,gEAAiE,CAAC;;;;EAIlG,CAAA"}
|
|
@@ -4,9 +4,9 @@ import { BoundWitnessWithMongoMeta } from '../BoundWitness';
|
|
|
4
4
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
5
5
|
export declare const payloadFromDbRepresentation: (value: PayloadWithMongoMeta) => Payload<PayloadMetaFields>;
|
|
6
6
|
export declare const boundWitnessFromDbRepresentation: (value: BoundWitnessWithMongoMeta) => BoundWitness<BoundWitnessFields>;
|
|
7
|
-
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields &
|
|
7
|
+
export declare const fromDbRepresentation: <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & BoundWitnessFields & {
|
|
8
8
|
schema: "network.xyo.boundwitness";
|
|
9
|
-
}) | (import("@xyo-network/payload-model").SchemaFields &
|
|
9
|
+
}) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & PayloadMetaFields<void> & {
|
|
10
10
|
schema: string;
|
|
11
11
|
});
|
|
12
12
|
//# sourceMappingURL=fromDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;
|
|
1
|
+
{"version":3,"file":"fromDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/fromDbRepresentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAkB,MAAM,iCAAiC,CAAA;AAElG,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAC3D,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,2BAA2B,UAAW,oBAAoB,KAAG,QAAQ,iBAAiB,CAIlG,CAAA;AAED,eAAO,MAAM,gCAAgC,UAAW,yBAAyB,KAAG,aAAa,kBAAkB,CAIlH,CAAA;AAED,eAAO,MAAM,oBAAoB,gEAAiE,CAAC;;;;EAIlG,CAAA"}
|
|
@@ -2,13 +2,13 @@ import { BoundWitnessMongoMeta } from '../BoundWitness';
|
|
|
2
2
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
3
3
|
export declare const payloadToDbRepresentation: <T extends {
|
|
4
4
|
schema: string;
|
|
5
|
-
} &
|
|
6
|
-
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields &
|
|
5
|
+
} & import("@xyo-network/payload-model").PayloadFields>(payload: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
6
|
+
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
7
7
|
schema: "network.xyo.boundwitness";
|
|
8
8
|
}>(payload: T) => Promise<BoundWitnessMongoMeta<T>>;
|
|
9
9
|
export declare const toDbRepresentation: <T extends ({
|
|
10
10
|
schema: string;
|
|
11
|
-
} &
|
|
11
|
+
} & import("@xyo-network/payload-model").PayloadFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
12
12
|
schema: "network.xyo.boundwitness";
|
|
13
13
|
})>(value: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
14
14
|
//# sourceMappingURL=toDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;
|
|
1
|
+
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;iEAAsC,CAAC,KAAG,QAAQ,qBAAqB,CAAC,CAAC,CAK9G,CAAA;AAED,eAAO,MAAM,8BAA8B;;YAA2C,CAAC,KAAG,QAAQ,sBAAsB,CAAC,CAAC,CAKzH,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;WAA6C,CAAC,qCAE5E,CAAA"}
|
|
@@ -2,13 +2,13 @@ import { BoundWitnessMongoMeta } from '../BoundWitness';
|
|
|
2
2
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
3
3
|
export declare const payloadToDbRepresentation: <T extends {
|
|
4
4
|
schema: string;
|
|
5
|
-
} &
|
|
6
|
-
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields &
|
|
5
|
+
} & import("@xyo-network/payload-model").PayloadFields>(payload: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
6
|
+
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
7
7
|
schema: "network.xyo.boundwitness";
|
|
8
8
|
}>(payload: T) => Promise<BoundWitnessMongoMeta<T>>;
|
|
9
9
|
export declare const toDbRepresentation: <T extends ({
|
|
10
10
|
schema: string;
|
|
11
|
-
} &
|
|
11
|
+
} & import("@xyo-network/payload-model").PayloadFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
12
12
|
schema: "network.xyo.boundwitness";
|
|
13
13
|
})>(value: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
14
14
|
//# sourceMappingURL=toDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;
|
|
1
|
+
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;iEAAsC,CAAC,KAAG,QAAQ,qBAAqB,CAAC,CAAC,CAK9G,CAAA;AAED,eAAO,MAAM,8BAA8B;;YAA2C,CAAC,KAAG,QAAQ,sBAAsB,CAAC,CAAC,CAKzH,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;WAA6C,CAAC,qCAE5E,CAAA"}
|
|
@@ -2,13 +2,13 @@ import { BoundWitnessMongoMeta } from '../BoundWitness';
|
|
|
2
2
|
import { PayloadWithMongoMeta } from '../Payload';
|
|
3
3
|
export declare const payloadToDbRepresentation: <T extends {
|
|
4
4
|
schema: string;
|
|
5
|
-
} &
|
|
6
|
-
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields &
|
|
5
|
+
} & import("@xyo-network/payload-model").PayloadFields>(payload: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
6
|
+
export declare const boundWitnessToDbRepresentation: <T extends import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
7
7
|
schema: "network.xyo.boundwitness";
|
|
8
8
|
}>(payload: T) => Promise<BoundWitnessMongoMeta<T>>;
|
|
9
9
|
export declare const toDbRepresentation: <T extends ({
|
|
10
10
|
schema: string;
|
|
11
|
-
} &
|
|
11
|
+
} & import("@xyo-network/payload-model").PayloadFields) | (import("@xyo-network/payload-model").SchemaFields & import("@xyo-network/payload-model").PayloadFields & import("@xyo-network/boundwitness-model").BoundWitnessFields & {
|
|
12
12
|
schema: "network.xyo.boundwitness";
|
|
13
13
|
})>(value: T) => Promise<PayloadWithMongoMeta<T>>;
|
|
14
14
|
//# sourceMappingURL=toDbRepresentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;
|
|
1
|
+
{"version":3,"file":"toDbRepresentation.d.ts","sourceRoot":"","sources":["../../../src/Mappings/toDbRepresentation.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,yBAAyB;;iEAAsC,CAAC,KAAG,QAAQ,qBAAqB,CAAC,CAAC,CAK9G,CAAA;AAED,eAAO,MAAM,8BAA8B;;YAA2C,CAAC,KAAG,QAAQ,sBAAsB,CAAC,CAAC,CAKzH,CAAA;AAED,eAAO,MAAM,kBAAkB;;;;WAA6C,CAAC,qCAE5E,CAAA"}
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Mappings/fromDbRepresentation.ts","../../src/Mappings/toDbRepresentation.ts"],"sourcesContent":["export * from './BoundWitness'\nexport * from './Mappings'\nexport * from './Payload'\n","import { BoundWitness, BoundWitnessFields, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { deepOmitPrefixedFields } from '@xyo-network/hash'\nimport { Payload, PayloadMetaFields } from '@xyo-network/payload-model'\n\nimport { BoundWitnessWithMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadFromDbRepresentation = (value: PayloadWithMongoMeta): Payload<PayloadMetaFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta }\n}\n\nexport const boundWitnessFromDbRepresentation = (value: BoundWitnessWithMongoMeta): BoundWitness<BoundWitnessFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta } as unknown as BoundWitness<BoundWitnessFields>\n}\n\nexport const fromDbRepresentation = <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => {\n return isBoundWitness(value) ?\n (boundWitnessFromDbRepresentation(value as unknown as BoundWitnessWithMongoMeta) as BoundWitness<BoundWitnessFields>)\n : (payloadFromDbRepresentation(value as PayloadWithMongoMeta) as Payload<PayloadMetaFields>)\n}\n","import { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { BoundWitnessMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadToDbRepresentation = async <T extends Payload>(payload: T): Promise<PayloadWithMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as PayloadWithMongoMeta<T>\n}\n\nexport const boundWitnessToDbRepresentation = async <T extends BoundWitness>(payload: T): Promise<BoundWitnessMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as BoundWitnessMongoMeta<T>\n}\n\nexport const toDbRepresentation = <T extends Payload | BoundWitness>(value: T) => {\n return isBoundWitness(value) ? boundWitnessToDbRepresentation(value) : payloadToDbRepresentation(value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACAA,gCAAiE;AACjE,kBAAuC;AAMhC,IAAMA,8BAA8B,wBAACC,UAAAA;AAC1C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,gBAAYC,oCAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJ2C;AAMpC,IAAMM,mCAAmC,wBAACR,UAAAA;AAC/C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,gBAAYC,oCAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJgD;AAMzC,IAAMO,uBAAuB,wBAAuDT,UAAAA;AACzF,aAAOU,0CAAeV,KAAAA,IACjBQ,iCAAiCR,KAAAA,IACjCD,4BAA4BC,KAAAA;AACnC,GAJoC;;;ACnBpC,IAAAW,6BAA6C;AAC7C,6BAA+B;AAMxB,IAAMC,4BAA4B,8BAA0BC,YAAAA;AACjE,QAAMC,QAAQ,MAAMC,sCAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,sCAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GALyC;AAOlC,IAAMC,iCAAiC,8BAA+Bd,YAAAA;AAC3E,QAAMC,QAAQ,MAAMC,sCAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,sCAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GAL8C;AAOvC,IAAME,qBAAqB,wBAAmCC,UAAAA;AACnE,aAAOC,2CAAeD,KAAAA,IAASF,+BAA+BE,KAAAA,IAASjB,0BAA0BiB,KAAAA;AACnG,GAFkC;","names":["payloadFromDbRepresentation","value","_$hash","_$meta","other","sanitized","deepOmitPrefixedFields","$hash","$meta","boundWitnessFromDbRepresentation","fromDbRepresentation","isBoundWitness","import_boundwitness_model","payloadToDbRepresentation","payload","built","PayloadBuilder","build","_hash","hash","$hash","$meta","fields","_$hash","_$meta","_timestamp","Date","now","boundWitnessToDbRepresentation","toDbRepresentation","value","isBoundWitness"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Mappings/fromDbRepresentation.ts","../../src/Mappings/toDbRepresentation.ts"],"sourcesContent":["export * from './BoundWitness'\nexport * from './Mappings'\nexport * from './Payload'\n","import { BoundWitness, BoundWitnessFields, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { deepOmitPrefixedFields } from '@xyo-network/hash'\nimport { Payload, PayloadMetaFields } from '@xyo-network/payload-model'\n\nimport { BoundWitnessWithMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadFromDbRepresentation = (value: PayloadWithMongoMeta): Payload<PayloadMetaFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta }\n}\n\nexport const boundWitnessFromDbRepresentation = (value: BoundWitnessWithMongoMeta): BoundWitness<BoundWitnessFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta } as unknown as BoundWitness<BoundWitnessFields>\n}\n\nexport const fromDbRepresentation = <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => {\n return isBoundWitness(value) ?\n (boundWitnessFromDbRepresentation(value as unknown as BoundWitnessWithMongoMeta) as BoundWitness<BoundWitnessFields>)\n : (payloadFromDbRepresentation(value as PayloadWithMongoMeta) as Payload<PayloadMetaFields>)\n}\n","import { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { BoundWitnessMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadToDbRepresentation = async <T extends Payload>(payload: T): Promise<PayloadWithMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as PayloadWithMongoMeta<T>\n}\n\nexport const boundWitnessToDbRepresentation = async <T extends BoundWitness>(payload: T): Promise<BoundWitnessMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as BoundWitnessMongoMeta<T>\n}\n\nexport const toDbRepresentation = <T extends Payload | BoundWitness>(value: T) => {\n return isBoundWitness(value) ? boundWitnessToDbRepresentation(value) : payloadToDbRepresentation(value)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;ACAA,gCAAiE;AACjE,kBAAuC;AAMhC,IAAMA,8BAA8B,wBAACC,UAAAA;AAC1C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,gBAAYC,oCAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJ2C;AAMpC,IAAMM,mCAAmC,wBAACR,UAAAA;AAC/C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,gBAAYC,oCAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJgD;AAMzC,IAAMO,uBAAuB,wBAAuDT,UAAAA;AACzF,aAAOU,0CAAeV,KAAAA,IACjBQ,iCAAiCR,KAAAA,IACjCD,4BAA4BC,KAAAA;AACnC,GAJoC;;;ACnBpC,IAAAW,6BAA6C;AAC7C,6BAA+B;AAMxB,IAAMC,4BAA4B,8BAA0BC,YAAAA;AACjE,QAAMC,QAAQ,MAAMC,sCAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,sCAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GALyC;AAOlC,IAAMC,iCAAiC,8BAA+Bd,YAAAA;AAC3E,QAAMC,QAAQ,MAAMC,sCAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,sCAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GAL8C;AAOvC,IAAME,qBAAqB,wBAAmCC,UAAAA;AACnE,aAAOC,2CAAeD,KAAAA,IAASF,+BAA+BE,KAAAA,IAASjB,0BAA0BiB,KAAAA;AACnG,GAFkC;","names":["payloadFromDbRepresentation","value","_$hash","_$meta","other","sanitized","deepOmitPrefixedFields","$hash","$meta","boundWitnessFromDbRepresentation","fromDbRepresentation","isBoundWitness","import_boundwitness_model","payloadToDbRepresentation","payload","built","PayloadBuilder","build","_hash","hash","$hash","$meta","fields","_$hash","_$meta","_timestamp","Date","now","boundWitnessToDbRepresentation","toDbRepresentation","value","isBoundWitness"]}
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Mappings/fromDbRepresentation.ts","../../src/Mappings/toDbRepresentation.ts"],"sourcesContent":["import { BoundWitness, BoundWitnessFields, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { deepOmitPrefixedFields } from '@xyo-network/hash'\nimport { Payload, PayloadMetaFields } from '@xyo-network/payload-model'\n\nimport { BoundWitnessWithMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadFromDbRepresentation = (value: PayloadWithMongoMeta): Payload<PayloadMetaFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta }\n}\n\nexport const boundWitnessFromDbRepresentation = (value: BoundWitnessWithMongoMeta): BoundWitness<BoundWitnessFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta } as unknown as BoundWitness<BoundWitnessFields>\n}\n\nexport const fromDbRepresentation = <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => {\n return isBoundWitness(value) ?\n (boundWitnessFromDbRepresentation(value as unknown as BoundWitnessWithMongoMeta) as BoundWitness<BoundWitnessFields>)\n : (payloadFromDbRepresentation(value as PayloadWithMongoMeta) as Payload<PayloadMetaFields>)\n}\n","import { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { BoundWitnessMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadToDbRepresentation = async <T extends Payload>(payload: T): Promise<PayloadWithMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as PayloadWithMongoMeta<T>\n}\n\nexport const boundWitnessToDbRepresentation = async <T extends BoundWitness>(payload: T): Promise<BoundWitnessMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as BoundWitnessMongoMeta<T>\n}\n\nexport const toDbRepresentation = <T extends Payload | BoundWitness>(value: T) => {\n return isBoundWitness(value) ? boundWitnessToDbRepresentation(value) : payloadToDbRepresentation(value)\n}\n"],"mappings":";;;;AAAA,SAA2CA,sBAAsB;AACjE,SAASC,8BAA8B;AAMhC,IAAMC,8BAA8B,wBAACC,UAAAA;AAC1C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,YAAYC,uBAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJ2C;AAMpC,IAAMM,mCAAmC,wBAACR,UAAAA;AAC/C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,YAAYC,uBAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJgD;AAMzC,IAAMO,uBAAuB,wBAAuDT,UAAAA;AACzF,SAAOU,eAAeV,KAAAA,IACjBQ,iCAAiCR,KAAAA,IACjCD,4BAA4BC,KAAAA;AACnC,GAJoC;;;ACnBpC,SAAuBW,kBAAAA,uBAAsB;AAC7C,SAASC,sBAAsB;AAMxB,IAAMC,4BAA4B,8BAA0BC,YAAAA;AACjE,QAAMC,QAAQ,MAAMC,eAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,eAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GALyC;AAOlC,IAAMC,iCAAiC,8BAA+Bd,YAAAA;AAC3E,QAAMC,QAAQ,MAAMC,eAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,eAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GAL8C;AAOvC,IAAME,qBAAqB,wBAAmCC,UAAAA;AACnE,SAAOC,gBAAeD,KAAAA,IAASF,+BAA+BE,KAAAA,IAASjB,0BAA0BiB,KAAAA;AACnG,GAFkC;","names":["isBoundWitness","deepOmitPrefixedFields","payloadFromDbRepresentation","value","_$hash","_$meta","other","sanitized","deepOmitPrefixedFields","$hash","$meta","boundWitnessFromDbRepresentation","fromDbRepresentation","isBoundWitness","isBoundWitness","PayloadBuilder","payloadToDbRepresentation","payload","built","PayloadBuilder","build","_hash","hash","$hash","$meta","fields","_$hash","_$meta","_timestamp","Date","now","boundWitnessToDbRepresentation","toDbRepresentation","value","isBoundWitness"]}
|
|
1
|
+
{"version":3,"sources":["../../src/Mappings/fromDbRepresentation.ts","../../src/Mappings/toDbRepresentation.ts"],"sourcesContent":["import { BoundWitness, BoundWitnessFields, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { deepOmitPrefixedFields } from '@xyo-network/hash'\nimport { Payload, PayloadMetaFields } from '@xyo-network/payload-model'\n\nimport { BoundWitnessWithMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadFromDbRepresentation = (value: PayloadWithMongoMeta): Payload<PayloadMetaFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta }\n}\n\nexport const boundWitnessFromDbRepresentation = (value: BoundWitnessWithMongoMeta): BoundWitness<BoundWitnessFields> => {\n const { _$hash, _$meta, ...other } = value\n const sanitized = deepOmitPrefixedFields(other, '_')\n return { ...sanitized, $hash: _$hash, $meta: _$meta } as unknown as BoundWitness<BoundWitnessFields>\n}\n\nexport const fromDbRepresentation = <T = PayloadWithMongoMeta | BoundWitnessWithMongoMeta>(value: T) => {\n return isBoundWitness(value) ?\n (boundWitnessFromDbRepresentation(value as unknown as BoundWitnessWithMongoMeta) as BoundWitness<BoundWitnessFields>)\n : (payloadFromDbRepresentation(value as PayloadWithMongoMeta) as Payload<PayloadMetaFields>)\n}\n","import { BoundWitness, isBoundWitness } from '@xyo-network/boundwitness-model'\nimport { PayloadBuilder } from '@xyo-network/payload-builder'\nimport { Payload } from '@xyo-network/payload-model'\n\nimport { BoundWitnessMongoMeta } from '../BoundWitness'\nimport { PayloadWithMongoMeta } from '../Payload'\n\nexport const payloadToDbRepresentation = async <T extends Payload>(payload: T): Promise<PayloadWithMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as PayloadWithMongoMeta<T>\n}\n\nexport const boundWitnessToDbRepresentation = async <T extends BoundWitness>(payload: T): Promise<BoundWitnessMongoMeta<T>> => {\n const built = await PayloadBuilder.build(payload)\n const _hash = await PayloadBuilder.hash(built)\n const { $hash, $meta, ...fields } = built\n return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as BoundWitnessMongoMeta<T>\n}\n\nexport const toDbRepresentation = <T extends Payload | BoundWitness>(value: T) => {\n return isBoundWitness(value) ? boundWitnessToDbRepresentation(value) : payloadToDbRepresentation(value)\n}\n"],"mappings":";;;;AAAA,SAA2CA,sBAAsB;AACjE,SAASC,8BAA8B;AAMhC,IAAMC,8BAA8B,wBAACC,UAAAA;AAC1C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,YAAYC,uBAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJ2C;AAMpC,IAAMM,mCAAmC,wBAACR,UAAAA;AAC/C,QAAM,EAAEC,QAAQC,QAAQ,GAAGC,MAAAA,IAAUH;AACrC,QAAMI,YAAYC,uBAAuBF,OAAO,GAAA;AAChD,SAAO;IAAE,GAAGC;IAAWE,OAAOL;IAAQM,OAAOL;EAAO;AACtD,GAJgD;AAMzC,IAAMO,uBAAuB,wBAAuDT,UAAAA;AACzF,SAAOU,eAAeV,KAAAA,IACjBQ,iCAAiCR,KAAAA,IACjCD,4BAA4BC,KAAAA;AACnC,GAJoC;;;ACnBpC,SAAuBW,kBAAAA,uBAAsB;AAC7C,SAASC,sBAAsB;AAMxB,IAAMC,4BAA4B,8BAA0BC,YAAAA;AACjE,QAAMC,QAAQ,MAAMC,eAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,eAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GALyC;AAOlC,IAAMC,iCAAiC,8BAA+Bd,YAAAA;AAC3E,QAAMC,QAAQ,MAAMC,eAAeC,MAAMH,OAAAA;AACzC,QAAMI,QAAQ,MAAMF,eAAeG,KAAKJ,KAAAA;AACxC,QAAM,EAAEK,OAAOC,OAAO,GAAGC,OAAAA,IAAWP;AACpC,SAAO;IAAE,GAAGO;IAAQC,QAAQH;IAAOI,QAAQH;IAAOH;IAAOO,YAAYC,KAAKC,IAAG;EAAG;AAClF,GAL8C;AAOvC,IAAME,qBAAqB,wBAAmCC,UAAAA;AACnE,SAAOC,gBAAeD,KAAAA,IAASF,+BAA+BE,KAAAA,IAASjB,0BAA0BiB,KAAAA;AACnG,GAFkC;","names":["isBoundWitness","deepOmitPrefixedFields","payloadFromDbRepresentation","value","_$hash","_$meta","other","sanitized","deepOmitPrefixedFields","$hash","$meta","boundWitnessFromDbRepresentation","fromDbRepresentation","isBoundWitness","isBoundWitness","PayloadBuilder","payloadToDbRepresentation","payload","built","PayloadBuilder","build","_hash","hash","$hash","$meta","fields","_$hash","_$meta","_timestamp","Date","now","boundWitnessToDbRepresentation","toDbRepresentation","value","isBoundWitness"]}
|
package/package.json
CHANGED
|
@@ -10,18 +10,18 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xylabs/hex": "^3.0.
|
|
14
|
-
"@xylabs/object": "^3.0.
|
|
15
|
-
"@xyo-network/boundwitness-model": "^2.
|
|
16
|
-
"@xyo-network/hash": "^2.
|
|
17
|
-
"@xyo-network/payload-builder": "^2.
|
|
18
|
-
"@xyo-network/payload-model": "^2.
|
|
13
|
+
"@xylabs/hex": "^3.0.24",
|
|
14
|
+
"@xylabs/object": "^3.0.24",
|
|
15
|
+
"@xyo-network/boundwitness-model": "^2.93.4",
|
|
16
|
+
"@xyo-network/hash": "^2.93.4",
|
|
17
|
+
"@xyo-network/payload-builder": "^2.93.4",
|
|
18
|
+
"@xyo-network/payload-model": "^2.93.4"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
22
|
-
"@xylabs/tsconfig": "^3.
|
|
21
|
+
"@xylabs/ts-scripts-yarn3": "^3.5.2",
|
|
22
|
+
"@xylabs/tsconfig": "^3.5.2",
|
|
23
23
|
"fake-indexeddb": "^4.0.2",
|
|
24
|
-
"typescript": "^5.4.
|
|
24
|
+
"typescript": "^5.4.3"
|
|
25
25
|
},
|
|
26
26
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
27
27
|
"types": "dist/node/index.d.ts",
|
|
@@ -62,6 +62,6 @@
|
|
|
62
62
|
"url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js.git"
|
|
63
63
|
},
|
|
64
64
|
"sideEffects": false,
|
|
65
|
-
"version": "2.86.
|
|
65
|
+
"version": "2.86.1",
|
|
66
66
|
"type": "module"
|
|
67
67
|
}
|
|
@@ -9,7 +9,7 @@ export const payloadToDbRepresentation = async <T extends Payload>(payload: T):
|
|
|
9
9
|
const built = await PayloadBuilder.build(payload)
|
|
10
10
|
const _hash = await PayloadBuilder.hash(built)
|
|
11
11
|
const { $hash, $meta, ...fields } = built
|
|
12
|
-
return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as PayloadWithMongoMeta<T>
|
|
12
|
+
return { ...fields, _$hash: $hash, _$meta: $meta, _hash, _timestamp: Date.now() } as unknown as PayloadWithMongoMeta<T>
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
export const boundWitnessToDbRepresentation = async <T extends BoundWitness>(payload: T): Promise<BoundWitnessMongoMeta<T>> => {
|