manyfest 1.0.42 → 1.0.44

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.
Files changed (55) hide show
  1. package/README.md +91 -260
  2. package/dist/manyfest.compatible.js +279 -112
  3. package/dist/manyfest.compatible.js.map +1 -1
  4. package/dist/manyfest.compatible.min.js +1 -1
  5. package/dist/manyfest.compatible.min.js.map +1 -1
  6. package/dist/manyfest.js +280 -112
  7. package/dist/manyfest.js.map +1 -1
  8. package/dist/manyfest.min.js +1 -1
  9. package/dist/manyfest.min.js.map +1 -1
  10. package/docs/.nojekyll +0 -0
  11. package/docs/README.md +108 -0
  12. package/docs/_sidebar.md +17 -0
  13. package/docs/address-notation.md +244 -0
  14. package/docs/cover.md +11 -0
  15. package/docs/hash-translation.md +202 -0
  16. package/docs/index.html +51 -0
  17. package/docs/quickstart.md +203 -0
  18. package/docs/reading.md +339 -0
  19. package/docs/schema-manipulation.md +186 -0
  20. package/docs/schema.md +319 -0
  21. package/docs/validating.md +344 -0
  22. package/docs/writing.md +300 -0
  23. package/package.json +3 -3
  24. package/source/Manyfest-CleanWrapCharacters.js +7 -1
  25. package/source/Manyfest-HashTranslation.js +29 -8
  26. package/source/Manyfest-ObjectAddress-CheckAddressExists.js +31 -17
  27. package/source/Manyfest-ObjectAddress-DeleteValue.js +27 -7
  28. package/source/Manyfest-ObjectAddress-GetValue.js +25 -10
  29. package/source/Manyfest-ObjectAddress-Parser.js +42 -35
  30. package/source/Manyfest-ObjectAddress-SetValue.js +21 -6
  31. package/source/Manyfest-ObjectAddressGeneration.js +23 -12
  32. package/source/Manyfest-ParseConditionals.js +3 -16
  33. package/source/Manyfest-SchemaManipulation.js +44 -21
  34. package/source/Manyfest.js +72 -17
  35. package/test/Manyfest_Performance_tests.js +48 -0
  36. package/types/Manyfest-CleanWrapCharacters.d.ts +7 -1
  37. package/types/Manyfest-CleanWrapCharacters.d.ts.map +1 -1
  38. package/types/Manyfest-HashTranslation.d.ts +34 -7
  39. package/types/Manyfest-HashTranslation.d.ts.map +1 -1
  40. package/types/Manyfest-ObjectAddress-CheckAddressExists.d.ts +23 -4
  41. package/types/Manyfest-ObjectAddress-CheckAddressExists.d.ts.map +1 -1
  42. package/types/Manyfest-ObjectAddress-DeleteValue.d.ts +25 -6
  43. package/types/Manyfest-ObjectAddress-DeleteValue.d.ts.map +1 -1
  44. package/types/Manyfest-ObjectAddress-GetValue.d.ts +26 -6
  45. package/types/Manyfest-ObjectAddress-GetValue.d.ts.map +1 -1
  46. package/types/Manyfest-ObjectAddress-Parser.d.ts +5 -5
  47. package/types/Manyfest-ObjectAddress-Parser.d.ts.map +1 -1
  48. package/types/Manyfest-ObjectAddress-SetValue.d.ts +18 -5
  49. package/types/Manyfest-ObjectAddress-SetValue.d.ts.map +1 -1
  50. package/types/Manyfest-ObjectAddressGeneration.d.ts +25 -4
  51. package/types/Manyfest-ObjectAddressGeneration.d.ts.map +1 -1
  52. package/types/Manyfest-SchemaManipulation.d.ts +47 -6
  53. package/types/Manyfest-SchemaManipulation.d.ts.map +1 -1
  54. package/types/Manyfest.d.ts +35 -12
  55. package/types/Manyfest.d.ts.map +1 -1
