manyfest 1.0.41 → 1.0.43

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 (42) hide show
  1. package/dist/manyfest.compatible.js +498 -182
  2. package/dist/manyfest.compatible.js.map +1 -0
  3. package/dist/manyfest.compatible.min.js +1 -1
  4. package/dist/manyfest.compatible.min.js.map +1 -1
  5. package/dist/manyfest.js +487 -173
  6. package/dist/manyfest.js.map +1 -0
  7. package/dist/manyfest.min.js +1 -1
  8. package/dist/manyfest.min.js.map +1 -1
  9. package/package.json +3 -3
  10. package/source/Manyfest-CleanWrapCharacters.js +7 -1
  11. package/source/Manyfest-HashTranslation.js +29 -8
  12. package/source/Manyfest-ObjectAddress-CheckAddressExists.js +28 -13
  13. package/source/Manyfest-ObjectAddress-DeleteValue.js +20 -2
  14. package/source/Manyfest-ObjectAddress-GetValue.js +23 -4
  15. package/source/Manyfest-ObjectAddress-Parser.js +39 -32
  16. package/source/Manyfest-ObjectAddress-SetValue.js +14 -2
  17. package/source/Manyfest-ObjectAddressGeneration.js +23 -12
  18. package/source/Manyfest-ParseConditionals.js +3 -3
  19. package/source/Manyfest-SchemaManipulation.js +44 -21
  20. package/source/Manyfest.js +69 -9
  21. package/test/Manyfest_Object_Read_tests.js +13 -0
  22. package/test/Manyfest_Performance_tests.js +48 -0
  23. package/types/Manyfest-CleanWrapCharacters.d.ts +7 -1
  24. package/types/Manyfest-CleanWrapCharacters.d.ts.map +1 -1
  25. package/types/Manyfest-HashTranslation.d.ts +34 -7
  26. package/types/Manyfest-HashTranslation.d.ts.map +1 -1
  27. package/types/Manyfest-ObjectAddress-CheckAddressExists.d.ts +23 -4
  28. package/types/Manyfest-ObjectAddress-CheckAddressExists.d.ts.map +1 -1
  29. package/types/Manyfest-ObjectAddress-DeleteValue.d.ts +25 -6
  30. package/types/Manyfest-ObjectAddress-DeleteValue.d.ts.map +1 -1
  31. package/types/Manyfest-ObjectAddress-GetValue.d.ts +26 -6
  32. package/types/Manyfest-ObjectAddress-GetValue.d.ts.map +1 -1
  33. package/types/Manyfest-ObjectAddress-Parser.d.ts +5 -5
  34. package/types/Manyfest-ObjectAddress-Parser.d.ts.map +1 -1
  35. package/types/Manyfest-ObjectAddress-SetValue.d.ts +18 -5
  36. package/types/Manyfest-ObjectAddress-SetValue.d.ts.map +1 -1
  37. package/types/Manyfest-ObjectAddressGeneration.d.ts +25 -4
  38. package/types/Manyfest-ObjectAddressGeneration.d.ts.map +1 -1
  39. package/types/Manyfest-SchemaManipulation.d.ts +47 -6
  40. package/types/Manyfest-SchemaManipulation.d.ts.map +1 -1
  41. package/types/Manyfest.d.ts +36 -12
  42. package/types/Manyfest.d.ts.map +1 -1
@@ -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,13 +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;
104
+ lintAddress(pAddress: any): any;
81
105
  getValueAtAddress(pObject: any, pAddress: any): any;
82
- setValueByHash(pObject: any, pHash: any, pValue: any): any;
83
- 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;
84
108
  deleteValueByHash(pObject: any, pHash: any, pValue: any): any;
85
109
  deleteValueAtAddress(pObject: any, pAddress: any, pValue: any): any;
86
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,sDAA4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