@chili-publish/studio-sdk 0.147.0 → 0.157.4

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 (73) hide show
  1. package/_bundles/main.js +1 -1
  2. package/_bundles/main.js.map +1 -1
  3. package/_bundles/report.html +2 -2
  4. package/lib/editor-engine.json +1 -1
  5. package/lib/package.json +4 -3
  6. package/lib/src/controllers/ActionController.d.ts +10 -0
  7. package/lib/src/controllers/ActionController.js +13 -0
  8. package/lib/src/controllers/ActionController.js.map +1 -1
  9. package/lib/src/controllers/ConnectorController.d.ts +27 -6
  10. package/lib/src/controllers/ConnectorController.js +34 -4
  11. package/lib/src/controllers/ConnectorController.js.map +1 -1
  12. package/lib/src/controllers/FontConnectorController.d.ts +49 -43
  13. package/lib/src/controllers/FontConnectorController.js +65 -53
  14. package/lib/src/controllers/FontConnectorController.js.map +1 -1
  15. package/lib/src/controllers/FontController.d.ts +68 -23
  16. package/lib/src/controllers/FontController.js +98 -28
  17. package/lib/src/controllers/FontController.js.map +1 -1
  18. package/lib/src/controllers/MediaConnectorController.d.ts +19 -23
  19. package/lib/src/controllers/MediaConnectorController.js +26 -31
  20. package/lib/src/controllers/MediaConnectorController.js.map +1 -1
  21. package/lib/src/controllers/SubscriberController.d.ts +2 -2
  22. package/lib/src/controllers/SubscriberController.js +3 -3
  23. package/lib/src/controllers/SubscriberController.js.map +1 -1
  24. package/lib/src/controllers/UndoManagerController.d.ts +36 -3
  25. package/lib/src/controllers/UndoManagerController.js +65 -3
  26. package/lib/src/controllers/UndoManagerController.js.map +1 -1
  27. package/lib/src/controllers/VariableController.d.ts +15 -5
  28. package/lib/src/controllers/VariableController.js +18 -6
  29. package/lib/src/controllers/VariableController.js.map +1 -1
  30. package/lib/src/index.d.ts +1 -1
  31. package/lib/src/index.js.map +1 -1
  32. package/lib/src/interactions/connector.d.ts +1 -1
  33. package/lib/src/interactions/connector.js +1 -1
  34. package/lib/src/interactions/connector.js.map +1 -1
  35. package/lib/src/sdk.js +5 -5
  36. package/lib/src/sdk.js.map +1 -1
  37. package/lib/src/tests/__mocks__/config.js +1 -1
  38. package/lib/src/tests/__mocks__/config.js.map +1 -1
  39. package/lib/src/tests/controllers/ActionController.test.js +7 -0
  40. package/lib/src/tests/controllers/ActionController.test.js.map +1 -1
  41. package/lib/src/tests/controllers/ConnectorController.test.js +28 -7
  42. package/lib/src/tests/controllers/ConnectorController.test.js.map +1 -1
  43. package/lib/src/tests/controllers/FontConnectorController.test.js +25 -25
  44. package/lib/src/tests/controllers/FontConnectorController.test.js.map +1 -1
  45. package/lib/src/tests/controllers/FontController.test.js +103 -45
  46. package/lib/src/tests/controllers/FontController.test.js.map +1 -1
  47. package/lib/src/tests/controllers/MediaConnectorController.test.js +14 -21
  48. package/lib/src/tests/controllers/MediaConnectorController.test.js.map +1 -1
  49. package/lib/src/tests/controllers/SubscriberContoller.test.js +5 -5
  50. package/lib/src/tests/controllers/SubscriberContoller.test.js.map +1 -1
  51. package/lib/src/tests/controllers/UndoManagerController.test.js +36 -2
  52. package/lib/src/tests/controllers/UndoManagerController.test.js.map +1 -1
  53. package/lib/src/tests/controllers/VariableController.test.js +35 -6
  54. package/lib/src/tests/controllers/VariableController.test.js.map +1 -1
  55. package/lib/src/types/CommonTypes.d.ts +14 -7
  56. package/lib/src/types/CommonTypes.js +5 -1
  57. package/lib/src/types/CommonTypes.js.map +1 -1
  58. package/lib/src/types/ConnectorTypes.d.ts +24 -20
  59. package/lib/src/types/ConnectorTypes.js +22 -8
  60. package/lib/src/types/ConnectorTypes.js.map +1 -1
  61. package/lib/src/types/FontConnectorTypes.d.ts +11 -15
  62. package/lib/src/types/FontConnectorTypes.js +5 -5
  63. package/lib/src/types/FontConnectorTypes.js.map +1 -1
  64. package/lib/src/types/FontTypes.d.ts +19 -10
  65. package/lib/src/types/MediaConnectorTypes.d.ts +4 -5
  66. package/lib/src/types/MediaConnectorTypes.js +1 -0
  67. package/lib/src/types/MediaConnectorTypes.js.map +1 -1
  68. package/lib/src/utils/EditorResponseData.d.ts +1 -1
  69. package/lib/src/utils/EditorResponseData.js +19 -4
  70. package/lib/src/utils/EditorResponseData.js.map +1 -1
  71. package/package.json +5 -4
  72. package/LICENSE +0 -21
  73. package/README.md +0 -89
