@xyo-network/payload-model 2.84.19 → 2.85.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
7
  var __export = (target, all) => {
7
8
  for (var name in all)
8
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -39,28 +40,28 @@ var ModuleErrorSchema = "network.xyo.error.module";
39
40
 
40
41
  // src/isPayload.ts
41
42
  var import_object = require("@xyo-network/object");
42
- var isAnyPayload = (value) => {
43
+ var isAnyPayload = /* @__PURE__ */ __name((value) => {
43
44
  if ((0, import_object.isObject)(value)) {
44
45
  return typeof value.schema === "string";
45
46
  }
46
47
  return false;
47
- };
48
+ }, "isAnyPayload");
48
49
  var asAnyPayload = import_object.AsObjectFactory.create(isAnyPayload);
49
- var isPayload = (schema) => (value) => {
50
+ var isPayload = /* @__PURE__ */ __name((schema) => (value) => {
50
51
  if (isAnyPayload(value)) {
51
52
  return schema.includes(value.schema);
52
53
  }
53
54
  return false;
54
- };
55
- var asPayload = (schema) => import_object.AsObjectFactory.create((value) => isPayload(schema)(value));
55
+ }, "isPayload");
56
+ var asPayload = /* @__PURE__ */ __name((schema) => import_object.AsObjectFactory.create((value) => isPayload(schema)(value)), "asPayload");
56
57
 
57
58
  // src/isPayloadOfSchemaType.ts
58
- var isPayloadOfSchemaType = (schema) => {
59
+ var isPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
59
60
  return (x) => isAnyPayload(x) && x?.schema === schema;
60
- };
61
- var notPayloadOfSchemaType = (schema) => {
61
+ }, "isPayloadOfSchemaType");
62
+ var notPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
62
63
  return (x) => !isAnyPayload(x) || x?.schema !== schema;
63
- };
64
+ }, "notPayloadOfSchemaType");
64
65
 
65
66
  // src/PayloadSet/PayloadSetSchema.ts
66
67
  var PayloadSetSchema = "network.xyo.payload.set";
@@ -68,11 +69,11 @@ var PayloadSetSchema = "network.xyo.payload.set";
68
69
  // src/Schema.ts
69
70
  var import_object2 = require("@xyo-network/object");
70
71
  var PayloadSchema = "network.xyo.payload";
71
- var isSchema = (value) => {
72
+ var isSchema = /* @__PURE__ */ __name((value) => {
72
73
  if (typeof value === "string") {
73
74
  return true;
74
75
  }
75
76
  return false;
76
- };
77
+ }, "isSchema");
77
78
  var asSchema = import_object2.AsTypeFactory.create(isSchema);