@@ -18,10 +18,23 @@ export = ManyfestObjectAddressSetValue;
18
18
  * @class ManyfestObjectAddressSetValue
19
19
  */
20
20
  declare class ManyfestObjectAddressSetValue {
21
- constructor(pInfoLog: any, pErrorLog: any);
22
- logInfo: any;
23
- logError: any;
24
- cleanWrapCharacters: (pCharacter: any, pString: any) => any;
25
- setValueAtAddress(pObject: any, pAddress: any, pValue: any): any;
21
+ /**
22
+ * @param {function} [pInfoLog] - (optional) A logging function for info messages
23
+ * @param {function} [pErrorLog] - (optional) A logging function for error messages
24
+ */
25
+ constructor(pInfoLog?: Function, pErrorLog?: Function);
26
+ logInfo: Function;
27
+ logError: Function;
28
+ cleanWrapCharacters: (pCharacter: string, pString: string) => string;
29
+ /**
30
+ * Set the value of an element at an address
31
+ *
32
+ * @param {object} pObject - The object to set the value in
33
+ * @param {string} pAddress - The address to set the value at
34
+ * @param {any} pValue - The value to set at the address
35
+ *
36
+ * @return {boolean} True if the value was set, false otherwise
37
+ */
38
+ setValueAtAddress(pObject: object, pAddress: string, pValue: any): boolean;
26
39
  }
27
40
  //# sourceMappingURL=Manyfest-ObjectAddress-SetValue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Manyfest-ObjectAddress-SetValue.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-SetValue.js"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;;;;EAiBE;AACF;IAEC,2CAOC;IAJA,aAAyE;IACzE,cAA4E;IAE5E,4DAA+C;IAIhD,iEAgOC;CACD"}
1
+ {"version":3,"file":"Manyfest-ObjectAddress-SetValue.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddress-SetValue.js"],"names":[],"mappings":";AAMA;;;;;;;;;;;;;;;;;EAiBE;AACF;IAEC;;;OAGG;IACH,uDAOC;IAJA,kBAAyE;IACzE,mBAA4E;IAE5E,qEAA+C;IAGhD;;;;;;;;OAQG;IACH,2BANW,MAAM,YACN,MAAM,UACN,GAAG,GAEF,OAAO,CAkOlB;CACD"}
@@ -22,9 +22,30 @@ export = ManyfestObjectAddressGeneration;
22
22
  * @class ManyfestObjectAddressGeneration
23
23
  */
24
24
  declare class ManyfestObjectAddressGeneration {
25
- constructor(pInfoLog: any, pErrorLog: any);
26
- logInfo: any;
27
- logError: any;
28
- generateAddressses(pObject: any, pBaseAddress: any, pSchema: any): any;
25
+ /**
26
+ * @param {function} [pInfoLog] - (optional) A logging function for info messages
27
+ * @param {function} [pErrorLog] - (optional) A logging function for error messages
28
+ */
29
+ constructor(pInfoLog?: Function, pErrorLog?: Function);
30
+ logInfo: Function;
31
+ logError: Function;
32
+ /**
33
+ * generateAddressses
34
+ *
35
+ * This flattens an object into a set of key:value pairs for *EVERY SINGLE
36
+ * POSSIBLE ADDRESS* in the object. It can get ... really insane really
37
+ * quickly. This is not meant to be used directly to generate schemas, but
38
+ * instead as a starting point for scripts or UIs.
39
+ *
40
+ * This will return a mega set of key:value pairs with all possible schema
41
+ * permutations and default values (when not an object) and everything else.
42
+ *
43
+ * @param {any} pObject - The object to generate addresses for
44
+ * @param {string} [pBaseAddress] - (optional) The base address to start from
45
+ * @param {object} [pSchema] - (optional) The schema object to append to
46
+ *
47
+ * @return {object} The generated schema object
48
+ */
49
+ generateAddressses(pObject: any, pBaseAddress?: string, pSchema?: object): object;
29
50
  }