@@ -20,6 +20,12 @@ export declare class ConnectorController {
20
20
  * @ignore
21
21
  */
22
22
  constructor(editorAPI: EditorAPI);
23
+ /**
24
+ * Gets a connector by its id
25
+ * @param id the id of the connector
26
+ * @returns connector
27
+ */
28
+ getById: (id: Id) => Promise<EditorResponse<ConnectorInstance>>;
23
29
  /**
24
30
  * Gets all available connectors of a 'ConnectorType'
25
31
  * @param type type of connector you want to get
@@ -47,14 +53,26 @@ export declare class ConnectorController {
47
53
  * @param configurationCallback callback to setup the connector
48
54
  * @returns
49
55
  */
50
- configure: (id: string, configurationCallback: (configurator: ConnectorConfigurator) => Promise<void>) => Promise<EditorResponse<null>>;
56
+ configure: (id: Id, configurationCallback: (configurator: ConnectorConfigurator) => Promise<void>) => Promise<EditorResponse<null>>;
51
57
  /**
52
- * Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitForConnectorReady'
58
+ * Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitToBeReady'
53
59
  * method in this controller.
54
60
  * @param id the id of your registered connector you want to make sure it is loaded
55
61
  * @returns connector state
56
62
  */
57
- getById: (id: string) => Promise<EditorResponse<ConnectorState>>;
63
+ getState: (id: Id) => Promise<EditorResponse<ConnectorState>>;
64
+ /**
65
+ * Gets the mapped data from connector.
66
+ * @param id the id of your registered connector
67
+ * @returns mappings
68
+ */
69
+ getMappings: (id: string) => Promise<EditorResponse<ConnectorMapping[]>>;
70
+ /**
71
+ * Gets the options from the connector.
72
+ * @param id the id of your registered connector
73
+ * @returns options
74
+ */
75
+ getOptions: (id: string) => Promise<EditorResponse<ConnectorOptions>>;
58
76
  /**
59
77
  * Connectors are loaded asynchronously in the editor engine, this causes some challenges while configuring them. To make sure
60
78
  * an action on the connector will be available, it's advised to await this method. After the Promise resolves we are sure
@@ -63,7 +81,7 @@ export declare class ConnectorController {
63
81
  * @param id the id of your registered connector you want to make sure it is loaded
64
82
  * @returns
65
83
  */
66
- waitToBeReady: (id: string, timeoutMilliseconds?: number) => Promise<EditorResponse<null>>;
84
+ waitToBeReady: (id: Id, timeoutMilliseconds?: number) => Promise<EditorResponse<null>>;
67
85
  }
68
86
  /**
69
87
  * Helper to setup your connector
@@ -73,7 +91,7 @@ declare class ConnectorConfigurator {
73
91
  /**
74
92
  * @ignore
75
93
  */
76
- constructor(id: string, res: EditorAPI);
94
+ constructor(id: Id, res: EditorAPI);
77
95
  /**
78
96
  * Allows to customize the context data a connector can work with. The options data
79
97
  * will be available using the context parameter in the connector implementation code.
@@ -82,10 +100,13 @@ declare class ConnectorConfigurator {
82
100
  */
83
101
  setOptions: (options: ConnectorOptions) => Promise<EditorResponse<null>>;
