@xyo-network/boundwitness-model 2.107.1 → 2.107.4
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/index.cjs +67 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +44 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +67 -1
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +44 -1
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +80 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +44 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +4 -4
package/dist/browser/index.cjs
CHANGED
|
@@ -1,2 +1,68 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
BoundWitnessJsonSchema: () => BoundWitnessJsonSchema,
|
|
24
|
+
BoundWitnessSchema: () => BoundWitnessSchema,
|
|
25
|
+
QueryBoundWitnessSchema: () => QueryBoundWitnessSchema,
|
|
26
|
+
asBoundWitness: () => asBoundWitness,
|
|
27
|
+
isBoundWitness: () => isBoundWitness,
|
|
28
|
+
isBoundWitnessPayload: () => isBoundWitnessPayload,
|
|
29
|
+
isBoundWitnessWithMeta: () => isBoundWitnessWithMeta,
|
|
30
|
+
isQueryBoundWitness: () => isQueryBoundWitness,
|
|
31
|
+
isQueryBoundWitnessWithMeta: () => isQueryBoundWitnessWithMeta,
|
|
32
|
+
notBoundWitness: () => notBoundWitness
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(src_exports);
|
|
35
|
+
|
|
36
|
+
// src/BoundWitness/BoundWitnessJsonSchema.ts
|
|
37
|
+
var BoundWitnessJsonSchema = () => {
|
|
38
|
+
return {
|
|
39
|
+
$id: "https://schemas.xyo.network/2.0/boundwitness",
|
|
40
|
+
additionalProperties: false,
|
|
41
|
+
properties: {
|
|
42
|
+
addresses: { items: { type: "string" }, type: "array" },
|
|
43
|
+
payload_hashes: { items: { type: "string" }, type: "array" },
|
|
44
|
+
payload_schemas: { items: { type: "string" }, type: "array" },
|
|
45
|
+
previous_hashes: { items: { nullable: true, type: "string" }, type: "array" },
|
|
46
|
+
schema: { type: "string" }
|
|
47
|
+
},
|
|
48
|
+
required: ["addresses", "payload_hashes", "payload_schemas", "previous_hashes", "schema"],
|
|
49
|
+
type: "object"
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// src/BoundWitness/BoundWitnessSchema.ts
|
|
54
|
+
var BoundWitnessSchema = "network.xyo.boundwitness";
|
|
55
|
+
|
|
56
|
+
// src/isBoundWitness.ts
|
|
57
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
58
|
+
var isBoundWitness = (value) => (0, import_payload_model.isPayloadOfSchemaType)(BoundWitnessSchema)(value);
|
|
59
|
+
var isBoundWitnessWithMeta = (value) => (0, import_payload_model.isPayloadOfSchemaTypeWithMeta)(BoundWitnessSchema)(value);
|
|
60
|
+
var notBoundWitness = (0, import_payload_model.notPayloadOfSchemaType)(BoundWitnessSchema);
|
|
61
|
+
var asBoundWitness = (payload) => isBoundWitness(payload) ? payload : void 0;
|
|
62
|
+
var isBoundWitnessPayload = isBoundWitness;
|
|
63
|
+
|
|
64
|
+
// src/QueryBoundWitness.ts
|
|
65
|
+
var QueryBoundWitnessSchema = BoundWitnessSchema;
|
|
66
|
+
var isQueryBoundWitness = (x) => isBoundWitness(x) && x?.query !== void 0;
|
|
67
|
+
var isQueryBoundWitnessWithMeta = (x) => isBoundWitness(x) && isBoundWitnessWithMeta(x) && x?.query !== void 0;
|
|
2
68
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["export * from './BoundWitness'\nexport * from './isBoundWitness'\nexport * from './QueryBoundWitness'\n","//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["export * from './BoundWitness'\nexport * from './isBoundWitness'\nexport * from './QueryBoundWitness'\n","//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,yBAAyB,MAAM;AAC1C,SAAO;AAAA,IACL,KAAK;AAAA,IACL,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACV,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MACtD,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC3D,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5D,iBAAiB,EAAE,OAAO,EAAE,UAAU,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA,IAC3B;AAAA,IACA,UAAU,CAAC,aAAa,kBAAkB,mBAAmB,mBAAmB,QAAQ;AAAA,IACxF,MAAM;AAAA,EACR;AACF;;;AChBO,IAAM,qBAAyC;;;ACDtD,2BAAuG;AAIhG,IAAM,iBAAiB,CAAC,cAA0C,4CAAoC,kBAAkB,EAAE,KAAK;AAC/H,IAAM,yBAAyB,CAAC,cACrC,oDAA4C,kBAAkB,EAAE,KAAK;AAChE,IAAM,sBAAkB,6CAAqC,kBAAkB;AAE/E,IAAM,iBAAiB,CAA4D,YACxF,eAAe,OAAO,IAAK,UAAgB;AAGtC,IAAM,wBAAwB;;;ACN9B,IAAM,0BAAmD;AASzD,IAAM,sBAAsB,CAAC,MAAwC,eAAe,CAAC,KAAM,GAAyB,UAAU;AAC9H,IAAM,8BAA8B,CAAC,MAC1C,eAAe,CAAC,KAAK,uBAAuB,CAAC,KAAM,GAAmC,UAAU;","names":[]}
|
package/dist/browser/index.js
CHANGED
|
@@ -1,2 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
// src/BoundWitness/BoundWitnessJsonSchema.ts
|
|
2
|
+
var BoundWitnessJsonSchema = () => {
|
|
3
|
+
return {
|
|
4
|
+
$id: "https://schemas.xyo.network/2.0/boundwitness",
|
|
5
|
+
additionalProperties: false,
|
|
6
|
+
properties: {
|
|
7
|
+
addresses: { items: { type: "string" }, type: "array" },
|
|
8
|
+
payload_hashes: { items: { type: "string" }, type: "array" },
|
|
9
|
+
payload_schemas: { items: { type: "string" }, type: "array" },
|
|
10
|
+
previous_hashes: { items: { nullable: true, type: "string" }, type: "array" },
|
|
11
|
+
schema: { type: "string" }
|
|
12
|
+
},
|
|
13
|
+
required: ["addresses", "payload_hashes", "payload_schemas", "previous_hashes", "schema"],
|
|
14
|
+
type: "object"
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/BoundWitness/BoundWitnessSchema.ts
|
|
19
|
+
var BoundWitnessSchema = "network.xyo.boundwitness";
|
|
20
|
+
|
|
21
|
+
// src/isBoundWitness.ts
|
|
22
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
23
|
+
var isBoundWitness = (value) => isPayloadOfSchemaType(BoundWitnessSchema)(value);
|
|
24
|
+
var isBoundWitnessWithMeta = (value) => isPayloadOfSchemaTypeWithMeta(BoundWitnessSchema)(value);
|
|
25
|
+
var notBoundWitness = notPayloadOfSchemaType(BoundWitnessSchema);
|
|
26
|
+
var asBoundWitness = (payload) => isBoundWitness(payload) ? payload : void 0;
|
|
27
|
+
var isBoundWitnessPayload = isBoundWitness;
|
|
28
|
+
|
|
29
|
+
// src/QueryBoundWitness.ts
|
|
30
|
+
var QueryBoundWitnessSchema = BoundWitnessSchema;
|
|
31
|
+
var isQueryBoundWitness = (x) => isBoundWitness(x) && x?.query !== void 0;
|
|
32
|
+
var isQueryBoundWitnessWithMeta = (x) => isBoundWitness(x) && isBoundWitnessWithMeta(x) && x?.query !== void 0;
|
|
33
|
+
export {
|
|
34
|
+
BoundWitnessJsonSchema,
|
|
35
|
+
BoundWitnessSchema,
|
|
36
|
+
QueryBoundWitnessSchema,
|
|
37
|
+
asBoundWitness,
|
|
38
|
+
isBoundWitness,
|
|
39
|
+
isBoundWitnessPayload,
|
|
40
|
+
isBoundWitnessWithMeta,
|
|
41
|
+
isQueryBoundWitness,
|
|
42
|
+
isQueryBoundWitnessWithMeta,
|
|
43
|
+
notBoundWitness
|
|
44
|
+
};
|
|
2
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":"AAGO,
|
|
1
|
+
{"version":3,"sources":["../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":";AAGO,IAAM,yBAAyB,MAAM;AAC1C,SAAO;AAAA,IACL,KAAK;AAAA,IACL,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACV,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MACtD,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC3D,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5D,iBAAiB,EAAE,OAAO,EAAE,UAAU,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA,IAC3B;AAAA,IACA,UAAU,CAAC,aAAa,kBAAkB,mBAAmB,mBAAmB,QAAQ;AAAA,IACxF,MAAM;AAAA,EACR;AACF;;;AChBO,IAAM,qBAAyC;;;ACDtD,SAAS,uBAAuB,+BAA+B,8BAAwC;AAIhG,IAAM,iBAAiB,CAAC,UAA0C,sBAAoC,kBAAkB,EAAE,KAAK;AAC/H,IAAM,yBAAyB,CAAC,UACrC,8BAA4C,kBAAkB,EAAE,KAAK;AAChE,IAAM,kBAAkB,uBAAqC,kBAAkB;AAE/E,IAAM,iBAAiB,CAA4D,YACxF,eAAe,OAAO,IAAK,UAAgB;AAGtC,IAAM,wBAAwB;;;ACN9B,IAAM,0BAAmD;AASzD,IAAM,sBAAsB,CAAC,MAAwC,eAAe,CAAC,KAAM,GAAyB,UAAU;AAC9H,IAAM,8BAA8B,CAAC,MAC1C,eAAe,CAAC,KAAK,uBAAuB,CAAC,KAAM,GAAmC,UAAU;","names":[]}
|
package/dist/neutral/index.cjs
CHANGED
|
@@ -1,2 +1,68 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
BoundWitnessJsonSchema: () => BoundWitnessJsonSchema,
|
|
24
|
+
BoundWitnessSchema: () => BoundWitnessSchema,
|
|
25
|
+
QueryBoundWitnessSchema: () => QueryBoundWitnessSchema,
|
|
26
|
+
asBoundWitness: () => asBoundWitness,
|
|
27
|
+
isBoundWitness: () => isBoundWitness,
|
|
28
|
+
isBoundWitnessPayload: () => isBoundWitnessPayload,
|
|
29
|
+
isBoundWitnessWithMeta: () => isBoundWitnessWithMeta,
|
|
30
|
+
isQueryBoundWitness: () => isQueryBoundWitness,
|
|
31
|
+
isQueryBoundWitnessWithMeta: () => isQueryBoundWitnessWithMeta,
|
|
32
|
+
notBoundWitness: () => notBoundWitness
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(src_exports);
|
|
35
|
+
|
|
36
|
+
// src/BoundWitness/BoundWitnessJsonSchema.ts
|
|
37
|
+
var BoundWitnessJsonSchema = () => {
|
|
38
|
+
return {
|
|
39
|
+
$id: "https://schemas.xyo.network/2.0/boundwitness",
|
|
40
|
+
additionalProperties: false,
|
|
41
|
+
properties: {
|
|
42
|
+
addresses: { items: { type: "string" }, type: "array" },
|
|
43
|
+
payload_hashes: { items: { type: "string" }, type: "array" },
|
|
44
|
+
payload_schemas: { items: { type: "string" }, type: "array" },
|
|
45
|
+
previous_hashes: { items: { nullable: true, type: "string" }, type: "array" },
|
|
46
|
+
schema: { type: "string" }
|
|
47
|
+
},
|
|
48
|
+
required: ["addresses", "payload_hashes", "payload_schemas", "previous_hashes", "schema"],
|
|
49
|
+
type: "object"
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// src/BoundWitness/BoundWitnessSchema.ts
|
|
54
|
+
var BoundWitnessSchema = "network.xyo.boundwitness";
|
|
55
|
+
|
|
56
|
+
// src/isBoundWitness.ts
|
|
57
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
58
|
+
var isBoundWitness = (value) => (0, import_payload_model.isPayloadOfSchemaType)(BoundWitnessSchema)(value);
|
|
59
|
+
var isBoundWitnessWithMeta = (value) => (0, import_payload_model.isPayloadOfSchemaTypeWithMeta)(BoundWitnessSchema)(value);
|
|
60
|
+
var notBoundWitness = (0, import_payload_model.notPayloadOfSchemaType)(BoundWitnessSchema);
|
|
61
|
+
var asBoundWitness = (payload) => isBoundWitness(payload) ? payload : void 0;
|
|
62
|
+
var isBoundWitnessPayload = isBoundWitness;
|
|
63
|
+
|
|
64
|
+
// src/QueryBoundWitness.ts
|
|
65
|
+
var QueryBoundWitnessSchema = BoundWitnessSchema;
|
|
66
|
+
var isQueryBoundWitness = (x) => isBoundWitness(x) && x?.query !== void 0;
|
|
67
|
+
var isQueryBoundWitnessWithMeta = (x) => isBoundWitness(x) && isBoundWitnessWithMeta(x) && x?.query !== void 0;
|
|
2
68
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["export * from './BoundWitness'\nexport * from './isBoundWitness'\nexport * from './QueryBoundWitness'\n","//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["export * from './BoundWitness'\nexport * from './isBoundWitness'\nexport * from './QueryBoundWitness'\n","//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,yBAAyB,MAAM;AAC1C,SAAO;AAAA,IACL,KAAK;AAAA,IACL,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACV,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MACtD,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC3D,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5D,iBAAiB,EAAE,OAAO,EAAE,UAAU,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA,IAC3B;AAAA,IACA,UAAU,CAAC,aAAa,kBAAkB,mBAAmB,mBAAmB,QAAQ;AAAA,IACxF,MAAM;AAAA,EACR;AACF;;;AChBO,IAAM,qBAAyC;;;ACDtD,2BAAuG;AAIhG,IAAM,iBAAiB,CAAC,cAA0C,4CAAoC,kBAAkB,EAAE,KAAK;AAC/H,IAAM,yBAAyB,CAAC,cACrC,oDAA4C,kBAAkB,EAAE,KAAK;AAChE,IAAM,sBAAkB,6CAAqC,kBAAkB;AAE/E,IAAM,iBAAiB,CAA4D,YACxF,eAAe,OAAO,IAAK,UAAgB;AAGtC,IAAM,wBAAwB;;;ACN9B,IAAM,0BAAmD;AASzD,IAAM,sBAAsB,CAAC,MAAwC,eAAe,CAAC,KAAM,GAAyB,UAAU;AAC9H,IAAM,8BAA8B,CAAC,MAC1C,eAAe,CAAC,KAAK,uBAAuB,CAAC,KAAM,GAAmC,UAAU;","names":[]}
|
package/dist/neutral/index.js
CHANGED
|
@@ -1,2 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
// src/BoundWitness/BoundWitnessJsonSchema.ts
|
|
2
|
+
var BoundWitnessJsonSchema = () => {
|
|
3
|
+
return {
|
|
4
|
+
$id: "https://schemas.xyo.network/2.0/boundwitness",
|
|
5
|
+
additionalProperties: false,
|
|
6
|
+
properties: {
|
|
7
|
+
addresses: { items: { type: "string" }, type: "array" },
|
|
8
|
+
payload_hashes: { items: { type: "string" }, type: "array" },
|
|
9
|
+
payload_schemas: { items: { type: "string" }, type: "array" },
|
|
10
|
+
previous_hashes: { items: { nullable: true, type: "string" }, type: "array" },
|
|
11
|
+
schema: { type: "string" }
|
|
12
|
+
},
|
|
13
|
+
required: ["addresses", "payload_hashes", "payload_schemas", "previous_hashes", "schema"],
|
|
14
|
+
type: "object"
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/BoundWitness/BoundWitnessSchema.ts
|
|
19
|
+
var BoundWitnessSchema = "network.xyo.boundwitness";
|
|
20
|
+
|
|
21
|
+
// src/isBoundWitness.ts
|
|
22
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
23
|
+
var isBoundWitness = (value) => isPayloadOfSchemaType(BoundWitnessSchema)(value);
|
|
24
|
+
var isBoundWitnessWithMeta = (value) => isPayloadOfSchemaTypeWithMeta(BoundWitnessSchema)(value);
|
|
25
|
+
var notBoundWitness = notPayloadOfSchemaType(BoundWitnessSchema);
|
|
26
|
+
var asBoundWitness = (payload) => isBoundWitness(payload) ? payload : void 0;
|
|
27
|
+
var isBoundWitnessPayload = isBoundWitness;
|
|
28
|
+
|
|
29
|
+
// src/QueryBoundWitness.ts
|
|
30
|
+
var QueryBoundWitnessSchema = BoundWitnessSchema;
|
|
31
|
+
var isQueryBoundWitness = (x) => isBoundWitness(x) && x?.query !== void 0;
|
|
32
|
+
var isQueryBoundWitnessWithMeta = (x) => isBoundWitness(x) && isBoundWitnessWithMeta(x) && x?.query !== void 0;
|
|
33
|
+
export {
|
|
34
|
+
BoundWitnessJsonSchema,
|
|
35
|
+
BoundWitnessSchema,
|
|
36
|
+
QueryBoundWitnessSchema,
|
|
37
|
+
asBoundWitness,
|
|
38
|
+
isBoundWitness,
|
|
39
|
+
isBoundWitnessPayload,
|
|
40
|
+
isBoundWitnessWithMeta,
|
|
41
|
+
isQueryBoundWitness,
|
|
42
|
+
isQueryBoundWitnessWithMeta,
|
|
43
|
+
notBoundWitness
|
|
44
|
+
};
|
|
2
45
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":"AAGO,
|
|
1
|
+
{"version":3,"sources":["../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":";AAGO,IAAM,yBAAyB,MAAM;AAC1C,SAAO;AAAA,IACL,KAAK;AAAA,IACL,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACV,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MACtD,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC3D,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5D,iBAAiB,EAAE,OAAO,EAAE,UAAU,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA,IAC3B;AAAA,IACA,UAAU,CAAC,aAAa,kBAAkB,mBAAmB,mBAAmB,QAAQ;AAAA,IACxF,MAAM;AAAA,EACR;AACF;;;AChBO,IAAM,qBAAyC;;;ACDtD,SAAS,uBAAuB,+BAA+B,8BAAwC;AAIhG,IAAM,iBAAiB,CAAC,UAA0C,sBAAoC,kBAAkB,EAAE,KAAK;AAC/H,IAAM,yBAAyB,CAAC,UACrC,8BAA4C,kBAAkB,EAAE,KAAK;AAChE,IAAM,kBAAkB,uBAAqC,kBAAkB;AAE/E,IAAM,iBAAiB,CAA4D,YACxF,eAAe,OAAO,IAAK,UAAgB;AAGtC,IAAM,wBAAwB;;;ACN9B,IAAM,0BAAmD;AASzD,IAAM,sBAAsB,CAAC,MAAwC,eAAe,CAAC,KAAM,GAAyB,UAAU;AAC9H,IAAM,8BAA8B,CAAC,MAC1C,eAAe,CAAC,KAAK,uBAAuB,CAAC,KAAM,GAAmC,UAAU;","names":[]}
|
package/dist/node/index.cjs
CHANGED
|
@@ -1,2 +1,81 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
BoundWitnessJsonSchema: () => BoundWitnessJsonSchema,
|
|
24
|
+
BoundWitnessSchema: () => BoundWitnessSchema,
|
|
25
|
+
QueryBoundWitnessSchema: () => QueryBoundWitnessSchema,
|
|
26
|
+
asBoundWitness: () => asBoundWitness,
|
|
27
|
+
isBoundWitness: () => isBoundWitness,
|
|
28
|
+
isBoundWitnessPayload: () => isBoundWitnessPayload,
|
|
29
|
+
isBoundWitnessWithMeta: () => isBoundWitnessWithMeta,
|
|
30
|
+
isQueryBoundWitness: () => isQueryBoundWitness,
|
|
31
|
+
isQueryBoundWitnessWithMeta: () => isQueryBoundWitnessWithMeta,
|
|
32
|
+
notBoundWitness: () => notBoundWitness
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(src_exports);
|
|
35
|
+
|
|
36
|
+
// src/BoundWitness/BoundWitnessJsonSchema.ts
|
|
37
|
+
var BoundWitnessJsonSchema = () => {
|
|
38
|
+
return {
|
|
39
|
+
$id: "https://schemas.xyo.network/2.0/boundwitness",
|
|
40
|
+
additionalProperties: false,
|
|
41
|
+
properties: {
|
|
42
|
+
addresses: { items: { type: "string" }, type: "array" },
|
|
43
|
+
payload_hashes: { items: { type: "string" }, type: "array" },
|
|
44
|
+
payload_schemas: { items: { type: "string" }, type: "array" },
|
|
45
|
+
previous_hashes: { items: { nullable: true, type: "string" }, type: "array" },
|
|
46
|
+
schema: { type: "string" }
|
|
47
|
+
},
|
|
48
|
+
required: ["addresses", "payload_hashes", "payload_schemas", "previous_hashes", "schema"],
|
|
49
|
+
type: "object"
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// src/BoundWitness/BoundWitnessSchema.ts
|
|
54
|
+
var BoundWitnessSchema = "network.xyo.boundwitness";
|
|
55
|
+
|
|
56
|
+
// src/isBoundWitness.ts
|
|
57
|
+
var import_payload_model = require("@xyo-network/payload-model");
|
|
58
|
+
var isBoundWitness = (value) => (0, import_payload_model.isPayloadOfSchemaType)(BoundWitnessSchema)(value);
|
|
59
|
+
var isBoundWitnessWithMeta = (value) => (0, import_payload_model.isPayloadOfSchemaTypeWithMeta)(BoundWitnessSchema)(value);
|
|
60
|
+
var notBoundWitness = (0, import_payload_model.notPayloadOfSchemaType)(BoundWitnessSchema);
|
|
61
|
+
var asBoundWitness = (payload) => isBoundWitness(payload) ? payload : void 0;
|
|
62
|
+
var isBoundWitnessPayload = isBoundWitness;
|
|
63
|
+
|
|
64
|
+
// src/QueryBoundWitness.ts
|
|
65
|
+
var QueryBoundWitnessSchema = BoundWitnessSchema;
|
|
66
|
+
var isQueryBoundWitness = (x) => isBoundWitness(x) && (x == null ? void 0 : x.query) !== void 0;
|
|
67
|
+
var isQueryBoundWitnessWithMeta = (x) => isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x == null ? void 0 : x.query) !== void 0;
|
|
68
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
+
0 && (module.exports = {
|
|
70
|
+
BoundWitnessJsonSchema,
|
|
71
|
+
BoundWitnessSchema,
|
|
72
|
+
QueryBoundWitnessSchema,
|
|
73
|
+
asBoundWitness,
|
|
74
|
+
isBoundWitness,
|
|
75
|
+
isBoundWitnessPayload,
|
|
76
|
+
isBoundWitnessWithMeta,
|
|
77
|
+
isQueryBoundWitness,
|
|
78
|
+
isQueryBoundWitnessWithMeta,
|
|
79
|
+
notBoundWitness
|
|
80
|
+
});
|
|
2
81
|
//# sourceMappingURL=index.cjs.map
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["export * from './BoundWitness'\nexport * from './isBoundWitness'\nexport * from './QueryBoundWitness'\n","//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["export * from './BoundWitness'\nexport * from './isBoundWitness'\nexport * from './QueryBoundWitness'\n","//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,yBAAyB,MAAM;AAC1C,SAAO;AAAA,IACL,KAAK;AAAA,IACL,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACV,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MACtD,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC3D,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5D,iBAAiB,EAAE,OAAO,EAAE,UAAU,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA,IAC3B;AAAA,IACA,UAAU,CAAC,aAAa,kBAAkB,mBAAmB,mBAAmB,QAAQ;AAAA,IACxF,MAAM;AAAA,EACR;AACF;;;AChBO,IAAM,qBAAyC;;;ACDtD,2BAAuG;AAIhG,IAAM,iBAAiB,CAAC,cAA0C,4CAAoC,kBAAkB,EAAE,KAAK;AAC/H,IAAM,yBAAyB,CAAC,cACrC,oDAA4C,kBAAkB,EAAE,KAAK;AAChE,IAAM,sBAAkB,6CAAqC,kBAAkB;AAE/E,IAAM,iBAAiB,CAA4D,YACxF,eAAe,OAAO,IAAK,UAAgB;AAGtC,IAAM,wBAAwB;;;ACN9B,IAAM,0BAAmD;AASzD,IAAM,sBAAsB,CAAC,MAAwC,eAAe,CAAC,MAAM,uBAAyB,WAAU;AAC9H,IAAM,8BAA8B,CAAC,MAC1C,eAAe,CAAC,KAAK,uBAAuB,CAAC,MAAM,uBAAmC,WAAU;","names":[]}
|
package/dist/node/index.js
CHANGED
|
@@ -1,2 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
// src/BoundWitness/BoundWitnessJsonSchema.ts
|
|
2
|
+
var BoundWitnessJsonSchema = () => {
|
|
3
|
+
return {
|
|
4
|
+
$id: "https://schemas.xyo.network/2.0/boundwitness",
|
|
5
|
+
additionalProperties: false,
|
|
6
|
+
properties: {
|
|
7
|
+
addresses: { items: { type: "string" }, type: "array" },
|
|
8
|
+
payload_hashes: { items: { type: "string" }, type: "array" },
|
|
9
|
+
payload_schemas: { items: { type: "string" }, type: "array" },
|
|
10
|
+
previous_hashes: { items: { nullable: true, type: "string" }, type: "array" },
|
|
11
|
+
schema: { type: "string" }
|
|
12
|
+
},
|
|
13
|
+
required: ["addresses", "payload_hashes", "payload_schemas", "previous_hashes", "schema"],
|
|
14
|
+
type: "object"
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// src/BoundWitness/BoundWitnessSchema.ts
|
|
19
|
+
var BoundWitnessSchema = "network.xyo.boundwitness";
|
|
20
|
+
|
|
21
|
+
// src/isBoundWitness.ts
|
|
22
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
23
|
+
var isBoundWitness = (value) => isPayloadOfSchemaType(BoundWitnessSchema)(value);
|
|
24
|
+
var isBoundWitnessWithMeta = (value) => isPayloadOfSchemaTypeWithMeta(BoundWitnessSchema)(value);
|
|
25
|
+
var notBoundWitness = notPayloadOfSchemaType(BoundWitnessSchema);
|
|
26
|
+
var asBoundWitness = (payload) => isBoundWitness(payload) ? payload : void 0;
|
|
27
|
+
var isBoundWitnessPayload = isBoundWitness;
|
|
28
|
+
|
|
29
|
+
// src/QueryBoundWitness.ts
|
|
30
|
+
var QueryBoundWitnessSchema = BoundWitnessSchema;
|
|
31
|
+
var isQueryBoundWitness = (x) => isBoundWitness(x) && (x == null ? void 0 : x.query) !== void 0;
|
|
32
|
+
var isQueryBoundWitnessWithMeta = (x) => isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x == null ? void 0 : x.query) !== void 0;
|
|
33
|
+
export {
|
|
34
|
+
BoundWitnessJsonSchema,
|
|
35
|
+
BoundWitnessSchema,
|
|
36
|
+
QueryBoundWitnessSchema,
|
|
37
|
+
asBoundWitness,
|
|
38
|
+
isBoundWitness,
|
|
39
|
+
isBoundWitnessPayload,
|
|
40
|
+
isBoundWitnessWithMeta,
|
|
41
|
+
isQueryBoundWitness,
|
|
42
|
+
isQueryBoundWitnessWithMeta,
|
|
43
|
+
notBoundWitness
|
|
44
|
+
};
|
|
2
45
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":"AAGO,
|
|
1
|
+
{"version":3,"sources":["../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/isBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["//Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n//https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","export type BoundWitnessSchema = 'network.xyo.boundwitness'\nexport const BoundWitnessSchema: BoundWitnessSchema = 'network.xyo.boundwitness'\n","import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, notPayloadOfSchemaType, WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\n\nexport const isBoundWitness = (value: unknown): value is BoundWitness => isPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)(value)\nexport const isBoundWitnessWithMeta = (value: unknown): value is WithMeta<BoundWitness> =>\n isPayloadOfSchemaTypeWithMeta<BoundWitness>(BoundWitnessSchema)(value)\nexport const notBoundWitness = notPayloadOfSchemaType<BoundWitness>(BoundWitnessSchema)\n\nexport const asBoundWitness = <T extends BoundWitness<{ schema: string }> = BoundWitness>(payload?: unknown) =>\n isBoundWitness(payload) ? (payload as T) : undefined\n\n/** @deprecated use isBoundWitness instead*/\nexport const isBoundWitnessPayload = isBoundWitness\n","import { Hash } from '@xylabs/hex'\nimport { WithMeta } from '@xyo-network/payload-model'\n\nimport { BoundWitness, BoundWitnessSchema } from './BoundWitness'\nimport { isBoundWitness, isBoundWitnessWithMeta } from './isBoundWitness'\n\nexport type QueryBoundWitnessSchema = BoundWitnessSchema\nexport const QueryBoundWitnessSchema: QueryBoundWitnessSchema = BoundWitnessSchema\n\nexport type QueryBoundWitness = BoundWitness<{\n additional?: Hash[]\n query: Hash\n resultSet?: string\n schema: QueryBoundWitnessSchema\n}>\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithMeta = (x?: unknown): x is WithMeta<QueryBoundWitness> =>\n isBoundWitness(x) && isBoundWitnessWithMeta(x) && (x as WithMeta<QueryBoundWitness>)?.query !== undefined\n"],"mappings":";AAGO,IAAM,yBAAyB,MAAM;AAC1C,SAAO;AAAA,IACL,KAAK;AAAA,IACL,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACV,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MACtD,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC3D,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5D,iBAAiB,EAAE,OAAO,EAAE,UAAU,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA,IAC3B;AAAA,IACA,UAAU,CAAC,aAAa,kBAAkB,mBAAmB,mBAAmB,QAAQ;AAAA,IACxF,MAAM;AAAA,EACR;AACF;;;AChBO,IAAM,qBAAyC;;;ACDtD,SAAS,uBAAuB,+BAA+B,8BAAwC;AAIhG,IAAM,iBAAiB,CAAC,UAA0C,sBAAoC,kBAAkB,EAAE,KAAK;AAC/H,IAAM,yBAAyB,CAAC,UACrC,8BAA4C,kBAAkB,EAAE,KAAK;AAChE,IAAM,kBAAkB,uBAAqC,kBAAkB;AAE/E,IAAM,iBAAiB,CAA4D,YACxF,eAAe,OAAO,IAAK,UAAgB;AAGtC,IAAM,wBAAwB;;;ACN9B,IAAM,0BAAmD;AASzD,IAAM,sBAAsB,CAAC,MAAwC,eAAe,CAAC,MAAM,uBAAyB,WAAU;AAC9H,IAAM,8BAA8B,CAAC,MAC1C,eAAe,CAAC,KAAK,uBAAuB,CAAC,MAAM,uBAAmC,WAAU;","names":[]}
|
package/package.json
CHANGED
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
},
|
|
12
12
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@xylabs/ts-scripts-yarn3": "^3.11.
|
|
15
|
-
"@xylabs/tsconfig": "^3.11.
|
|
14
|
+
"@xylabs/ts-scripts-yarn3": "^3.11.10",
|
|
15
|
+
"@xylabs/tsconfig": "^3.11.10",
|
|
16
16
|
"typescript": "^5.5.2"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@xylabs/hex": "^3.5.1",
|
|
20
20
|
"@xylabs/object": "^3.5.1",
|
|
21
|
-
"@xyo-network/payload-model": "~2.107.
|
|
21
|
+
"@xyo-network/payload-model": "~2.107.4"
|
|
22
22
|
},
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
@@ -58,6 +58,6 @@
|
|
|
58
58
|
},
|
|
59
59
|
"sideEffects": false,
|
|
60
60
|
"types": "dist/node/index.d.ts",
|
|
61
|
-
"version": "2.107.
|
|
61
|
+
"version": "2.107.4",
|
|
62
62
|
"type": "module"
|
|
63
63
|
}
|