dbm 1.1.1 → 1.1.3

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 (36) hide show
  1. package/commands/CommandBaseObject.js +25 -0
  2. package/commands/SetProperty.js +18 -0
  3. package/commands/index.js +20 -8
  4. package/core/source/FromObject.js +8 -0
  5. package/core/source/index.js +9 -0
  6. package/flow/controllers/edit/EditMultipleValues.js +57 -0
  7. package/flow/controllers/edit/EditValue.js +52 -0
  8. package/flow/controllers/edit/index.js +2 -0
  9. package/flow/controllers/index.js +2 -1
  10. package/graphapi/webclient/admin/EditorGroup.js +59 -0
  11. package/graphapi/webclient/admin/ItemEditor.js +74 -0
  12. package/graphapi/webclient/admin/ItemSaveData.js +63 -0
  13. package/graphapi/webclient/admin/SaveData.js +60 -0
  14. package/graphapi/webclient/admin/SaveFunctions.js +7 -0
  15. package/graphapi/webclient/admin/ValueEditor.js +61 -0
  16. package/graphapi/webclient/admin/index.js +8 -0
  17. package/graphapi/webclient/decode/index.js +16 -3
  18. package/graphapi/webclient/index.js +17 -1
  19. package/package.json +1 -1
  20. package/react/admin/EditPage.js +87 -66
  21. package/react/admin/SelectImageFromLibrary.js +56 -0
  22. package/react/admin/editor/Editor.js +2 -0
  23. package/react/admin/editor/fields/ImageField.js +143 -4
  24. package/react/admin/index.js +1 -0
  25. package/react/area/OpenCloseExpandableArea.js +1 -1
  26. package/react/image/CoverScaledImage.js +5 -0
  27. package/react/image/Image.js +10 -1
  28. package/react/image/WidthScaledImage.js +5 -0
  29. package/react/modules/index.js +11 -1
  30. package/react/text/index.js +2 -2
  31. package/site/BrowserUpdater.js +64 -0
  32. package/site/SiteDataLoader.js +9 -13
  33. package/site/SiteNavigation.js +0 -15
  34. package/site/index.js +20 -1
  35. package/utils/ArrayFunctions.js +0 -1
  36. package/utils/UrlFunctions.js +39 -13
@@ -8,4 +8,29 @@ export default class CommandBaseObject extends Dbm.core.BaseObject {
8
8
  perform(aFromObject, aData) {
9
9
  //MENOTE: should be overridden
10
10
  }
11
+
12
+ _resolveSource(aValueOrSource) {
13
+ if(aValueOrSource) {
14
+ if(aValueOrSource.isFlowProperty) {
15
+ return aValueOrSource.value;
16
+ }
17
+ else if(aValueOrSource.isSource) {
18
+ return aValueOrSource.getSource(aFromObject, aData);
19
+ }
20
+ }
21
+
22
+ return aValueOrSource;
23
+ }
24
+
25
+ _resolveSourceWithoutFlow(aValueOrSource) {
26
+ if(aValueOrSource && aValueOrSource.isSource) {
27
+ return aValueOrSource.getSource(aFromObject, aData);
28
+ }
29
+
30
+ return aValueOrSource;
31
+ }
32
+
33
+ getInput(aName) {
34
+ return this._resolveSource(this.item[aName]);
35
+ }
11
36
  }
@@ -0,0 +1,18 @@
1
+ import Dbm from "../index.js";
2
+ import CommandBaseObject from "./CommandBaseObject.js"
3
+
4
+ export default class SetProperty extends CommandBaseObject {
5
+ _construct() {
6
+ super._construct();
7
+
8
+ this.item.setValue("property", null);
9
+ this.item.setValue("value", null);
10
+ }
11
+
12
+ perform(aFromObject, aData) {
13
+
14
+ let value = this.getInput("value");
15
+
16
+ this._resolveSourceWithoutFlow(this.item.property).value = value;
17
+ }
18
+ }
package/commands/index.js CHANGED
@@ -2,10 +2,11 @@ import Dbm from "../index.js";
2
2
 