78
79
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Error.ts","../../src/isPayload.ts","../../src/isPayloadOfSchemaType.ts","../../src/PayloadSet/PayloadSetSchema.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Error'\nexport * from './isPayload'\nexport * from './isPayloadOfSchemaType'\nexport * from './Payload'\nexport * from './PayloadFindFilter'\nexport * from './PayloadSet'\nexport * from './Query'\nexport * from './Schema'\n","import { Payload } from './Payload'\n\nexport type ModuleErrorSchema = 'network.xyo.error.module'\nexport const ModuleErrorSchema: ModuleErrorSchema = 'network.xyo.error.module'\n\nexport type ModuleError = Payload<{\n message?: string\n name?: string\n query?: string\n schema: ModuleErrorSchema\n sources?: string[]\n}>\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AsObjectFactory, isObject } from '@xyo-network/object'\n\nimport { Payload } from './Payload'\n\nexport const isAnyPayload = (value: unknown): value is Payload => {\n if (isObject(value)) {\n return typeof value.schema === 'string'\n }\n return false\n}\n\nexport const asAnyPayload = AsObjectFactory.create(isAnyPayload)\n\nexport const isPayload =\n <T extends Payload>(schema: string[]) =>\n (value: unknown): value is T => {\n if (isAnyPayload(value)) {\n return schema.includes(value.schema)\n }\n return false\n }\n\nexport const asPayload = <T extends Payload>(schema: string[]) => AsObjectFactory.create((value: unknown): value is T => isPayload(schema)(value))\n","import { isAnyPayload } from './isPayload'\nimport { Payload } from './Payload'\n\nexport const isPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n","export type PayloadSetSchema = 'network.xyo.payload.set'\nexport const PayloadSetSchema: PayloadSetSchema = 'network.xyo.payload.set'\n","import { AsTypeFactory, EmptyObject } from '@xyo-network/object'\n\n/** Schema type in Javascript is a string */\nexport type Schema = string\n\nexport const PayloadSchema = 'network.xyo.payload'\nexport type PayloadSchema = typeof PayloadSchema\n\nexport const isSchema = (value: unknown): value is Schema => {\n if (typeof value === 'string') {\n return true\n }\n return false\n}\n\nexport const asSchema = AsTypeFactory.create<Schema>(isSchema)\n\n/** Schema fields for a Payload */\nexport interface SchemaFields extends EmptyObject {\n /** Schema of the object */\n schema: Schema\n}\n\n/** Add the Schema Fields to an object */\nexport type WithSchema<T extends EmptyObject | void = void> = T extends EmptyObject ? SchemaFields & T : SchemaFields\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,oBAAuC;;;ACFpD,oBAA0C;AAInC,IAAM,eAAe,CAAC,UAAqC;AAChE,UAAI,wBAAS,KAAK,GAAG;AACnB,WAAO,OAAO,MAAM,WAAW;AAAA,EACjC;AACA,SAAO;AACT;AAEO,IAAM,eAAe,8BAAgB,OAAO,YAAY;AAExD,IAAM,YACX,CAAoB,WACpB,CAAC,UAA+B;AAC9B,MAAI,aAAa,KAAK,GAAG;AACvB,WAAO,OAAO,SAAS,MAAM,MAAM;AAAA,EACrC;AACA,SAAO;AACT;AAEK,IAAM,YAAY,CAAoB,WAAqB,8BAAgB,OAAO,CAAC,UAA+B,UAAU,MAAM,EAAE,KAAK,CAAC;;;ACpB1I,IAAM,wBAAwB,CAAoB,WAAmB;AAC1E,SAAO,CAAC,MAA+B,aAAa,CAAC,KAAK,GAAG,WAAW;AAC1E;AAEO,IAAM,yBAAyB,CAAoB,WAAmB;AAC3E,SAAO,CAAC,MAA+B,CAAC,aAAa,CAAC,KAAK,GAAG,WAAW;AAC3E;;;ACRO,IAAM,mBAAqC;;;ACDlD,IAAAA,iBAA2C;AAKpC,IAAM,gBAAgB;AAGtB,IAAM,WAAW,CAAC,UAAoC;AAC3D,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,IAAM,WAAW,6BAAc,OAAe,QAAQ;","names":["import_object"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Error.ts","../../src/isPayload.ts","../../src/isPayloadOfSchemaType.ts","../../src/PayloadSet/PayloadSetSchema.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Error'\nexport * from './isPayload'\nexport * from './isPayloadOfSchemaType'\nexport * from './Payload'\nexport * from './PayloadFindFilter'\nexport * from './PayloadSet'\nexport * from './Query'\nexport * from './Schema'\n","import { Payload } from './Payload'\n\nexport type ModuleErrorSchema = 'network.xyo.error.module'\nexport const ModuleErrorSchema: ModuleErrorSchema = 'network.xyo.error.module'\n\nexport type ModuleError = Payload<{\n message?: string\n name?: string\n query?: string\n schema: ModuleErrorSchema\n sources?: string[]\n}>\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AsObjectFactory, isObject } from '@xyo-network/object'\n\nimport { Payload } from './Payload'\n\nexport const isAnyPayload = (value: unknown): value is Payload => {\n if (isObject(value)) {\n return typeof value.schema === 'string'\n }\n return false\n}\n\nexport const asAnyPayload = AsObjectFactory.create(isAnyPayload)\n\nexport const isPayload =\n <T extends Payload>(schema: string[]) =>\n (value: unknown): value is T => {\n if (isAnyPayload(value)) {\n return schema.includes(value.schema)\n }\n return false\n }\n\nexport const asPayload = <T extends Payload>(schema: string[]) => AsObjectFactory.create((value: unknown): value is T => isPayload(schema)(value))\n","import { isAnyPayload } from './isPayload'\nimport { Payload } from './Payload'\n\nexport const isPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n","export type PayloadSetSchema = 'network.xyo.payload.set'\nexport const PayloadSetSchema: PayloadSetSchema = 'network.xyo.payload.set'\n","import { AsTypeFactory, EmptyObject } from '@xyo-network/object'\n\n/** Schema type in Javascript is a string */\nexport type Schema = string\n\nexport const PayloadSchema = 'network.xyo.payload'\nexport type PayloadSchema = typeof PayloadSchema\n\nexport const isSchema = (value: unknown): value is Schema => {\n if (typeof value === 'string') {\n return true\n }\n return false\n}\n\nexport const asSchema = AsTypeFactory.create<Schema>(isSchema)\n\n/** Schema fields for a Payload */\nexport interface SchemaFields extends EmptyObject {\n /** Schema of the object */\n schema: Schema\n}\n\n/** Add the Schema Fields to an object */\nexport type WithSchema<T extends EmptyObject | void = void> = T extends EmptyObject ? SchemaFields & T : SchemaFields\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;ACGO,IAAMA,oBAAuC;;;ACFpD,oBAA0C;AAInC,IAAMC,eAAe,wBAACC,UAAAA;AAC3B,UAAIC,wBAASD,KAAAA,GAAQ;AACnB,WAAO,OAAOA,MAAME,WAAW;EACjC;AACA,SAAO;AACT,GAL4B;AAOrB,IAAMC,eAAeC,8BAAgBC,OAAON,YAAAA;AAE5C,IAAMO,YACX,wBAAoBJ,WACpB,CAACF,UAAAA;AACC,MAAID,aAAaC,KAAAA,GAAQ;AACvB,WAAOE,OAAOK,SAASP,MAAME,MAAM;EACrC;AACA,SAAO;AACT,GANA;AAQK,IAAMM,YAAY,wBAAoBN,WAAqBE,8BAAgBC,OAAO,CAACL,UAA+BM,UAAUJ,MAAAA,EAAQF,KAAAA,CAAAA,GAAlH;;;ACpBlB,IAAMS,wBAAwB,wBAAoBC,WAAAA;AACvD,SAAO,CAACC,MAA+BC,aAAaD,CAAAA,KAAMA,GAAGD,WAAWA;AAC1E,GAFqC;AAI9B,IAAMG,yBAAyB,wBAAoBH,WAAAA;AACxD,SAAO,CAACC,MAA+B,CAACC,aAAaD,CAAAA,KAAMA,GAAGD,WAAWA;AAC3E,GAFsC;;;ACN/B,IAAMI,mBAAqC;;;ACDlD,IAAAC,iBAA2C;AAKpC,IAAMC,gBAAgB;AAGtB,IAAMC,WAAW,wBAACC,UAAAA;AACvB,MAAI,OAAOA,UAAU,UAAU;AAC7B,WAAO;EACT;AACA,SAAO;AACT,GALwB;AAOjB,IAAMC,WAAWC,6BAAcC,OAAeJ,QAAAA;","names":["ModuleErrorSchema","isAnyPayload","value","isObject","schema","asAnyPayload","AsObjectFactory","create","isPayload","includes","asPayload","isPayloadOfSchemaType","schema","x","isAnyPayload","notPayloadOfSchemaType","PayloadSetSchema","import_object","PayloadSchema","isSchema","value","asSchema","AsTypeFactory","create"]}
@@ -1,30 +1,33 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
1
4
  // src/Error.ts
2
5
  var ModuleErrorSchema = "network.xyo.error.module";
3
6
 
4
7
  // src/isPayload.ts