84
102
  /**
85
- * Allows to map document data (variables, selectedFrame, etc) to connector context data.
103
+ * Allows to map variables or strings to connector context data.
86
104
  * By defining the mappings, we can trigger re-download of assets (dynamic asset provider)
87
105
  * or populate filters for the query endpoint. The mapped data will be available using
88
106
  * the context parameter in the connector implementation code.
107
+ *
108
+ * For the variables the mapping should follow the format "var.[variable id]". e.g. var.6B29FC40-CA47-1067-B31D-00DD010662DA
109
+ *
89
110
  * @param mappings collection of mappings to set to this connector
90
111
  * @returns
91
112
  */
@@ -44,6 +44,15 @@ export class ConnectorController {
44
44
  * @ignore
45
45
  */
46
46
  _ConnectorController_editorAPI.set(this, void 0);
47
+ /**
48
+ * Gets a connector by its id
49
+ * @param id the id of the connector
50
+ * @returns connector
51
+ */
52
+ this.getById = (id) => __awaiter(this, void 0, void 0, function* () {
53
+ const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
54
+ return res.getConnectorById(id).then((result) => getEditorResponseData(result));
55
+ });
47
56
  /**
48
57
  * Gets all available connectors of a 'ConnectorType'
49
58
  * @param type type of connector you want to get
@@ -90,15 +99,33 @@ export class ConnectorController {
90
99
  return res.updateConnectorConfiguration(id).then((result) => getEditorResponseData(result));
91
100
  });
92
101
  /**
93
- * Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitForConnectorReady'
102
+ * Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitToBeReady'
94
103
  * method in this controller.
95
104
  * @param id the id of your registered connector you want to make sure it is loaded
96
105
  * @returns connector state
97
106
  */
98
- this.getById = (id) => __awaiter(this, void 0, void 0, function* () {
107
+ this.getState = (id) => __awaiter(this, void 0, void 0, function* () {
99
108
  const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
100
109
  return res.getConnectorState(id).then((result) => getEditorResponseData(result));
101
110
  });
111
+ /**
112
+ * Gets the mapped data from connector.
113
+ * @param id the id of your registered connector
114
+ * @returns mappings
115
+ */
116
+ this.getMappings = (id) => __awaiter(this, void 0, void 0, function* () {
117
+ const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
118
+ return res.getConnectorMappings(id).then((result) => getEditorResponseData(result));
119
+ });
120
+ /**
121
+ * Gets the options from the connector.
122
+ * @param id the id of your registered connector
123
+ * @returns options
124
+ */
125
+ this.getOptions = (id) => __awaiter(this, void 0, void 0, function* () {
126
+ const res = yield __classPrivateFieldGet(this, _ConnectorController_editorAPI, "f");
127
+ return res.getConnectorOptions(id).then((result) => getEditorResponseData(result));
128
+ });
102
129
  /**
103
130
  * Connectors are loaded asynchronously in the editor engine, this causes some challenges while configuring them. To make sure
104
131
  * an action on the connector will be available, it's advised to await this method. After the Promise resolves we are sure
@@ -118,7 +145,7 @@ export class ConnectorController {
118
145
  // using while loop will prevent stack overflow issues when using recursion
119
146
  // wait for maximum 2 seconds to fail
120
147
  while (retries * waitTime < timeout) {
121
- const result = yield this.getById(id);
148
+ const result = yield this.getState(id);
122
149
  if (result.success &&
123
150
  result.parsedData &&
124
151
  (result.parsedData.type === ConnectorStateType.running ||
@@ -175,10 +202,13 @@ class ConnectorConfigurator {
175
202
  .then((result) => getEditorResponseData(result));
176
203
  });
177
204
  /**
178
- * Allows to map document data (variables, selectedFrame, etc) to connector context data.
205
+ * Allows to map variables or strings to connector context data.
179
206
  * By defining the mappings, we can trigger re-download of assets (dynamic asset provider)
180
207
  * or populate filters for the query endpoint. The mapped data will be available using
181
208
  * the context parameter in the connector implementation code.
209
+ *
210
+ * For the variables the mapping should follow the format "var.[variable id]". e.g. var.6B29FC40-CA47-1067-B31D-00DD010662DA
211
+ *
182
212
  * @param mappings collection of mappings to set to this connector
183
213
  * @returns
184
214
  */
@@ -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;;;;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,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAK,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etaData } from '../types/CommonTypes';
2
- import { DeprecatedMediaType, ConnectorCapabilities, MediaType, QueryOptions, QueryPage } from '../types/ConnectorTypes';
3
- import { Font, FontDownloadType } from '../types/FontConnectorTypes';
1
+ import { ConnectorConfigOptions, EditorAPI, EditorResponse, MetaData } from '../types/CommonTypes';
2
+ import { ConnectorCapabilities, DeprecatedMediaType, MediaType, QueryOptions, QueryPage } from '../types/ConnectorTypes';
3
+ import { FontFamily, FontPreviewFormat, FontStyle } from '../types/FontConnectorTypes';
4
4
  /**
5
5
  * The FontConnectorController is responsible for all communication regarding Font connectors.
6
6
  * Methods inside this controller can be called by `window.SDK.FontConnector.{method-name}`
@@ -21,79 +21,85 @@ export declare class FontConnectorController {
21
21
  constructor(editorAPI: EditorAPI);
22
22
  /**
23
23
  * Query a specific FontConnector for data using both standardized queryOptions and the dynamic
24
- * context as parameters. This call returns an array of Font items.
25
- * @param id unique id of the Font connector
26
- * @param queryOptions stringified instance of `QueryOptions`
27
- * @param context stringified `Map<string, string>` of dynamic options
28
- * @returns array of font items
24
+ * context as parameters.
25
+ * @param connectorId unique id of the Font connector
26
+ * @param queryOptions query options
27
+ * @param context context that will be available in the connector script.
28
+ * @returns array of font families
29
29
  */
30
- query: (id: string, queryOptions: QueryOptions, context: MetaData) => Promise<EditorResponse<QueryPage<Font>>>;
30
+ query: (connectorId: string, queryOptions: QueryOptions, context?: MetaData) => Promise<EditorResponse<QueryPage<FontFamily>>>;
31
31
  /**
32
- * Returns a single font using a specific FontConnector. The connector needs to list `detail` as a supported capability.
33
- * @param id unique id of the Font connector
34
- * @param fontId unique id of the Font
35
- * @returns font details
32
+ * Returns all font styles for a family using a specific FontConnector. The connector needs to list `detail` as a supported capability.
33
+ * @param connectorId unique id of the Font connector
34
+ * @param fontFamilyId unique id of the Font family
35
+ * @param context context that will be available in the connector script.
36
+ * @returns array of font styles
36
37
  */
37
- detail: (id: string, fontId: string) => Promise<EditorResponse<Font>>;
38
+ detail: (connectorId: string, fontFamilyId: string, context?: MetaData) => Promise<EditorResponse<FontStyle[]>>;
38
39
  /**
39
40
  * The combination of a `connectorId` and `fontId` is typically enough for a Font connector to
40
41
  * perform the download of this asset. The `download` endpoint is capable of relaying this information to the
41
42
  * Font connector instance running in the editor engine.
42
- * @param id unique id of the Font connector
43
- * @param fontId unique id of the Font to download
44
- * @param downloadType hint to the Font connector about desired quality of the downloaded Font
43
+ * @param connectorId unique id of the Font connector
44
+ * @param fontStyleId unique id of the Font style to download
45
+ * @param context context that will be available in the connector script.
46
+ * @returns
47
+ */
48
+ download: (connectorId: string, fontStyleId: string, context?: MetaData) => Promise<Uint8Array>;
49
+ /**
50
+ * The combination of a `connectorId` and `fontFamilyId` is typically enough for a Font connector to
51
+ * perform the preview of this asset. The `preview` endpoint is capable of relaying this information to the
52
+ * Font connector instance running in the editor engine.
53
+ * @param connectorId unique id of the Font connector
54
+ * @param fontFamilyId unique id of the Font family to download
55
+ * @param previewFormat hint to the Font connector about desired format of the Font preview
45
56
  * @param context dynamic map of additional options potentially used by the connector
46
57
  * @returns
47
58
  */
48
- download: (id: string, fontId: string, downloadType: FontDownloadType, context: MetaData) => Promise<Uint8Array>;
59
+ preview: (connectorId: string, fontFamilyId: string, previewFormat: FontPreviewFormat, context?: MetaData) => Promise<Uint8Array>;
49
60
  /**
50
61
  * Depending on the connector capabilities, this api method allows you to upload new Font to the
51
62
  * connector's backend.
52
- * @param id unique id of the Font connector
53
- * @param fontId unique id of the Font to upload
63
+ * @param connectorId unique id of the Font connector
64
+ * @param fontStyleId unique id of the Font style to upload
54
65
  * @param blob byte array representation of the Font to upload
66
+ * @param context context that will be available in the connector script.
55
67
  * @returns
56
68
  */
57
- upload: (id: string, fontId: string, blob: Uint8Array) => Promise<EditorResponse<null>>;
69
+ upload: (connectorId: string, fontStyleId: string, blob: Uint8Array, context?: MetaData) => Promise<EditorResponse<null>>;
58
70
  /**
59
71
  * Depending on the connector capabilities, removes Font identified by `fontId` from the connector's backend storage
60
- * @param id unique id of the Font connector
61
- * @param fontId unique id of the Font to download
72
+ * @param connectorId unique id of the Font connector
73
+ * @param fontStyleId unique id of the Font style to remove
74
+ * @param context context that will be available in the connector script.
62
75
  * @returns
63
76
  */
64
- remove: (id: string, fontId: string) => Promise<EditorResponse<null>>;
77
+ remove: (connectorId: string, fontStyleId: string, context?: MetaData) => Promise<EditorResponse<null>>;
65
78
  /**
66
79
  * Depending on the connector capabilities, copies Font identified by `fontId` to a new Font item on the
67
80
  * connector's backend
68
- * @param id unique id of the Font connector
69
- * @param fontId unique id of the Font to download
81
+ * @param connectorId unique id of the Font connector
82
+ * @param fontStyleId unique id of the Font to download
70
83
  * @param newName name of the copied Font on the connector's backend
84
+ * @param context context that will be available in the connector script.
71
85
  * @returns
72
86
  */
73
- copy: (id: string, fontId: string, newName: string) => Promise<EditorResponse<null>>;
74
- /**
75
- * All connectors have a certain set of queryOptions they allow to be passed in the query context. This
76
- * method allows you to discover what options are available for a given connector. If you want to use any of these
77
- * options, they need to be passed in the `context` parameter of the `query` api method.
78
- * @param id unique id of the Font connector
79
- * @returns query options
80
- */
81
- getQueryOptions: (id: string) => Promise<EditorResponse<ConnectorOptions>>;
87
+ copy: (connectorId: string, fontStyleId: string, newName: string, context?: MetaData) => Promise<EditorResponse<null>>;
82
88
  /**
83
- * All connectors have a certain set of downloadOptions they allow to be passed in the download context. This
84
- * method allows you to discover what options are available for a given connector. If you want to use any of these
85
- * options, they need to be passed in the `context` parameter of the `download` api method.
86
- * @param id unique id of the Font connector
87
- * @returns download options
89
+ * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This
90
+ * method allows you to discover which mappings are available for a given connector. If you want to use any of these
91
+ * mappings, they will be available in the `context` parameter of any connector method.
92
+ * @param connectorId unique id of the media connector
93
+ * @returns connector mappings
88
94
  */
89
- getDownloadOptions: (id: string) => Promise<EditorResponse<ConnectorOptions>>;
95
+ getConfigurationOptions: (connectorId: string) => Promise<EditorResponse<ConnectorConfigOptions>>;
90
96
  /**
91
97
  * This method returns what capabilities the selected connector has. It gives an indication what methods can
92
98
  * be used successfully for a certain connector.
93
- * @param id unique id of the Font connector
99
+ * @param connectorId unique id of the Font connector
94
100
  * @returns connector capabilities
95
101
  */
96
- getCapabilities: (id: string) => Promise<EditorResponse<ConnectorCapabilities>>;
102
+ getCapabilities: (connectorId: string) => Promise<EditorResponse<ConnectorCapabilities>>;
97
103
  /**
98
104
  * This method will parse the deprecatedFontType to the new Font type. This method will be removed once the deprecatedFontType is out of use
99
105
  * @param deprecatedType is 0 or 1
@@ -45,116 +45,128 @@ export class FontConnectorController {
45
45
  _FontConnectorController_blobAPI.set(this, void 0);
46
46
  /**
47
47
  * Query a specific FontConnector for data using both standardized queryOptions and the dynamic
48
- * context as parameters. This call returns an array of Font items.
49
- * @param id unique id of the Font connector
50
- * @param queryOptions stringified instance of `QueryOptions`
51
- * @param context stringified `Map<string, string>` of dynamic options
52
- * @returns array of font items
48
+ * context as parameters.
49
+ * @param connectorId unique id of the Font connector
50
+ * @param queryOptions query options
51
+ * @param context context that will be available in the connector script.
52
+ * @returns array of font families
53
53
  */
54
- this.query = (id, queryOptions, context) => __awaiter(this, void 0, void 0, function* () {
54
+ this.query = (connectorId, queryOptions, context = {}) => __awaiter(this, void 0, void 0, function* () {
55
55
  const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
56
56
  return res
57
- .fontConnectorQuery(id, JSON.stringify(queryOptions), JSON.stringify(context))
57
+ .fontConnectorQuery(connectorId, JSON.stringify(queryOptions), JSON.stringify(context))
58
58
  .then((result) => getEditorResponseData(result));
59
59
  });
60
60
  /**
61
- * Returns a single font using a specific FontConnector. The connector needs to list `detail` as a supported capability.
62
- * @param id unique id of the Font connector
63
- * @param fontId unique id of the Font
64
- * @returns font details
61
+ * Returns all font styles for a family using a specific FontConnector. The connector needs to list `detail` as a supported capability.
62
+ * @param connectorId unique id of the Font connector
63
+ * @param fontFamilyId unique id of the Font family
64
+ * @param context context that will be available in the connector script.
65
+ * @returns array of font styles
65
66
  */
66
- this.detail = (id, fontId) => __awaiter(this, void 0, void 0, function* () {
67
+ this.detail = (connectorId, fontFamilyId, context = {}) => __awaiter(this, void 0, void 0, function* () {
67
68
  const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
68
- return res.fontConnectorDetail(id, fontId).then((result) => getEditorResponseData(result));
69
+ return res
70
+ .fontConnectorDetail(connectorId, fontFamilyId, JSON.stringify(context))
71
+ .then((result) => getEditorResponseData(result));
69
72
  });
70
73
  /**
71
74
  * The combination of a `connectorId` and `fontId` is typically enough for a Font connector to
72
75
  * perform the download of this asset. The `download` endpoint is capable of relaying this information to the
73
76
  * Font connector instance running in the editor engine.
74
- * @param id unique id of the Font connector
75
- * @param fontId unique id of the Font to download
76
- * @param downloadType hint to the Font connector about desired quality of the downloaded Font
77
+ * @param connectorId unique id of the Font connector
78
+ * @param fontStyleId unique id of the Font style to download
79
+ * @param context context that will be available in the connector script.
80
+ * @returns
81
+ */
82
+ this.download = (connectorId, fontStyleId, context = {}) => __awaiter(this, void 0, void 0, function* () {
83
+ const res = yield __classPrivateFieldGet(this, _FontConnectorController_blobAPI, "f");
84
+ return res
85
+ .fontConnectorDownload(connectorId, fontStyleId, JSON.stringify(context))
86
+ .then((result) => { var _a; return (_a = result) !== null && _a !== void 0 ? _a : result; });
87
+ });
88
+ /**
89
+ * The combination of a `connectorId` and `fontFamilyId` is typically enough for a Font connector to
90
+ * perform the preview of this asset. The `preview` endpoint is capable of relaying this information to the
91
+ * Font connector instance running in the editor engine.
92
+ * @param connectorId unique id of the Font connector
93
+ * @param fontFamilyId unique id of the Font family to download
94
+ * @param previewFormat hint to the Font connector about desired format of the Font preview
77
95
  * @param context dynamic map of additional options potentially used by the connector
78
96
  * @returns
79
97
  */
80
- this.download = (id, fontId, downloadType, context) => __awaiter(this, void 0, void 0, function* () {
98
+ this.preview = (connectorId, fontFamilyId, previewFormat, context = {}) => __awaiter(this, void 0, void 0, function* () {
81
99
  const res = yield __classPrivateFieldGet(this, _FontConnectorController_blobAPI, "f");
82
100
  return res
83
- .fontConnectorDownload(id, fontId, downloadType, JSON.stringify(context))
101
+ .fontConnectorPreview(connectorId, fontFamilyId, previewFormat, JSON.stringify(context))
84
102
  .then((result) => { var _a; return (_a = result) !== null && _a !== void 0 ? _a : result; });
85
103
  });
86
104
  /**
87
105
  * Depending on the connector capabilities, this api method allows you to upload new Font to the
88
106
  * connector's backend.
89
- * @param id unique id of the Font connector
90
- * @param fontId unique id of the Font to upload
107
+ * @param connectorId unique id of the Font connector
108
+ * @param fontStyleId unique id of the Font style to upload
91
109
  * @param blob byte array representation of the Font to upload
110
+ * @param context context that will be available in the connector script.
92
111
  * @returns
93
112
  */
94
- this.upload = (id, fontId, blob) => __awaiter(this, void 0, void 0, function* () {
113
+ this.upload = (connectorId, fontStyleId, blob, context = {}) => __awaiter(this, void 0, void 0, function* () {
95
114
  const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
96
- return res.fontConnectorUpload(id, fontId, blob).then((result) => getEditorResponseData(result));
115
+ return res
116
+ .fontConnectorUpload(connectorId, fontStyleId, blob, JSON.stringify(context))
117
+ .then((result) => getEditorResponseData(result));
97
118
  });
98
119
  /**
99
120
  * Depending on the connector capabilities, removes Font identified by `fontId` from the connector's backend storage
100
- * @param id unique id of the Font connector
101
- * @param fontId unique id of the Font to download
121
+ * @param connectorId unique id of the Font connector
122
+ * @param fontStyleId unique id of the Font style to remove
123
+ * @param context context that will be available in the connector script.
102
124
  * @returns
103
125
  */
104
- this.remove = (id, fontId) => __awaiter(this, void 0, void 0, function* () {
126
+ this.remove = (connectorId, fontStyleId, context = {}) => __awaiter(this, void 0, void 0, function* () {
105
127
  const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
106
- return res.fontConnectorRemove(id, fontId).then((result) => getEditorResponseData(result));
128
+ return res
129
+ .fontConnectorRemove(connectorId, fontStyleId, JSON.stringify(context))
130
+ .then((result) => getEditorResponseData(result));
107
131
  });
108
132
  /**
109
133
  * Depending on the connector capabilities, copies Font identified by `fontId` to a new Font item on the
110
134
  * connector's backend
111
- * @param id unique id of the Font connector
112
- * @param fontId unique id of the Font to download
135
+ * @param connectorId unique id of the Font connector
136
+ * @param fontStyleId unique id of the Font to download
113
137
  * @param newName name of the copied Font on the connector's backend
138
+ * @param context context that will be available in the connector script.
114
139
  * @returns
115
140
  */
116
- this.copy = (id, fontId, newName) => __awaiter(this, void 0, void 0, function* () {
117
- const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
118
- return res
119
- .fontConnectorCopy(id, fontId, newName)
120
- .then((result) => getEditorResponseData(result));
121
- });
122
- /**
123
- * All connectors have a certain set of queryOptions they allow to be passed in the query context. This
124
- * method allows you to discover what options are available for a given connector. If you want to use any of these
125
- * options, they need to be passed in the `context` parameter of the `query` api method.
126
- * @param id unique id of the Font connector
127
- * @returns query options
128
- */
129
- this.getQueryOptions = (id) => __awaiter(this, void 0, void 0, function* () {
141
+ this.copy = (connectorId, fontStyleId, newName, context = {}) => __awaiter(this, void 0, void 0, function* () {
130
142
  const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
131
143
  return res
132
- .fontConnectorGetQueryOptions(id)
144
+ .fontConnectorCopy(connectorId, fontStyleId, newName, JSON.stringify(context))
133
145
  .then((result) => getEditorResponseData(result));
134
146
  });
135
147
  /**
136
- * All connectors have a certain set of downloadOptions they allow to be passed in the download context. This
137
- * method allows you to discover what options are available for a given connector. If you want to use any of these
138
- * options, they need to be passed in the `context` parameter of the `download` api method.
139
- * @param id unique id of the Font connector
140
- * @returns download options
148
+ * All connectors have a certain set of mappings they allow to be passed into the connector methods their context. This
149
+ * method allows you to discover which mappings are available for a given connector. If you want to use any of these
150
+ * mappings, they will be available in the `context` parameter of any connector method.
151
+ * @param connectorId unique id of the media connector
152
+ * @returns connector mappings
141
153
  */
142
- this.getDownloadOptions = (id) => __awaiter(this, void 0, void 0, function* () {
154
+ this.getConfigurationOptions = (connectorId) => __awaiter(this, void 0, void 0, function* () {
143
155
  const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
144
156
  return res
145
- .fontConnectorGetDownloadOptions(id)
157
+ .fontConnectorGetConfigurationOptions(connectorId)
146
158
  .then((result) => getEditorResponseData(result));
147
159
  });
148
160
  /**
149
161
  * This method returns what capabilities the selected connector has. It gives an indication what methods can
150
162
  * be used successfully for a certain connector.
151
- * @param id unique id of the Font connector
163
+ * @param connectorId unique id of the Font connector
152
164
  * @returns connector capabilities
153
165
  */
154
- this.getCapabilities = (id) => __awaiter(this, void 0, void 0, function* () {
166
+ this.getCapabilities = (connectorId) => __awaiter(this, void 0, void 0, function* () {
155
167
  const res = yield __classPrivateFieldGet(this, _FontConnectorController_editorAPI, "f");
156
168
  return res
157
- .fontConnectorGetCapabilities(id)
169
+ .fontConnectorGetCapabilities(connectorId)
158
170
  .then((result) => getEditorResponseData(result));
159
171
  });
160
172
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"FontConnectorController.js","sourceRoot":"","sources":["../../../src/controllers/FontConnectorController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EACH,mBAAmB,EAEnB,SAAS,GAGZ,MAAM,yBAAyB,CAAC;AAIjC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,uBAAuB;IAOhC;;OAEG;IACH,YAAY,SAAoB;QAThC;;WAEG;QACH,qDAAsB;QACtB,mDAAuB;QAUvB;;;;;;;WAOG;QACH,UAAK,GAAG,CAAO,EAAU,EAAE,YAA0B,EAAE,OAAiB,EAAE,EAAE;YACxE,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,0CAAW,CAAC;YAClC,OAAO,GAAG;iBACL,kBAAkB,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,C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ClC,OAAO,GAAG;iBACL,4BAA4B,CAAC,EAAE,CAAC;iBAChC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAwB,MAAM,CAAC,CAAC,CAAC;QAChF,CAAC,CAAA,CAAC;QAEF;;;;WAIG;QACH,4BAAuB,GAAG,CAAC,cAAmC,EAAE,EAAE;YAC9D,IAAI,cAAc,KAAK,mBAAmB,CAAC,IAAI;gBAAE,OAAO,SAAS,CAAC,IAAI,CAAC;YACvE,IAAI,cAAc,KAAK,mBAAmB,CAAC,UAAU;gBAAE,OAAO,SAAS,CAAC,UAAU,CAAC;QACvF,CAAC,CAAC;QA5IE,uBAAA,IAAI,sCAAc,SAAS,MAAA,CAAC;QAC5B,uBAAA,IAAI,oCAAY,SAAuC,MAAA,CAAC;IAC5D,CAAC;CA2IJ"}
1
+ {"version":3,"file":"FontConnectorController.js","sourceRoot":"","sources":["../../../src/controllers/FontConnectorController.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAEH,mBAAmB,EACnB,SAAS,GAGZ,MAAM,yBAAyB,CAAC;AAIjC;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,uBAAuB;IAOhC;;OAEG;IACH,YAAY,SAAoB;QAThC;;WAEG;QACH,qDAAsB;QACtB,mDAAuB;QAUvB;;;;;;;WAOG;QACH,UAAK,GAAG,CAAO,WAAmB,EAAE,YAA0B,EAAE,UAAoB,EAAE,EAAE,EAAE;YACtF,MAAM,GAAG,GAAG,MAAM,uBAAA,IAAI,0CAAW,CAAC;YAClC,OAAO,GAAG;iBACL,kBAAkB,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;iBACtF,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,qBAAqB,CAAwB,MAAM,CAAC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