30
51
  //# sourceMappingURL=Manyfest-ObjectAddressGeneration.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Manyfest-ObjectAddressGeneration.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddressGeneration.js"],"names":[],"mappings":";AAKA;;;;;;;;;;;;;;;;;;;;;EAqBE;AACF;IAEC,2CAKC;IAFA,aAAyE;IACzE,cAA4E;IAY7E,uEA+EC;CACD"}
1
+ {"version":3,"file":"Manyfest-ObjectAddressGeneration.d.ts","sourceRoot":"","sources":["../source/Manyfest-ObjectAddressGeneration.js"],"names":[],"mappings":";AAKA;;;;;;;;;;;;;;;;;;;;;EAqBE;AACF;IAEC;;;OAGG;IACH,uDAKC;IAFA,kBAAyE;IACzE,mBAA4E;IAG7E;;;;;;;;;;;;;;;;OAgBG;IACH,4BANW,GAAG,iBACH,MAAM,YACN,MAAM,GAEL,MAAM,CAgFjB;CACD"}
@@ -5,11 +5,52 @@ export = ManyfestSchemaManipulation;
5
5
  * @class ManyfestSchemaManipulation
6
6
  */
7
7
  declare class ManyfestSchemaManipulation {
8
- constructor(pInfoLog: any, pErrorLog: any);
9
- logInfo: any;
10
- logError: any;
11
- resolveAddressMappings(pManyfestSchemaDescriptors: any, pAddressMapping: any): boolean;
12
- safeResolveAddressMappings(pManyfestSchemaDescriptors: any, pAddressMapping: any): any;
13
- mergeAddressMappings(pManyfestSchemaDescriptorsDestination: any, pManyfestSchemaDescriptorsSource: any): any;
8
+ /**
9
+ * @param {function} [pInfoLog] - (optional) A logging function for info messages
10
+ * @param {function} [pErrorLog] - (optional) A logging function for error messages
11
+ */
12
+ constructor(pInfoLog?: Function, pErrorLog?: Function);
13
+ logInfo: Function;
14
+ logError: Function;
15
+ /**
16
+ * This translates the default address mappings to something different.
17
+ *
18
+ * For instance you can pass in manyfest schema descriptor object:
19
+ * {
20
+ * "Address.Of.a": { "Hash": "a", "Type": "Number" },
21
+ * "Address.Of.b": { "Hash": "b", "Type": "Number" }
22
+ * }
23
+ *
24
+ *
25
+ * And then an address mapping (basically a Hash->Address map)
26
+ * {
27
+ * "a": "New.Address.Of.a",
28
+ * "b": "New.Address.Of.b"
29
+ * }
30
+ *
31
+ * NOTE: This mutates the schema object permanently, altering the base hash.
32
+ * If there is a collision with an existing address, it can lead to overwrites.
33
+ * TODO: Discuss what should happen on collisions.
34
+ *
35
+ * @param {object} pManyfestSchemaDescriptors - The manyfest schema descriptors to resolve address mappings for
36
+ * @param {object} pAddressMapping - The address mapping object to use for remapping
37
+ *
38
+ * @return {boolean} True if successful, false if there was an error
39
+ */
40
+ resolveAddressMappings(pManyfestSchemaDescriptors: object, pAddressMapping: object): boolean;
41
+ /**
42
+ * @param {object} pManyfestSchemaDescriptors - The manyfest schema descriptors to resolve address mappings for
43
+ * @param {object} pAddressMapping - The address mapping object to use for remapping
44
+ *
45
+ * @return {object} A new object containing the remapped schema descriptors
46
+ */
47
+ safeResolveAddressMappings(pManyfestSchemaDescriptors: object, pAddressMapping: object): object;
48
+ /**
49
+ * @param {object} pManyfestSchemaDescriptorsDestination - The destination manyfest schema descriptors
50
+ * @param {object} pManyfestSchemaDescriptorsSource - The source manyfest schema descriptors
51
+ *
52
+ * @return {object} A new object containing the merged schema descriptors
53
+ */
54
+ mergeAddressMappings(pManyfestSchemaDescriptorsDestination: object, pManyfestSchemaDescriptorsSource: object): object;
14
55
  }