5
8
  import { AsObjectFactory, isObject } from "@xyo-network/object";
6
- var isAnyPayload = (value) => {
9
+ var isAnyPayload = /* @__PURE__ */ __name((value) => {
7
10
  if (isObject(value)) {
8
11
  return typeof value.schema === "string";
9
12
  }
10
13
  return false;
11
- };
14
+ }, "isAnyPayload");
12
15
  var asAnyPayload = AsObjectFactory.create(isAnyPayload);
13
- var isPayload = (schema) => (value) => {
16
+ var isPayload = /* @__PURE__ */ __name((schema) => (value) => {
14
17
  if (isAnyPayload(value)) {
15
18
  return schema.includes(value.schema);
16
19
  }
17
20
  return false;
18
- };
19
- var asPayload = (schema) => AsObjectFactory.create((value) => isPayload(schema)(value));
21
+ }, "isPayload");
22
+ var asPayload = /* @__PURE__ */ __name((schema) => AsObjectFactory.create((value) => isPayload(schema)(value)), "asPayload");
20
23
 
21
24
  // src/isPayloadOfSchemaType.ts
22
- var isPayloadOfSchemaType = (schema) => {
25
+ var isPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
23
26
  return (x) => isAnyPayload(x) && x?.schema === schema;
24
- };
25
- var notPayloadOfSchemaType = (schema) => {
27
+ }, "isPayloadOfSchemaType");
28
+ var notPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
26
29
  return (x) => !isAnyPayload(x) || x?.schema !== schema;
27
- };
30
+ }, "notPayloadOfSchemaType");
28
31
 
29
32
  // src/PayloadSet/PayloadSetSchema.ts
30
33
  var PayloadSetSchema = "network.xyo.payload.set";
@@ -32,12 +35,12 @@ var PayloadSetSchema = "network.xyo.payload.set";
32
35
  // src/Schema.ts
33
36
  import { AsTypeFactory } from "@xyo-network/object";
34
37
  var PayloadSchema = "network.xyo.payload";
35
- var isSchema = (value) => {
38
+ var isSchema = /* @__PURE__ */ __name((value) => {
36
39
  if (typeof value === "string") {
37
40
  return true;
38
41
  }
39
42
  return false;
40
- };
43
+ }, "isSchema");
41
44
  var asSchema = AsTypeFactory.create(isSchema);
42
45
  export {
43
46
  ModuleErrorSchema,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Error.ts","../../src/isPayload.ts","../../src/isPayloadOfSchemaType.ts","../../src/PayloadSet/PayloadSetSchema.ts","../../src/Schema.ts"],"sourcesContent":["import { Payload } from './Payload'\n\nexport type ModuleErrorSchema = 'network.xyo.error.module'\nexport const ModuleErrorSchema: ModuleErrorSchema = 'network.xyo.error.module'\n\nexport type ModuleError = Payload<{\n message?: string\n name?: string\n query?: string\n schema: ModuleErrorSchema\n sources?: string[]\n}>\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AsObjectFactory, isObject } from '@xyo-network/object'\n\nimport { Payload } from './Payload'\n\nexport const isAnyPayload = (value: unknown): value is Payload => {\n if (isObject(value)) {\n return typeof value.schema === 'string'\n }\n return false\n}\n\nexport const asAnyPayload = AsObjectFactory.create(isAnyPayload)\n\nexport const isPayload =\n <T extends Payload>(schema: string[]) =>\n (value: unknown): value is T => {\n if (isAnyPayload(value)) {\n return schema.includes(value.schema)\n }\n return false\n }\n\nexport const asPayload = <T extends Payload>(schema: string[]) => AsObjectFactory.create((value: unknown): value is T => isPayload(schema)(value))\n","import { isAnyPayload } from './isPayload'\nimport { Payload } from './Payload'\n\nexport const isPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n","export type PayloadSetSchema = 'network.xyo.payload.set'\nexport const PayloadSetSchema: PayloadSetSchema = 'network.xyo.payload.set'\n","import { AsTypeFactory, EmptyObject } from '@xyo-network/object'\n\n/** Schema type in Javascript is a string */\nexport type Schema = string\n\nexport const PayloadSchema = 'network.xyo.payload'\nexport type PayloadSchema = typeof PayloadSchema\n\nexport const isSchema = (value: unknown): value is Schema => {\n if (typeof value === 'string') {\n return true\n }\n return false\n}\n\nexport const asSchema = AsTypeFactory.create<Schema>(isSchema)\n\n/** Schema fields for a Payload */\nexport interface SchemaFields extends EmptyObject {\n /** Schema of the object */\n schema: Schema\n}\n\n/** Add the Schema Fields to an object */\nexport type WithSchema<T extends EmptyObject | void = void> = T extends EmptyObject ? SchemaFields & T : SchemaFields\n"],"mappings":";AAGO,IAAM,oBAAuC;;;ACFpD,SAAS,iBAAiB,gBAAgB;AAInC,IAAM,eAAe,CAAC,UAAqC;AAChE,MAAI,SAAS,KAAK,GAAG;AACnB,WAAO,OAAO,MAAM,WAAW;AAAA,EACjC;AACA,SAAO;AACT;AAEO,IAAM,eAAe,gBAAgB,OAAO,YAAY;AAExD,IAAM,YACX,CAAoB,WACpB,CAAC,UAA+B;AAC9B,MAAI,aAAa,KAAK,GAAG;AACvB,WAAO,OAAO,SAAS,MAAM,MAAM;AAAA,EACrC;AACA,SAAO;AACT;AAEK,IAAM,YAAY,CAAoB,WAAqB,gBAAgB,OAAO,CAAC,UAA+B,UAAU,MAAM,EAAE,KAAK,CAAC;;;ACpB1I,IAAM,wBAAwB,CAAoB,WAAmB;AAC1E,SAAO,CAAC,MAA+B,aAAa,CAAC,KAAK,GAAG,WAAW;AAC1E;AAEO,IAAM,yBAAyB,CAAoB,WAAmB;AAC3E,SAAO,CAAC,MAA+B,CAAC,aAAa,CAAC,KAAK,GAAG,WAAW;AAC3E;;;ACRO,IAAM,mBAAqC;;;ACDlD,SAAS,qBAAkC;AAKpC,IAAM,gBAAgB;AAGtB,IAAM,WAAW,CAAC,UAAoC;AAC3D,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,IAAM,WAAW,cAAc,OAAe,QAAQ;","names":[]}
