@chili-publish/studio-sdk 1.12.0 → 1.13.0
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/_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/ConfigurationController.d.ts +6 -6
- package/lib/src/controllers/ConfigurationController.js +31 -23
- package/lib/src/controllers/ConfigurationController.js.map +1 -1
- package/lib/src/controllers/ConnectorController.d.ts +2 -2
- package/lib/src/controllers/ConnectorController.js +35 -6
- package/lib/src/controllers/ConnectorController.js.map +1 -1
- package/lib/src/controllers/FrameController.d.ts +85 -1
- package/lib/src/controllers/FrameController.js +169 -0
- package/lib/src/controllers/FrameController.js.map +1 -1
- package/lib/src/controllers/SubscriberController.d.ts +5 -1
- package/lib/src/controllers/SubscriberController.js +7 -2
- package/lib/src/controllers/SubscriberController.js.map +1 -1
- package/lib/src/controllers/VariableController.d.ts +26 -0
- package/lib/src/controllers/VariableController.js +54 -3
- package/lib/src/controllers/VariableController.js.map +1 -1
- package/lib/src/index.d.ts +2 -2
- package/lib/src/index.js +1 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/next/NextInitiator.d.ts +2 -0
- package/lib/src/next/NextInitiator.js +2 -0
- package/lib/src/next/NextInitiator.js.map +1 -1
- package/lib/src/next/controllers/ConnectorController.d.ts +43 -0
- package/lib/src/next/controllers/ConnectorController.js +79 -0
- package/lib/src/next/controllers/ConnectorController.js.map +1 -0
- package/lib/src/next/controllers/SubscriberController.d.ts +5 -0
- package/lib/src/next/controllers/SubscriberController.js +8 -0
- package/lib/src/next/controllers/SubscriberController.js.map +1 -1
- package/lib/src/next/controllers/VariableController.d.ts +10 -0
- package/lib/src/next/controllers/VariableController.js +14 -0
- package/lib/src/next/controllers/VariableController.js.map +1 -1
- package/lib/src/next/index.d.ts +1 -0
- package/lib/src/next/tests/controllers/ConnectorController.test.js +72 -0
- package/lib/src/next/tests/controllers/ConnectorController.test.js.map +1 -0
- package/lib/src/next/tests/controllers/SubscriberContoller.test.d.ts +1 -0
- package/lib/src/next/tests/controllers/SubscriberContoller.test.js +44 -0
- package/lib/src/next/tests/controllers/SubscriberContoller.test.js.map +1 -0
- package/lib/src/next/tests/controllers/VariableController.test.js +34 -1
- package/lib/src/next/tests/controllers/VariableController.test.js.map +1 -1
- package/lib/src/next/types/ConnectorTypes.d.ts +44 -0
- package/lib/src/next/types/ConnectorTypes.js +22 -0
- package/lib/src/next/types/ConnectorTypes.js.map +1 -0
- package/lib/src/next/types/VariableTypes.d.ts +10 -0
- package/lib/src/next/types/VariableTypes.js +11 -1
- package/lib/src/next/types/VariableTypes.js.map +1 -1
- package/lib/src/sdk.d.ts +2 -1
- package/lib/src/sdk.js +7 -6
- package/lib/src/sdk.js.map +1 -1
- package/lib/src/tests/__mocks__/localConfig.d.ts +2 -0
- package/lib/src/tests/__mocks__/localConfig.js +4 -0
- package/lib/src/tests/__mocks__/localConfig.js.map +1 -0
- package/lib/src/tests/controllers/ConnectorController.test.js +54 -10
- package/lib/src/tests/controllers/ConnectorController.test.js.map +1 -1
- package/lib/src/tests/controllers/FrameController.test.js +99 -1
- package/lib/src/tests/controllers/FrameController.test.js.map +1 -1
- package/lib/src/tests/controllers/SubscriberContoller.test.js +36 -6
- package/lib/src/tests/controllers/SubscriberContoller.test.js.map +1 -1
- package/lib/src/tests/controllers/VariableController.test.js +40 -1
- package/lib/src/tests/controllers/VariableController.test.js.map +1 -1
- package/lib/src/tests/utils/ConnectorCompatibilityTools.test.d.ts +1 -0
- package/lib/src/tests/utils/ConnectorCompatibilityTools.test.js +74 -0
- package/lib/src/tests/utils/ConnectorCompatibilityTools.test.js.map +1 -0
- package/lib/src/tests/utils/LocalConfigurationDecorator.test.d.ts +1 -0
- package/lib/src/tests/utils/LocalConfigurationDecorator.test.js +61 -0
- package/lib/src/tests/utils/LocalConfigurationDecorator.test.js.map +1 -0
- package/lib/src/types/ConnectorTypes.d.ts +2 -2
- package/lib/src/types/ConnectorTypes.js +1 -1
- package/lib/src/types/FrameTypes.d.ts +43 -0
- package/lib/src/types/FrameTypes.js +7 -0
- package/lib/src/types/FrameTypes.js.map +1 -1
- package/lib/src/types/VariableTypes.d.ts +2 -0
- package/lib/src/types/VariableTypes.js.map +1 -1
- package/lib/src/utils/ConnectorCompatibilityTools.d.ts +17 -0
- package/lib/src/utils/ConnectorCompatibilityTools.js +54 -0
- package/lib/src/utils/ConnectorCompatibilityTools.js.map +1 -0
- package/lib/src/utils/LocalConfigurationDecorator.d.ts +23 -0
- package/lib/src/utils/LocalConfigurationDecorator.js +76 -0
- package/lib/src/utils/LocalConfigurationDecorator.js.map +1 -0
- package/package.json +1 -1
- package/lib/src/tests/controllers/ConfigurationConnectorController.test.js +0 -54
- package/lib/src/tests/controllers/ConfigurationConnectorController.test.js.map +0 -1
- /package/lib/src/{tests/controllers/ConfigurationConnectorController.test.d.ts → next/tests/controllers/ConnectorController.test.d.ts} +0 -0
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ConnectorGrafxRegistration, ConnectorInstance, ConnectorLocalRegistration, ConnectorType, ConnectorUrlRegistration } from '../types/ConnectorTypes';
|
|
2
|
+
import { EditorAPI, Id } from '../../types/CommonTypes';
|
|
3
|
+
/**
|
|
4
|
+
* The ConnectorController manages lifetime of all available connectors, regardless of the type, in the
|
|
5
|
+
* document. Use it to add/remove connectors to a template, or set specific configuration.
|
|
6
|
+
*
|
|
7
|
+
* The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an
|
|
8
|
+
* implementation of a set of capabilities we need to interact with a certain external resource management system.
|
|
9
|
+
* In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet
|
|
10
|
+
* is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to
|
|
11
|
+
* execute the media connector both on web using webassembly and on the server side during e.g. animation output
|
|
12
|
+
* generation.
|
|
13
|
+
* This controller is an interface to the running connector instance inside the studio engine. The engine will
|
|
14
|
+
* automatically register the 'grafx-media' and 'grafx-font' connectors. Custom connectors need to be registered
|
|
15
|
+
* manually.
|
|
16
|
+
*/
|
|
17
|
+
export declare class ConnectorController {
|
|
18
|
+
#private;
|
|
19
|
+
/**
|
|
20
|
+
* @ignore
|
|
21
|
+
*/
|
|
22
|
+
constructor(editorAPI: EditorAPI);
|
|
23
|
+
/**
|
|
24
|
+
* Registers a new connector in the SDK. After successful registration, depending
|
|
25
|
+
* on the connector type, the connector can be configured and used in the template
|
|
26
|
+
* Remember to add custom authentication information after registering the connector
|
|
27
|
+
* @param registration registration object containing all details about the connector
|
|
28
|
+
* @returns the Id of the newly created connector, this Id should be used going forward.
|
|
29
|
+
*/
|
|
30
|
+
register: (registration: ConnectorGrafxRegistration | ConnectorUrlRegistration | ConnectorLocalRegistration) => Promise<import("../../types/CommonTypes").EditorResponse<string>>;
|
|
31
|
+
/**
|
|
32
|
+
* Gets a connector by its id
|
|
33
|
+
* @param id the id of the connector
|
|
34
|
+
* @returns connector
|
|
35
|
+
*/
|
|
36
|
+
getById: (id: Id) => Promise<import("../../types/CommonTypes").EditorResponse<ConnectorInstance>>;
|
|
37
|
+
/**
|
|
38
|
+
* Gets all available connectors of a 'ConnectorType'
|
|
39
|
+
* @param type type of connector you want to get
|
|
40
|
+
* @returns list of all available connectors of a 'ConnectorType'
|
|
41
|
+
*/
|
|
42
|
+
getAllByType: (type: ConnectorType) => Promise<import("../../types/CommonTypes").EditorResponse<ConnectorInstance[]>>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
14
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
15
|
+
};
|
|
16
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
17
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
18
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
19
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
20
|
+
};
|
|
21
|
+
var _ConnectorController_editorAPI;
|
|
22
|
+
import { getEditorResponseData } from '../../utils/EditorResponseData';
|
|
23
|
+
/**
|
|
24
|
+
* The ConnectorController manages lifetime of all available connectors, regardless of the type, in the
|
|
25
|
+
* document. Use it to add/remove connectors to a template, or set specific configuration.
|
|
26
|
+
*
|
|
27
|
+
* The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an
|
|
28
|
+
* implementation of a set of capabilities we need to interact with a certain external resource management system.
|
|
29
|
+
* In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet
|
|
30
|
+
* is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to
|
|
31
|
+
* execute the media connector both on web using webassembly and on the server side during e.g. animation output
|
|
32
|
+
* generation.
|
|
33
|
+
* This controller is an interface to the running connector instance inside the studio engine. The engine will
|
|
34
|
+
* automatically register the 'grafx-media' and 'grafx-font' connectors. Custom connectors need to be registered
|
|
35
|
+
* manually.
|
|
36
|
+
*/
|
|
37
|
+
export class ConnectorController {
|
|
38
|
+
/**
|
|
39
|
+
* @ignore
|
|
40
|
+
*/
|
|
41
|
+
constructor(editorAPI) {
|
|
42
|
+
/**
|
|
43
|
+
* @ignore
|
|
44
|
+
*/
|
|
45
|
+
_ConnectorController_editorAPI.set(this, void 0);
|
|
46
|
+
/**
|
|
47
|
+
* Registers a new connector in the SDK. After successful registration, depending
|
|
48
|
+
* on the connector type, the connector can be configured and used in the template
|
|
49
|
+
* Remember to add custom authentication information after registering the connector
|
|
50
|
+
* @param registration registration object containing all details about the connector
|
|
51
|
+
* @returns the Id of the newly created connector, this Id should be used going forward.
|
|
52
|
+
*/
|
|
53
|
+
this.register = (registration) => __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
|
|
55
|
+
return res.registerConnector(JSON.stringify(registration)).then((result) => getEditorResponseData(result));
|
|
56
|
+
});
|
|
57
|
+
/**
|
|
58
|
+
* Gets a connector by its id
|
|
59
|
+
* @param id the id of the connector
|
|
60
|
+
* @returns connector
|
|
61
|
+
*/
|
|
62
|
+
this.getById = (id) => __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
|
|
64
|
+
return res.getConnectorById(id).then((result) => getEditorResponseData(result));
|
|
65
|
+
});
|
|
66
|
+
/**
|
|
67
|
+
* Gets all available connectors of a 'ConnectorType'
|
|
68
|
+
* @param type type of connector you want to get
|
|
69
|
+
* @returns list of all available connectors of a 'ConnectorType'
|
|
70
|
+
*/
|
|
71
|
+
this.getAllByType = (type) => __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
|
|
73
|
+
return res.getConnectors(type).then((result) => getEditorResponseData(result));
|
|
74
|
+
});
|
|
75
|
+
__classPrivateFieldSet(this, _ConnectorController_editorAPI, editorAPI, "f");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
_ConnectorController_editorAPI = new WeakMap();
|
|
79
|
+
//# sourceMappingURL=ConnectorController.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorController.js","sourceRoot":"","sources":["../../../../src/next/controllers/ConnectorController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAOA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAGvE;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,mBAAmB;IAM5B;;OAEG;IACH,YAAY,SAAoB;QARhC;;WAEG;QACH,iDAAsB;QAStB;;;;;;WAMG;QACH,aAAQ,GAAG,CACP,YAAgG,EAClG,EAAE;YACA,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,sCAAW,CAAC;YAElC,OAAO,GAAG,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAK,MAAM,CAAC,CAAC,CAAC;QACnH,CAAC,CAAA,CAAC;QAEF;;;;WAIG;QACH,YAAO,GAAG,CAAO,EAAM,EAAE,EAAE;YACvB,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,sCAAW,CAAC;YAClC,OAAO,GAAG,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAoB,MAAM,CAAC,CAAC,CAAC;QACvG,CAAC,CAAA,CAAC;QAEF;;;;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;QApCE,uBAAA,IAAI,kCAAc,SAAS,MAAA,CAAC;IAChC,CAAC;CAoCJ"}
|
|
@@ -17,4 +17,9 @@ export declare class SubscriberController {
|
|
|
17
17
|
* @param variablesJson Stringified array of Variable
|
|
18
18
|
*/
|
|
19
19
|
onVariableListChanged: (variablesJson: string) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Listener on connectors, if this changes, this listener will get triggered with the updates
|
|
22
|
+
* @param connectors Stringified array of ConnectorInstance type
|
|
23
|
+
*/
|
|
24
|
+
onConnectorsChanged: (connectors: string) => void;
|
|
20
25
|
}
|
|
@@ -15,6 +15,14 @@ export class SubscriberController {
|
|
|
15
15
|
const callBack = this.config.onVariableListChanged;
|
|
16
16
|
callBack && callBack(JSON.parse(variablesJson));
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Listener on connectors, if this changes, this listener will get triggered with the updates
|
|
20
|
+
* @param connectors Stringified array of ConnectorInstance type
|
|
21
|
+
*/
|
|
22
|
+
this.onConnectorsChanged = (connectors) => {
|
|
23
|
+
const callBack = this.config.onConnectorsChanged;
|
|
24
|
+
callBack && callBack(JSON.parse(connectors));
|
|
25
|
+
};
|
|
18
26
|
this.config = config;
|
|
19
27
|
}
|
|
20
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubscriberController.js","sourceRoot":"","sources":["../../../../src/next/controllers/SubscriberController.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAM7B;;OAEG;IACH,YAAY,MAAkB;QAI9B;;;WAGG;QACH,0BAAqB,GAAG,CAAC,aAAqB,EAAE,EAAE;YAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC;YACnD,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"SubscriberController.js","sourceRoot":"","sources":["../../../../src/next/controllers/SubscriberController.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAM7B;;OAEG;IACH,YAAY,MAAkB;QAI9B;;;WAGG;QACH,0BAAqB,GAAG,CAAC,aAAqB,EAAE,EAAE;YAC9C,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,qBAAqB,CAAC;YACnD,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC;QACpD,CAAC,CAAC;QAEF;;;WAGG;QACH,wBAAmB,GAAG,CAAC,UAAkB,EAAE,EAAE;YACzC,MAAM,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,mBAAmB,CAAC;YACjD,QAAQ,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC;QACjD,CAAC,CAAC;QAnBE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACzB,CAAC;CAmBJ"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EditorAPI, Id } from '../../types/CommonTypes';
|
|
2
2
|
import { ListVariableItem, Variable } from '../../types/VariableTypes';
|
|
3
|
+
import { ConnectorGrafxRegistration, ConnectorLocalRegistration, ConnectorUrlRegistration } from '../types/ConnectorTypes';
|
|
3
4
|
export declare class VariableController {
|
|
4
5
|
#private;
|
|
5
6
|
/**
|
|
@@ -33,4 +34,13 @@ export declare class VariableController {
|
|
|
33
34
|
* @returns
|
|
34
35
|
*/
|
|
35
36
|
setListVariable: (id: Id, items: ListVariableItem[]) => Promise<import("../../types/CommonTypes").EditorResponse<null>>;
|
|
37
|
+
/**
|
|
38
|
+
* This method sets the image variable connector. Setting a connector will
|
|
39
|
+
* automatically remove the assetId linked to the connector if present.
|
|
40
|
+
* If a connector was the source of the variable, it will be unregistered.
|
|
41
|
+
* @param id The id of the image variable to update
|
|
42
|
+
* @param registration registration object containing all details about the connector
|
|
43
|
+
* @returns The new id of the connector
|
|
44
|
+
*/
|
|
45
|
+
setImageVariableConnector: (id: string, registration: ConnectorLocalRegistration | ConnectorGrafxRegistration | ConnectorUrlRegistration) => Promise<import("../../types/CommonTypes").EditorResponse<string>>;
|
|
36
46
|
}
|
|
@@ -70,6 +70,20 @@ export class VariableController {
|
|
|
70
70
|
.setListVariableItems(id, items.map((item) => JSON.stringify(item)))
|
|
71
71
|
.then((result) => getEditorResponseData(result));
|
|
72
72
|
});
|
|
73
|
+
/**
|
|
74
|
+
* This method sets the image variable connector. Setting a connector will
|
|
75
|
+
* automatically remove the assetId linked to the connector if present.
|
|
76
|
+
* If a connector was the source of the variable, it will be unregistered.
|
|
77
|
+
* @param id The id of the image variable to update
|
|
78
|
+
* @param registration registration object containing all details about the connector
|
|
79
|
+
* @returns The new id of the connector
|
|
80
|
+
*/
|
|
81
|
+
this.setImageVariableConnector = (id, registration) => __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
const res = yield __classPrivateFieldGet(this, _VariableController_editorAPI, "f");
|
|
83
|
+
return res
|
|
84
|
+
.setImageVariableConnector(id, JSON.stringify(registration))
|
|
85
|
+
.then((result) => getEditorResponseData(result));
|
|
86
|
+
});
|
|
73
87
|
__classPrivateFieldSet(this, _VariableController_editorAPI, editorAPI, "f");
|
|
74
88
|
}
|
|
75
89
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariableController.js","sourceRoot":"","sources":["../../../../src/next/controllers/VariableController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"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AAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAC5C;iBACA,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAO,MAAM,CAAC,CAAC,CAAC;QAC/D,CAAC,CAAA,CAAC;QAEF;;;;;;;WAOG;QACH,8BAAyB,GAAG,CACxB,EAAU,EACV,YAAgG,EAClG,EAAE;YACA,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,qCAAW,CAAC;YAElC,OAAO,GAAG;iBACL,yBAAyB,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC;iBAC3D,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAK,MAAM,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAA,CAAC;QApEE,uBAAA,IAAI,iCAAc,SAAS,MAAA,CAAC;IAChC,CAAC;CAoEJ"}
|
package/lib/src/next/index.d.ts
CHANGED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { ConnectorController } from '../../controllers/ConnectorController';
|
|
11
|
+
import { castToEditorResponse, getEditorResponseData } from '../../../utils/EditorResponseData';
|
|
12
|
+
import { ConnectorRegistrationSource, } from '../../types/ConnectorTypes';
|
|
13
|
+
import { ConnectorType } from '../../../types/ConnectorTypes';
|
|
14
|
+
let mockedConnectorController;
|
|
15
|
+
const mockEditorApi = {
|
|
16
|
+
getConnectorById: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
17
|
+
getConnectors: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
18
|
+
registerConnector: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
19
|
+
};
|
|
20
|
+
beforeEach(() => {
|
|
21
|
+
mockedConnectorController = new ConnectorController(mockEditorApi);
|
|
22
|
+
jest.spyOn(mockEditorApi, 'getConnectorById');
|
|
23
|
+
jest.spyOn(mockEditorApi, 'getConnectors');
|
|
24
|
+
jest.spyOn(mockEditorApi, 'registerConnector');
|
|
25
|
+
});
|
|
26
|
+
afterEach(() => {
|
|
27
|
+
jest.restoreAllMocks();
|
|
28
|
+
});
|
|
29
|
+
describe('ConnectorController', () => {
|
|
30
|
+
const connectorId = 'dam';
|
|
31
|
+
it('Should call the getById method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
32
|
+
yield mockedConnectorController.getById(connectorId);
|
|
33
|
+
expect(mockEditorApi.getConnectorById).toHaveBeenCalledTimes(1);
|
|
34
|
+
}));
|
|
35
|
+
it('Should call the getAllByType method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
|
+
yield mockedConnectorController.getAllByType(ConnectorType.media);
|
|
37
|
+
expect(mockEditorApi.getConnectors).toHaveBeenCalledTimes(1);
|
|
38
|
+
}));
|
|
39
|
+
it('Should be possible to retrieve all connectors of a certain type', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
yield mockedConnectorController.getAllByType(ConnectorType.media);
|
|
41
|
+
expect(mockEditorApi.getConnectors).toHaveBeenCalledTimes(1);
|
|
42
|
+
expect(mockEditorApi.getConnectors).toHaveBeenCalledWith(ConnectorType.media);
|
|
43
|
+
}));
|
|
44
|
+
it('Should be possible to register a url connector', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
const nonGrafxRegistration = {
|
|
46
|
+
url: 'https://mock.url/',
|
|
47
|
+
source: ConnectorRegistrationSource.url,
|
|
48
|
+
};
|
|
49
|
+
yield mockedConnectorController.register(nonGrafxRegistration);
|
|
50
|
+
expect(mockEditorApi.registerConnector).toHaveBeenCalledTimes(1);
|
|
51
|
+
expect(mockEditorApi.registerConnector).toHaveBeenCalledWith(JSON.stringify(nonGrafxRegistration));
|
|
52
|
+
}));
|
|
53
|
+
it('Should be possible to register a local connector', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
+
const nonGrafxRegistration = {
|
|
55
|
+
url: './local.test',
|
|
56
|
+
source: ConnectorRegistrationSource.local,
|
|
57
|
+
};
|
|
58
|
+
yield mockedConnectorController.register(nonGrafxRegistration);
|
|
59
|
+
expect(mockEditorApi.registerConnector).toHaveBeenCalledTimes(1);
|
|
60
|
+
expect(mockEditorApi.registerConnector).toHaveBeenCalledWith(JSON.stringify(nonGrafxRegistration));
|
|
61
|
+
}));
|
|
62
|
+
it('Should be possible to register a grafx connector', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
63
|
+
const grafxRegistration = {
|
|
64
|
+
id: 'grafx-id',
|
|
65
|
+
source: ConnectorRegistrationSource.grafx,
|
|
66
|
+
};
|
|
67
|
+
yield mockedConnectorController.register(grafxRegistration);
|
|
68
|
+
expect(mockEditorApi.registerConnector).toHaveBeenCalledTimes(1);
|
|
69
|
+
expect(mockEditorApi.registerConnector).toHaveBeenCalledWith(JSON.stringify(grafxRegistration));
|
|
70
|
+
}));
|
|
71
|
+
});
|
|
72
|
+
//# sourceMappingURL=ConnectorController.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorController.test.js","sourceRoot":"","sources":["../../../../../src/next/tests/controllers/ConnectorController.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,mBAAmB,EAAE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,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC,CAAC;IACvG,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,kDAAkD,EAAE,GAAS,EAAE;QAC9D,MAAM,iBAAiB,GAA+B;YAClD,EAAE,EAAE,UAAU;YACd,MAAM,EAAE,2BAA2B,CAAC,KAAK;SAC5C,CAAC;QAEF,MAAM,yBAAyB,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QAE5D,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACjE,MAAM,CAAC,aAAa,CAAC,iBAAiB,CAAC,CAAC,oBAAoB,CAAC,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC,CAAC;IACpG,CAAC,CAAA,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { castToEditorResponse, getEditorResponseData } from '../../../utils/EditorResponseData';
|
|
11
|
+
import { SubscriberController } from '../../controllers/SubscriberController';
|
|
12
|
+
import { ConnectorRegistrationSource } from '../../types/ConnectorTypes';
|
|
13
|
+
import { VariableType } from '../../types/VariableTypes';
|
|
14
|
+
let mockedSubscriberController;
|
|
15
|
+
const mockEditorApi = {
|
|
16
|
+
onVariableListChanged: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
17
|
+
onConnectorsChanged: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
18
|
+
};
|
|
19
|
+
beforeEach(() => {
|
|
20
|
+
mockedSubscriberController = new SubscriberController(mockEditorApi);
|
|
21
|
+
jest.spyOn(mockEditorApi, 'onVariableListChanged');
|
|
22
|
+
jest.spyOn(mockEditorApi, 'onConnectorsChanged');
|
|
23
|
+
});
|
|
24
|
+
afterEach(() => {
|
|
25
|
+
jest.restoreAllMocks();
|
|
26
|
+
});
|
|
27
|
+
describe('SubscriberController', () => {
|
|
28
|
+
it('Should be possible to subscribe to onVariableListChanged', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
const variables = [
|
|
30
|
+
{ id: '1', type: VariableType.group },
|
|
31
|
+
{ id: 'varList', type: VariableType.list, selected: 'Orange', items: ['Apple', 'Pear', 'Orange'] },
|
|
32
|
+
];
|
|
33
|
+
mockedSubscriberController.onVariableListChanged(JSON.stringify(variables));
|
|
34
|
+
expect(mockEditorApi.onVariableListChanged).toHaveBeenCalledWith(variables);
|
|
35
|
+
expect(mockEditorApi.onVariableListChanged).toHaveBeenCalledTimes(1);
|
|
36
|
+
}));
|
|
37
|
+
it('Should be possible to subscribe to onConnectorsChanged', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
38
|
+
const connectors = [{ id: 'id', name: 'name', source: ConnectorRegistrationSource.local }];
|
|
39
|
+
mockedSubscriberController.onConnectorsChanged(JSON.stringify(connectors));
|
|
40
|
+
expect(mockEditorApi.onConnectorsChanged).toHaveBeenCalledWith(connectors);
|
|
41
|
+
expect(mockEditorApi.onConnectorsChanged).toHaveBeenCalledTimes(1);
|
|
42
|
+
}));
|
|
43
|
+
});
|
|
44
|
+
//# sourceMappingURL=SubscriberContoller.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriberContoller.test.js","sourceRoot":"","sources":["../../../../../src/next/tests/controllers/SubscriberContoller.test.ts"],"names":[],"mappings":";;;;;;;;;AACA,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAChG,OAAO,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AAC9E,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,IAAI,0BAAgD,CAAC;AAErD,MAAM,aAAa,GAAc;IAC7B,qBAAqB,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA;IACpF,mBAAmB,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAA,GAAA;CACrF,CAAC;AAEF,UAAU,CAAC,GAAG,EAAE;IACZ,0BAA0B,GAAG,IAAI,oBAAoB,CAAC,aAAa,CAAC,CAAC;IAErE,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC;IACnD,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,qBAAqB,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,GAAG,EAAE;IACX,IAAI,CAAC,eAAe,EAAE,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,0DAA0D,EAAE,GAAS,EAAE;QACtE,MAAM,SAAS,GAAG;YACd,EAAE,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,CAAC,KAAK,EAAE;YACrC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE;SACrG,CAAC;QACF,0BAA0B,CAAC,qBAAqB,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;QAC5E,MAAM,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;QAC5E,MAAM,CAAC,aAAa,CAAC,qBAAqB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACzE,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,wDAAwD,EAAE,GAAS,EAAE;QACpE,MAAM,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,2BAA2B,CAAC,KAAK,EAAE,CAAC,CAAC;QAE3F,0BAA0B,CAAC,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;QAC3E,MAAM,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;QAC3E,MAAM,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;IACvE,CAAC,CAAA,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -9,7 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { VariableController } from '../../controllers/VariableController';
|
|
11
11
|
import { VariableType } from '../../../types/VariableTypes';
|
|
12
|
-
import {
|
|
12
|
+
import { castToEditorResponse, getEditorResponseData } from '../../../utils/EditorResponseData';
|
|
13
|
+
import { ConnectorRegistrationSource, } from '../../types/ConnectorTypes';
|
|
13
14
|
afterEach(() => {
|
|
14
15
|
jest.restoreAllMocks();
|
|
15
16
|
});
|
|
@@ -34,6 +35,7 @@ describe('Next.VariableController', () => {
|
|
|
34
35
|
getVariableByName: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(listVar)); }),
|
|
35
36
|
getVariables: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(variables)); }),
|
|
36
37
|
setListVariableItems: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
38
|
+
setImageVariableConnector: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse('newConnectorId')); }),
|
|
37
39
|
};
|
|
38
40
|
beforeEach(() => {
|
|
39
41
|
mockedVariableController = new VariableController(mockEditorApi);
|
|
@@ -41,6 +43,7 @@ describe('Next.VariableController', () => {
|
|
|
41
43
|
jest.spyOn(mockEditorApi, 'getVariableByName');
|
|
42
44
|
jest.spyOn(mockEditorApi, 'getVariables');
|
|
43
45
|
jest.spyOn(mockEditorApi, 'setListVariableItems');
|
|
46
|
+
jest.spyOn(mockEditorApi, 'setImageVariableConnector');
|
|
44
47
|
});
|
|
45
48
|
it('get variable by id', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
46
49
|
const result = yield mockedVariableController.getById('2');
|
|
@@ -82,5 +85,35 @@ describe('Next.VariableController', () => {
|
|
|
82
85
|
{ value: 'c', displayValue: 'dis c' },
|
|
83
86
|
].map((item) => JSON.stringify(item)));
|
|
84
87
|
}));
|
|
88
|
+
it('set image variable url connector', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
+
const registration = {
|
|
90
|
+
url: 'test://test.test',
|
|
91
|
+
source: ConnectorRegistrationSource.url,
|
|
92
|
+
};
|
|
93
|
+
const response = yield mockedVariableController.setImageVariableConnector(variableId, registration);
|
|
94
|
+
expect(mockEditorApi.setImageVariableConnector).toHaveBeenCalledTimes(1);
|
|
95
|
+
expect(mockEditorApi.setImageVariableConnector).toHaveBeenCalledWith(variableId, JSON.stringify(registration));
|
|
96
|
+
expect(response === null || response === void 0 ? void 0 : response.parsedData).toBe('newConnectorId');
|
|
97
|
+
}));
|
|
98
|
+
it('set image variable local connector', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
99
|
+
const registration = {
|
|
100
|
+
url: './test.local',
|
|
101
|
+
source: ConnectorRegistrationSource.local,
|
|
102
|
+
};
|
|
103
|
+
const response = yield mockedVariableController.setImageVariableConnector(variableId, registration);
|
|
104
|
+
expect(mockEditorApi.setImageVariableConnector).toHaveBeenCalledTimes(1);
|
|
105
|
+
expect(mockEditorApi.setImageVariableConnector).toHaveBeenCalledWith(variableId, JSON.stringify(registration));
|
|
106
|
+
expect(response === null || response === void 0 ? void 0 : response.parsedData).toBe('newConnectorId');
|
|
107
|
+
}));
|
|
108
|
+
it('set image variable Grafx connector', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
109
|
+
const grafxRegistration = {
|
|
110
|
+
source: ConnectorRegistrationSource.grafx,
|
|
111
|
+
id: 'grafx-id',
|
|
112
|
+
};
|
|
113
|
+
const response = yield mockedVariableController.setImageVariableConnector(variableId, grafxRegistration);
|
|
114
|
+
expect(mockEditorApi.setImageVariableConnector).toHaveBeenCalledTimes(1);
|
|
115
|
+
expect(mockEditorApi.setImageVariableConnector).toHaveBeenCalledWith(variableId, JSON.stringify(grafxRegistration));
|
|
116
|
+
expect(response === null || response === void 0 ? void 0 : response.parsedData).toBe('newConnectorId');
|
|
117
|
+
}));
|
|
85
118
|
});
|
|
86
119
|
//# sourceMappingURL=VariableController.test.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariableController.test.js","sourceRoot":"","sources":["../../../../../src/next/tests/controllers/VariableController.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAA8B,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAGxF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"VariableController.test.js","sourceRoot":"","sources":["../../../../../src/next/tests/controllers/VariableController.test.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,EAA8B,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAGxF,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAEhG,OAAO,EAGH,2BAA2B,GAE9B,MAAM,4BAA4B,CAAC;AAEpC,SAAS,CAAC,GAAG,EAAE;IACX,IAAI,CAAC,eAAe,EAAE,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACrC,IAAI,wBAA4C,CAAC;IAEjD,MAAM,UAAU,GAAG,YAAY,CAAC;IAEhC,MAAM,OAAO,GAA0E;QACnF,EAAE,EAAE,UAAU;QACd,IAAI,EAAE,YAAY,CAAC,IAAI;QACvB,IAAI,EAAE,EAAE;QACR,KAAK,EAAE,EAAE;QACT,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,KAAK;QACjB,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,CAAC;QACd,QAAQ,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE;QACjD,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,CAAC;KACnD,CAAC;IAEF,MAAM,SAAS,GAAG,CAAC,OAAO,CAAC,CAAC;IAE5B,MAAM,aAAa,GAAc;QAC7B,eAAe,EAAE,GAAS,EAAE,kDAAC,OAAA,qBAAqB,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,CAAA,GAAA;QACjF,iBAAiB,EAAE,GAAS,EAAE,kDAAC,O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C,gBAAgB,CAAC,CAAC;IACxD,CAAC,CAAA,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,GAAS,EAAE;QAChD,MAAM,iBAAiB,GAA+B;YAClD,MAAM,EAAE,2BAA2B,CAAC,KAAK;YACzC,EAAE,EAAE,UAAU;SACjB,CAAC;QAEF,MAAM,QAAQ,GAAG,MAAM,wBAAwB,CAAC,yBAAyB,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC;QAEzG,MAAM,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACzE,MAAM,CAAC,aAAa,CAAC,yBAAyB,CAAC,CAAC,oBAAoB,CAChE,UAAU,EACV,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAC,CACpC,CAAC;QACF,MAAM,CAAC,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,UAAU,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACxD,CAAC,CAAA,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Id } from '../../types/CommonTypes';
|
|
2
|
+
export interface ConnectorUrlRegistration {
|
|
3
|
+
/**
|
|
4
|
+
* Url to the connector. Must be a publicly accessible url.
|
|
5
|
+
*/
|
|
6
|
+
url: string;
|
|
7
|
+
source: ConnectorRegistrationSource.url;
|
|
8
|
+
}
|
|
9
|
+
export interface ConnectorGrafxRegistration {
|
|
10
|
+
/**
|
|
11
|
+
* `RemoteConnectorId` of the connector with `grafx` source.
|
|
12
|
+
*/
|
|
13
|
+
id: Id;
|
|
14
|
+
source: ConnectorRegistrationSource.grafx;
|
|
15
|
+
}
|
|
16
|
+
export interface ConnectorLocalRegistration {
|
|
17
|
+
url: string;
|
|
18
|
+
source: ConnectorRegistrationSource.local;
|
|
19
|
+
}
|
|
20
|
+
export declare enum ConnectorRegistrationSource {
|
|
21
|
+
/**
|
|
22
|
+
* Connector is hosted on a publicly accessible link.
|
|
23
|
+
*/
|
|
24
|
+
url = "url",
|
|
25
|
+
/**
|
|
26
|
+
* Connector is hosted on GraFx Environment API.
|
|
27
|
+
*/
|
|
28
|
+
grafx = "grafx",
|
|
29
|
+
/**
|
|
30
|
+
* Connector is embedded in the document.
|
|
31
|
+
* Note: This is a temporary type; only to be used internally.
|
|
32
|
+
*/
|
|
33
|
+
local = "local"
|
|
34
|
+
}
|
|
35
|
+
export declare enum ConnectorType {
|
|
36
|
+
media = "media",
|
|
37
|
+
fonts = "fonts"
|
|
38
|
+
}
|
|
39
|
+
export declare type ConnectorInstance = {
|
|
40
|
+
id: Id;
|
|
41
|
+
name: string;
|
|
42
|
+
iconUrl: string;
|
|
43
|
+
source: ConnectorGrafxRegistration | ConnectorUrlRegistration | ConnectorLocalRegistration;
|
|
44
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export var ConnectorRegistrationSource;
|
|
2
|
+
(function (ConnectorRegistrationSource) {
|
|
3
|
+
/**
|
|
4
|
+
* Connector is hosted on a publicly accessible link.
|
|
5
|
+
*/
|
|
6
|
+
ConnectorRegistrationSource["url"] = "url";
|
|
7
|
+
/**
|
|
8
|
+
* Connector is hosted on GraFx Environment API.
|
|
9
|
+
*/
|
|
10
|
+
ConnectorRegistrationSource["grafx"] = "grafx";
|
|
11
|
+
/**
|
|
12
|
+
* Connector is embedded in the document.
|
|
13
|
+
* Note: This is a temporary type; only to be used internally.
|
|
14
|
+
*/
|
|
15
|
+
ConnectorRegistrationSource["local"] = "local";
|
|
16
|
+
})(ConnectorRegistrationSource || (ConnectorRegistrationSource = {}));
|
|
17
|
+
export var ConnectorType;
|
|
18
|
+
(function (ConnectorType) {
|
|
19
|
+
ConnectorType["media"] = "media";
|
|
20
|
+
ConnectorType["fonts"] = "fonts";
|
|
21
|
+
})(ConnectorType || (ConnectorType = {}));
|
|
22
|
+
//# sourceMappingURL=ConnectorTypes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorTypes.js","sourceRoot":"","sources":["../../../../src/next/types/ConnectorTypes.ts"],"names":[],"mappings":"AAuBA,MAAM,CAAN,IAAY,2BAgBX;AAhBD,WAAY,2BAA2B;IACnC;;OAEG;IACH,0CAAW,CAAA;IAEX;;OAEG;IACH,8CAAe,CAAA;IAEf;;;OAGG;IACH,8CAAe,CAAA;AACnB,CAAC,EAhBW,2BAA2B,KAA3B,2BAA2B,QAgBtC;AAED,MAAM,CAAN,IAAY,aAGX;AAHD,WAAY,aAAa;IACrB,gCAAe,CAAA;IACf,gCAAe,CAAA;AACnB,CAAC,EAHW,aAAa,KAAb,aAAa,QAGxB"}
|
|
@@ -3,3 +3,13 @@ export interface ListVariable extends Variable {
|
|
|
3
3
|
items: ListVariableItem[];
|
|
4
4
|
selected?: ListVariableItem;
|
|
5
5
|
}
|
|
6
|
+
export declare enum VariableType {
|
|
7
|
+
shortText = "shortText",
|
|
8
|
+
longText = "longText",
|
|
9
|
+
image = "image",
|
|
10
|
+
list = "list",
|
|
11
|
+
boolean = "boolean",
|
|
12
|
+
group = "group",
|
|
13
|
+
number = "number",
|
|
14
|
+
date = "date"
|
|
15
|
+
}
|
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var VariableType;
|
|
2
|
+
(function (VariableType) {
|
|
3
|
+
VariableType["shortText"] = "shortText";
|
|
4
|
+
VariableType["longText"] = "longText";
|
|
5
|
+
VariableType["image"] = "image";
|
|
6
|
+
VariableType["list"] = "list";
|
|
7
|
+
VariableType["boolean"] = "boolean";
|
|
8
|
+
VariableType["group"] = "group";
|
|
9
|
+
VariableType["number"] = "number";
|
|
10
|
+
VariableType["date"] = "date";
|
|
11
|
+
})(VariableType || (VariableType = {}));
|
|
2
12
|
//# sourceMappingURL=VariableTypes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariableTypes.js","sourceRoot":"","sources":["../../../../src/next/types/VariableTypes.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"VariableTypes.js","sourceRoot":"","sources":["../../../../src/next/types/VariableTypes.ts"],"names":[],"mappings":"AAOA,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACpB,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,iCAAiB,CAAA;IACjB,6BAAa,CAAA;AACjB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB"}
|
package/lib/src/sdk.d.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { CanvasController } from './controllers/CanvasController';
|
|
|
6
6
|
import { CharacterStyleController } from './controllers/CharacterStyleController';
|
|
7
7
|
import { ColorStyleController } from './controllers/ColorStyleController';
|
|
8
8
|
import { ColorConversionController } from './controllers/ColorConversionController';
|
|
9
|
-
import { ConfigurationController } from './controllers/ConfigurationController';
|
|
10
9
|
import { ConnectorController } from './controllers/ConnectorController';
|
|
11
10
|
import { DebugController } from './controllers/DebugController';
|
|
12
11
|
import { DocumentController } from './controllers/DocumentController';
|
|
@@ -28,6 +27,7 @@ import { InfoController } from './controllers/InfoController';
|
|
|
28
27
|
import { ClipboardController } from './controllers/ClipboardController';
|
|
29
28
|
import { BarcodeController } from './controllers/BarcodeController';
|
|
30
29
|
import { NextInitiator } from './next/NextInitiator';
|
|
30
|
+
import { ConfigurationController } from './controllers/ConfigurationController';
|
|
31
31
|
export declare class SDK {
|
|
32
32
|
config: ConfigType;
|
|
33
33
|
connection: Connection;
|
|
@@ -66,6 +66,7 @@ export declare class SDK {
|
|
|
66
66
|
next: NextInitiator;
|
|
67
67
|
private subscriber;
|
|
68
68
|
private enabledNextSubscribers;
|
|
69
|
+
private localConfig;
|
|
69
70
|
/**
|
|
70
71
|
* The SDK should be configured clientside and it exposes all controllers to work with in other applications
|
|
71
72
|
* @param config The configuration object where the SDK and editor can get configured
|