15
56
  //# sourceMappingURL=Manyfest-SchemaManipulation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Manyfest-SchemaManipulation.d.ts","sourceRoot":"","sources":["../source/Manyfest-SchemaManipulation.js"],"names":[],"mappings":";AAKA;;;;EAIE;AACF;IAEC,2CAKC;IAFA,aAA0E;IAC1E,cAA6E;IAqB9E,uFA8DC;IAED,uFAMC;IAED,6GAwBC;CACD"}
1
+ {"version":3,"file":"Manyfest-SchemaManipulation.d.ts","sourceRoot":"","sources":["../source/Manyfest-SchemaManipulation.js"],"names":[],"mappings":";AAKA;;;;EAIE;AACF;IAEC;;;OAGG;IACH,uDAKC;IAFA,kBAA0E;IAC1E,mBAA6E;IAG9E;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,mDALW,MAAM,mBACN,MAAM,GAEL,OAAO,CAgElB;IAED;;;;;OAKG;IACH,uDALW,MAAM,mBACN,MAAM,GAEL,MAAM,CAQjB;IAED;;;;;OAKG;IACH,4DALW,MAAM,oCACN,MAAM,GAEL,MAAM,CA0BjB;CACD"}
@@ -17,8 +17,14 @@ export = Manyfest;
17
17
  */