1
+ {"version":3,"sources":["../../src/Error.ts","../../src/isPayload.ts","../../src/isPayloadOfSchemaType.ts","../../src/PayloadSet/PayloadSetSchema.ts","../../src/Schema.ts"],"sourcesContent":["import { Payload } from './Payload'\n\nexport type ModuleErrorSchema = 'network.xyo.error.module'\nexport const ModuleErrorSchema: ModuleErrorSchema = 'network.xyo.error.module'\n\nexport type ModuleError = Payload<{\n message?: string\n name?: string\n query?: string\n schema: ModuleErrorSchema\n sources?: string[]\n}>\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AsObjectFactory, isObject } from '@xyo-network/object'\n\nimport { Payload } from './Payload'\n\nexport const isAnyPayload = (value: unknown): value is Payload => {\n if (isObject(value)) {\n return typeof value.schema === 'string'\n }\n return false\n}\n\nexport const asAnyPayload = AsObjectFactory.create(isAnyPayload)\n\nexport const isPayload =\n <T extends Payload>(schema: string[]) =>\n (value: unknown): value is T => {\n if (isAnyPayload(value)) {\n return schema.includes(value.schema)\n }\n return false\n }\n\nexport const asPayload = <T extends Payload>(schema: string[]) => AsObjectFactory.create((value: unknown): value is T => isPayload(schema)(value))\n","import { isAnyPayload } from './isPayload'\nimport { Payload } from './Payload'\n\nexport const isPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n","export type PayloadSetSchema = 'network.xyo.payload.set'\nexport const PayloadSetSchema: PayloadSetSchema = 'network.xyo.payload.set'\n","import { AsTypeFactory, EmptyObject } from '@xyo-network/object'\n\n/** Schema type in Javascript is a string */\nexport type Schema = string\n\nexport const PayloadSchema = 'network.xyo.payload'\nexport type PayloadSchema = typeof PayloadSchema\n\nexport const isSchema = (value: unknown): value is Schema => {\n if (typeof value === 'string') {\n return true\n }\n return false\n}\n\nexport const asSchema = AsTypeFactory.create<Schema>(isSchema)\n\n/** Schema fields for a Payload */\nexport interface SchemaFields extends EmptyObject {\n /** Schema of the object */\n schema: Schema\n}\n\n/** Add the Schema Fields to an object */\nexport type WithSchema<T extends EmptyObject | void = void> = T extends EmptyObject ? SchemaFields & T : SchemaFields\n"],"mappings":";;;;AAGO,IAAMA,oBAAuC;;;ACFpD,SAASC,iBAAiBC,gBAAgB;AAInC,IAAMC,eAAe,wBAACC,UAAAA;AAC3B,MAAIC,SAASD,KAAAA,GAAQ;AACnB,WAAO,OAAOA,MAAME,WAAW;EACjC;AACA,SAAO;AACT,GAL4B;AAOrB,IAAMC,eAAeC,gBAAgBC,OAAON,YAAAA;AAE5C,IAAMO,YACX,wBAAoBJ,WACpB,CAACF,UAAAA;AACC,MAAID,aAAaC,KAAAA,GAAQ;AACvB,WAAOE,OAAOK,SAASP,MAAME,MAAM;EACrC;AACA,SAAO;AACT,GANA;AAQK,IAAMM,YAAY,wBAAoBN,WAAqBE,gBAAgBC,OAAO,CAACL,UAA+BM,UAAUJ,MAAAA,EAAQF,KAAAA,CAAAA,GAAlH;;;ACpBlB,IAAMS,wBAAwB,wBAAoBC,WAAAA;AACvD,SAAO,CAACC,MAA+BC,aAAaD,CAAAA,KAAMA,GAAGD,WAAWA;AAC1E,GAFqC;AAI9B,IAAMG,yBAAyB,wBAAoBH,WAAAA;AACxD,SAAO,CAACC,MAA+B,CAACC,aAAaD,CAAAA,KAAMA,GAAGD,WAAWA;AAC3E,GAFsC;;;ACN/B,IAAMI,mBAAqC;;;ACDlD,SAASC,qBAAkC;AAKpC,IAAMC,gBAAgB;AAGtB,IAAMC,WAAW,wBAACC,UAAAA;AACvB,MAAI,OAAOA,UAAU,UAAU;AAC7B,WAAO;EACT;AACA,SAAO;AACT,GALwB;AAOjB,IAAMC,WAAWC,cAAcC,OAAeJ,QAAAA;","names":["ModuleErrorSchema","AsObjectFactory","isObject","isAnyPayload","value","isObject","schema","asAnyPayload","AsObjectFactory","create","isPayload","includes","asPayload","isPayloadOfSchemaType","schema","x","isAnyPayload","notPayloadOfSchemaType","PayloadSetSchema","AsTypeFactory","PayloadSchema","isSchema","value","asSchema","AsTypeFactory","create"]}
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
7
  var __export = (target, all) => {
7
8
  for (var name in all)
8
9
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -39,28 +40,28 @@ var ModuleErrorSchema = "network.xyo.error.module";
39
40
 
40
41
  // src/isPayload.ts
41
42
  var import_object = require("@xyo-network/object");
42
- var isAnyPayload = (value) => {
43
+ var isAnyPayload = /* @__PURE__ */ __name((value) => {
43
44
  if ((0, import_object.isObject)(value)) {
44
45
  return typeof value.schema === "string";
45
46
  }
46
47
  return false;
47
- };
48
+ }, "isAnyPayload");
48
49
  var asAnyPayload = import_object.AsObjectFactory.create(isAnyPayload);
49
- var isPayload = (schema) => (value) => {
50
+ var isPayload = /* @__PURE__ */ __name((schema) => (value) => {
50
51
  if (isAnyPayload(value)) {
51
52
  return schema.includes(value.schema);
52
53
  }
53
54
  return false;
54
- };
55
- var asPayload = (schema) => import_object.AsObjectFactory.create((value) => isPayload(schema)(value));
55
+ }, "isPayload");
56
+ var asPayload = /* @__PURE__ */ __name((schema) => import_object.AsObjectFactory.create((value) => isPayload(schema)(value)), "asPayload");
56
57
 
57
58
  // src/isPayloadOfSchemaType.ts
58
- var isPayloadOfSchemaType = (schema) => {
59
+ var isPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
59
60
  return (x) => isAnyPayload(x) && (x == null ? void 0 : x.schema) === schema;
60
- };
61
- var notPayloadOfSchemaType = (schema) => {
61
+ }, "isPayloadOfSchemaType");
62
+ var notPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
62
63
  return (x) => !isAnyPayload(x) || (x == null ? void 0 : x.schema) !== schema;
