@chili-publish/studio-sdk 0.123.0 → 0.133.2
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 +1 -1
- package/_bundles/main.js +1 -1
- package/_bundles/main.js.map +1 -1
- package/_bundles/report.html +2 -2
- package/lib/editor-engine.json +1 -1
- package/lib/package.json +1 -1
- package/lib/src/controllers/ActionController.d.ts +33 -25
- package/lib/src/controllers/ActionController.js +42 -31
- package/lib/src/controllers/ActionController.js.map +1 -1
- package/lib/src/controllers/AnimationController.d.ts +24 -24
- package/lib/src/controllers/AnimationController.js +28 -28
- package/lib/src/controllers/AnimationController.js.map +1 -1
- package/lib/src/controllers/CanvasController.d.ts +3 -2
- package/lib/src/controllers/CanvasController.js +4 -3
- package/lib/src/controllers/CanvasController.js.map +1 -1
- package/lib/src/controllers/CharacterStyleController.d.ts +23 -23
- package/lib/src/controllers/CharacterStyleController.js +26 -26
- package/lib/src/controllers/CharacterStyleController.js.map +1 -1
- package/lib/src/controllers/ColorStyleController.d.ts +22 -22
- package/lib/src/controllers/ColorStyleController.js +27 -27
- package/lib/src/controllers/ColorStyleController.js.map +1 -1
- package/lib/src/controllers/ConfigurationController.d.ts +1 -1
- package/lib/src/controllers/ConfigurationController.js +1 -1
- package/lib/src/controllers/ConnectorController.d.ts +21 -12
- package/lib/src/controllers/ConnectorController.js +28 -19
- package/lib/src/controllers/ConnectorController.js.map +1 -1
- package/lib/src/controllers/DebugController.d.ts +2 -2
- package/lib/src/controllers/DebugController.js +2 -2
- package/lib/src/controllers/DebugController.js.map +1 -1
- package/lib/src/controllers/DocumentController.d.ts +6 -6
- package/lib/src/controllers/DocumentController.js +7 -7
- package/lib/src/controllers/DocumentController.js.map +1 -1
- package/lib/src/controllers/ExperimentController.d.ts +32 -7
- package/lib/src/controllers/ExperimentController.js +42 -9
- package/lib/src/controllers/ExperimentController.js.map +1 -1
- package/lib/src/controllers/FontConnectorController.d.ts +36 -28
- package/lib/src/controllers/FontConnectorController.js +45 -37
- package/lib/src/controllers/FontConnectorController.js.map +1 -1
- package/lib/src/controllers/FontController.d.ts +15 -15
- package/lib/src/controllers/FontController.js +18 -18
- package/lib/src/controllers/FontController.js.map +1 -1
- package/lib/src/controllers/FrameController.d.ts +127 -127
- package/lib/src/controllers/FrameController.js +173 -173
- package/lib/src/controllers/FrameController.js.map +1 -1
- package/lib/src/controllers/LayoutController.d.ts +37 -37
- package/lib/src/controllers/LayoutController.js +48 -48
- package/lib/src/controllers/LayoutController.js.map +1 -1
- package/lib/src/controllers/MediaConnectorController.d.ts +33 -23
- package/lib/src/controllers/MediaConnectorController.js +41 -31
- package/lib/src/controllers/MediaConnectorController.js.map +1 -1
- package/lib/src/controllers/PageController.d.ts +11 -11
- package/lib/src/controllers/PageController.js +16 -16
- package/lib/src/controllers/PageController.js.map +1 -1
- package/lib/src/controllers/ParagraphStyleController.d.ts +20 -20
- package/lib/src/controllers/ParagraphStyleController.js +23 -23
- package/lib/src/controllers/ParagraphStyleController.js.map +1 -1
- package/lib/src/controllers/ShapeController.d.ts +28 -28
- package/lib/src/controllers/ShapeController.js +43 -43
- package/lib/src/controllers/ShapeController.js.map +1 -1
- package/lib/src/controllers/SubscriberController.d.ts +18 -18
- package/lib/src/controllers/SubscriberController.js +24 -24
- package/lib/src/controllers/SubscriberController.js.map +1 -1
- package/lib/src/controllers/TextStyleController.d.ts +7 -7
- package/lib/src/controllers/TextStyleController.js +7 -7
- package/lib/src/controllers/TextStyleController.js.map +1 -1
- package/lib/src/controllers/ToolController.d.ts +10 -10
- package/lib/src/controllers/ToolController.js +9 -9
- package/lib/src/controllers/ToolController.js.map +1 -1
- package/lib/src/controllers/UtilsController.d.ts +10 -4
- package/lib/src/controllers/UtilsController.js +10 -4
- package/lib/src/controllers/UtilsController.js.map +1 -1
- package/lib/src/controllers/VariableController.d.ts +78 -34
- package/lib/src/controllers/VariableController.js +106 -53
- package/lib/src/controllers/VariableController.js.map +1 -1
- package/lib/src/index.d.ts +4 -3
- package/lib/src/index.js +5 -4
- package/lib/src/index.js.map +1 -1
- package/lib/src/interactions/connector.d.ts +4 -3
- package/lib/src/interactions/connector.js +7 -3
- package/lib/src/interactions/connector.js.map +1 -1
- package/lib/src/tests/__mocks__/FrameProperties.d.ts +2 -2
- package/lib/src/tests/__mocks__/FrameProperties.js +2 -2
- package/lib/src/tests/__mocks__/FrameProperties.js.map +1 -1
- package/lib/src/tests/__mocks__/MockImageFrameSource.js +5 -5
- package/lib/src/tests/__mocks__/MockImageFrameSource.js.map +1 -1
- package/lib/src/tests/__mocks__/animations.js +1 -1
- package/lib/src/tests/__mocks__/animations.js.map +1 -1
- package/lib/src/tests/__mocks__/mockDocument.d.ts +1 -1
- package/lib/src/tests/__mocks__/mockDocument.js +1 -1
- package/lib/src/tests/__mocks__/mockDocument.js.map +1 -1
- package/lib/src/tests/controllers/ActionController.test.js +18 -9
- package/lib/src/tests/controllers/ActionController.test.js.map +1 -1
- package/lib/src/tests/controllers/AnimationController.test.js +14 -14
- package/lib/src/tests/controllers/AnimationController.test.js.map +1 -1
- package/lib/src/tests/controllers/CharacterStyleController.test.js +11 -11
- package/lib/src/tests/controllers/CharacterStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ColorStyleController.test.js +17 -17
- package/lib/src/tests/controllers/ColorStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ConnectorController.test.js +6 -6
- package/lib/src/tests/controllers/ConnectorController.test.js.map +1 -1
- package/lib/src/tests/controllers/DebugController.test.js +1 -1
- package/lib/src/tests/controllers/DebugController.test.js.map +1 -1
- package/lib/src/tests/controllers/DocumentController.test.js +6 -6
- package/lib/src/tests/controllers/DocumentController.test.js.map +1 -1
- package/lib/src/tests/controllers/ExperimentController.test.js +29 -1
- package/lib/src/tests/controllers/ExperimentController.test.js.map +1 -1
- package/lib/src/tests/controllers/FontConnectorController.test.js +11 -11
- package/lib/src/tests/controllers/FontController.test.js +11 -11
- package/lib/src/tests/controllers/FontController.test.js.map +1 -1
- package/lib/src/tests/controllers/FrameController.test.js +113 -113
- package/lib/src/tests/controllers/FrameController.test.js.map +1 -1
- package/lib/src/tests/controllers/LayoutController.test.js +25 -27
- package/lib/src/tests/controllers/LayoutController.test.js.map +1 -1
- package/lib/src/tests/controllers/MediaConnectorController.test.js +1 -1
- package/lib/src/tests/controllers/PageController.test.js +11 -11
- package/lib/src/tests/controllers/PageController.test.js.map +1 -1
- package/lib/src/tests/controllers/ParagraphStyleController.test.js +12 -12
- package/lib/src/tests/controllers/ParagraphStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ShapeController.test.js +26 -26
- package/lib/src/tests/controllers/ShapeController.test.js.map +1 -1
- package/lib/src/tests/controllers/SubscriberContoller.test.js +7 -7
- package/lib/src/tests/controllers/SubscriberContoller.test.js.map +1 -1
- package/lib/src/tests/controllers/TextStyleController.test.js +6 -6
- package/lib/src/tests/controllers/TextStyleController.test.js.map +1 -1
- package/lib/src/tests/controllers/ToolController.test.js +9 -9
- package/lib/src/tests/controllers/ToolController.test.js.map +1 -1
- package/lib/src/tests/controllers/UtilsController.test.js +20 -0
- package/lib/src/tests/controllers/UtilsController.test.js.map +1 -1
- package/lib/src/tests/controllers/VariableController.test.js +62 -31
- package/lib/src/tests/controllers/VariableController.test.js.map +1 -1
- package/lib/src/tests/interactions/connector.test.js +14 -0
- package/lib/src/tests/interactions/connector.test.js.map +1 -1
- package/lib/src/tests/utils/getClaculatedValue.test.js +2 -2
- package/lib/src/tests/utils/getClaculatedValue.test.js.map +1 -1
- package/lib/src/types/ActionTypes.d.ts +3 -3
- package/lib/src/types/AnimationTypes.d.ts +3 -3
- package/lib/src/types/CharacterStyleTypes.d.ts +2 -1
- package/lib/src/types/ColorStyleTypes.d.ts +8 -7
- package/lib/src/types/ColorStyleTypes.js +1 -1
- package/lib/src/types/ColorStyleTypes.js.map +1 -1
- package/lib/src/types/CommonTypes.d.ts +7 -5
- package/lib/src/types/ConfigurationTypes.d.ts +3 -0
- package/lib/src/types/ConnectorTypes.d.ts +5 -4
- package/lib/src/types/ConnectorTypes.js.map +1 -1
- package/lib/src/types/DocumentTypes.d.ts +23 -25
- package/lib/src/types/DocumentTypes.js.map +1 -1
- package/lib/src/types/FontConnectorTypes.d.ts +2 -1
- package/lib/src/types/FontConnectorTypes.js.map +1 -1
- package/lib/src/types/FontTypes.d.ts +5 -4
- package/lib/src/types/FrameTypes.d.ts +20 -20
- package/lib/src/types/LayoutTypes.d.ts +14 -14
- package/lib/src/types/LayoutTypes.js.map +1 -1
- package/lib/src/types/MediaConnectorTypes.d.ts +2 -1
- package/lib/src/types/MediaConnectorTypes.js.map +1 -1
- package/lib/src/types/PageTypes.d.ts +3 -3
- package/lib/src/types/ParagraphStyleTypes.d.ts +6 -5
- package/lib/src/types/TextStyleTypes.d.ts +5 -5
- package/lib/src/types/TextStyleTypes.js +1 -1
- package/lib/src/types/TextStyleTypes.js.map +1 -1
- package/lib/src/types/TextTypes.d.ts +4 -0
- package/lib/src/types/TextTypes.js +6 -0
- package/lib/src/types/TextTypes.js.map +1 -0
- package/lib/src/types/VariableTypes.d.ts +12 -11
- package/lib/src/types/VariableTypes.js +3 -2
- package/lib/src/types/VariableTypes.js.map +1 -1
- package/lib/src/utils/enums.d.ts +8 -3
- package/lib/src/utils/enums.js +19 -13
- package/lib/src/utils/enums.js.map +1 -1
- package/lib/src/utils/getCalculatedValue.js +2 -2
- package/package.json +1 -1
|
@@ -12,51 +12,51 @@ export declare class ColorStyleController {
|
|
|
12
12
|
constructor(editorAPI: EditorAPI);
|
|
13
13
|
/**
|
|
14
14
|
* This method returns the list of colors
|
|
15
|
-
* @returns
|
|
15
|
+
* @returns list of all colors
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
getAll: () => Promise<import("../types/CommonTypes").EditorResponse<DocumentColor[]>>;
|
|
18
18
|
/**
|
|
19
19
|
* This method returns a color by id
|
|
20
|
-
* @param
|
|
21
|
-
* @returns
|
|
20
|
+
* @param id the id of a specific color
|
|
21
|
+
* @returns color properties for given id
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
getById: (id: string) => Promise<import("../types/CommonTypes").EditorResponse<DocumentColor>>;
|
|
24
24
|
/**
|
|
25
|
-
* This method
|
|
25
|
+
* This method creates a new color
|
|
26
26
|
* @returns the new created color id
|
|
27
27
|
*/
|
|
28
|
-
|
|
28
|
+
create: () => Promise<import("../types/CommonTypes").EditorResponse<string>>;
|
|
29
29
|
/**
|
|
30
|
-
* This method duplicates a color
|
|
31
|
-
* @param
|
|
32
|
-
* @returns the
|
|
30
|
+
* This method duplicates a color by the id
|
|
31
|
+
* @param id the id of a specific color
|
|
32
|
+
* @returns id of the duplicated color
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
duplicate: (id: string) => Promise<import("../types/CommonTypes").EditorResponse<string>>;
|
|
35
35
|
/**
|
|
36
36
|
* This method changes positions of colors
|
|
37
|
-
* @param order
|
|
38
|
-
* @param
|
|
37
|
+
* @param order the position of the colors
|
|
38
|
+
* @param ids the list of color IDs
|
|
39
39
|
* @returns
|
|
40
40
|
*/
|
|
41
|
-
|
|
41
|
+
move: (order: number, ids: string[]) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
42
42
|
/**
|
|
43
43
|
* This method renames a color
|
|
44
|
-
* @param id
|
|
45
|
-
* @param
|
|
44
|
+
* @param id the id of a specific color
|
|
45
|
+
* @param newColorName the new name of the color
|
|
46
46
|
* @returns
|
|
47
47
|
*/
|
|
48
|
-
|
|
48
|
+
rename: (id: string, newColorName: string) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
49
49
|
/**
|
|
50
50
|
* This method updates a color
|
|
51
|
-
* @param id
|
|
52
|
-
* @param
|
|
51
|
+
* @param id the id of a specific color
|
|
52
|
+
* @param newColorProperties the new color properties
|
|
53
53
|
* @returns
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
update: (id: string, newColorProperties: ColorUpdate) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
56
56
|
/**
|
|
57
57
|
* This method removes a color
|
|
58
|
-
* @param id
|
|
58
|
+
* @param id the id of a specific color
|
|
59
59
|
* @returns
|
|
60
60
|
*/
|
|
61
|
-
|
|
61
|
+
remove: (id: string) => Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
62
62
|
}
|
|
@@ -35,74 +35,74 @@ export class ColorStyleController {
|
|
|
35
35
|
_ColorStyleController_editorAPI.set(this, void 0);
|
|
36
36
|
/**
|
|
37
37
|
* This method returns the list of colors
|
|
38
|
-
* @returns
|
|
38
|
+
* @returns list of all colors
|
|
39
39
|
*/
|
|
40
|
-
this.
|
|
40
|
+
this.getAll = () => __awaiter(this, void 0, void 0, function* () {
|
|
41
41
|
const res = yield __classPrivateFieldGet(this, _ColorStyleController_editorAPI, "f");
|
|
42
42
|
return res.getColors().then((result) => getEditorResponseData(result));
|
|
43
43
|
});
|
|
44
44
|
/**
|
|
45
45
|
* This method returns a color by id
|
|
46
|
-
* @param
|
|
47
|
-
* @returns
|
|
46
|
+
* @param id the id of a specific color
|
|
47
|
+
* @returns color properties for given id
|
|
48
48
|
*/
|
|
49
|
-
this.
|
|
49
|
+
this.getById = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
50
50
|
const res = yield __classPrivateFieldGet(this, _ColorStyleController_editorAPI, "f");
|
|
51
|
-
return res.getColorById(
|
|
51
|
+
return res.getColorById(id).then((result) => getEditorResponseData(result));
|
|
52
52
|
});
|
|
53
53
|
/**
|
|
54
|
-
* This method
|
|
54
|
+
* This method creates a new color
|
|
55
55
|
* @returns the new created color id
|
|
56
56
|
*/
|
|
57
|
-
this.
|
|
57
|
+
this.create = () => __awaiter(this, void 0, void 0, function* () {
|
|
58
58
|
const res = yield __classPrivateFieldGet(this, _ColorStyleController_editorAPI, "f");
|
|
59
59
|
return res.createColor().then((result) => getEditorResponseData(result));
|
|
60
60
|
});
|
|
61
61
|
/**
|
|
62
|
-
* This method duplicates a color
|
|
63
|
-
* @param
|
|
64
|
-
* @returns the
|
|
62
|
+
* This method duplicates a color by the id
|
|
63
|
+
* @param id the id of a specific color
|
|
64
|
+
* @returns id of the duplicated color
|
|
65
65
|
*/
|
|
66
|
-
this.
|
|
66
|
+
this.duplicate = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
67
67
|
const res = yield __classPrivateFieldGet(this, _ColorStyleController_editorAPI, "f");
|
|
68
|
-
return res.duplicateColor(
|
|
68
|
+
return res.duplicateColor(id).then((result) => getEditorResponseData(result));
|
|
69
69
|
});
|
|
70
70
|
/**
|
|
71
71
|
* This method changes positions of colors
|
|
72
|
-
* @param order
|
|
73
|
-
* @param
|
|
72
|
+
* @param order the position of the colors
|
|
73
|
+
* @param ids the list of color IDs
|
|
74
74
|
* @returns
|
|
75
75
|
*/
|
|
76
|
-
this.
|
|
76
|
+
this.move = (order, ids) => __awaiter(this, void 0, void 0, function* () {
|
|
77
77
|
const res = yield __classPrivateFieldGet(this, _ColorStyleController_editorAPI, "f");
|
|
78
|
-
return res.moveColors(order,
|
|
78
|
+
return res.moveColors(order, ids).then((result) => getEditorResponseData(result));
|
|
79
79
|
});
|
|
80
80
|
/**
|
|
81
81
|
* This method renames a color
|
|
82
|
-
* @param id
|
|
83
|
-
* @param
|
|
82
|
+
* @param id the id of a specific color
|
|
83
|
+
* @param newColorName the new name of the color
|
|
84
84
|
* @returns
|
|
85
85
|
*/
|
|
86
|
-
this.
|
|
86
|
+
this.rename = (id, newColorName) => __awaiter(this, void 0, void 0, function* () {
|
|
87
87
|
const res = yield __classPrivateFieldGet(this, _ColorStyleController_editorAPI, "f");
|
|
88
|
-
return res.renameColor(id,
|
|
88
|
+
return res.renameColor(id, newColorName).then((result) => getEditorResponseData(result));
|
|
89
89
|
});
|
|
90
90
|
/**
|
|
91
91
|
* This method updates a color
|
|
92
|
-
* @param id
|
|
93
|
-
* @param
|
|
92
|
+
* @param id the id of a specific color
|
|
93
|
+
* @param newColorProperties the new color properties
|
|
94
94
|
* @returns
|
|
95
95
|
*/
|
|
96
|
-
this.
|
|
96
|
+
this.update = (id, newColorProperties) => __awaiter(this, void 0, void 0, function* () {
|
|
97
97
|
const res = yield __classPrivateFieldGet(this, _ColorStyleController_editorAPI, "f");
|
|
98
|
-
return res.updateColor(id, JSON.stringify(
|
|
98
|
+
return res.updateColor(id, JSON.stringify(newColorProperties)).then((result) => getEditorResponseData(result));
|
|
99
99
|
});
|
|
100
100
|
/**
|
|
101
101
|
* This method removes a color
|
|
102
|
-
* @param id
|
|
102
|
+
* @param id the id of a specific color
|
|
103
103
|
* @returns
|
|
104
104
|
*/
|
|
105
|
-
this.
|
|
105
|
+
this.remove = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
106
106
|
const res = yield __classPrivateFieldGet(this, _ColorStyleController_editorAPI, "f");
|
|
107
107
|
return res.removeColor(id).then((result) => getEditorResponseData(result));
|
|
108
108
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorStyleController.js","sourceRoot":"","sources":["../../../src/controllers/ColorStyleController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAM7B;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,kDAAsB;QAStB;;;WAGG;QACH,
|
|
1
|
+
{"version":3,"file":"ColorStyleController.js","sourceRoot":"","sources":["../../../src/controllers/ColorStyleController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAM7B;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,kDAAsB;QAStB;;;WAGG;QACH,WAAM,GAAG,GAAS,EAAE;YAChB,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,uCAAW,CAAC;YAClC,O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AAC;QAEF;;;;;WAKG;QACH,WAAM,GAAG,CAAO,EAAU,EAAE,YAAoB,EAAE,EAAE;YAChD,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,uCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,WAAW,CAAC,EAAE,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QACnG,CAAC,CAAA,CAAC;QAEF;;;;;WAKG;QACH,WAAM,GAAG,CAAO,EAAU,EAAE,kBAA+B,EAAE,EAAE;YAC3D,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,uCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QACzH,CAAC,CAAA,CAAC;QAEF;;;;WAIG;QACH,WAAM,GAAG,CAAO,EAAU,EAAE,EAAE;YAC1B,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,uCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QACrF,CAAC,CAAA,CAAC;QAlFE,uBAAA,IAAI,mCAAc,SAAS,MAAA,CAAC;IAChC,CAAC;CAkFJ"}
|
|
@@ -15,7 +15,7 @@ export declare class ConfigurationController {
|
|
|
15
15
|
/**
|
|
16
16
|
* This method returns the value for a given configuration key. If a value was not found in the configuration store
|
|
17
17
|
* this method returns an error. The key cannot be null.
|
|
18
|
-
* @returns
|
|
18
|
+
* @returns value for a given configuration key
|
|
19
19
|
*/
|
|
20
20
|
getValue: (key: WellKnownConfigurationKeys | string) => Promise<import("../types/CommonTypes").EditorResponse<string>>;
|
|
21
21
|
/**
|
|
@@ -38,7 +38,7 @@ export class ConfigurationController {
|
|
|
38
38
|
/**
|
|
39
39
|
* This method returns the value for a given configuration key. If a value was not found in the configuration store
|
|
40
40
|
* this method returns an error. The key cannot be null.
|
|
41
|
-
* @returns
|
|
41
|
+
* @returns value for a given configuration key
|
|
42
42
|
*/
|
|
43
43
|
this.getValue = (key) => __awaiter(this, void 0, void 0, function* () {
|
|
44
44
|
const res = yield __classPrivateFieldGet(this, _ConfigurationController_editorAPI, "f");
|
|
@@ -4,7 +4,7 @@ import { ConnectorState, ConnectorMapping, ConnectorRegistration, ConnectorInsta
|
|
|
4
4
|
* The ConnectorController manages lifetime of all available connectors, regardless of the type, in the
|
|
5
5
|
* document. Use it to add/remove connectors to a template, or set specific configuration.
|
|
6
6
|
*
|
|
7
|
-
* The way CHILI Studio handles different sources of
|
|
7
|
+
* The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an
|
|
8
8
|
* implementation of a set of capabilities we need to interact with a certain external resource management system.
|
|
9
9
|
* In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet
|
|
10
10
|
* is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to
|
|
@@ -23,36 +23,41 @@ export declare class ConnectorController {
|
|
|
23
23
|
/**
|
|
24
24
|
* Gets all available connectors of a 'ConnectorType'
|
|
25
25
|
* @param type type of connector you want to get
|
|
26
|
+
* @returns list of all available connectors of a 'ConnectorType'
|
|
26
27
|
*/
|
|
27
|
-
|
|
28
|
+
getAllByType: (type: ConnectorType) => Promise<EditorResponse<ConnectorInstance[]>>;
|
|
28
29
|
/**
|
|
29
30
|
* Registers a new connector in the SDK. After successful registration, depending
|
|
30
31
|
* on the connector type, the connector can be configured and used in the template
|
|
31
32
|
* Remember to add custom authentication information after registering the connector
|
|
32
33
|
* @param registration registration object containing all details about the connector
|
|
34
|
+
* @returns
|
|
33
35
|
*/
|
|
34
|
-
|
|
36
|
+
register: (registration: ConnectorRegistration) => Promise<EditorResponse<null>>;
|
|
35
37
|
/**
|
|
36
38
|
* Configures a registered connector. A configurator helper is passed as an argument
|
|
37
39
|
* of the callback for you to setup your connector.
|
|
38
|
-
* @param
|
|
40
|
+
* @param id the id of your registered connector
|
|
39
41
|
* @param configurationCallback callback to setup the connector
|
|
42
|
+
* @returns
|
|
40
43
|
*/
|
|
41
|
-
configure: (
|
|
44
|
+
configure: (id: string, configurationCallback: (configurator: ConnectorConfigurator) => Promise<void>) => Promise<EditorResponse<null>>;
|
|
42
45
|
/**
|
|
43
46
|
* Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitForConnectorReady'
|
|
44
47
|
* method in this controller.
|
|
45
|
-
* @param
|
|
48
|
+
* @param id the id of your registered connector you want to make sure it is loaded
|
|
49
|
+
* @returns connector state
|
|
46
50
|
*/
|
|
47
|
-
|
|
51
|
+
getById: (id: string) => Promise<EditorResponse<ConnectorState>>;
|
|
48
52
|
/**
|
|
49
53
|
* Connectors are loaded asynchronously in the editor engine, this causes some challenges while configuring them. To make sure
|
|
50
54
|
* an action on the connector will be available, it's advised to await this method. After the Promise resolves we are sure
|
|
51
55
|
* the connector is up and running. This is used internally by the configure method to ensure correct execution. It's especially
|
|
52
|
-
*
|
|
53
|
-
* @param
|
|
56
|
+
* useful during startup of the SDK / right after the loadDocument call.
|
|
57
|
+
* @param id the id of your registered connector you want to make sure it is loaded
|
|
58
|
+
* @returns
|
|
54
59
|
*/
|
|
55
|
-
|
|
60
|
+
waitToBeReady: (id: string, timeoutMilliseconds?: number) => Promise<EditorResponse<null>>;
|
|
56
61
|
}
|
|
57
62
|
/**
|
|
58
63
|
* Helper to setup your connector
|
|
@@ -62,25 +67,28 @@ declare class ConnectorConfigurator {
|
|
|
62
67
|
/**
|
|
63
68
|
* @ignore
|
|
64
69
|
*/
|
|
65
|
-
constructor(
|
|
70
|
+
constructor(id: string, res: EditorAPI);
|
|
66
71
|
/**
|
|
67
72
|
* Allows to customize the context data a connector can work with. The options data
|
|
68
73
|
* will be available using the context parameter in the connector implementation code.
|
|
69
74
|
* @param options object containing key value data to pass to connector context
|
|
75
|
+
* @returns
|
|
70
76
|
*/
|
|
71
77
|
setOptions: (options: ConnectorOptions) => Promise<EditorResponse<null>>;
|
|
72
78
|
/**
|
|
73
79
|
* Allows to map document data (variables, selectedFrame, etc) to connector context data.
|
|
74
|
-
* By defining the mappings, we can trigger
|
|
80
|
+
* By defining the mappings, we can trigger re-download of assets (dynamic asset provider)
|
|
75
81
|
* or populate filters for the query endpoint. The mapped data will be available using
|
|
76
82
|
* the context parameter in the connector implementation code.
|
|
77
83
|
* @param mappings collection of mappings to set to this connector
|
|
84
|
+
* @returns
|
|
78
85
|
*/
|
|
79
86
|
setMappings: (mappings: ConnectorMapping[]) => Promise<EditorResponse<null>>;
|
|
80
87
|
/**
|
|
81
88
|
* This method sets the CHILI GraFx Access Token in the Authentication HTTP header for the 'chili' authentication type.
|
|
82
89
|
* The CHILI Token will be used to authenticate every grafx connector http call.
|
|
83
90
|
* @param token token for the CHILI authentication
|
|
91
|
+
* @returns
|
|
84
92
|
*/
|
|
85
93
|
setChiliToken: (token: string) => Promise<EditorResponse<null>>;
|
|
86
94
|
/**
|
|
@@ -89,6 +97,7 @@ declare class ConnectorConfigurator {
|
|
|
89
97
|
* Can only be used after a connector has been registered. (if you are using a grafx connector no registration is needed)
|
|
90
98
|
* @param headerName name of the header
|
|
91
99
|
* @param headerValue value of the header
|
|
100
|
+
* @returns
|
|
92
101
|
*/
|
|
93
102
|
setHttpHeader: (headerName: string, headerValue: string) => Promise<EditorResponse<null>>;
|
|
94
103
|
}
|
|
@@ -25,7 +25,7 @@ import { getEditorResponseData } from '../utils/EditorResponseData';
|
|
|
25
25
|
* The ConnectorController manages lifetime of all available connectors, regardless of the type, in the
|
|
26
26
|
* document. Use it to add/remove connectors to a template, or set specific configuration.
|
|
27
27
|
*
|
|
28
|
-
* The way CHILI Studio handles different sources of
|
|
28
|
+
* The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an
|
|
29
29
|
* implementation of a set of capabilities we need to interact with a certain external resource management system.
|
|
30
30
|
* In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet
|
|
31
31
|
* is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to
|
|
@@ -47,8 +47,9 @@ export class ConnectorController {
|
|
|
47
47
|
/**
|
|
48
48
|
* Gets all available connectors of a 'ConnectorType'
|
|
49
49
|
* @param type type of connector you want to get
|
|
50
|
+
* @returns list of all available connectors of a 'ConnectorType'
|
|
50
51
|
*/
|
|
51
|
-
this.
|
|
52
|
+
this.getAllByType = (type) => __awaiter(this, void 0, void 0, function* () {
|
|
52
53
|
const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
|
|
53
54
|
return res.getConnectors(type).then((result) => getEditorResponseData(result));
|
|
54
55
|
});
|
|
@@ -57,8 +58,9 @@ export class ConnectorController {
|
|
|
57
58
|
* on the connector type, the connector can be configured and used in the template
|
|
58
59
|
* Remember to add custom authentication information after registering the connector
|
|
59
60
|
* @param registration registration object containing all details about the connector
|
|
61
|
+
* @returns
|
|
60
62
|
*/
|
|
61
|
-
this.
|
|
63
|
+
this.register = (registration) => __awaiter(this, void 0, void 0, function* () {
|
|
62
64
|
const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
|
|
63
65
|
return res
|
|
64
66
|
.registerConnector(JSON.stringify(registration))
|
|
@@ -67,35 +69,38 @@ export class ConnectorController {
|
|
|
67
69
|
/**
|
|
68
70
|
* Configures a registered connector. A configurator helper is passed as an argument
|
|
69
71
|
* of the callback for you to setup your connector.
|
|
70
|
-
* @param
|
|
72
|
+
* @param id the id of your registered connector
|
|
71
73
|
* @param configurationCallback callback to setup the connector
|
|
74
|
+
* @returns
|
|
72
75
|
*/
|
|
73
|
-
this.configure = (
|
|
76
|
+
this.configure = (id, configurationCallback) => __awaiter(this, void 0, void 0, function* () {
|
|
74
77
|
const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
|
|
75
78
|
// wait for connector to be ready
|
|
76
|
-
yield this.
|
|
79
|
+
yield this.waitToBeReady(id);
|
|
77
80
|
// execute callback
|
|
78
|
-
yield configurationCallback(new ConnectorConfigurator(
|
|
81
|
+
yield configurationCallback(new ConnectorConfigurator(id, res));
|
|
79
82
|
// invalidate connector in engine
|
|
80
|
-
return res.updateConnectorConfiguration(
|
|
83
|
+
return res.updateConnectorConfiguration(id).then((result) => getEditorResponseData(result));
|
|
81
84
|
});
|
|
82
85
|
/**
|
|
83
86
|
* Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitForConnectorReady'
|
|
84
87
|
* method in this controller.
|
|
85
|
-
* @param
|
|
88
|
+
* @param id the id of your registered connector you want to make sure it is loaded
|
|
89
|
+
* @returns connector state
|
|
86
90
|
*/
|
|
87
|
-
this.
|
|
91
|
+
this.getById = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
88
92
|
const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
|
|
89
|
-
return res.getConnectorState(
|
|
93
|
+
return res.getConnectorState(id).then((result) => getEditorResponseData(result));
|
|
90
94
|
});
|
|
91
95
|
/**
|
|
92
96
|
* Connectors are loaded asynchronously in the editor engine, this causes some challenges while configuring them. To make sure
|
|
93
97
|
* an action on the connector will be available, it's advised to await this method. After the Promise resolves we are sure
|
|
94
98
|
* the connector is up and running. This is used internally by the configure method to ensure correct execution. It's especially
|
|
95
|
-
*
|
|
96
|
-
* @param
|
|
99
|
+
* useful during startup of the SDK / right after the loadDocument call.
|
|
100
|
+
* @param id the id of your registered connector you want to make sure it is loaded
|
|
101
|
+
* @returns
|
|
97
102
|
*/
|
|
98
|
-
this.
|
|
103
|
+
this.waitToBeReady = (id, timeoutMilliseconds = 2000) => __awaiter(this, void 0, void 0, function* () {
|
|
99
104
|
// minimum timeout is 500ms
|
|
100
105
|
let timeout = Math.max(timeoutMilliseconds, 500);
|
|
101
106
|
// maximum timeout is 5000ms
|
|
@@ -103,10 +108,10 @@ export class ConnectorController {
|
|
|
103
108
|
const waitTime = 100;
|
|
104
109
|
let retries = 0;
|
|
105
110
|
try {
|
|
106
|
-
// using while loop will prevent
|
|
111
|
+
// using while loop will prevent stack overflow issues when using recursion
|
|
107
112
|
// wait for maximum 2 seconds to fail
|
|
108
113
|
while (retries * waitTime < timeout) {
|
|
109
|
-
const result = yield this.
|
|
114
|
+
const result = yield this.getById(id);
|
|
110
115
|
if (result.success &&
|
|
111
116
|
result.parsedData &&
|
|
112
117
|
(result.parsedData.type === ConnectorStateType.running ||
|
|
@@ -145,7 +150,7 @@ class ConnectorConfigurator {
|
|
|
145
150
|
/**
|
|
146
151
|
* @ignore
|
|
147
152
|
*/
|
|
148
|
-
constructor(
|
|
153
|
+
constructor(id, res) {
|
|
149
154
|
/**
|
|
150
155
|
* @ignore
|
|
151
156
|
*/
|
|
@@ -155,6 +160,7 @@ class ConnectorConfigurator {
|
|
|
155
160
|
* Allows to customize the context data a connector can work with. The options data
|
|
156
161
|
* will be available using the context parameter in the connector implementation code.
|
|
157
162
|
* @param options object containing key value data to pass to connector context
|
|
163
|
+
* @returns
|
|
158
164
|
*/
|
|
159
165
|
this.setOptions = (options) => __awaiter(this, void 0, void 0, function* () {
|
|
160
166
|
return __classPrivateFieldGet(this, _ConnectorConfigurator_res, "f")
|
|
@@ -163,10 +169,11 @@ class ConnectorConfigurator {
|
|
|
163
169
|
});
|
|
164
170
|
/**
|
|
165
171
|
* Allows to map document data (variables, selectedFrame, etc) to connector context data.
|
|
166
|
-
* By defining the mappings, we can trigger
|
|
172
|
+
* By defining the mappings, we can trigger re-download of assets (dynamic asset provider)
|
|
167
173
|
* or populate filters for the query endpoint. The mapped data will be available using
|
|
168
174
|
* the context parameter in the connector implementation code.
|
|
169
175
|
* @param mappings collection of mappings to set to this connector
|
|
176
|
+
* @returns
|
|
170
177
|
*/
|
|
171
178
|
this.setMappings = (mappings) => __awaiter(this, void 0, void 0, function* () {
|
|
172
179
|
const result = yield __classPrivateFieldGet(this, _ConnectorConfigurator_res, "f").setConnectorMappings(__classPrivateFieldGet(this, _ConnectorConfigurator_connectorId, "f"), mappings.map(function (m) {
|
|
@@ -178,6 +185,7 @@ class ConnectorConfigurator {
|
|
|
178
185
|
* This method sets the CHILI GraFx Access Token in the Authentication HTTP header for the 'chili' authentication type.
|
|
179
186
|
* The CHILI Token will be used to authenticate every grafx connector http call.
|
|
180
187
|
* @param token token for the CHILI authentication
|
|
188
|
+
* @returns
|
|
181
189
|
*/
|
|
182
190
|
this.setChiliToken = (token) => __awaiter(this, void 0, void 0, function* () {
|
|
183
191
|
return __classPrivateFieldGet(this, _ConnectorConfigurator_res, "f")
|
|
@@ -190,13 +198,14 @@ class ConnectorConfigurator {
|
|
|
190
198
|
* Can only be used after a connector has been registered. (if you are using a grafx connector no registration is needed)
|
|
191
199
|
* @param headerName name of the header
|
|
192
200
|
* @param headerValue value of the header
|
|
201
|
+
* @returns
|
|
193
202
|
*/
|
|
194
203
|
this.setHttpHeader = (headerName, headerValue) => __awaiter(this, void 0, void 0, function* () {
|
|
195
204
|
return __classPrivateFieldGet(this, _ConnectorConfigurator_res, "f")
|
|
196
205
|
.connectorAuthenticationSetHttpHeader(__classPrivateFieldGet(this, _ConnectorConfigurator_connectorId, "f"), headerName, headerValue)
|
|
197
206
|
.then((result) => getEditorResponseData(result));
|
|
198
207
|
});
|
|
199
|
-
__classPrivateFieldSet(this, _ConnectorConfigurator_connectorId,
|
|
208
|
+
__classPrivateFieldSet(this, _ConnectorConfigurator_connectorId, id, "f");
|
|
200
209
|
__classPrivateFieldSet(this, _ConnectorConfigurator_res, res, "f");
|
|
201
210
|
}
|
|
202
211
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConnectorController.js","sourceRoot":"","sources":["../../../src/controllers/ConnectorController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAEH,kBAAkB,GAKrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,mBAAmB;IAM5B;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,iDAAsB;QAStB
|
|
1
|
+
{"version":3,"file":"ConnectorController.js","sourceRoot":"","sources":["../../../src/controllers/ConnectorController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAEH,kBAAkB,GAKrB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAEpE;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,mBAAmB;IAM5B;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,iDAAsB;QAStB;;;;WAIG;QACH,iBAAY,GAAG,CAAO,IAAmB,EAAE,EAAE;YACzC,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,sCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAsB,MAAM,CAAC,CAAC,CAAC;QACxG,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QACH,aAAQ,GAAG,CAAO,YAAmC,EAAE,EAAE;YACrD,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,sCAAW,CAAC;YAClC,OAAO,GAAG;iBACL,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;iBAC/C,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAA,CAAC;QAEF;;;;;;WAMG;QACH,cAAS,GAAG,CACR,EAAU,EACV,qBAA6E,EAC/E,EAAE;YACA,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,sCAAW,C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14
|
* This method returns all debug logs
|
|
15
|
-
* @returns
|
|
15
|
+
* @returns list of all debug logs
|
|
16
16
|
*/
|
|
17
|
-
|
|
17
|
+
getAllLogs: () => Promise<import("../types/CommonTypes").EditorResponse<DebugData[]>>;
|
|
18
18
|
/**
|
|
19
19
|
* This method toggles the showcase of debug panel
|
|
20
20
|
* @returns
|
|
@@ -35,9 +35,9 @@ export class DebugController {
|
|
|
35
35
|
_DebugController_editorAPI.set(this, void 0);
|
|
36
36
|
/**
|
|
37
37
|
* This method returns all debug logs
|
|
38
|
-
* @returns
|
|
38
|
+
* @returns list of all debug logs
|
|
39
39
|
*/
|
|
40
|
-
this.
|
|
40
|
+
this.getAllLogs = () => __awaiter(this, void 0, void 0, function* () {
|
|
41
41
|
const res = yield __classPrivateFieldGet(this, _DebugController_editorAPI, "f");
|
|
42
42
|
return res.getLogs().then((result) => getEditorResponseData(result));
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugController.js","sourceRoot":"","sources":["../../../src/controllers/DebugController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE;;;GAGG;AACH,MAAM,OAAO,eAAe;IAMxB;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,6CAAsB;QAStB;;;WAGG;QACH,
|
|
1
|
+
{"version":3,"file":"DebugController.js","sourceRoot":"","sources":["../../../src/controllers/DebugController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAGpE;;;GAGG;AACH,MAAM,OAAO,eAAe;IAMxB;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,6CAAsB;QAStB;;;WAGG;QACH,eAAU,GAAG,GAAS,EAAE;YACpB,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,kCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,OAAO,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAc,MAAM,CAAC,CAAC,CAAC;QACtF,CAAC,CAAA,CAAC;QAEF;;;WAGG;QACH,qBAAgB,GAAG,GAAS,EAAE;YAC1B,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,kCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,gBAAgB,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QACxF,CAAC,CAAA,CAAC;QAEF;;;WAGG;QACH,gBAAW,GAAG,GAAS,EAAE;YACrB,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,kCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QACnF,CAAC,CAAA,CAAC;QAEF;;;WAGG;QACH,iBAAY,GAAG,GAAS,EAAE;YACtB,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,kCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,YAAY,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QACpF,CAAC,CAAA,CAAC;QArCE,uBAAA,IAAI,8BAAc,SAAS,MAAA,CAAC;IAChC,CAAC;CAqCJ"}
|
|
@@ -13,20 +13,20 @@ export declare class DocumentController {
|
|
|
13
13
|
constructor(editorAPI: EditorAPI);
|
|
14
14
|
/**
|
|
15
15
|
* This method retrieves the current document state from the editor
|
|
16
|
-
* @returns
|
|
16
|
+
* @returns the JSON document in the form of a string
|
|
17
17
|
*/
|
|
18
|
-
|
|
18
|
+
getCurrentState: () => Promise<import("../types/CommonTypes").EditorResponse<ChiliDocument>>;
|
|
19
19
|
/**
|
|
20
20
|
* This method will load a provided document in the ChiliDocument format
|
|
21
|
-
* @param doc
|
|
22
|
-
* @returns
|
|
21
|
+
* @param doc the document to load in
|
|
22
|
+
* @returns the document loaded inside of the canvas
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
load: (doc: ChiliDocument | string) => Promise<import("../types/CommonTypes").EditorResponse<unknown>>;
|
|
25
25
|
/**
|
|
26
26
|
* This method will call an external api to create a download url
|
|
27
27
|
* The video will be generated in the dimensions (and resolution) of the layout.
|
|
28
28
|
* This means that any upscaling (e.g. playing the video full screen on a 4k monitor) will result in interpolation (= quality loss).
|
|
29
|
-
* @param format
|
|
29
|
+
* @param format the format of a downloadable url
|
|
30
30
|
* @param layoutId id of layout to be downloaded
|
|
31
31
|
* @returns the download link
|
|
32
32
|
*/
|
|
@@ -37,18 +37,18 @@ export class DocumentController {
|
|
|
37
37
|
_DocumentController_editorAPI.set(this, void 0);
|
|
38
38
|
/**
|
|
39
39
|
* This method retrieves the current document state from the editor
|
|
40
|
-
* @returns
|
|
40
|
+
* @returns the JSON document in the form of a string
|
|
41
41
|
*/
|
|
42
|
-
this.
|
|
42
|
+
this.getCurrentState = () => __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
const res = yield __classPrivateFieldGet(this, _DocumentController_editorAPI, "f");
|
|
44
44
|
return res.getCurrentDocumentState().then((result) => getEditorResponseData(result));
|
|
45
45
|
});
|
|
46
46
|
/**
|
|
47
47
|
* This method will load a provided document in the ChiliDocument format
|
|
48
|
-
* @param doc
|
|
49
|
-
* @returns
|
|
48
|
+
* @param doc the document to load in
|
|
49
|
+
* @returns the document loaded inside of the canvas
|
|
50
50
|
*/
|
|
51
|
-
this.
|
|
51
|
+
this.load = (doc) => __awaiter(this, void 0, void 0, function* () {
|
|
52
52
|
const res = yield __classPrivateFieldGet(this, _DocumentController_editorAPI, "f");
|
|
53
53
|
if (typeof doc === 'string')
|
|
54
54
|
return res.loadDocument(doc);
|
|
@@ -58,7 +58,7 @@ export class DocumentController {
|
|
|
58
58
|
* This method will call an external api to create a download url
|
|
59
59
|
* The video will be generated in the dimensions (and resolution) of the layout.
|
|
60
60
|
* This means that any upscaling (e.g. playing the video full screen on a 4k monitor) will result in interpolation (= quality loss).
|
|
61
|
-
* @param format
|
|
61
|
+
* @param format the format of a downloadable url
|
|
62
62
|
* @param layoutId id of layout to be downloaded
|
|
63
63
|
* @returns the download link
|
|
64
64
|
*/
|
|
@@ -67,7 +67,7 @@ export class DocumentController {
|
|
|
67
67
|
let error = null;
|
|
68
68
|
let PREPARE_DOWNLOAD_URL = null;
|
|
69
69
|
let DOWNLOAD_URL = '';
|
|
70
|
-
const documentResponse = yield this.
|
|
70
|
+
const documentResponse = yield this.getCurrentState();
|
|
71
71
|
const FETCH_URL = getFetchURL(format, layoutId);
|
|
72
72
|
try {
|
|
73
73
|
const response = yield fetch(FETCH_URL, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DocumentController.js","sourceRoot":"","sources":["../../../src/controllers/DocumentController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE;;;GAGG;AAEH,MAAM,OAAO,kBAAkB;IAM3B;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,gDAAsB;QAStB;;;WAGG;QACH,
|
|
1
|
+
{"version":3,"file":"DocumentController.js","sourceRoot":"","sources":["../../../src/controllers/DocumentController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,UAAU,EAAmB,MAAM,gBAAgB,CAAC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE;;;GAG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