18
18
  declare class Manyfest {
19
19
  constructor(pFable: any, pManifest: any, pServiceHash: any);
20
+ /** @type {import('fable')} */
21
+ fable: any;
20
22
  /** @type {Record<string, any>} */
21
23
  options: Record<string, any>;
24
+ /** @type {string} */
25
+ Hash: string;
26
+ /** @type {string} */
27
+ UUID: string;
22
28
  serviceType: string;
23
29
  logInfo: (pLogLine: any, pLogObject: any) => void;
24
30
  logError: (pLogLine: any, pLogObject: any) => void;
@@ -26,10 +32,14 @@ declare class Manyfest {
26
32
  objectAddressGetValue: libObjectAddressGetValue;
27
33
  objectAddressSetValue: libObjectAddressSetValue;
28
34
  objectAddressDeleteValue: libObjectAddressDeleteValue;
29
- scope: any;
30
- elementAddresses: any[];
31
- elementHashes: {};
32
- elementDescriptors: {};
35
+ /** @type {string} */
36
+ scope: string;
37
+ /** @type {Array<string>} */
38
+ elementAddresses: Array<string>;
39
+ /** @type {Record<string, string>} */
40
+ elementHashes: Record<string, string>;
41
+ /** @type {Record<string, ManifestDescriptor>} */
42
+ elementDescriptors: Record<string, ManifestDescriptor>;
33
43
  schemaManipulations: libSchemaManipulation;
34
44
  objectAddressGeneration: libObjectAddressGeneration;
35
45
  hashTranslations: libHashTranslation;
@@ -39,13 +49,26 @@ declare class Manyfest {
39
49
  */
40
50
  reset(): void;
41
51
  clone(): import("./Manyfest.js");
42
- deserialize(pManifestString: any): void;
52
+ /**
53
+ * @param {string} pManifestString - The manifest string to deserialize
54
+ *
55
+ * @return {Manyfest} The deserialized manifest
56
+ */
57
+ deserialize(pManifestString: string): Manyfest;
43
58
  loadManifest(pManifest: any): void;
59
+ /**
60
+ * Serialize the Manifest to a string
61
+ *
62
+ * @return {string} - The serialized manifest
63
+ */
44
64
  serialize(): string;
65
+ /**
66
+ * @return {{ Scope: string, Descriptors: Record<string, ManifestDescriptor>, HashTranslations: Record<string, string> }} - A copy of the manifest state.
67
+ */
45
68
  getManifest(): {
46
- Scope: any;
47
- Descriptors: any;
48
- HashTranslations: any;
69
+ Scope: string;
70
+ Descriptors: Record<string, ManifestDescriptor>;
71
+ HashTranslations: Record<string, string>;
49
72
  };
50
73
  /**
51
74
  * Add a descriptor to the manifest
@@ -74,14 +97,14 @@ declare class Manyfest {
74
97
  /*************************************************************************
75
98
  * Beginning of Object Manipulation (read & write) Functions
76
99
  */
77
- checkAddressExistsByHash(pObject: any, pHash: any): any;
78
- checkAddressExists(pObject: any, pAddress: any): any;
100
+ checkAddressExistsByHash(pObject: any, pHash: any): boolean;
101
+ checkAddressExists(pObject: any, pAddress: any): boolean;
79
102
  resolveHashAddress(pHash: any): any;
80
103
  getValueByHash(pObject: any, pHash: any): any;
81
104
  lintAddress(pAddress: any): any;
82
105
  getValueAtAddress(pObject: any, pAddress: any): any;
83
- setValueByHash(pObject: any, pHash: any, pValue: any): any;
84
- setValueAtAddress(pObject: any, pAddress: any, pValue: any): any;
106
+ setValueByHash(pObject: any, pHash: any, pValue: any): boolean;
107
+ setValueAtAddress(pObject: any, pAddress: any, pValue: any): boolean;
85
108
  deleteValueByHash(pObject: any, pHash: any, pValue: any): any;
86
109
  deleteValueAtAddress(pObject: any, pAddress: any, pValue: any): any;
87
110
  validate(pObject: any): {
@@ -1 +1 @@
1
- {"version":3,"file":"Manyfest.d.ts","sourceRoot":"","sources":["../source/Manyfest.js"],"names":[],"mappings":";AAiBA;;;;;;;;;;GAUG;AAEH;;;;EAIE;AACF;IAEC,4DAkEC;IAvDA,kCAAkC;IAClC,SADW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAClB;IAEN,oBAA6B;IAGnC,kDAA2B;IAC3B,mDAA4B;IAG5B,oEAA0G;IAC1G,gDAAsF;IACtF,gDAAsF;IACtF,sDAA4F;IAwB5F,WAAsB;IACtB,wBAAiC;IACjC,kBAA8B;IAC9B,uBAAmC;IASnC,2CAAiF;IACjF,oDAA0F;IAE1F,qCAA2E;IAE3E,oBAA8D;IAG/D;;OAEG;IAGH,cAMC;IAED,iCAWC;IAGD,wCAIC;IAGD,mCAiEC;IAGD,oBAGC;IAED;;;;MAQC;IAED;;;;;OAKG;IACH,wBAHW,MAAM,eACN,kBAAkB,WAyC5B;IAED;;;;OAIG;IACH,2BAJW,MAAM,GAEL,kBAAkB,CAK7B;IAED;;;;OAIG;IACH,wBAJW,MAAM,GAEL,kBAAkB,CAK7B;IAED;;;OAGG;IACH,wBAFW,CAAC,CAAC,EAAE,kBAAkB,KAAK,IAAI,QAUzC;IAED;;OAEG;IAEH,wDAGC;IAGD,qDAGC;IAGD,oCA8BC;IAGD,8CAWC;IAED,gCAcC;IAGD,oDAiBC;IAGD,2DAGC;IAGD,iEAIC;IAGD,8DAGC;IAGD,oEAIC;IAGD;;;;MAiHC;IAED;;;;OAIG;IACH,6BAFW,kBAAkB,OA4B5B;IAGD,+DAQC;IAID,2EA0BC;CACD;;;;;;;;;;;0BArlBY;IACR,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,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