63
- };
64
+ }, "notPayloadOfSchemaType");
64
65
 
65
66
  // src/PayloadSet/PayloadSetSchema.ts
66
67
  var PayloadSetSchema = "network.xyo.payload.set";
@@ -68,12 +69,12 @@ var PayloadSetSchema = "network.xyo.payload.set";
68
69
  // src/Schema.ts
69
70
  var import_object2 = require("@xyo-network/object");
70
71
  var PayloadSchema = "network.xyo.payload";
71
- var isSchema = (value) => {
72
+ var isSchema = /* @__PURE__ */ __name((value) => {
72
73
  if (typeof value === "string") {
73
74
  return true;
74
75
  }
75
76
  return false;
76
- };
77
+ }, "isSchema");
77
78
  var asSchema = import_object2.AsTypeFactory.create(isSchema);
78
79
  // Annotate the CommonJS export names for ESM import in node:
79
80
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/index.ts","../../src/Error.ts","../../src/isPayload.ts","../../src/isPayloadOfSchemaType.ts","../../src/PayloadSet/PayloadSetSchema.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Error'\nexport * from './isPayload'\nexport * from './isPayloadOfSchemaType'\nexport * from './Payload'\nexport * from './PayloadFindFilter'\nexport * from './PayloadSet'\nexport * from './Query'\nexport * from './Schema'\n","import { Payload } from './Payload'\n\nexport type ModuleErrorSchema = 'network.xyo.error.module'\nexport const ModuleErrorSchema: ModuleErrorSchema = 'network.xyo.error.module'\n\nexport type ModuleError = Payload<{\n message?: string\n name?: string\n query?: string\n schema: ModuleErrorSchema\n sources?: string[]\n}>\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AsObjectFactory, isObject } from '@xyo-network/object'\n\nimport { Payload } from './Payload'\n\nexport const isAnyPayload = (value: unknown): value is Payload => {\n if (isObject(value)) {\n return typeof value.schema === 'string'\n }\n return false\n}\n\nexport const asAnyPayload = AsObjectFactory.create(isAnyPayload)\n\nexport const isPayload =\n <T extends Payload>(schema: string[]) =>\n (value: unknown): value is T => {\n if (isAnyPayload(value)) {\n return schema.includes(value.schema)\n }\n return false\n }\n\nexport const asPayload = <T extends Payload>(schema: string[]) => AsObjectFactory.create((value: unknown): value is T => isPayload(schema)(value))\n","import { isAnyPayload } from './isPayload'\nimport { Payload } from './Payload'\n\nexport const isPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n","export type PayloadSetSchema = 'network.xyo.payload.set'\nexport const PayloadSetSchema: PayloadSetSchema = 'network.xyo.payload.set'\n","import { AsTypeFactory, EmptyObject } from '@xyo-network/object'\n\n/** Schema type in Javascript is a string */\nexport type Schema = string\n\nexport const PayloadSchema = 'network.xyo.payload'\nexport type PayloadSchema = typeof PayloadSchema\n\nexport const isSchema = (value: unknown): value is Schema => {\n if (typeof value === 'string') {\n return true\n }\n return false\n}\n\nexport const asSchema = AsTypeFactory.create<Schema>(isSchema)\n\n/** Schema fields for a Payload */\nexport interface SchemaFields extends EmptyObject {\n /** Schema of the object */\n schema: Schema\n}\n\n/** Add the Schema Fields to an object */\nexport type WithSchema<T extends EmptyObject | void = void> = T extends EmptyObject ? SchemaFields & T : SchemaFields\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,oBAAuC;;;ACFpD,oBAA0C;AAInC,IAAM,eAAe,CAAC,UAAqC;AAChE,UAAI,wBAAS,KAAK,GAAG;AACnB,WAAO,OAAO,MAAM,WAAW;AAAA,EACjC;AACA,SAAO;AACT;AAEO,IAAM,eAAe,8BAAgB,OAAO,YAAY;AAExD,IAAM,YACX,CAAoB,WACpB,CAAC,UAA+B;AAC9B,MAAI,aAAa,KAAK,GAAG;AACvB,WAAO,OAAO,SAAS,MAAM,MAAM;AAAA,EACrC;AACA,SAAO;AACT;AAEK,IAAM,YAAY,CAAoB,WAAqB,8BAAgB,OAAO,CAAC,UAA+B,UAAU,MAAM,EAAE,KAAK,CAAC;;;ACpB1I,IAAM,wBAAwB,CAAoB,WAAmB;AAC1E,SAAO,CAAC,MAA+B,aAAa,CAAC,MAAK,uBAAG,YAAW;AAC1E;AAEO,IAAM,yBAAyB,CAAoB,WAAmB;AAC3E,SAAO,CAAC,MAA+B,CAAC,aAAa,CAAC,MAAK,uBAAG,YAAW;AAC3E;;;ACRO,IAAM,mBAAqC;;;ACDlD,IAAAA,iBAA2C;AAKpC,IAAM,gBAAgB;AAGtB,IAAM,WAAW,CAAC,UAAoC;AAC3D,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,IAAM,WAAW,6BAAc,OAAe,QAAQ;","names":["import_object"]}
1
+ {"version":3,"sources":["../../src/index.ts","../../src/Error.ts","../../src/isPayload.ts","../../src/isPayloadOfSchemaType.ts","../../src/PayloadSet/PayloadSetSchema.ts","../../src/Schema.ts"],"sourcesContent":["export * from './Error'\nexport * from './isPayload'\nexport * from './isPayloadOfSchemaType'\nexport * from './Payload'\nexport * from './PayloadFindFilter'\nexport * from './PayloadSet'\nexport * from './Query'\nexport * from './Schema'\n","import { Payload } from './Payload'\n\nexport type ModuleErrorSchema = 'network.xyo.error.module'\nexport const ModuleErrorSchema: ModuleErrorSchema = 'network.xyo.error.module'\n\nexport type ModuleError = Payload<{\n message?: string\n name?: string\n query?: string\n schema: ModuleErrorSchema\n sources?: string[]\n}>\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AsObjectFactory, isObject } from '@xyo-network/object'\n\nimport { Payload } from './Payload'\n\nexport const isAnyPayload = (value: unknown): value is Payload => {\n if (isObject(value)) {\n return typeof value.schema === 'string'\n }\n return false\n}\n\nexport const asAnyPayload = AsObjectFactory.create(isAnyPayload)\n\nexport const isPayload =\n <T extends Payload>(schema: string[]) =>\n (value: unknown): value is T => {\n if (isAnyPayload(value)) {\n return schema.includes(value.schema)\n }\n return false\n }\n\nexport const asPayload = <T extends Payload>(schema: string[]) => AsObjectFactory.create((value: unknown): value is T => isPayload(schema)(value))\n","import { isAnyPayload } from './isPayload'\nimport { Payload } from './Payload'\n\nexport const isPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n","export type PayloadSetSchema = 'network.xyo.payload.set'\nexport const PayloadSetSchema: PayloadSetSchema = 'network.xyo.payload.set'\n","import { AsTypeFactory, EmptyObject } from '@xyo-network/object'\n\n/** Schema type in Javascript is a string */\nexport type Schema = string\n\nexport const PayloadSchema = 'network.xyo.payload'\nexport type PayloadSchema = typeof PayloadSchema\n\nexport const isSchema = (value: unknown): value is Schema => {\n if (typeof value === 'string') {\n return true\n }\n return false\n}\n\nexport const asSchema = AsTypeFactory.create<Schema>(isSchema)\n\n/** Schema fields for a Payload */\nexport interface SchemaFields extends EmptyObject {\n /** Schema of the object */\n schema: Schema\n}\n\n/** Add the Schema Fields to an object */\nexport type WithSchema<T extends EmptyObject | void = void> = T extends EmptyObject ? SchemaFields & T : SchemaFields\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;ACGO,IAAMA,oBAAuC;;;ACFpD,oBAA0C;AAInC,IAAMC,eAAe,wBAACC,UAAAA;AAC3B,UAAIC,wBAASD,KAAAA,GAAQ;AACnB,WAAO,OAAOA,MAAME,WAAW;EACjC;AACA,SAAO;AACT,GAL4B;AAOrB,IAAMC,eAAeC,8BAAgBC,OAAON,YAAAA;AAE5C,IAAMO,YACX,wBAAoBJ,WACpB,CAACF,UAAAA;AACC,MAAID,aAAaC,KAAAA,GAAQ;AACvB,WAAOE,OAAOK,SAASP,MAAME,MAAM;EACrC;AACA,SAAO;AACT,GANA;AAQK,IAAMM,YAAY,wBAAoBN,WAAqBE,8BAAgBC,OAAO,CAACL,UAA+BM,UAAUJ,MAAAA,EAAQF,KAAAA,CAAAA,GAAlH;;;ACpBlB,IAAMS,wBAAwB,wBAAoBC,WAAAA;AACvD,SAAO,CAACC,MAA+BC,aAAaD,CAAAA,MAAMA,uBAAGD,YAAWA;AAC1E,GAFqC;AAI9B,IAAMG,yBAAyB,wBAAoBH,WAAAA;AACxD,SAAO,CAACC,MAA+B,CAACC,aAAaD,CAAAA,MAAMA,uBAAGD,YAAWA;AAC3E,GAFsC;;;ACN/B,IAAMI,mBAAqC;;;ACDlD,IAAAC,iBAA2C;AAKpC,IAAMC,gBAAgB;AAGtB,IAAMC,WAAW,wBAACC,UAAAA;AACvB,MAAI,OAAOA,UAAU,UAAU;AAC7B,WAAO;EACT;AACA,SAAO;AACT,GALwB;AAOjB,IAAMC,WAAWC,6BAAcC,OAAeJ,QAAAA;","names":["ModuleErrorSchema","isAnyPayload","value","isObject","schema","asAnyPayload","AsObjectFactory","create","isPayload","includes","asPayload","isPayloadOfSchemaType","schema","x","isAnyPayload","notPayloadOfSchemaType","PayloadSetSchema","import_object","PayloadSchema","isSchema","value","asSchema","AsTypeFactory","create"]}
@@ -1,30 +1,33 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
+
1
4
  // src/Error.ts
2
5
  var ModuleErrorSchema = "network.xyo.error.module";
3
6
 
4
7
  // src/isPayload.ts
5
8
  import { AsObjectFactory, isObject } from "@xyo-network/object";
6
- var isAnyPayload = (value) => {
9
+ var isAnyPayload = /* @__PURE__ */ __name((value) => {
7
10
  if (isObject(value)) {
8
11
  return typeof value.schema === "string";
9
12
  }
10
13
  return false;
11
- };
14
+ }, "isAnyPayload");
12
15
  var asAnyPayload = AsObjectFactory.create(isAnyPayload);
13
- var isPayload = (schema) => (value) => {
16
+ var isPayload = /* @__PURE__ */ __name((schema) => (value) => {
14
17
  if (isAnyPayload(value)) {
15
18
  return schema.includes(value.schema);
16
19
  }
17
20
  return false;
18
- };
19
- var asPayload = (schema) => AsObjectFactory.create((value) => isPayload(schema)(value));
21
+ }, "isPayload");
22
+ var asPayload = /* @__PURE__ */ __name((schema) => AsObjectFactory.create((value) => isPayload(schema)(value)), "asPayload");
20
23
 
21
24
  // src/isPayloadOfSchemaType.ts
22
- var isPayloadOfSchemaType = (schema) => {
25
+ var isPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
23
26
  return (x) => isAnyPayload(x) && (x == null ? void 0 : x.schema) === schema;
24
- };
25
- var notPayloadOfSchemaType = (schema) => {
27
+ }, "isPayloadOfSchemaType");
28
+ var notPayloadOfSchemaType = /* @__PURE__ */ __name((schema) => {
26
29
  return (x) => !isAnyPayload(x) || (x == null ? void 0 : x.schema) !== schema;
27
- };
30
+ }, "notPayloadOfSchemaType");
28
31
 
29
32
  // src/PayloadSet/PayloadSetSchema.ts
30
33
  var PayloadSetSchema = "network.xyo.payload.set";
@@ -32,12 +35,12 @@ var PayloadSetSchema = "network.xyo.payload.set";
32
35
  // src/Schema.ts
33
36
  import { AsTypeFactory } from "@xyo-network/object";
34
37
  var PayloadSchema = "network.xyo.payload";
35
- var isSchema = (value) => {
38
+ var isSchema = /* @__PURE__ */ __name((value) => {
36
39
  if (typeof value === "string") {
37
40
  return true;
38
41
  }
39
42
  return false;
40
- };
43
+ }, "isSchema");
41
44
  var asSchema = AsTypeFactory.create(isSchema);
42
45
  export {
43
46
  ModuleErrorSchema,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Error.ts","../../src/isPayload.ts","../../src/isPayloadOfSchemaType.ts","../../src/PayloadSet/PayloadSetSchema.ts","../../src/Schema.ts"],"sourcesContent":["import { Payload } from './Payload'\n\nexport type ModuleErrorSchema = 'network.xyo.error.module'\nexport const ModuleErrorSchema: ModuleErrorSchema = 'network.xyo.error.module'\n\nexport type ModuleError = Payload<{\n message?: string\n name?: string\n query?: string\n schema: ModuleErrorSchema\n sources?: string[]\n}>\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AsObjectFactory, isObject } from '@xyo-network/object'\n\nimport { Payload } from './Payload'\n\nexport const isAnyPayload = (value: unknown): value is Payload => {\n if (isObject(value)) {\n return typeof value.schema === 'string'\n }\n return false\n}\n\nexport const asAnyPayload = AsObjectFactory.create(isAnyPayload)\n\nexport const isPayload =\n <T extends Payload>(schema: string[]) =>\n (value: unknown): value is T => {\n if (isAnyPayload(value)) {\n return schema.includes(value.schema)\n }\n return false\n }\n\nexport const asPayload = <T extends Payload>(schema: string[]) => AsObjectFactory.create((value: unknown): value is T => isPayload(schema)(value))\n","import { isAnyPayload } from './isPayload'\nimport { Payload } from './Payload'\n\nexport const isPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n","export type PayloadSetSchema = 'network.xyo.payload.set'\nexport const PayloadSetSchema: PayloadSetSchema = 'network.xyo.payload.set'\n","import { AsTypeFactory, EmptyObject } from '@xyo-network/object'\n\n/** Schema type in Javascript is a string */\nexport type Schema = string\n\nexport const PayloadSchema = 'network.xyo.payload'\nexport type PayloadSchema = typeof PayloadSchema\n\nexport const isSchema = (value: unknown): value is Schema => {\n if (typeof value === 'string') {\n return true\n }\n return false\n}\n\nexport const asSchema = AsTypeFactory.create<Schema>(isSchema)\n\n/** Schema fields for a Payload */\nexport interface SchemaFields extends EmptyObject {\n /** Schema of the object */\n schema: Schema\n}\n\n/** Add the Schema Fields to an object */\nexport type WithSchema<T extends EmptyObject | void = void> = T extends EmptyObject ? SchemaFields & T : SchemaFields\n"],"mappings":";AAGO,IAAM,oBAAuC;;;ACFpD,SAAS,iBAAiB,gBAAgB;AAInC,IAAM,eAAe,CAAC,UAAqC;AAChE,MAAI,SAAS,KAAK,GAAG;AACnB,WAAO,OAAO,MAAM,WAAW;AAAA,EACjC;AACA,SAAO;AACT;AAEO,IAAM,eAAe,gBAAgB,OAAO,YAAY;AAExD,IAAM,YACX,CAAoB,WACpB,CAAC,UAA+B;AAC9B,MAAI,aAAa,KAAK,GAAG;AACvB,WAAO,OAAO,SAAS,MAAM,MAAM;AAAA,EACrC;AACA,SAAO;AACT;AAEK,IAAM,YAAY,CAAoB,WAAqB,gBAAgB,OAAO,CAAC,UAA+B,UAAU,MAAM,EAAE,KAAK,CAAC;;;ACpB1I,IAAM,wBAAwB,CAAoB,WAAmB;AAC1E,SAAO,CAAC,MAA+B,aAAa,CAAC,MAAK,uBAAG,YAAW;AAC1E;AAEO,IAAM,yBAAyB,CAAoB,WAAmB;AAC3E,SAAO,CAAC,MAA+B,CAAC,aAAa,CAAC,MAAK,uBAAG,YAAW;AAC3E;;;ACRO,IAAM,mBAAqC;;;ACDlD,SAAS,qBAAkC;AAKpC,IAAM,gBAAgB;AAGtB,IAAM,WAAW,CAAC,UAAoC;AAC3D,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,IAAM,WAAW,cAAc,OAAe,QAAQ;","names":[]}
1
+ {"version":3,"sources":["../../src/Error.ts","../../src/isPayload.ts","../../src/isPayloadOfSchemaType.ts","../../src/PayloadSet/PayloadSetSchema.ts","../../src/Schema.ts"],"sourcesContent":["import { Payload } from './Payload'\n\nexport type ModuleErrorSchema = 'network.xyo.error.module'\nexport const ModuleErrorSchema: ModuleErrorSchema = 'network.xyo.error.module'\n\nexport type ModuleError = Payload<{\n message?: string\n name?: string\n query?: string\n schema: ModuleErrorSchema\n sources?: string[]\n}>\n","/* eslint-disable @typescript-eslint/no-explicit-any */\nimport { AsObjectFactory, isObject } from '@xyo-network/object'\n\nimport { Payload } from './Payload'\n\nexport const isAnyPayload = (value: unknown): value is Payload => {\n if (isObject(value)) {\n return typeof value.schema === 'string'\n }\n return false\n}\n\nexport const asAnyPayload = AsObjectFactory.create(isAnyPayload)\n\nexport const isPayload =\n <T extends Payload>(schema: string[]) =>\n (value: unknown): value is T => {\n if (isAnyPayload(value)) {\n return schema.includes(value.schema)\n }\n return false\n }\n\nexport const asPayload = <T extends Payload>(schema: string[]) => AsObjectFactory.create((value: unknown): value is T => isPayload(schema)(value))\n","import { isAnyPayload } from './isPayload'\nimport { Payload } from './Payload'\n\nexport const isPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => isAnyPayload(x) && x?.schema === schema\n}\n\nexport const notPayloadOfSchemaType = <T extends Payload>(schema: string) => {\n return (x?: unknown | null): x is T => !isAnyPayload(x) || x?.schema !== schema\n}\n","export type PayloadSetSchema = 'network.xyo.payload.set'\nexport const PayloadSetSchema: PayloadSetSchema = 'network.xyo.payload.set'\n","import { AsTypeFactory, EmptyObject } from '@xyo-network/object'\n\n/** Schema type in Javascript is a string */\nexport type Schema = string\n\nexport const PayloadSchema = 'network.xyo.payload'\nexport type PayloadSchema = typeof PayloadSchema\n\nexport const isSchema = (value: unknown): value is Schema => {\n if (typeof value === 'string') {\n return true\n }\n return false\n}\n\nexport const asSchema = AsTypeFactory.create<Schema>(isSchema)\n\n/** Schema fields for a Payload */\nexport interface SchemaFields extends EmptyObject {\n /** Schema of the object */\n schema: Schema\n}\n\n/** Add the Schema Fields to an object */\nexport type WithSchema<T extends EmptyObject | void = void> = T extends EmptyObject ? SchemaFields & T : SchemaFields\n"],"mappings":";;;;AAGO,IAAMA,oBAAuC;;;ACFpD,SAASC,iBAAiBC,gBAAgB;AAInC,IAAMC,eAAe,wBAACC,UAAAA;AAC3B,MAAIC,SAASD,KAAAA,GAAQ;AACnB,WAAO,OAAOA,MAAME,WAAW;EACjC;AACA,SAAO;AACT,GAL4B;AAOrB,IAAMC,eAAeC,gBAAgBC,OAAON,YAAAA;AAE5C,IAAMO,YACX,wBAAoBJ,WACpB,CAACF,UAAAA;AACC,MAAID,aAAaC,KAAAA,GAAQ;AACvB,WAAOE,OAAOK,SAASP,MAAME,MAAM;EACrC;AACA,SAAO;AACT,GANA;AAQK,IAAMM,YAAY,wBAAoBN,WAAqBE,gBAAgBC,OAAO,CAACL,UAA+BM,UAAUJ,MAAAA,EAAQF,KAAAA,CAAAA,GAAlH;;;ACpBlB,IAAMS,wBAAwB,wBAAoBC,WAAAA;AACvD,SAAO,CAACC,MAA+BC,aAAaD,CAAAA,MAAMA,uBAAGD,YAAWA;AAC1E,GAFqC;AAI9B,IAAMG,yBAAyB,wBAAoBH,WAAAA;AACxD,SAAO,CAACC,MAA+B,CAACC,aAAaD,CAAAA,MAAMA,uBAAGD,YAAWA;AAC3E,GAFsC;;;ACN/B,IAAMI,mBAAqC;;;ACDlD,SAASC,qBAAkC;AAKpC,IAAMC,gBAAgB;AAGtB,IAAMC,WAAW,wBAACC,UAAAA;AACvB,MAAI,OAAOA,UAAU,UAAU;AAC7B,WAAO;EACT;AACA,SAAO;AACT,GALwB;AAOjB,IAAMC,WAAWC,cAAcC,OAAeJ,QAAAA;","names":["ModuleErrorSchema","AsObjectFactory","isObject","isAnyPayload","value","isObject","schema","asAnyPayload","AsObjectFactory","create","isPayload","includes","asPayload","isPayloadOfSchemaType","schema","x","isAnyPayload","notPayloadOfSchemaType","PayloadSetSchema","AsTypeFactory","PayloadSchema","isSchema","value","asSchema","AsTypeFactory","create"]}
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/XYOracleNetwork/sdk-xyo-client-js/issues"
11
11
  },
12
12
  "dependencies": {
13
- "@xyo-network/object": "~2.84.19"
13
+ "@xyo-network/object": "~2.85.0"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@xylabs/ts-scripts-yarn3": "^3.2.25",
@@ -56,6 +56,6 @@
56
56
  },
57
57
  "sideEffects": false,
58
58
  "types": "dist/node/index.d.ts",
59
- "version": "2.84.19",
59
+ "version": "2.85.0",
60
60
  "type": "module"
61
61
  }