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.
- package/README.md +91 -260
- package/dist/manyfest.compatible.js +279 -112
- package/dist/manyfest.compatible.js.map +1 -1
- package/dist/manyfest.compatible.min.js +1 -1
- package/dist/manyfest.compatible.min.js.map +1 -1
- package/dist/manyfest.js +280 -112
- package/dist/manyfest.js.map +1 -1
- package/dist/manyfest.min.js +1 -1
- package/dist/manyfest.min.js.map +1 -1
- package/docs/.nojekyll +0 -0
- package/docs/README.md +108 -0
- package/docs/_sidebar.md +17 -0
- package/docs/address-notation.md +244 -0
- package/docs/cover.md +11 -0
- package/docs/hash-translation.md +202 -0
- package/docs/index.html +51 -0
- package/docs/quickstart.md +203 -0
- package/docs/reading.md +339 -0
- package/docs/schema-manipulation.md +186 -0
- package/docs/schema.md +319 -0
- package/docs/validating.md +344 -0
- package/docs/writing.md +300 -0
- package/package.json +3 -3
- package/source/Manyfest-CleanWrapCharacters.js +7 -1
- package/source/Manyfest-HashTranslation.js +29 -8
- package/source/Manyfest-ObjectAddress-CheckAddressExists.js +31 -17
- package/source/Manyfest-ObjectAddress-DeleteValue.js +27 -7
- package/source/Manyfest-ObjectAddress-GetValue.js +25 -10
- package/source/Manyfest-ObjectAddress-Parser.js +42 -35
- package/source/Manyfest-ObjectAddress-SetValue.js +21 -6
- package/source/Manyfest-ObjectAddressGeneration.js +23 -12
- package/source/Manyfest-ParseConditionals.js +3 -16
- package/source/Manyfest-SchemaManipulation.js +44 -21
- package/source/Manyfest.js +72 -17
- package/test/Manyfest_Performance_tests.js +48 -0
- package/types/Manyfest-CleanWrapCharacters.d.ts +7 -1
- package/types/Manyfest-CleanWrapCharacters.d.ts.map +1 -1
- package/types/Manyfest-HashTranslation.d.ts +34 -7
- package/types/Manyfest-HashTranslation.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddress-CheckAddressExists.d.ts +23 -4
- package/types/Manyfest-ObjectAddress-CheckAddressExists.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddress-DeleteValue.d.ts +25 -6
- package/types/Manyfest-ObjectAddress-DeleteValue.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddress-GetValue.d.ts +26 -6
- package/types/Manyfest-ObjectAddress-GetValue.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddress-Parser.d.ts +5 -5
- package/types/Manyfest-ObjectAddress-Parser.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddress-SetValue.d.ts +18 -5
- package/types/Manyfest-ObjectAddress-SetValue.d.ts.map +1 -1
- package/types/Manyfest-ObjectAddressGeneration.d.ts +25 -4
- package/types/Manyfest-ObjectAddressGeneration.d.ts.map +1 -1
- package/types/Manyfest-SchemaManipulation.d.ts +47 -6
- package/types/Manyfest-SchemaManipulation.d.ts.map +1 -1
- package/types/Manyfest.d.ts +35 -12
- 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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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,
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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,
|
|
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
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,
|
|
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"}
|
package/types/Manyfest.d.ts
CHANGED
|
@@ -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
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
|
-
|
|
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:
|
|
47
|
-
Descriptors:
|
|
48
|
-
HashTranslations:
|
|
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):
|
|
78
|
-
checkAddressExists(pObject: any, pAddress: 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):
|
|
84
|
-
setValueAtAddress(pObject: any, pAddress: any, pValue: 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): {
|
package/types/Manyfest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Manyfest.d.ts","sourceRoot":"","sources":["../source/Manyfest.js"],"names":[],"mappings":";AAiBA;;;;;;;;;;GAUG;AAEH;;;;EAIE;AACF;IAEC,
|
|
1
|
+
{"version":3,"file":"Manyfest.d.ts","sourceRoot":"","sources":["../source/Manyfest.js"],"names":[],"mappings":";AAiBA;;;;;;;;;;GAUG;AAEH;;;;EAIE;AACF;IAEC,4DA4EC;IAjEA,8BAA8B;IAC9B,WAAU;IACV,kCAAkC;IAClC,SADW,MAAM,CAAC,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