3
3
  export {default as CommandBaseObject} from "./CommandBaseObject.js";
4
4
  export {default as CallFunction} from "./CallFunction.js";
5
+ export {default as SetProperty} from "./SetProperty.js";
5
6
  export {default as ResolvePromise} from "./ResolvePromise.js";
6
7
 
7
8
 
8
- let callScopedFunction = function(aScopeObject, aFunction, aArguments = []) {
9
+ export const callScopedFunction = function(aScopeObject, aFunction, aArguments = []) {
9
10
  let newCommand = new Dbm.commands.CallFunction();
10
11
  newCommand.item.setValue("scopeObject", aScopeObject);
11
12
  newCommand.item.setValue("callFunction", aFunction);
@@ -14,9 +15,7 @@ let callScopedFunction = function(aScopeObject, aFunction, aArguments = []) {
14
15
  return newCommand;
15
16
  }
16
17
 
17
- export {callScopedFunction};
18
-
19
- let callFunction = function(aFunction, aArguments = []) {
18
+ export const callFunction = function(aFunction, aArguments = []) {
20
19
  let newCommand = new Dbm.commands.CallFunction();
21
20
  newCommand.item.setValue("callFunction", aFunction);
22
21
  newCommand.item.setValue("callArguments", aArguments);
@@ -24,13 +23,26 @@ let callFunction = function(aFunction, aArguments = []) {
24
23
  return newCommand;
25
24
  }
26
25
 
27
- export {callFunction};
28
-
29
- let resolvePromise = function(aValue = null) {
26
+ export const resolvePromise = function(aValue = null) {
30
27
  let newCommand = new Dbm.commands.ResolvePromise();
31
28
  newCommand.item.setValue("value", aValue);
32
29
 
33
30
  return newCommand;
34
31
  }
35
32
 
36
- export {resolvePromise};
33
+ export const setProperty = function(aProperty, aValue) {
34
+ let newCommand = new Dbm.commands.SetProperty();
35
+ newCommand.item.setValue("property", aProperty);
36
+ newCommand.item.setValue("value", aValue);
37
+
38
+ return newCommand;
39
+ }
40
+
41
+ export const performCommands = function(aCommands, aFromObject = null, aEventData = null) {
42
+ let currentArray = aCommands;
43
+ let currentArrayLength = currentArray.length;
44
+ for(let i = 0; i < currentArrayLength; i++) {
45
+ let currentCommand = currentArray[i];
46
+ currentCommand.perform(aFromObject, aEventData);
47
+ }
48
+ }
@@ -0,0 +1,8 @@
1
+ import Dbm from "../../index.js";
2
+
3
+ export default class FromObject extends Dbm.core.source.SourceBaseObject {
4
+
5
+ getBaseObject(aFromObject, aEventData) {
6
+ return aFromObject;
7
+ }
8
+ }
@@ -2,6 +2,7 @@ import Dbm from "../../index.js";
2
2
 
3
3
  export {default as SourceBaseObject} from "./SourceBaseObject.js";
4
4
  export {default as EventSource} from "./EventSource.js";
5
+ export {default as FromObject} from "./FromObject.js";
5
6
  export {default as StaticSource} from "./StaticSource.js";
6
7
 
7
8
  export const event = function(aPath = null) {
@@ -12,6 +13,14 @@ export const event = function(aPath = null) {
12
13
  return newSource;
13
14
  }
14
15
 
16
+ export const fromObject = function(aPath = null) {
17
+ let newSource = new Dbm.core.source.FromObject();
18
+
19
+ newSource.item.properties.path.setOrConnect(aPath);
20
+
21
+ return newSource;
22
+ }
23
+
15
24
  export const staticObject = function(aObject, aPath = null) {
16
25
  let newSource = new Dbm.core.source.StaticSource();
17
26
 
@@ -0,0 +1,57 @@
1
+ import Dbm from "../../../index.js";
2
+
3
+ export default class EditMultipleValues extends Dbm.core.BaseObject {
4
+ _construct() {
5
+ super._construct();
6
+
7
+ this.item.requireProperty("editValues", {});
8
+
9
+ let anyChange = Dbm.flow.updatefunctions.logic.any();
10
+
11
+ this.item.requireProperty("anyChange", anyChange);
12
+ this.item.requireProperty("changed", false).connectInput(anyChange.output.properties.value);
13
+
14
+ }
15
+
16
+ get editors() {
17
+ return this.item.editValues;
18
+ }
19
+
20
+ _createEditValue(aName) {
21
+
22
+ let editValue = new Dbm.flow.controllers.edit.EditValue();
23
+
24
+ this.addEditor(aName, editValue);
25
+
26
+ return editValue;
27
+ }
28
+
29
+ addEditor(aName, aEditor) {
30
+ let editValues = {...this.item.editValues};
31
+ editValues[aName] = aEditor;
32
+
33
+ this.item.anyChange.addCheck(aEditor.item.properties.changed);
34
+
35
+ this.item.editValues = editValues;
36
+
37
+ return this;
38
+ }
39
+
40
+ getEditorIfExists(aName) {
41
+ let editValues = this.item.editValues;
42
+ if(editValues[aName]) {
43
+ return editValues[aName];
44
+ }
45
+
46
+ return null;
47
+ }
48
+
49
+ getEditor(aName) {
50
+ let editValue = this.getEditorIfExists(aName);
51
+ if(!editValue) {
52
+ editValue = this._createEditValue(aName);
53
+ }
54
+
55
+ return editValue;
56
+ }
57
+ }
@@ -0,0 +1,52 @@
1
+ import Dbm from "../../../index.js";
2
+
3
+ export default class EditValue extends Dbm.core.BaseObject {
4
+ _construct() {
5
+ super._construct();
6
+
7
+ this.item.requireProperty("storedValue", null);
8
+ this.item.requireProperty("value", null);
9
+
10
+ let condition = Dbm.flow.updatefunctions.logic.condition(this.item.properties.storedValue, "!==", this.item.properties.value);
11
+
12
+ this.item.requireProperty("changed", false).connectInput(condition.output.properties.result);
13
+ this._setStoredValueBound = this._setStoredValue.bind(this);
14
+ }
15
+
16
+ get value() {
17
+ return this.item.properties.value;
18
+ }
19
+
20
+ getValue() {
21
+ return this.item.value;
22
+ }
23
+
24
+ setInitialValue(aValue) {
25
+ this.item.storedValue = aValue;
26
+ this.item.value = aValue;
27
+
28
+ return this;
29
+ }
30
+
31
+ _setStoredValue(aValue) {
32
+ this.item.storedValue = aValue;
33
+
34
+ return this;
35
+ }
36
+
37
+ store() {
38
+ this.item.properties.storedValue.getMostUpstreamProperty().storedValue = this.item.value;
39
+
40
+ return this;
41
+ }
42
+
43
+ undo() {
44
+ this.item.value = this.item.storedValue;
45
+
46
+ return this;
47
+ }
48
+
49
+ getStoreCommand() {
50
+ return Dbm.commands.callFunction(this._setStoredValueBound, [this.item.value]);
51
+ }
52
+ }
@@ -0,0 +1,2 @@
1
+ export {default as EditValue} from "./EditValue.js";
2
+ export {default as EditMultipleValues} from "./EditMultipleValues.js";
@@ -1 +1,2 @@
1
- export * as select from "./select/index.js";
1
+ export * as select from "./select/index.js";
2
+ export * as edit from "./edit/index.js";
@@ -0,0 +1,59 @@
1
+ import Dbm from "../../../index.js";
2
+
3
+ export default class EditorGroup extends Dbm.core.BaseObject {
4
+
5
+ _construct() {
6
+ super._construct();
7
+
8
+ this.item.requireProperty("status", "none");
9
+ this.item.requireProperty("editors", []);
10
+
11
+ let anyChange = Dbm.flow.updatefunctions.logic.any();
12
+
13
+ this.item.requireProperty("anyChange", anyChange);
14
+ this.item.requireProperty("changed", false).connectInput(anyChange.output.properties.value);
15
+ }
16
+
17
+ getItemEditor(aId) {
18
+ let itemEditor = this.item["editor_" + aId];
19
+ if(!itemEditor) {
20
+ itemEditor = new Dbm.graphapi.webclient.admin.ItemEditor();
21
+ itemEditor.item.setValue("editedItem", Dbm.getInstance().repository.getItem(aId));
22
+ this.item.setValue("editor_" + aId, itemEditor);
23
+ this.item.editors = [].concat(this.item.editors, itemEditor);
24
+ this.item.anyChange.addCheck(itemEditor.item.properties.changed);
25
+ }
26
+
27
+ return itemEditor;
28
+ }
29
+
30
+ addCommandsToSaveData(aSaveData) {
31
+
32
+ aSaveData.addStartCommand(Dbm.commands.setProperty(this.item.properties.status, "loading"));
33
+
34
+ let currentArray = this.item.editors;
35
+ let currentArrayLength = currentArray.length;
36
+ for(let i = 0; i < currentArrayLength; i++) {
37
+ let currentEditor = currentArray[i];
38
+
39
+ if(currentEditor.item.changed) {
40
+ currentEditor.addCommandsToSaveData(aSaveData);
41
+ }
42
+
43
+ }
44
+
45
+ aSaveData.addSavedCommand(Dbm.commands.setProperty(this.item.properties.status, "none"));
46
+ }
47
+
48
+ getSaveData() {
49
+ let saveData = new Dbm.graphapi.webclient.admin.SaveData();
50
+ this.addCommandsToSaveData(saveData);
51
+ return saveData;
52
+ }
53
+
54
+ save() {
55
+ let saveData = this.getSaveData();
56
+ console.log(saveData);
57
+ saveData.save();
58
+ }
59
+ }
@@ -0,0 +1,74 @@
1
+ import Dbm from "../../../index.js";
2
+
3
+ export default class ItemEditor extends Dbm.core.BaseObject {
4
+
5
+ _construct() {
6
+ super._construct();
7
+
8
+ this.item.requireProperty("status", "none");
9
+ this.item.requireProperty("editors", []);
10
+
11
+ let anyChange = Dbm.flow.updatefunctions.logic.any();
12
+
13
+ this.item.requireProperty("anyChange", anyChange);
14
+ this.item.requireProperty("changed", false).connectInput(anyChange.output.properties.value);
15
+ }
16
+
17
+ getEditor(aField) {
18
+ return this.item["editor_" + aField];
19
+ }
20
+
21
+ addEditor(aName, aInitialValue, aSaveFunction, aUpdateEncoding = null) {
22
+ let valueEditor = this.item["editor_" + aName];
23
+ if(!valueEditor) {
24
+ valueEditor = new Dbm.graphapi.webclient.admin.ValueEditor();
25
+ valueEditor.item.editValue.setInitialValue(aInitialValue);
26
+
27
+ valueEditor.item.setValue("itemEditor", this.item);
28
+ valueEditor.item.setValue("name", aName);
29
+ valueEditor.item.setValue("updateEncoding", aUpdateEncoding);
30
+
31
+ this.item.anyChange.addCheck(valueEditor.item.properties.changed);
32
+ this.item.setValue("editor_" + aName, valueEditor);
33
+ this.item.editors = [].concat(this.item.editors, valueEditor);
34
+
35
+ valueEditor.addSaveFunction(aSaveFunction);
36
+ }
37
+
38
+ return valueEditor;
39
+ }
40
+
41
+ addFieldEditor(aField, aInitialValue, aUpdateEncoding = null) {
42
+ return this.addEditor(aField, aInitialValue, Dbm.graphapi.webclient.admin.SaveFunctions.setField, aUpdateEncoding);
43
+ }
44
+
45
+ addCommandsToSaveData(aSaveData) {
46
+
47
+ let editedItemId = Dbm.objectPath(this.item, "editedItem.id");
48
+ let itemSaveData = aSaveData.getItemSaveData(editedItemId);
49
+
50
+ let currentArray = this.item.editors;
51
+ let currentArrayLength = currentArray.length;
52
+ for(let i = 0; i < currentArrayLength; i++) {
53
+ let currentEditor = currentArray[i];
54
+
55
+ if(currentEditor.item.changed) {
56
+ currentEditor.addCommandsToSaveData(aSaveData);
57
+ }
58
+ }
59
+
60
+ itemSaveData.addStartCommand(Dbm.commands.setProperty(this.item.properties.status, "loading"));
61
+ itemSaveData.addSavedCommand(Dbm.commands.setProperty(this.item.properties.status, "none"));
62
+ }
63
+
64
+ getSaveData() {
65
+ let saveData = new Dbm.graphapi.webclient.admin.SaveData();
66
+ this.addCommandsToSaveData(saveData);
67
+ return saveData;
68
+ }
69
+
70
+ save() {
71
+ let saveData = this.getSaveData();
72
+ saveData.save();
73
+ }
74
+ }
@@ -0,0 +1,63 @@
1
+ import Dbm from "../../../index.js";
2
+
3
+ export default class ItemSaveData extends Dbm.core.BaseObject {
4
+ _construct() {
5
+ super._construct();
6
+
7
+ this.saveData = null;
8
+ this.itemId = 0;
9
+ this._changes = [];
10
+ this._updateEncodings = [];
11
+ this._savedCommands = [];
12
+ }
13
+
14
+ addChange(aChange) {
15
+ this._changes.push(aChange);
16
+
17
+ return this;
18
+ }
19
+
20
+ createChange(aType, aData) {
21
+ this._changes.push({"type": aType, "data": aData});
22
+
23
+ return this;
24
+ }
25
+
26
+ setField(aField, aValue) {
27
+ this.createChange("setField", {"value": aValue, "field": aField});
28
+
29
+ return this;
30
+ }
31
+
32
+ addUpdateEncoding(aEncoding) {
33
+ this._updateEncodings.push(aEncoding);
34
+
35
+ return this;
36
+ }
37
+
38
+ addStartCommand(aCommand) {
39
+ this.saveData.addStartCommand(aCommand);
40
+
41
+ return this;
42
+ }
43
+
44
+ addSavedCommand(aCommand) {
45
+ this._savedCommands.push(aCommand);
46
+
47
+ return this;
48
+ }
49
+
50
+ save() {
51
+ let graphApi = Dbm.getInstance().repository.getItem("graphApi").controller;
52
+
53
+ let request = graphApi.editItem(this.itemId, this._changes, this._updateEncodings);
54
+ Dbm.flow.addUpdateCommandWhenMatched(request.properties.status, 1, Dbm.commands.callFunction(this._saved.bind(this)));
55
+
56
+ return request;
57
+ }
58
+
59
+ _saved() {
60
+ console.log("_saved");
61
+ Dbm.commands.performCommands(this._savedCommands, this);
62
+ }
63
+ }
@@ -0,0 +1,60 @@
1
+ import Dbm from "../../../index.js";
2
+
3
+ export default class SaveData extends Dbm.core.BaseObject {
4
+ _construct() {
5
+ super._construct();
6
+
7
+ this._startCommands = [];
8
+ this._savedCommands = [];
9
+
10
+ this._saveOperations = [];
11
+ this._currentEditor = null;
12
+ }
13
+
14
+ getItemSaveData(aId) {
15
+
16
+ //METODO: check that it's an item save operation
17
+ if(this._currentEditor && this._currentEditor.itemId === aId) {
18
+ return this._currentEditor;
19
+ }
20
+
21
+ this._currentEditor = new Dbm.graphapi.webclient.admin.ItemSaveData();
22
+ this._currentEditor.itemId = aId;
23
+ this._currentEditor.saveData = this;
24
+ this._saveOperations.push(this._currentEditor);
25
+
26
+ return this._currentEditor;
27
+ }
28
+
29
+ addStartCommand(aCommand) {
30
+ this._startCommands.push(aCommand);
31
+
32
+ return this;
33
+ }
34
+
35
+ addSavedCommand(aCommand) {
36
+ this._savedCommands.push(aCommand);
37
+
38
+ return this;
39
+ }
40
+
41
+ save() {
42
+ Dbm.commands.performCommands(this._startCommands, this);
43
+
44
+ let saveOperations = [].concat(this._saveOperations);
45
+ this._performNextSaveOperation(saveOperations);
46
+
47
+ return this;
48
+ }
49
+
50
+ _performNextSaveOperation(aSaveOperations) {
51
+ if(aSaveOperations.length === 0) {
52
+ Dbm.commands.performCommands(this._savedCommands, this);
53
+ return;
54
+ }
55
+
56
+ let nextOperation = aSaveOperations.shift();
57
+ let request = nextOperation.save();
58
+ Dbm.flow.addUpdateCommandWhenMatched(request.properties.status, 1, Dbm.commands.callFunction(this._performNextSaveOperation.bind(this), [aSaveOperations]));
59
+ }
60
+ }
@@ -0,0 +1,7 @@
1
+ export const setField = function(aEditor, aItemSaveData) {
2
+ aItemSaveData.setField(aEditor.item.name, aEditor.item.editValue.getValue());
3
+ }
4
+
5
+ export const setUrl = function(aEditor, aItemSaveData) {
6
+ aItemSaveData.createChange("setUrl", {"value": aEditor.item.editValue.getValue()});
7
+ }
@@ -0,0 +1,61 @@
1
+ import Dbm from "../../../index.js";
2
+
3
+ export default class ValueEditor extends Dbm.core.BaseObject {
4
+
5
+ _construct() {
6
+ super._construct();
7
+
8
+ this.item.requireProperty("status", "none");
9
+ this.item.requireProperty("saveCommands", []);
10
+
11
+ let editValue = new Dbm.flow.controllers.edit.EditValue();
12
+ this.item.setValue("editValue", editValue);
13
+
14
+ this.item.requireProperty("changed", false).connectInput(editValue.item.properties.changed);
15
+ }
16
+
17
+ addSaveCommand(aCommand) {
18
+
19
+ this.item.saveCommands = [].concat(this.item.saveCommands, aCommand);
20
+
21
+ return this;
22
+ }
23
+
24
+ addSaveFunction(aFunction) {
25
+ this.addSaveCommand(Dbm.commands.callFunction(aFunction, [Dbm.core.source.fromObject(), Dbm.core.source.event()]));
26
+
27
+ return this;
28
+ }
29
+
30
+ addCommandsToSaveData(aSaveData) {
31
+
32
+ let editedItemId = Dbm.objectPath(this.item, "itemEditor.editedItem.id");
33
+ let itemSaveData = aSaveData.getItemSaveData(editedItemId);
34
+
35
+ let currentArray = this.item.saveCommands;
36
+ let currentArrayLength = currentArray.length;
37
+ for(let i = 0; i < currentArrayLength; i++) {
38
+ let currentCommand = currentArray[i];
39
+ currentCommand.perform(this, itemSaveData);
40
+ }
41
+
42
+ if(this.item.updateEncoding) {
43
+ itemSaveData.addUpdateEncoding(this.item.updateEncoding);
44
+ }
45
+
46
+ itemSaveData.addSavedCommand(this.item.editValue.getStoreCommand());
47
+ itemSaveData.addStartCommand(Dbm.commands.setProperty(this.item.properties.status, "loading"));
48
+ itemSaveData.addSavedCommand(Dbm.commands.setProperty(this.item.properties.status, "none"));
49
+ }
50
+
51
+ getSaveData() {
52
+ let saveData = new Dbm.graphapi.webclient.admin.SaveData();
53
+ this.addCommandsToSaveData(saveData);
54
+ return saveData;
55
+ }
56
+
57
+ save() {
58
+ let saveData = this.getSaveData();
59
+ saveData.save();
60
+ }
61
+ }
@@ -0,0 +1,8 @@
1
+ export {default as SaveData} from "./SaveData.js";
2
+ export {default as ItemSaveData} from "./ItemSaveData.js";
3
+
4
+ export {default as EditorGroup} from "./EditorGroup.js";
5
+ export {default as ItemEditor} from "./ItemEditor.js";
6
+ export {default as ValueEditor} from "./ValueEditor.js";
7
+
8
+ export * as SaveFunctions from "./SaveFunctions.js";
@@ -2,7 +2,7 @@ import Dbm from "../../../index.js";
2
2
 
3
3
  export {default as DecodeBaseObject} from "./DecodeBaseObject.js";
4
4
 
5
- let fullSetup = function() {
5
+ export const fullSetup = function() {
6
6
  let decodePrefix = "graphApi/decode/";
7
7
 
8
8
  if(process.env.NODE_ENV === "development") {
@@ -78,6 +78,19 @@ let fullSetup = function() {
78
78
  currentDecoder.item.setValue("encodingType", name);
79
79
  currentDecoder.item.register(decodePrefix + name);
80
80
  }
81
- }
82
81
 
83
- export {fullSetup};
82
+ {
83
+ let name = "type";
84
+ let currentDecoder = new Dbm.graphapi.webclient.decode.DecodeBaseObject();
85
+ currentDecoder.item.setValue("encodingType", name);
86
+ currentDecoder.item.register(decodePrefix + name);
87
+ }
88
+
89
+ {
90
+ let name = "image";
91
+ let currentDecoder = new Dbm.graphapi.webclient.decode.DecodeBaseObject();
92
+ currentDecoder.item.setValue("copyFields", ["originalFileName", "path", "url", "resizeUrl", "altText"]);
93
+ currentDecoder.item.setValue("encodingType", name);
94
+ currentDecoder.item.register(decodePrefix + name);
95
+ }
96
+ }
@@ -1,7 +1,23 @@
1
+ import Dbm from "../../index.js";
2
+
1
3
  export {default as WebSocketConnection} from "./WebSocketConnection.js";
2
4
  export {default as WebSocketRequest} from "./WebSocketRequest.js";
3
5
  export {default as GraphApi} from "./GraphApi.js";
4
6
  export {default as ApiConnection} from "./ApiConnection.js";
5
7
  export {default as ApiRequest} from "./ApiRequest.js";
6
8
 
7
- export * as decode from "./decode/index.js";
9
+ export * as decode from "./decode/index.js";
10
+ export * as admin from "./admin/index.js";
11
+
12
+ export const setup = function(aWsPath, aApiPath) {
13
+ let webSocketConnection = new Dbm.graphapi.webclient.WebSocketConnection();
14
+ webSocketConnection.setup(aWsPath);
15
+
16
+ let apiConnection = new Dbm.graphapi.webclient.ApiConnection();
17
+ apiConnection.setup(aApiPath);
18
+
19
+ let graphApi = new Dbm.graphapi.webclient.GraphApi();
20
+ graphApi.setWebsocketConnection(webSocketConnection);
21
+ graphApi.setApiConnection(apiConnection);
22
+ graphApi.item.register("graphApi");
23
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbm",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {},