@chili-publish/studio-sdk 1.44.0 → 1.45.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.
Files changed (88) hide show
  1. package/_bundles/main.js +2 -2
  2. package/_bundles/main.js.map +1 -1
  3. package/lib/src/controllers/BrandKitController.cjs.js +13 -64
  4. package/lib/src/controllers/BrandKitController.cjs.js.map +1 -1
  5. package/lib/src/controllers/BrandKitController.d.ts +22 -30
  6. package/lib/src/controllers/BrandKitController.es.js +13 -64
  7. package/lib/src/controllers/BrandKitController.es.js.map +1 -1
  8. package/lib/src/controllers/ComponentController.cjs.js.map +1 -1
  9. package/lib/src/controllers/ComponentController.d.ts +1 -1
  10. package/lib/src/controllers/ComponentController.es.js.map +1 -1
  11. package/lib/src/controllers/ConnectorController.cjs.js.map +1 -1
  12. package/lib/src/controllers/ConnectorController.d.ts +5 -5
  13. package/lib/src/controllers/ConnectorController.es.js.map +1 -1
  14. package/lib/src/exceptions/AsyncExceptions.cjs.js.map +1 -1
  15. package/lib/src/exceptions/AsyncExceptions.d.ts +1 -0
  16. package/lib/src/exceptions/AsyncExceptions.es.js.map +1 -1
  17. package/lib/src/exceptions/Helpers.cjs.js.map +1 -1
  18. package/lib/src/exceptions/Helpers.es.js.map +1 -1
  19. package/lib/src/index.cjs.js +3 -2
  20. package/lib/src/index.cjs.js.map +1 -1
  21. package/lib/src/index.d.ts +2 -1
  22. package/lib/src/index.es.js +2 -1
  23. package/lib/src/next/NextInitiator.cjs.js +0 -2
  24. package/lib/src/next/NextInitiator.cjs.js.map +1 -1
  25. package/lib/src/next/NextInitiator.d.ts +0 -2
  26. package/lib/src/next/NextInitiator.es.js +0 -2
  27. package/lib/src/next/NextInitiator.es.js.map +1 -1
  28. package/lib/src/next/index.d.ts +0 -1
  29. package/lib/src/sdk/editor-engine.json.cjs.js +1 -1
  30. package/lib/src/sdk/editor-engine.json.es.js +1 -1
  31. package/lib/src/sdk/package.json.cjs.js +1 -1
  32. package/lib/src/sdk/package.json.es.js +1 -1
  33. package/lib/src/sdk.cjs.js +116 -78
  34. package/lib/src/sdk.cjs.js.map +1 -1
  35. package/lib/src/sdk.d.ts +52 -34
  36. package/lib/src/sdk.es.js +116 -78
  37. package/lib/src/sdk.es.js.map +1 -1
  38. package/lib/src/types/BrandKitTypes.d.ts +70 -108
  39. package/lib/src/types/ColorStyleTypes.cjs.js +10 -0
  40. package/lib/src/types/ColorStyleTypes.cjs.js.map +1 -1
  41. package/lib/src/types/ColorStyleTypes.es.js +10 -0
  42. package/lib/src/types/ColorStyleTypes.es.js.map +1 -1
  43. package/lib/src/types/CommonTypes.cjs.js +1 -0
  44. package/lib/src/types/CommonTypes.cjs.js.map +1 -1
  45. package/lib/src/types/CommonTypes.d.ts +2 -1
  46. package/lib/src/types/CommonTypes.es.js +1 -0
  47. package/lib/src/types/CommonTypes.es.js.map +1 -1
  48. package/lib/src/types/ConnectorTypes.cjs.js +6 -2
  49. package/lib/src/types/ConnectorTypes.cjs.js.map +1 -1
  50. package/lib/src/types/ConnectorTypes.d.ts +10 -1
  51. package/lib/src/types/ConnectorTypes.es.js +6 -2
  52. package/lib/src/types/ConnectorTypes.es.js.map +1 -1
  53. package/lib/src/types/FrameTypes.cjs.js.map +1 -1
  54. package/lib/src/types/FrameTypes.d.ts +1 -4
  55. package/lib/src/types/FrameTypes.es.js.map +1 -1
  56. package/lib/src/types/MethodInvocationTypes.d.ts +27 -0
  57. package/lib/src/utils/EngineEventTrigger.cjs.js +4 -1
  58. package/lib/src/utils/EngineEventTrigger.cjs.js.map +1 -1
  59. package/lib/src/utils/EngineEventTrigger.d.ts +2 -1
  60. package/lib/src/utils/EngineEventTrigger.es.js +5 -2
  61. package/lib/src/utils/EngineEventTrigger.es.js.map +1 -1
  62. package/lib/src/utils/MethodInstrumentation.cjs.js +176 -0
  63. package/lib/src/utils/MethodInstrumentation.cjs.js.map +1 -0
  64. package/lib/src/utils/MethodInstrumentation.d.ts +10 -0
  65. package/lib/src/utils/MethodInstrumentation.es.js +176 -0
  66. package/lib/src/utils/MethodInstrumentation.es.js.map +1 -0
  67. package/lib/src/utils/SdkEvent.cjs.js +29 -0
  68. package/lib/src/utils/SdkEvent.cjs.js.map +1 -0
  69. package/lib/src/utils/SdkEvent.d.ts +13 -0
  70. package/lib/src/utils/SdkEvent.es.js +29 -0
  71. package/lib/src/utils/SdkEvent.es.js.map +1 -0
  72. package/lib/src/utils/SdkEvents.cjs.js +11 -0
  73. package/lib/src/utils/SdkEvents.cjs.js.map +1 -0
  74. package/lib/src/utils/SdkEvents.d.ts +19 -0
  75. package/lib/src/utils/SdkEvents.es.js +11 -0
  76. package/lib/src/utils/SdkEvents.es.js.map +1 -0
  77. package/package.json +1 -1
  78. package/lib/src/next/controllers/BrandKitController.cjs.js +0 -34
  79. package/lib/src/next/controllers/BrandKitController.cjs.js.map +0 -1
  80. package/lib/src/next/controllers/BrandKitController.d.ts +0 -24
  81. package/lib/src/next/controllers/BrandKitController.es.js +0 -34
  82. package/lib/src/next/controllers/BrandKitController.es.js.map +0 -1
  83. package/lib/src/next/types/BrandKitTypes.d.ts +0 -52
  84. package/lib/src/utils/BrandKitAdapter.cjs.js +0 -42
  85. package/lib/src/utils/BrandKitAdapter.cjs.js.map +0 -1
  86. package/lib/src/utils/BrandKitAdapter.d.ts +0 -9
  87. package/lib/src/utils/BrandKitAdapter.es.js +0 -42
  88. package/lib/src/utils/BrandKitAdapter.es.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectorController.es.js","sources":["../../../src/controllers/ConnectorController.ts"],"sourcesContent":["import { EditorAPI, EditorResponse, Id } from '../types/CommonTypes';\r\nimport {\r\n ConnectorInstance,\r\n ConnectorMappingDirection,\r\n ConnectorMappingType,\r\n ConnectorOptions,\r\n ConnectorRegistration,\r\n ConnectorState,\r\n ConnectorStateType,\r\n ConnectorToEngineMapping,\r\n ConnectorType,\r\n EngineToConnectorMapping,\r\n} from '../types/ConnectorTypes';\r\nimport { getEditorResponseData } from '../utils/EditorResponseData';\r\n\r\nimport * as Next from '../next/types/ConnectorTypes';\r\nimport { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\r\nimport { ConnectorCompatibilityTools } from '../utils/ConnectorCompatibilityTools';\r\n\r\n/**\r\n * The ConnectorController manages lifetime of all available connectors, regardless of the type, in the\r\n * document. Use it to add/remove connectors to a template, or set specific configuration.\r\n *\r\n * The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an\r\n * implementation of a set of capabilities we need to interact with a certain external resource management system.\r\n * In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet\r\n * is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to\r\n * execute the media connector both on web using webassembly and on the server side during e.g. animation output\r\n * generation.\r\n * This controller is an interface to the running connector instance inside the studio engine. The engine will\r\n * automatically register the 'grafx-media' and 'grafx-font' connectors. Custom connectors need to be registered\r\n * manually.\r\n */\r\nexport class ConnectorController {\r\n /**\r\n * @ignore\r\n */\r\n #editorAPI: EditorAPI;\r\n #localConfig: Map<string, string>;\r\n #connectorCompatibilityTools: ConnectorCompatibilityTools;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(editorAPI: EditorAPI, localConfig: Map<string, string>) {\r\n this.#editorAPI = editorAPI;\r\n this.#localConfig = localConfig;\r\n this.#connectorCompatibilityTools = new ConnectorCompatibilityTools();\r\n }\r\n\r\n /**\r\n * Gets a connector by its id\r\n * @param id the id of the connector\r\n * @returns connector\r\n */\r\n getById = async (id: Id) => {\r\n // add backwards compatibility code\r\n const res = await this.#editorAPI;\r\n return res\r\n .getConnectorById(id)\r\n .then((result) => getEditorResponseData<Next.ConnectorInstance>(result))\r\n .then((resp) => {\r\n const update: EditorResponse<ConnectorInstance> = { ...resp, parsedData: null };\r\n if (resp.parsedData) {\r\n update.parsedData = this.#connectorCompatibilityTools.makeSingleConnectorBackwardsCompatible(\r\n resp.parsedData,\r\n this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl),\r\n );\r\n }\r\n return update;\r\n });\r\n };\r\n\r\n /**\r\n * Gets all available connectors of a 'ConnectorType'\r\n * @param type type of connector you want to get\r\n * @returns list of all available connectors of a 'ConnectorType'\r\n */\r\n getAllByType = async (type: ConnectorType) => {\r\n // add backwards compatibility code\r\n const res = await this.#editorAPI;\r\n return res\r\n .getConnectors(type)\r\n .then((result) => getEditorResponseData<Next.ConnectorInstance[]>(result))\r\n .then((resp) => {\r\n const update: EditorResponse<ConnectorInstance[]> = { ...resp, parsedData: null };\r\n if (resp.parsedData) {\r\n update.parsedData = this.#connectorCompatibilityTools.makeMultipleConnectorsBackwardsCompatible(\r\n resp.parsedData,\r\n this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl),\r\n );\r\n }\r\n return update;\r\n });\r\n };\r\n\r\n /**\r\n * Registers a new connector in the SDK. After successful registration, depending\r\n * on the connector type, the connector can be configured and used in the template\r\n * Remember to add custom authentication information after registering the connector\r\n * @param registration registration object containing all details about the connector\r\n * @returns the Id of the newly created connector, this Id should be used going forward.\r\n */\r\n register = async (registration: ConnectorRegistration) => {\r\n const res = await this.#editorAPI;\r\n\r\n const connectorRegistration =\r\n this.#connectorCompatibilityTools.makeConnectorSourceForwardsCompatible(registration);\r\n\r\n return res\r\n .registerConnector(JSON.stringify(connectorRegistration))\r\n .then((result) => getEditorResponseData<Id>(result));\r\n };\r\n\r\n /**\r\n * Unregisters a connector from the document.\r\n * @param id the id of the connector to unregister\r\n * @returns\r\n */\r\n unregister = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.unregisterConnector(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Configures a registered connector. A configurator helper is passed as an argument\r\n * of the callback for you to setup your connector.\r\n * @param id the id of your registered connector\r\n * @param configurationCallback callback to setup the connector\r\n * @returns\r\n */\r\n configure = async (id: Id, configurationCallback: (configurator: ConnectorConfigurator) => Promise<void>) => {\r\n const res = await this.#editorAPI;\r\n // wait for connector to be ready\r\n await this.waitToBeReady(id);\r\n // execute callback\r\n await configurationCallback(new ConnectorConfigurator(id, res));\r\n // invalidate connector in engine\r\n return res.updateConnectorConfiguration(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitToBeReady'\r\n * method in this controller.\r\n * @param id the id of your registered connector you want to make sure it is loaded\r\n * @returns connector state\r\n */\r\n getState = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorState(id).then((result) => getEditorResponseData<ConnectorState>(result));\r\n };\r\n\r\n /**\r\n * Gets the mapped data from connector.\r\n * @param id the id of your registered connector\r\n * @param direction the mapping direction\r\n * @returns mappings\r\n */\r\n async getMappings(\r\n id: string,\r\n direction: ConnectorMappingDirection.engineToConnector,\r\n ): Promise<EditorResponse<EngineToConnectorMapping[]>>;\r\n async getMappings(\r\n id: string,\r\n direction: ConnectorMappingDirection.connectorToEngine,\r\n ): Promise<EditorResponse<ConnectorToEngineMapping[]>>;\r\n async getMappings(id: string, direction?: undefined): Promise<EditorResponse<ConnectorMappingType[]>>;\r\n async getMappings(id: string, direction?: ConnectorMappingDirection) {\r\n const res = await this.#editorAPI;\r\n return res\r\n .getConnectorMappings(id)\r\n .then((result) => getEditorResponseData<ConnectorMappingType[]>(result))\r\n .then((result) =>\r\n !direction\r\n ? result\r\n : {\r\n ...result,\r\n parsedData: result.parsedData?.filter((cm) => cm.direction === direction),\r\n },\r\n );\r\n }\r\n\r\n /**\r\n * Gets the options from the connector.\r\n * @param id the id of your registered connector\r\n * @returns options\r\n */\r\n getOptions = async (id: string) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorOptions(id).then((result) => getEditorResponseData<ConnectorOptions>(result));\r\n };\r\n\r\n /**\r\n * Connectors are loaded asynchronously in the editor engine, this causes some challenges while configuring them. To make sure\r\n * an action on the connector will be available, it's advised to await this method. After the Promise resolves we are sure\r\n * the connector is up and running. This is used internally by the configure method to ensure correct execution. It's especially\r\n * useful during startup of the SDK / right after the loadDocument call.\r\n * @param id the id of your registered connector you want to make sure it is loaded\r\n * @returns\r\n */\r\n waitToBeReady = async (id: Id, timeoutMilliseconds = 2000): Promise<EditorResponse<null>> => {\r\n // minimum timeout is 500ms\r\n let timeout = Math.max(timeoutMilliseconds, 500);\r\n\r\n // maximum timeout is 5000ms\r\n timeout = Math.min(timeout, 5000);\r\n\r\n const waitTime = 100;\r\n let retries = 0;\r\n\r\n try {\r\n // using while loop will prevent stack overflow issues when using recursion\r\n // wait for maximum 2 seconds to fail\r\n while (retries * waitTime < timeout) {\r\n const result = await this.getState(id);\r\n\r\n if (\r\n result.success &&\r\n result.parsedData &&\r\n (result.parsedData.type === ConnectorStateType.running ||\r\n result.parsedData.type === ConnectorStateType.ready)\r\n ) {\r\n return getEditorResponseData<null>(\r\n { data: null, success: true, error: undefined, status: 0, parsedData: undefined },\r\n false,\r\n );\r\n }\r\n\r\n await new Promise((resolve) => setTimeout(resolve, waitTime));\r\n retries++;\r\n }\r\n } catch (err) {\r\n return getEditorResponseData<null>(\r\n {\r\n data: null,\r\n success: false,\r\n error: `Error while getting connector state ${err}`,\r\n status: 50000,\r\n parsedData: undefined,\r\n },\r\n false,\r\n );\r\n }\r\n\r\n return getEditorResponseData<null>(\r\n {\r\n data: null,\r\n success: false,\r\n error: `Timed out waiting for connector`,\r\n status: 50000,\r\n parsedData: undefined,\r\n },\r\n false,\r\n );\r\n };\r\n\r\n /**\r\n * Updates the mappings for a given connector.\r\n * @param id the id of your registered connector\r\n * @param mappings An array of mapping objects\r\n * @returns\r\n */\r\n updateMappings = async (id: Id, mappings: ConnectorMappingType[]) => {\r\n return await this.configure(id, async (config) => {\r\n // Retrieve all existing mappings\r\n const { parsedData: existingMappings } = await this.getMappings(id);\r\n\r\n // Filter out old mappings that are being replaced with new ones\r\n const filteredMappings =\r\n existingMappings?.filter(\r\n (mapping) =>\r\n !mappings.some(\r\n (newMapping) =>\r\n newMapping.name === mapping.name && newMapping.direction === mapping.direction,\r\n ),\r\n ) ?? [];\r\n\r\n // Filter out new mappings that have empty `name` or `value`\r\n const validMappings = mappings.filter((i) => i.name !== '' && i.value !== '');\r\n\r\n // Merge valid new mappings with the filtered existing mappings\r\n const combinedMappings = [...filteredMappings, ...validMappings];\r\n\r\n // Update the configuration with the resulted mappings\r\n await config.setMappings(combinedMappings);\r\n });\r\n };\r\n\r\n /**\r\n * Sets the mappings for a given connector, replacing the existing mappings with the new ones.\r\n * @param id the id of your registered connector\r\n * @param mappings An array of mapping objects to set\r\n * @returns\r\n */\r\n applyMappings = async (id: Id, mappings: ConnectorMappingType[]) => {\r\n return await this.configure(id, async (config) => {\r\n const validMappings = mappings.filter((i) => i.name !== '' && i.value !== '');\r\n await config.setMappings(validMappings);\r\n });\r\n };\r\n\r\n /**\r\n * Sets HTTP headers on every local connector instance of the given type that uses the given remote (Environment API) connector id.\r\n * It's applicable as for already registered connectors as well as for future one with same remote connector id.\r\n *\r\n * @param remoteConnectorId unique id of the remote connector from the Environment API (grafx source)\r\n * @param headers HTTP headers to set on the connector\r\n * @returns EditorResponse with null on success; error if the engine call fails\r\n */\r\n setHttpHeaders = async (\r\n remoteConnectorId: string,\r\n headers: Record<string, string>,\r\n ): Promise<EditorResponse<null>> => {\r\n const res = await this.#editorAPI;\r\n return res\r\n .remoteConnectorAuthenticationSetHttpHeaders(remoteConnectorId, JSON.stringify(headers))\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n}\r\n\r\n/**\r\n * Helper to setup your connector\r\n */\r\nclass ConnectorConfigurator {\r\n /**\r\n * @ignore\r\n */\r\n #connectorId: Id;\r\n #res: EditorAPI;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(id: Id, res: EditorAPI) {\r\n this.#connectorId = id;\r\n this.#res = res;\r\n }\r\n\r\n /**\r\n * Allows to customize the context data a connector can work with. The options data\r\n * will be available using the context parameter in the connector implementation code.\r\n * @param options object containing key value data to pass to connector context\r\n * @returns\r\n */\r\n setOptions = async (options: ConnectorOptions) => {\r\n return this.#res\r\n .setConnectorOptions(this.#connectorId, JSON.stringify(options))\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Allows to map variables or strings to connector context data.\r\n * By defining the mappings, we can trigger re-download of assets (dynamic asset provider)\r\n * or populate filters for the query endpoint. The mapped data will be available using\r\n * the context parameter in the connector implementation code.\r\n *\r\n * For the variables the mapping should follow the format \"var.[variable id]\". e.g. var.6B29FC40-CA47-1067-B31D-00DD010662DA\r\n *\r\n * @param mappings collection of mappings to set to this connector\r\n * @returns\r\n */\r\n setMappings = async (mappings: ConnectorMappingType[]) => {\r\n const result = await this.#res.setConnectorMappings(\r\n this.#connectorId,\r\n mappings.map(function (m) {\r\n return JSON.stringify(m);\r\n }),\r\n );\r\n return getEditorResponseData<null>(result);\r\n };\r\n\r\n /**\r\n * This method sets the HTTP headers for the 'staticKey' authentication type.\r\n * These additional headers will be added to all connector http calls.\r\n * Can only be used after a connector has been registered. (if you are using a grafx connector no registration is needed)\r\n * @param headerName name of the header\r\n * @param headerValue value of the header\r\n * @returns\r\n */\r\n setHttpHeader = async (headerName: string, headerValue: string) => {\r\n return this.#res\r\n .connectorAuthenticationSetHttpHeader(this.#connectorId, headerName, headerValue)\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;AAiCO,MAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA,EAW7B,YAAY,WAAsB,aAAkC;AAPpE;AAAA;AAAA;AAAA;AACA;AACA;AAgBA,SAAA,UAAU,OAAO,OAAW;AAExB,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IACF,iBAAiB,EAAE,EACnB,KAAK,CAAC,WAAW,sBAA8C,MAAM,CAAC,EACtE,KAAK,CAAC,SAAS;AACZ,cAAM,SAA4C,EAAE,GAAG,MAAM,YAAY,KAAA;AACzE,YAAI,KAAK,YAAY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;AAAA,QAAS;AAAA;AAAA,IAC5E;AAAA,EAEhB;AA0IJ;AAzRI;AACA;AACA;AA4RJ,MAAM,sBAAsB;AAAA;AAAA;AAAA;AAAA,EAUxB,YAAY,IAAQ,KAAgB;AANpC;AAAA;AAAA;AAAA;AACA;AAgBA,SAAA,aAAa,OAAO,YAA8B;AAC9C,aAAO,mBAAK,MACP,oBAAoB,mBAAK,eAAc,KAAK,UAAU,OAAO,CAAC,EAC9D,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAaA,SAAA,cAAc,OAAO,aAAqC;AACtD,YAAM,SAAS,MAAM,mBAAK,MAAK;AAAA,QAC3B,mBAAK;AAAA,QACL,SAAS,IAAI,SAAU,GAAG;AACtB,iBAAO,KAAK,UAAU,CAAC;AAAA,QAC3B,CAAC;AAAA,MAAA;AAEL,aAAO,sBAA4B,MAAM;AAAA,IAC7C;AAUA,SAAA,gBAAgB,OAAO,YAAoB,gBAAwB;AAC/D,aAAO,mBAAK,MACP,qCAAqC,mBAAK,eAAc,YAAY,WAAW,EAC/E,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAjDI,uBAAK,cAAe;AACpB,uBAAK,MAAO;AAAA,EAChB;AAgDJ;AAzDI;AACA;"}
1
+ {"version":3,"file":"ConnectorController.es.js","sources":["../../../src/controllers/ConnectorController.ts"],"sourcesContent":["import { EditorAPI, EditorResponse, Id } from '../types/CommonTypes';\r\nimport {\r\n ConnectorInstance,\r\n ConnectorMappingDirection,\r\n ConnectorMappingType,\r\n ConnectorOptions,\r\n ConnectorRegistration,\r\n ConnectorState,\r\n ConnectorStateType,\r\n ConnectorToEngineMapping,\r\n ConnectorType,\r\n EngineToConnectorMapping,\r\n} from '../types/ConnectorTypes';\r\nimport { getEditorResponseData } from '../utils/EditorResponseData';\r\n\r\nimport * as Next from '../next/types/ConnectorTypes';\r\nimport { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';\r\nimport { ConnectorCompatibilityTools } from '../utils/ConnectorCompatibilityTools';\r\n\r\n/**\r\n * The ConnectorController manages lifetime of all available connectors, regardless of the type, in the\r\n * document. Use it to add/remove connectors to a template, or set specific configuration.\r\n *\r\n * The way CHILI Studio handles different sources of resources is called 'Connectors'. A Connectors is an\r\n * implementation of a set of capabilities we need to interact with a certain external resource management system.\r\n * In essence a connector is the combination of a Javascript snippet and some metadata. The Javascript snippet\r\n * is loaded in the studio engine using a sandboxed Javascript execution engine (QuickJs). This allows us to\r\n * execute the media connector both on web using webassembly and on the server side during e.g. animation output\r\n * generation.\r\n * This controller is an interface to the running connector instance inside the studio engine. The engine will\r\n * automatically register the 'grafx-media' and 'grafx-font' connectors. Custom connectors need to be registered\r\n * manually.\r\n */\r\nexport class ConnectorController {\r\n /**\r\n * @ignore\r\n */\r\n #editorAPI: EditorAPI;\r\n #localConfig: Map<string, string>;\r\n #connectorCompatibilityTools: ConnectorCompatibilityTools;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(editorAPI: EditorAPI, localConfig: Map<string, string>) {\r\n this.#editorAPI = editorAPI;\r\n this.#localConfig = localConfig;\r\n this.#connectorCompatibilityTools = new ConnectorCompatibilityTools();\r\n }\r\n\r\n /**\r\n * Gets a connector by its id\r\n * @param id the id of the connector\r\n * @returns connector\r\n */\r\n getById = async (id: Id) => {\r\n // add backwards compatibility code\r\n const res = await this.#editorAPI;\r\n return res\r\n .getConnectorById(id)\r\n .then((result) => getEditorResponseData<Next.ConnectorInstance>(result))\r\n .then((resp) => {\r\n const update: EditorResponse<ConnectorInstance> = { ...resp, parsedData: null };\r\n if (resp.parsedData) {\r\n update.parsedData = this.#connectorCompatibilityTools.makeSingleConnectorBackwardsCompatible(\r\n resp.parsedData,\r\n this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl),\r\n );\r\n }\r\n return update;\r\n });\r\n };\r\n\r\n /**\r\n * Gets all available connectors of a 'ConnectorType'\r\n * @param type type of connector you want to get\r\n * @returns list of all available connectors of a 'ConnectorType'\r\n */\r\n getAllByType = async (type: ConnectorType) => {\r\n // add backwards compatibility code\r\n const res = await this.#editorAPI;\r\n return res\r\n .getConnectors(type)\r\n .then((result) => getEditorResponseData<Next.ConnectorInstance[]>(result))\r\n .then((resp) => {\r\n const update: EditorResponse<ConnectorInstance[]> = { ...resp, parsedData: null };\r\n if (resp.parsedData) {\r\n update.parsedData = this.#connectorCompatibilityTools.makeMultipleConnectorsBackwardsCompatible(\r\n resp.parsedData,\r\n this.#localConfig.get(WellKnownConfigurationKeys.GraFxStudioEnvironmentApiUrl),\r\n );\r\n }\r\n return update;\r\n });\r\n };\r\n\r\n /**\r\n * Registers a new connector in the SDK. After successful registration, depending\r\n * on the connector type, the connector can be configured and used in the template\r\n * Remember to add custom authentication information after registering the connector\r\n * @param registration registration object containing all details about the connector\r\n * @returns the Id of the newly created connector, this Id should be used going forward.\r\n */\r\n register = async (registration: ConnectorRegistration) => {\r\n const res = await this.#editorAPI;\r\n\r\n const connectorRegistration =\r\n this.#connectorCompatibilityTools.makeConnectorSourceForwardsCompatible(registration);\r\n\r\n return res\r\n .registerConnector(JSON.stringify(connectorRegistration))\r\n .then((result) => getEditorResponseData<Id>(result));\r\n };\r\n\r\n /**\r\n * Unregisters a connector from the document.\r\n * @param id the id of the connector to unregister\r\n * @returns\r\n */\r\n unregister = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.unregisterConnector(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Configures a registered connector. A configurator helper is passed as an argument\r\n * of the callback for you to setup your connector.\r\n * @param id the id of your registered connector\r\n * @param configurationCallback callback to setup the connector\r\n * @returns\r\n */\r\n configure = async (id: Id, configurationCallback: (configurator: ConnectorConfigurator) => Promise<void>) => {\r\n const res = await this.#editorAPI;\r\n // wait for connector to be ready\r\n await this.waitToBeReady(id);\r\n // execute callback\r\n await configurationCallback(new ConnectorConfigurator(id, res));\r\n // invalidate connector in engine\r\n return res.updateConnectorConfiguration(id).then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Gets the current state a connector is in, to wait until a connector is ready to be used, use the 'waitToBeReady'\r\n * method in this controller.\r\n * @param id the id of your registered connector you want to make sure it is loaded\r\n * @returns connector state\r\n */\r\n getState = async (id: Id) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorState(id).then((result) => getEditorResponseData<ConnectorState>(result));\r\n };\r\n\r\n /**\r\n * Gets the mapped data from connector.\r\n * @param id the id of your registered connector\r\n * @param direction the mapping direction\r\n * @returns mappings\r\n */\r\n async getMappings(\r\n id: string,\r\n direction: ConnectorMappingDirection.engineToConnector,\r\n ): Promise<EditorResponse<EngineToConnectorMapping[]>>;\r\n async getMappings(\r\n id: string,\r\n direction: ConnectorMappingDirection.connectorToEngine,\r\n ): Promise<EditorResponse<ConnectorToEngineMapping[]>>;\r\n async getMappings(id: string, direction?: undefined): Promise<EditorResponse<ConnectorMappingType[]>>;\r\n async getMappings(id: string, direction?: ConnectorMappingDirection) {\r\n const res = await this.#editorAPI;\r\n return res\r\n .getConnectorMappings(id)\r\n .then((result) => getEditorResponseData<ConnectorMappingType[]>(result))\r\n .then((result) =>\r\n !direction\r\n ? result\r\n : {\r\n ...result,\r\n parsedData: result.parsedData?.filter((cm) => cm.direction === direction),\r\n },\r\n );\r\n }\r\n\r\n /**\r\n * Gets the options from the connector.\r\n * @param id the id of your registered connector\r\n * @returns options\r\n */\r\n getOptions = async (id: string) => {\r\n const res = await this.#editorAPI;\r\n return res.getConnectorOptions(id).then((result) => getEditorResponseData<ConnectorOptions>(result));\r\n };\r\n\r\n /**\r\n * Connectors are loaded asynchronously in the editor engine, this causes some challenges while configuring them. To make sure\r\n * an action on the connector will be available, it's advised to await this method. After the Promise resolves we are sure\r\n * the connector is up and running. This is used internally by the configure method to ensure correct execution. It's especially\r\n * useful during startup of the SDK / right after the loadDocument call.\r\n * @param id the id of your registered connector you want to make sure it is loaded\r\n * @returns\r\n */\r\n waitToBeReady = async (id: Id, timeoutMilliseconds = 2000): Promise<EditorResponse<null>> => {\r\n // minimum timeout is 500ms\r\n let timeout = Math.max(timeoutMilliseconds, 500);\r\n\r\n // maximum timeout is 5000ms\r\n timeout = Math.min(timeout, 5000);\r\n\r\n const waitTime = 100;\r\n let retries = 0;\r\n\r\n try {\r\n // using while loop will prevent stack overflow issues when using recursion\r\n // wait for maximum 2 seconds to fail\r\n while (retries * waitTime < timeout) {\r\n const result = await this.getState(id);\r\n\r\n if (\r\n result.success &&\r\n result.parsedData &&\r\n (result.parsedData.type === ConnectorStateType.running ||\r\n result.parsedData.type === ConnectorStateType.ready)\r\n ) {\r\n return getEditorResponseData<null>(\r\n { data: null, success: true, error: undefined, status: 0, parsedData: undefined },\r\n false,\r\n );\r\n }\r\n\r\n await new Promise((resolve) => setTimeout(resolve, waitTime));\r\n retries++;\r\n }\r\n } catch (err) {\r\n return getEditorResponseData<null>(\r\n {\r\n data: null,\r\n success: false,\r\n error: `Error while getting connector state ${err}`,\r\n status: 50000,\r\n parsedData: undefined,\r\n },\r\n false,\r\n );\r\n }\r\n\r\n return getEditorResponseData<null>(\r\n {\r\n data: null,\r\n success: false,\r\n error: `Timed out waiting for connector`,\r\n status: 50000,\r\n parsedData: undefined,\r\n },\r\n false,\r\n );\r\n };\r\n\r\n /**\r\n * Updates the mappings for a given connector.\r\n * @param id the id of your registered connector\r\n * @param mappings An array of mapping objects\r\n * @returns\r\n */\r\n updateMappings = async (id: Id, mappings: ConnectorMappingType[]) => {\r\n return await this.configure(id, async (config) => {\r\n // Retrieve all existing mappings\r\n const { parsedData: existingMappings } = await this.getMappings(id);\r\n\r\n // Filter out old mappings that are being replaced with new ones\r\n const filteredMappings =\r\n existingMappings?.filter(\r\n (mapping) =>\r\n !mappings.some(\r\n (newMapping) =>\r\n newMapping.name === mapping.name && newMapping.direction === mapping.direction,\r\n ),\r\n ) ?? [];\r\n\r\n // Filter out new mappings that have empty `name` or `value`\r\n const validMappings = mappings.filter((i) => i.name !== '' && i.value !== '');\r\n\r\n // Merge valid new mappings with the filtered existing mappings\r\n const combinedMappings = [...filteredMappings, ...validMappings];\r\n\r\n // Update the configuration with the resulted mappings\r\n await config.setMappings(combinedMappings);\r\n });\r\n };\r\n\r\n /**\r\n * Sets the mappings for a given connector, replacing the existing mappings with the new ones.\r\n * @param id the id of your registered connector\r\n * @param mappings An array of mapping objects to set\r\n * @returns\r\n */\r\n applyMappings = async (id: Id, mappings: ConnectorMappingType[]) => {\r\n return await this.configure(id, async (config) => {\r\n const validMappings = mappings.filter((i) => i.name !== '' && i.value !== '');\r\n await config.setMappings(validMappings);\r\n });\r\n };\r\n\r\n /**\r\n * Sets HTTP headers on every local connector instance of the given type that uses the given remote (Environment API) connector id.\r\n * It's applicable as for already registered connectors as well as for future one with same remote connector id.\r\n *\r\n * @param remoteConnectorId unique id of the remote connector from the Environment API (grafx source)\r\n * @param headers HTTP headers to set on the connector\r\n * @returns EditorResponse with null on success; error if the engine call fails\r\n */\r\n setHttpHeaders = async (\r\n remoteConnectorId: string,\r\n headers: Record<string, string>,\r\n ): Promise<EditorResponse<null>> => {\r\n const res = await this.#editorAPI;\r\n return res\r\n .remoteConnectorAuthenticationSetHttpHeaders(remoteConnectorId, JSON.stringify(headers))\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n}\r\n\r\n/**\r\n * Helper to setup your connector\r\n */\r\nclass ConnectorConfigurator {\r\n /**\r\n * @ignore\r\n */\r\n #connectorId: Id;\r\n #res: EditorAPI;\r\n\r\n /**\r\n * @ignore\r\n */\r\n constructor(id: Id, res: EditorAPI) {\r\n this.#connectorId = id;\r\n this.#res = res;\r\n }\r\n\r\n /**\r\n * Allows to customize the context data a connector can work with. The options data\r\n * will be available using the context parameter in the connector implementation code.\r\n * @param options object containing key value data to pass to connector context\r\n * @returns\r\n */\r\n setOptions = async (options: ConnectorOptions) => {\r\n return this.#res\r\n .setConnectorOptions(this.#connectorId, JSON.stringify(options))\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n\r\n /**\r\n * Allows to map variables or strings to connector context data.\r\n * By defining the mappings, we can trigger re-download of assets (dynamic asset provider)\r\n * or populate filters for the query endpoint. The mapped data will be available using\r\n * the context parameter in the connector implementation code.\r\n *\r\n * For the variables the mapping should follow the format \"var.[variable id]\". e.g. var.6B29FC40-CA47-1067-B31D-00DD010662DA\r\n *\r\n * @param mappings collection of mappings to set to this connector\r\n * @returns\r\n */\r\n setMappings = async (mappings: ConnectorMappingType[]) => {\r\n const result = await this.#res.setConnectorMappings(\r\n this.#connectorId,\r\n mappings.map(function (m) {\r\n return JSON.stringify(m);\r\n }),\r\n );\r\n return getEditorResponseData<null>(result);\r\n };\r\n\r\n /**\r\n * This method sets the HTTP headers for the 'staticKey' authentication type.\r\n * These additional headers will be added to all connector http calls.\r\n * Can only be used after a connector has been registered. (if you are using a grafx connector no registration is needed)\r\n * @param headerName name of the header\r\n * @param headerValue value of the header\r\n * @returns\r\n */\r\n setHttpHeader = async (headerName: string, headerValue: string) => {\r\n return this.#res\r\n .connectorAuthenticationSetHttpHeader(this.#connectorId, headerName, headerValue)\r\n .then((result) => getEditorResponseData<null>(result));\r\n };\r\n}\r\n"],"names":[],"mappings":";;;;;;;;;;;;AAiCO,MAAM,oBAAoB;AAAA;AAAA;AAAA;AAAA,EAW7B,YAAY,WAAsB,aAAkC;AAPpE;AAAA;AAAA;AAAA;AACA;AACA;AAgBA,SAAA,UAAU,OAAO,OAAW;AAExB,YAAM,MAAM,MAAM,mBAAK;AACvB,aAAO,IACF,iBAAiB,EAAE,EACnB,KAAK,CAAC,WAAW,sBAA8C,MAAM,CAAC,EACtE,KAAK,CAAC,SAAS;AACZ,cAAM,SAA4C,EAAE,GAAG,MAAM,YAAY,KAAA;AACzE,YAAI,KAAK,YAAY;AACjB,iBAAO,aAAa,mBAAK,8BAA6B;AAAA,YAClD,KAAK;AAAA,YACL,mBAAK,cAAa,IAAI,2BAA2B,4BAA4B;AAAA,UAAA;AAAA,QA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B,YAAY,IAAQ,KAAgB;AANpC;AAAA;AAAA;AAAA;AACA;AAgBA,SAAA,aAAa,OAAO,YAA8B;AAC9C,aAAO,mBAAK,MACP,oBAAoB,mBAAK,eAAc,KAAK,UAAU,OAAO,CAAC,EAC9D,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAaA,SAAA,cAAc,OAAO,aAAqC;AACtD,YAAM,SAAS,MAAM,mBAAK,MAAK;AAAA,QAC3B,mBAAK;AAAA,QACL,SAAS,IAAI,SAAU,GAAG;AACtB,iBAAO,KAAK,UAAU,CAAC;AAAA,QAC3B,CAAC;AAAA,MAAA;AAEL,aAAO,sBAA4B,MAAM;AAAA,IAC7C;AAUA,SAAA,gBAAgB,OAAO,YAAoB,gBAAwB;AAC/D,aAAO,mBAAK,MACP,qCAAqC,mBAAK,eAAc,YAAY,WAAW,EAC/E,KAAK,CAAC,WAAW,sBAA4B,MAAM,CAAC;AAAA,IAC7D;AAjDI,uBAAK,cAAe;AACpB,uBAAK,MAAO;AAAA,EAChB;AAgDJ;AAzDI;AACA;"}
@@ -1 +1 @@
1
- {"version":3,"file":"AsyncExceptions.cjs.js","sources":["../../../src/exceptions/AsyncExceptions.ts"],"sourcesContent":["import { ActionEditorEvent } from '../types/ActionTypes';\nimport { Id } from '../types/CommonTypes';\n\nexport interface ActionEventErrorData {\n event: ActionEditorEvent;\n actionIds: Id[];\n}\n\ninterface AsyncErrorBase {\n type: AsyncErrorType;\n message: string;\n}\n\nenum AsyncErrorType {\n action = 'action',\n dataRow = 'dataRow',\n}\n\ninterface ExceptionContext {\n variableId?: Id;\n}\n\ninterface EditorExceptionDto {\n type: string;\n code: number;\n message: string;\n context?: ExceptionContext;\n}\n\nexport class ActionAsyncError implements AsyncErrorBase {\n type: AsyncErrorType;\n id?: string;\n event?: ActionEditorEvent;\n eventChain?: ActionEventErrorData[];\n message: string;\n\n constructor(message: string, id?: string, event?: ActionEditorEvent, eventChain?: ActionEventErrorData[]) {\n this.type = AsyncErrorType.action;\n this.message = message;\n this.id = id;\n this.event = event;\n this.eventChain = eventChain;\n }\n}\n\nexport class DataRowAsyncError implements AsyncErrorBase {\n type: AsyncErrorType;\n count: number;\n exceptions: EditorExceptionDto[];\n message: string;\n\n constructor(count: number, message: string, exceptions: EditorExceptionDto[]) {\n this.type = AsyncErrorType.dataRow;\n this.count = count;\n this.message = message;\n this.exceptions = exceptions;\n }\n}\n\nexport type AsyncError = ActionAsyncError | DataRowAsyncError;\n"],"names":[],"mappings":";;AA6BO,MAAM,iBAA2C;AAAA,EAOpD,YAAY,SAAiB,IAAa,OAA2B,YAAqC;AACtG,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,KAAK;AACV,SAAK,QAAQ;AACb,SAAK,aAAa;AAAA,EACtB;AACJ;AAEO,MAAM,kBAA4C;AAAA,EAMrD,YAAY,OAAe,SAAiB,YAAkC;AAC1E,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK,UAAU;AACf,SAAK,aAAa;AAAA,EACtB;AACJ;;;"}
1
+ {"version":3,"file":"AsyncExceptions.cjs.js","sources":["../../../src/exceptions/AsyncExceptions.ts"],"sourcesContent":["import { ActionEditorEvent } from '../types/ActionTypes';\nimport { Id } from '../types/CommonTypes';\n\nexport interface ActionEventErrorData {\n event: ActionEditorEvent;\n actionIds: Id[];\n}\n\ninterface AsyncErrorBase {\n type: AsyncErrorType;\n message: string;\n}\n\nenum AsyncErrorType {\n action = 'action',\n dataRow = 'dataRow',\n}\n\ninterface ExceptionContext {\n variableId?: Id;\n columnName?: string;\n}\n\ninterface EditorExceptionDto {\n type: string;\n code: number;\n message: string;\n context?: ExceptionContext;\n}\n\nexport class ActionAsyncError implements AsyncErrorBase {\n type: AsyncErrorType;\n id?: string;\n event?: ActionEditorEvent;\n eventChain?: ActionEventErrorData[];\n message: string;\n\n constructor(message: string, id?: string, event?: ActionEditorEvent, eventChain?: ActionEventErrorData[]) {\n this.type = AsyncErrorType.action;\n this.message = message;\n this.id = id;\n this.event = event;\n this.eventChain = eventChain;\n }\n}\n\nexport class DataRowAsyncError implements AsyncErrorBase {\n type: AsyncErrorType;\n count: number;\n exceptions: EditorExceptionDto[];\n message: string;\n\n constructor(count: number, message: string, exceptions: EditorExceptionDto[]) {\n this.type = AsyncErrorType.dataRow;\n this.count = count;\n this.message = message;\n this.exceptions = exceptions;\n }\n}\n\nexport type AsyncError = ActionAsyncError | DataRowAsyncError;\n"],"names":[],"mappings":";;AA8BO,MAAM,iBAA2C;AAAA,EAOpD,YAAY,SAAiB,IAAa,OAA2B,YAAqC;AACtG,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,KAAK;AACV,SAAK,QAAQ;AACb,SAAK,aAAa;AAAA,EACtB;AACJ;AAEO,MAAM,kBAA4C;AAAA,EAMrD,YAAY,OAAe,SAAiB,YAAkC;AAC1E,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK,UAAU;AACf,SAAK,aAAa;AAAA,EACtB;AACJ;;;"}
@@ -14,6 +14,7 @@ declare enum AsyncErrorType {
14
14
  }
15
15
  interface ExceptionContext {
16
16
  variableId?: Id;
17
+ columnName?: string;
17
18
  }
18
19
  interface EditorExceptionDto {
19
20
  type: string;
@@ -1 +1 @@
1
- {"version":3,"file":"AsyncExceptions.es.js","sources":["../../../src/exceptions/AsyncExceptions.ts"],"sourcesContent":["import { ActionEditorEvent } from '../types/ActionTypes';\nimport { Id } from '../types/CommonTypes';\n\nexport interface ActionEventErrorData {\n event: ActionEditorEvent;\n actionIds: Id[];\n}\n\ninterface AsyncErrorBase {\n type: AsyncErrorType;\n message: string;\n}\n\nenum AsyncErrorType {\n action = 'action',\n dataRow = 'dataRow',\n}\n\ninterface ExceptionContext {\n variableId?: Id;\n}\n\ninterface EditorExceptionDto {\n type: string;\n code: number;\n message: string;\n context?: ExceptionContext;\n}\n\nexport class ActionAsyncError implements AsyncErrorBase {\n type: AsyncErrorType;\n id?: string;\n event?: ActionEditorEvent;\n eventChain?: ActionEventErrorData[];\n message: string;\n\n constructor(message: string, id?: string, event?: ActionEditorEvent, eventChain?: ActionEventErrorData[]) {\n this.type = AsyncErrorType.action;\n this.message = message;\n this.id = id;\n this.event = event;\n this.eventChain = eventChain;\n }\n}\n\nexport class DataRowAsyncError implements AsyncErrorBase {\n type: AsyncErrorType;\n count: number;\n exceptions: EditorExceptionDto[];\n message: string;\n\n constructor(count: number, message: string, exceptions: EditorExceptionDto[]) {\n this.type = AsyncErrorType.dataRow;\n this.count = count;\n this.message = message;\n this.exceptions = exceptions;\n }\n}\n\nexport type AsyncError = ActionAsyncError | DataRowAsyncError;\n"],"names":[],"mappings":"AA6BO,MAAM,iBAA2C;AAAA,EAOpD,YAAY,SAAiB,IAAa,OAA2B,YAAqC;AACtG,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,KAAK;AACV,SAAK,QAAQ;AACb,SAAK,aAAa;AAAA,EACtB;AACJ;AAEO,MAAM,kBAA4C;AAAA,EAMrD,YAAY,OAAe,SAAiB,YAAkC;AAC1E,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK,UAAU;AACf,SAAK,aAAa;AAAA,EACtB;AACJ;"}
1
+ {"version":3,"file":"AsyncExceptions.es.js","sources":["../../../src/exceptions/AsyncExceptions.ts"],"sourcesContent":["import { ActionEditorEvent } from '../types/ActionTypes';\nimport { Id } from '../types/CommonTypes';\n\nexport interface ActionEventErrorData {\n event: ActionEditorEvent;\n actionIds: Id[];\n}\n\ninterface AsyncErrorBase {\n type: AsyncErrorType;\n message: string;\n}\n\nenum AsyncErrorType {\n action = 'action',\n dataRow = 'dataRow',\n}\n\ninterface ExceptionContext {\n variableId?: Id;\n columnName?: string;\n}\n\ninterface EditorExceptionDto {\n type: string;\n code: number;\n message: string;\n context?: ExceptionContext;\n}\n\nexport class ActionAsyncError implements AsyncErrorBase {\n type: AsyncErrorType;\n id?: string;\n event?: ActionEditorEvent;\n eventChain?: ActionEventErrorData[];\n message: string;\n\n constructor(message: string, id?: string, event?: ActionEditorEvent, eventChain?: ActionEventErrorData[]) {\n this.type = AsyncErrorType.action;\n this.message = message;\n this.id = id;\n this.event = event;\n this.eventChain = eventChain;\n }\n}\n\nexport class DataRowAsyncError implements AsyncErrorBase {\n type: AsyncErrorType;\n count: number;\n exceptions: EditorExceptionDto[];\n message: string;\n\n constructor(count: number, message: string, exceptions: EditorExceptionDto[]) {\n this.type = AsyncErrorType.dataRow;\n this.count = count;\n this.message = message;\n this.exceptions = exceptions;\n }\n}\n\nexport type AsyncError = ActionAsyncError | DataRowAsyncError;\n"],"names":[],"mappings":"AA8BO,MAAM,iBAA2C;AAAA,EAOpD,YAAY,SAAiB,IAAa,OAA2B,YAAqC;AACtG,SAAK,OAAO;AACZ,SAAK,UAAU;AACf,SAAK,KAAK;AACV,SAAK,QAAQ;AACb,SAAK,aAAa;AAAA,EACtB;AACJ;AAEO,MAAM,kBAA4C;AAAA,EAMrD,YAAY,OAAe,SAAiB,YAAkC;AAC1E,SAAK,OAAO;AACZ,SAAK,QAAQ;AACb,SAAK,UAAU;AACf,SAAK,aAAa;AAAA,EACtB;AACJ;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Helpers.cjs.js","sources":["../../../src/exceptions/Helpers.ts"],"sourcesContent":["import { EditorResponse, Id } from '../types/CommonTypes';\nimport { connectorHttpErrorErrorCode, variableInvalidValueErrorCode } from './Codes';\nimport { ConnectorHttpError , VariableValueConstrainsViolationError } from './Exceptions';\n\nexport function throwEditorResponseError(response: EditorResponse<unknown>): never {\n const parsedError = response.error ?? 'Yikes, something went wrong';\n const parsedCause = {\n cause: {\n name: String(response.status),\n message: response.error ?? 'Yikes, something went wrong',\n },\n };\n\n if (response.status === connectorHttpErrorErrorCode) {\n const parsedErrorData = JSON.parse(response.data as string);\n const httpStatusCode = parsedErrorData['statusCode'] as number;\n\n throw new ConnectorHttpError(httpStatusCode, parsedError, parsedCause);\n } else {\n throw new Error(parsedError, parsedCause);\n }\n}\n\n\n\nfunction parseVariableConstraintError(errorMsg: string): { valid: boolean; variableId?: string } {\n // Only the listed formats are considered valid for constraint errors.\n // Extend with future use cases (i.e. character's limit error)\n const patterns = [\n /DateVariable '([^']+)' should not be part of excludedDays, \".*\" was given/,\n /DateVariable '([^']+)' expects \\$date to be > startDate:.*$/,\n /DateVariable '([^']+)' expects \\$date to be < endDate:.*$/,\n /NumberVariable '([^']+)' expects \\$extractedValue to be >= .+$/,\n /NumberVariable '([^']+)' expects \\$extractedValue to be <= .+$/,\n ];\n\n for (const pattern of patterns) {\n const match = errorMsg.match(pattern);\n if (match) {\n return { valid: true };\n }\n }\n return { valid: false };\n}\n\n/**\n * Variable-specific failure hook\n * Throws VariableValueConstrainsViolationError when the response matches a recognized constraint error;\n * otherwise returns so `getEditorResponseData` falls back to `throwEditorResponseError`.\n */\nexport function throwVariableException(response: EditorResponse<unknown>, context: { id: Id }): void {\n if (response.status === variableInvalidValueErrorCode && response.error) {\n const errorMsg = response.error;\n const parseResult = parseVariableConstraintError(errorMsg);\n\n if (parseResult.valid) {\n throw new VariableValueConstrainsViolationError(context, errorMsg, {\n cause: { name: String(response.status), message: errorMsg },\n });\n }\n }\n}\n"],"names":["connectorHttpErrorErrorCode","ConnectorHttpError","variableInvalidValueErrorCode","VariableValueConstrainsViolationError"],"mappings":";;;;AAIO,SAAS,yBAAyB,UAA0C;AAC/E,QAAM,cAAc,SAAS,SAAS;AACtC,QAAM,cAAc;AAAA,IAChB,OAAO;AAAA,MACH,MAAM,OAAO,SAAS,MAAM;AAAA,MAC5B,SAAS,SAAS,SAAS;AAAA,IAAA;AAAA,EAC/B;AAGJ,MAAI,SAAS,WAAWA,mCAA6B;AACjD,UAAM,kBAAkB,KAAK,MAAM,SAAS,IAAc;AAC1D,UAAM,iBAAiB,gBAAgB,YAAY;AAEnD,UAAM,IAAIC,WAAAA,mBAAmB,gBAAgB,aAAa,WAAW;AAAA,EACzE,OAAO;AACH,UAAM,IAAI,MAAM,aAAa,WAAW;AAAA,EAC5C;AACJ;AAIA,SAAS,6BAA6B,UAA2D;AAG7F,QAAM,WAAW;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGJ,aAAW,WAAW,UAAU;AAC5B,UAAM,QAAQ,SAAS,MAAM,OAAO;AACpC,QAAI,OAAO;AACP,aAAO,EAAE,OAAO,KAAA;AAAA,IACpB;AAAA,EACJ;AACA,SAAO,EAAE,OAAO,MAAA;AACpB;AAOO,SAAS,uBAAuB,UAAmC,SAA2B;AACjG,MAAI,SAAS,WAAWC,uCAAiC,SAAS,OAAO;AACrE,UAAM,WAAW,SAAS;AAC1B,UAAM,cAAc,6BAA6B,QAAQ;AAEzD,QAAI,YAAY,OAAO;AACnB,YAAM,IAAIC,WAAAA,sCAAsC,SAAS,UAAU;AAAA,QAC/D,OAAO,EAAE,MAAM,OAAO,SAAS,MAAM,GAAG,SAAS,SAAA;AAAA,MAAS,CAC7D;AAAA,IACL;AAAA,EACJ;AACJ;;;"}
1
+ {"version":3,"file":"Helpers.cjs.js","sources":["../../../src/exceptions/Helpers.ts"],"sourcesContent":["import { EditorResponse, Id } from '../types/CommonTypes';\nimport { connectorHttpErrorErrorCode, variableInvalidValueErrorCode } from './Codes';\nimport { ConnectorHttpError, VariableValueConstrainsViolationError } from './Exceptions';\n\nexport function throwEditorResponseError(response: EditorResponse<unknown>): never {\n const parsedError = response.error ?? 'Yikes, something went wrong';\n const parsedCause = {\n cause: {\n name: String(response.status),\n message: response.error ?? 'Yikes, something went wrong',\n },\n };\n\n if (response.status === connectorHttpErrorErrorCode) {\n const parsedErrorData = JSON.parse(response.data as string);\n const httpStatusCode = parsedErrorData['statusCode'] as number;\n\n throw new ConnectorHttpError(httpStatusCode, parsedError, parsedCause);\n } else {\n throw new Error(parsedError, parsedCause);\n }\n}\n\nfunction parseVariableConstraintError(errorMsg: string): { valid: boolean; variableId?: string } {\n // Only the listed formats are considered valid for constraint errors.\n // Extend with future use cases (i.e. character's limit error)\n const patterns = [\n /DateVariable '([^']+)' should not be part of excludedDays, \".*\" was given/,\n /DateVariable '([^']+)' expects \\$date to be > startDate:.*$/,\n /DateVariable '([^']+)' expects \\$date to be < endDate:.*$/,\n /NumberVariable '([^']+)' expects \\$extractedValue to be >= .+$/,\n /NumberVariable '([^']+)' expects \\$extractedValue to be <= .+$/,\n ];\n\n for (const pattern of patterns) {\n const match = errorMsg.match(pattern);\n if (match) {\n return { valid: true };\n }\n }\n return { valid: false };\n}\n\n/**\n * Variable-specific failure hook\n * Throws VariableValueConstrainsViolationError when the response matches a recognized constraint error;\n * otherwise returns so `getEditorResponseData` falls back to `throwEditorResponseError`.\n */\nexport function throwVariableException(response: EditorResponse<unknown>, context: { id: Id }): void {\n if (response.status === variableInvalidValueErrorCode && response.error) {\n const errorMsg = response.error;\n const parseResult = parseVariableConstraintError(errorMsg);\n\n if (parseResult.valid) {\n throw new VariableValueConstrainsViolationError(context, errorMsg, {\n cause: { name: String(response.status), message: errorMsg },\n });\n }\n }\n}\n"],"names":["connectorHttpErrorErrorCode","ConnectorHttpError","variableInvalidValueErrorCode","VariableValueConstrainsViolationError"],"mappings":";;;;AAIO,SAAS,yBAAyB,UAA0C;AAC/E,QAAM,cAAc,SAAS,SAAS;AACtC,QAAM,cAAc;AAAA,IAChB,OAAO;AAAA,MACH,MAAM,OAAO,SAAS,MAAM;AAAA,MAC5B,SAAS,SAAS,SAAS;AAAA,IAAA;AAAA,EAC/B;AAGJ,MAAI,SAAS,WAAWA,mCAA6B;AACjD,UAAM,kBAAkB,KAAK,MAAM,SAAS,IAAc;AAC1D,UAAM,iBAAiB,gBAAgB,YAAY;AAEnD,UAAM,IAAIC,WAAAA,mBAAmB,gBAAgB,aAAa,WAAW;AAAA,EACzE,OAAO;AACH,UAAM,IAAI,MAAM,aAAa,WAAW;AAAA,EAC5C;AACJ;AAEA,SAAS,6BAA6B,UAA2D;AAG7F,QAAM,WAAW;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGJ,aAAW,WAAW,UAAU;AAC5B,UAAM,QAAQ,SAAS,MAAM,OAAO;AACpC,QAAI,OAAO;AACP,aAAO,EAAE,OAAO,KAAA;AAAA,IACpB;AAAA,EACJ;AACA,SAAO,EAAE,OAAO,MAAA;AACpB;AAOO,SAAS,uBAAuB,UAAmC,SAA2B;AACjG,MAAI,SAAS,WAAWC,uCAAiC,SAAS,OAAO;AACrE,UAAM,WAAW,SAAS;AAC1B,UAAM,cAAc,6BAA6B,QAAQ;AAEzD,QAAI,YAAY,OAAO;AACnB,YAAM,IAAIC,WAAAA,sCAAsC,SAAS,UAAU;AAAA,QAC/D,OAAO,EAAE,MAAM,OAAO,SAAS,MAAM,GAAG,SAAS,SAAA;AAAA,MAAS,CAC7D;AAAA,IACL;AAAA,EACJ;AACJ;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"Helpers.es.js","sources":["../../../src/exceptions/Helpers.ts"],"sourcesContent":["import { EditorResponse, Id } from '../types/CommonTypes';\nimport { connectorHttpErrorErrorCode, variableInvalidValueErrorCode } from './Codes';\nimport { ConnectorHttpError , VariableValueConstrainsViolationError } from './Exceptions';\n\nexport function throwEditorResponseError(response: EditorResponse<unknown>): never {\n const parsedError = response.error ?? 'Yikes, something went wrong';\n const parsedCause = {\n cause: {\n name: String(response.status),\n message: response.error ?? 'Yikes, something went wrong',\n },\n };\n\n if (response.status === connectorHttpErrorErrorCode) {\n const parsedErrorData = JSON.parse(response.data as string);\n const httpStatusCode = parsedErrorData['statusCode'] as number;\n\n throw new ConnectorHttpError(httpStatusCode, parsedError, parsedCause);\n } else {\n throw new Error(parsedError, parsedCause);\n }\n}\n\n\n\nfunction parseVariableConstraintError(errorMsg: string): { valid: boolean; variableId?: string } {\n // Only the listed formats are considered valid for constraint errors.\n // Extend with future use cases (i.e. character's limit error)\n const patterns = [\n /DateVariable '([^']+)' should not be part of excludedDays, \".*\" was given/,\n /DateVariable '([^']+)' expects \\$date to be > startDate:.*$/,\n /DateVariable '([^']+)' expects \\$date to be < endDate:.*$/,\n /NumberVariable '([^']+)' expects \\$extractedValue to be >= .+$/,\n /NumberVariable '([^']+)' expects \\$extractedValue to be <= .+$/,\n ];\n\n for (const pattern of patterns) {\n const match = errorMsg.match(pattern);\n if (match) {\n return { valid: true };\n }\n }\n return { valid: false };\n}\n\n/**\n * Variable-specific failure hook\n * Throws VariableValueConstrainsViolationError when the response matches a recognized constraint error;\n * otherwise returns so `getEditorResponseData` falls back to `throwEditorResponseError`.\n */\nexport function throwVariableException(response: EditorResponse<unknown>, context: { id: Id }): void {\n if (response.status === variableInvalidValueErrorCode && response.error) {\n const errorMsg = response.error;\n const parseResult = parseVariableConstraintError(errorMsg);\n\n if (parseResult.valid) {\n throw new VariableValueConstrainsViolationError(context, errorMsg, {\n cause: { name: String(response.status), message: errorMsg },\n });\n }\n }\n}\n"],"names":[],"mappings":";;AAIO,SAAS,yBAAyB,UAA0C;AAC/E,QAAM,cAAc,SAAS,SAAS;AACtC,QAAM,cAAc;AAAA,IAChB,OAAO;AAAA,MACH,MAAM,OAAO,SAAS,MAAM;AAAA,MAC5B,SAAS,SAAS,SAAS;AAAA,IAAA;AAAA,EAC/B;AAGJ,MAAI,SAAS,WAAW,6BAA6B;AACjD,UAAM,kBAAkB,KAAK,MAAM,SAAS,IAAc;AAC1D,UAAM,iBAAiB,gBAAgB,YAAY;AAEnD,UAAM,IAAI,mBAAmB,gBAAgB,aAAa,WAAW;AAAA,EACzE,OAAO;AACH,UAAM,IAAI,MAAM,aAAa,WAAW;AAAA,EAC5C;AACJ;AAIA,SAAS,6BAA6B,UAA2D;AAG7F,QAAM,WAAW;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGJ,aAAW,WAAW,UAAU;AAC5B,UAAM,QAAQ,SAAS,MAAM,OAAO;AACpC,QAAI,OAAO;AACP,aAAO,EAAE,OAAO,KAAA;AAAA,IACpB;AAAA,EACJ;AACA,SAAO,EAAE,OAAO,MAAA;AACpB;AAOO,SAAS,uBAAuB,UAAmC,SAA2B;AACjG,MAAI,SAAS,WAAW,iCAAiC,SAAS,OAAO;AACrE,UAAM,WAAW,SAAS;AAC1B,UAAM,cAAc,6BAA6B,QAAQ;AAEzD,QAAI,YAAY,OAAO;AACnB,YAAM,IAAI,sCAAsC,SAAS,UAAU;AAAA,QAC/D,OAAO,EAAE,MAAM,OAAO,SAAS,MAAM,GAAG,SAAS,SAAA;AAAA,MAAS,CAC7D;AAAA,IACL;AAAA,EACJ;AACJ;"}
1
+ {"version":3,"file":"Helpers.es.js","sources":["../../../src/exceptions/Helpers.ts"],"sourcesContent":["import { EditorResponse, Id } from '../types/CommonTypes';\nimport { connectorHttpErrorErrorCode, variableInvalidValueErrorCode } from './Codes';\nimport { ConnectorHttpError, VariableValueConstrainsViolationError } from './Exceptions';\n\nexport function throwEditorResponseError(response: EditorResponse<unknown>): never {\n const parsedError = response.error ?? 'Yikes, something went wrong';\n const parsedCause = {\n cause: {\n name: String(response.status),\n message: response.error ?? 'Yikes, something went wrong',\n },\n };\n\n if (response.status === connectorHttpErrorErrorCode) {\n const parsedErrorData = JSON.parse(response.data as string);\n const httpStatusCode = parsedErrorData['statusCode'] as number;\n\n throw new ConnectorHttpError(httpStatusCode, parsedError, parsedCause);\n } else {\n throw new Error(parsedError, parsedCause);\n }\n}\n\nfunction parseVariableConstraintError(errorMsg: string): { valid: boolean; variableId?: string } {\n // Only the listed formats are considered valid for constraint errors.\n // Extend with future use cases (i.e. character's limit error)\n const patterns = [\n /DateVariable '([^']+)' should not be part of excludedDays, \".*\" was given/,\n /DateVariable '([^']+)' expects \\$date to be > startDate:.*$/,\n /DateVariable '([^']+)' expects \\$date to be < endDate:.*$/,\n /NumberVariable '([^']+)' expects \\$extractedValue to be >= .+$/,\n /NumberVariable '([^']+)' expects \\$extractedValue to be <= .+$/,\n ];\n\n for (const pattern of patterns) {\n const match = errorMsg.match(pattern);\n if (match) {\n return { valid: true };\n }\n }\n return { valid: false };\n}\n\n/**\n * Variable-specific failure hook\n * Throws VariableValueConstrainsViolationError when the response matches a recognized constraint error;\n * otherwise returns so `getEditorResponseData` falls back to `throwEditorResponseError`.\n */\nexport function throwVariableException(response: EditorResponse<unknown>, context: { id: Id }): void {\n if (response.status === variableInvalidValueErrorCode && response.error) {\n const errorMsg = response.error;\n const parseResult = parseVariableConstraintError(errorMsg);\n\n if (parseResult.valid) {\n throw new VariableValueConstrainsViolationError(context, errorMsg, {\n cause: { name: String(response.status), message: errorMsg },\n });\n }\n }\n}\n"],"names":[],"mappings":";;AAIO,SAAS,yBAAyB,UAA0C;AAC/E,QAAM,cAAc,SAAS,SAAS;AACtC,QAAM,cAAc;AAAA,IAChB,OAAO;AAAA,MACH,MAAM,OAAO,SAAS,MAAM;AAAA,MAC5B,SAAS,SAAS,SAAS;AAAA,IAAA;AAAA,EAC/B;AAGJ,MAAI,SAAS,WAAW,6BAA6B;AACjD,UAAM,kBAAkB,KAAK,MAAM,SAAS,IAAc;AAC1D,UAAM,iBAAiB,gBAAgB,YAAY;AAEnD,UAAM,IAAI,mBAAmB,gBAAgB,aAAa,WAAW;AAAA,EACzE,OAAO;AACH,UAAM,IAAI,MAAM,aAAa,WAAW;AAAA,EAC5C;AACJ;AAEA,SAAS,6BAA6B,UAA2D;AAG7F,QAAM,WAAW;AAAA,IACb;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EAAA;AAGJ,aAAW,WAAW,UAAU;AAC5B,UAAM,QAAQ,SAAS,MAAM,OAAO;AACpC,QAAI,OAAO;AACP,aAAO,EAAE,OAAO,KAAA;AAAA,IACpB;AAAA,EACJ;AACA,SAAO,EAAE,OAAO,MAAA;AACpB;AAOO,SAAS,uBAAuB,UAAmC,SAA2B;AACjG,MAAI,SAAS,WAAW,iCAAiC,SAAS,OAAO;AACrE,UAAM,WAAW,SAAS;AAC1B,UAAM,cAAc,6BAA6B,QAAQ;AAEzD,QAAI,YAAY,OAAO;AACnB,YAAM,IAAI,sCAAsC,SAAS,UAAU;AAAA,QAC/D,OAAO,EAAE,MAAM,OAAO,SAAS,MAAM,GAAG,SAAS,SAAA;AAAA,MAAS,CAC7D;AAAA,IACL;AAAA,EACJ;AACJ;"}
@@ -8,8 +8,8 @@ const LayoutTypes = require("./types/LayoutTypes.cjs.js");
8
8
  const DocumentTypes = require("./types/DocumentTypes.cjs.js");
9
9
  const ViewModeTypes = require("./types/ViewModeTypes.cjs.js");
10
10
  const VariableTypes = require("./types/VariableTypes.cjs.js");
11
- const CommonTypes = require("./types/CommonTypes.cjs.js");
12
11
  const ColorStyleTypes = require("./types/ColorStyleTypes.cjs.js");
12
+ const CommonTypes = require("./types/CommonTypes.cjs.js");
13
13
  const GradientStyleTypes = require("./types/GradientStyleTypes.cjs.js");
14
14
  const ConnectorTypes = require("./types/ConnectorTypes.cjs.js");
15
15
  const FontConnectorTypes = require("./types/FontConnectorTypes.cjs.js");
@@ -75,9 +75,10 @@ exports.VariableType = VariableTypes.VariableType;
75
75
  exports.VariableVisibilityOperator = VariableTypes.VariableVisibilityOperator;
76
76
  exports.VariableVisibilityTargetType = VariableTypes.VariableVisibilityTargetType;
77
77
  exports.VariableVisibilityType = VariableTypes.VariableVisibilityType;
78
- exports.SDKUnauthorizedError = CommonTypes.SDKUnauthorizedError;
78
+ exports.APIColorType = ColorStyleTypes.APIColorType;
79
79
  exports.ColorType = ColorStyleTypes.ColorType;
80
80
  exports.ColorUsageType = ColorStyleTypes.ColorUsageType;
81
+ exports.SDKUnauthorizedError = CommonTypes.SDKUnauthorizedError;
81
82
  exports.GradientType = GradientStyleTypes.GradientType;
82
83
  exports.GradientUsageType = GradientStyleTypes.GradientUsageType;
83
84
  exports.AuthCredentialsTypeEnum = ConnectorTypes.AuthCredentialsTypeEnum;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -12,6 +12,7 @@ export type { FrameProperties, Layout, LayoutListItemType, LayoutPreset, LayoutP
12
12
  export { Day, Locale, VariableType, VariableVisibilityOperator, VariableVisibilityTargetType, VariableVisibilityType, DataSourceVariableDisplayOptionsType, DataSourceVariableSourceType, } from './types/VariableTypes';
13
13
  export type { AbsoluteDate, BooleanVariable, ConnectorImageVariableSource, DateRestriction, DateVariable, GroupVariable, ImageVariable, ListVariable, ListVariableItem, LongTextVariable, NumberVariable, RelativeDate, ShortTextVariable, ValueWithStyle, RichTextVariable, Variable, VariableVisibility, VariableVisibilityConditional, VariableVisibilityConditionValue, VariableVisibilityLayout, VariableWithValue, DataSourceVariable, DataSourceVariableDisplayOptions, DataSourceVariableDisplayOptionsList, DataSourceVariableDisplayOptionsTable, InjectedDataSourceVariableSource, ConnectorDataSourceVariableSource, DataSourceVariableSource, } from './types/VariableTypes';
14
14
  export type { Color, ColorUpdate, DocumentColor } from './types/ColorStyleTypes';
15
+ export { APIColorType } from './types/ColorStyleTypes';
15
16
  export type { AnimationPlaybackType, BasicAnimationsType, EaseTweenCombinationType, FrameAnimationPropertiesType, FrameAnimationType, } from './types/AnimationTypes';
16
17
  export type { ConfigType, EditorResponse, Id, InitialStateType, PageType, PrivateData, PropertyState, SelectedLayoutFrame, } from './types/CommonTypes';
17
18
  export { SDKUnauthorizedError } from './types/CommonTypes';
@@ -34,7 +35,7 @@ export * from './types/MediaConnectorTypes';
34
35
  export { Alignment, Case, FontWeights, Scripting, SelectedTextStyles, SelectedTextStyleSections, TextPosition, MarkedListType, } from './types/TextStyleTypes';
35
36
  export { NumberListFormat, NumberListSeparatorSymbol } from './types/ParagraphStyleTypes';
36
37
  export { WellKnownConfigurationKeys, FrameEditingMode } from './types/ConfigurationTypes';
37
- export type { APIBrandKit, APIBrandKitMedia, BrandKitCharacterStyle, BrandKitColor, BrandKitFont, APIBrandKitTheme, BrandKitMedia, BrandKitParagraphStyle, CMYK, CMYKColorValue, HEXColorValue, RGB, RGBColorValue, SpotCMYKColorValue, SpotHEXColorValue, SpotRGBColorValue, StudioBrandKit, BrandKitTheme, } from './types/BrandKitTypes';
38
+ export type { APIBrandKit, APIBrandKitMedia, APIBrandKitCharacterStyle, APIBrandKitColor, APIBrandKitFont, APIBrandKitTheme, BrandKitMedia, APIBrandKitParagraphStyle, CMYK, CMYKColorValue, HEXColorValue, RGB, RGBColorValue, SpotCMYKColorValue, SpotHEXColorValue, SpotRGBColorValue, BrandKit, } from './types/BrandKitTypes';
38
39
  export type { ComponentGridSettings, FixedComponentGridSettings } from './types/ComponentGridTypes';
39
40
  export { ComponentGridLayoutAlgorithm } from './types/ComponentGridTypes';
40
41
  export * from './types/ActionTypes';
@@ -6,8 +6,8 @@ import { ConstraintMode, LayoutIntent, LayoutType, PositionEnum } from "./types/
6
6
  import { DocumentIssueTypeEnum, DocumentType } from "./types/DocumentTypes.es.js";
7
7
  import { ViewMode } from "./types/ViewModeTypes.es.js";
8
8
  import { DataSourceVariableDisplayOptionsType, DataSourceVariableSourceType, Day, Locale, VariableType, VariableVisibilityOperator, VariableVisibilityTargetType, VariableVisibilityType } from "./types/VariableTypes.es.js";
9
+ import { APIColorType, ColorType, ColorUsageType } from "./types/ColorStyleTypes.es.js";
9
10
  import { SDKUnauthorizedError } from "./types/CommonTypes.es.js";
10
- import { ColorType, ColorUsageType } from "./types/ColorStyleTypes.es.js";
11
11
  import { GradientType, GradientUsageType } from "./types/GradientStyleTypes.es.js";
12
12
  import { AuthCredentialsTypeEnum, AuthRefreshTypeEnum, ConnectorConfigContextType, ConnectorConfigValueType, ConnectorEventType, ConnectorMapping, ConnectorMappingDirection, ConnectorMappingSource, ConnectorRegistrationSource, ConnectorStateType, ConnectorSupportedAuth, ConnectorType, DeprecatedMediaConnectorDownloadType, DeprecatedMediaType, GrafxTokenAuthCredentials, MediaType, RefreshedAuthCredendentials, SortBy, SortOrder, UploadAssetValidationError, UploadAssetValidationErrorType, grafxMediaConnectorRegistration } from "./types/ConnectorTypes.es.js";
13
13
  import { FontPreviewFormat } from "./types/FontConnectorTypes.es.js";
@@ -27,6 +27,7 @@ import { ActionAsyncError, DataRowAsyncError } from "./exceptions/AsyncException
27
27
  import * as index from "./next/index.es.js";
28
28
  import { MeasurementUnit } from "./connector-types/src/Common.es.js";
29
29
  export {
30
+ APIColorType,
30
31
  ActionAsyncError,
31
32
  ActionEditorEvent,
32
33
  Alignment,
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const BrandKitController = require("./controllers/BrandKitController.cjs.js");
4
3
  const SubscriberController = require("./controllers/SubscriberController.cjs.js");
5
4
  const VariableController = require("./controllers/VariableController.cjs.js");
6
5
  const ConnectorController = require("./controllers/ConnectorController.cjs.js");
@@ -21,7 +20,6 @@ class NextInitiator {
21
20
  this.connector = new ConnectorController.ConnectorController(this.editorAPI);
22
21
  this.page = new PageController.PageController(this.editorAPI);
23
22
  this.canvas = new CanvasController.CanvasController(this.editorAPI);
24
- this.brandKit = new BrandKitController.BrandKitController(this.editorAPI);
25
23
  }
26
24
  }
27
25
  exports.NextInitiator = NextInitiator;
@@ -1 +1 @@
1
- {"version":3,"file":"NextInitiator.cjs.js","sources":["../../../src/next/NextInitiator.ts"],"sourcesContent":["import { Connection } from 'penpal';\nimport { EditorAPI, RuntimeConfigType } from '../types/CommonTypes';\nimport { BrandKitController } from './controllers/BrandKitController';\nimport { SubscriberController } from './controllers/SubscriberController';\nimport { VariableController } from './controllers/VariableController';\nimport { ConnectorController } from './controllers/ConnectorController';\nimport { PageController } from './controllers/PageController';\nimport { CanvasController } from '../controllers/CanvasController';\n\n/**\n * The next initiator is a split off on SDK level to tag next features.\n * The principle is that all breaking changes that we are anticipating, come into this section of the SDK.\n * This allows us to introduce breaking changes before bumping the SDK Major version, since we want to bundle some of them.\n * This way our major version can stay stable for longer, without sacrificing the flexibility we need to innovate.\n * Together with a major update, the functions and additions in this part of the SDK will be moved to the main part.\n * If you're using the next controller, you might need to import the typings also from the next types.\n * this can be referenced in your application as @chili-publish/studio-sdk/lib/src/next\n */\nexport class NextInitiator {\n private config: RuntimeConfigType;\n private connection: Connection;\n\n /**\n * @ignore\n */\n private editorAPI: EditorAPI;\n\n subscriber: SubscriberController;\n variable: VariableController;\n connector: ConnectorController;\n page: PageController;\n canvas: CanvasController;\n brandKit: BrandKitController;\n\n /**\n * The next initiator is a split off on SDK level to tag next features\n * The SDK should be configured clientside and it exposes all controllers to work with in other applications\n * @param config The configuration object where the SDK and editor can get configured\n */\n constructor(config: RuntimeConfigType, connection: Connection, editorAPI: EditorAPI) {\n this.config = config;\n this.connection = connection;\n this.editorAPI = editorAPI;\n\n this.subscriber = new SubscriberController(config);\n this.variable = new VariableController(this.editorAPI);\n this.connector = new ConnectorController(this.editorAPI);\n this.page = new PageController(this.editorAPI);\n this.canvas = new CanvasController(this.editorAPI);\n this.brandKit = new BrandKitController(this.editorAPI);\n }\n}\n"],"names":["SubscriberController","VariableController","ConnectorController","PageController","CanvasController","BrandKitController"],"mappings":";;;;;;;;AAkBO,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBvB,YAAY,QAA2B,YAAwB,WAAsB;AACjF,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,YAAY;AAEjB,SAAK,aAAa,IAAIA,qBAAAA,qBAAqB,MAAM;AACjD,SAAK,WAAW,IAAIC,sCAAmB,KAAK,SAAS;AACrD,SAAK,YAAY,IAAIC,wCAAoB,KAAK,SAAS;AACvD,SAAK,OAAO,IAAIC,8BAAe,KAAK,SAAS;AAC7C,SAAK,SAAS,IAAIC,kCAAiB,KAAK,SAAS;AACjD,SAAK,WAAW,IAAIC,sCAAmB,KAAK,SAAS;AAAA,EACzD;AACJ;;"}
1
+ {"version":3,"file":"NextInitiator.cjs.js","sources":["../../../src/next/NextInitiator.ts"],"sourcesContent":["import { Connection } from 'penpal';\nimport { EditorAPI, RuntimeConfigType } from '../types/CommonTypes';\nimport { SubscriberController } from './controllers/SubscriberController';\nimport { VariableController } from './controllers/VariableController';\nimport { ConnectorController } from './controllers/ConnectorController';\nimport { PageController } from './controllers/PageController';\nimport { CanvasController } from '../controllers/CanvasController';\n\n/**\n * The next initiator is a split off on SDK level to tag next features.\n * The principle is that all breaking changes that we are anticipating, come into this section of the SDK.\n * This allows us to introduce breaking changes before bumping the SDK Major version, since we want to bundle some of them.\n * This way our major version can stay stable for longer, without sacrificing the flexibility we need to innovate.\n * Together with a major update, the functions and additions in this part of the SDK will be moved to the main part.\n * If you're using the next controller, you might need to import the typings also from the next types.\n * this can be referenced in your application as @chili-publish/studio-sdk/lib/src/next\n */\nexport class NextInitiator {\n private config: RuntimeConfigType;\n private connection: Connection;\n\n /**\n * @ignore\n */\n private editorAPI: EditorAPI;\n\n subscriber: SubscriberController;\n variable: VariableController;\n connector: ConnectorController;\n page: PageController;\n canvas: CanvasController;\n\n /**\n * The next initiator is a split off on SDK level to tag next features\n * The SDK should be configured clientside and it exposes all controllers to work with in other applications\n * @param config The configuration object where the SDK and editor can get configured\n */\n constructor(config: RuntimeConfigType, connection: Connection, editorAPI: EditorAPI) {\n this.config = config;\n this.connection = connection;\n this.editorAPI = editorAPI;\n\n this.subscriber = new SubscriberController(config);\n this.variable = new VariableController(this.editorAPI);\n this.connector = new ConnectorController(this.editorAPI);\n this.page = new PageController(this.editorAPI);\n this.canvas = new CanvasController(this.editorAPI);\n }\n}\n"],"names":["SubscriberController","VariableController","ConnectorController","PageController","CanvasController"],"mappings":";;;;;;;AAiBO,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBvB,YAAY,QAA2B,YAAwB,WAAsB;AACjF,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,YAAY;AAEjB,SAAK,aAAa,IAAIA,qBAAAA,qBAAqB,MAAM;AACjD,SAAK,WAAW,IAAIC,sCAAmB,KAAK,SAAS;AACrD,SAAK,YAAY,IAAIC,wCAAoB,KAAK,SAAS;AACvD,SAAK,OAAO,IAAIC,8BAAe,KAAK,SAAS;AAC7C,SAAK,SAAS,IAAIC,kCAAiB,KAAK,SAAS;AAAA,EACrD;AACJ;;"}
@@ -1,6 +1,5 @@
1
1
  import { Connection } from 'penpal';
2
2
  import { EditorAPI, RuntimeConfigType } from '../types/CommonTypes';
3
- import { BrandKitController } from './controllers/BrandKitController';
4
3
  import { SubscriberController } from './controllers/SubscriberController';
5
4
  import { VariableController } from './controllers/VariableController';
6
5
  import { ConnectorController } from './controllers/ConnectorController';
@@ -27,7 +26,6 @@ export declare class NextInitiator {
27
26
  connector: ConnectorController;
28
27
  page: PageController;
29
28
  canvas: CanvasController;
30
- brandKit: BrandKitController;
31
29
  /**
32
30
  * The next initiator is a split off on SDK level to tag next features
33
31
  * The SDK should be configured clientside and it exposes all controllers to work with in other applications
@@ -1,4 +1,3 @@
1
- import { BrandKitController } from "./controllers/BrandKitController.es.js";
2
1
  import { SubscriberController } from "./controllers/SubscriberController.es.js";
3
2
  import { VariableController } from "./controllers/VariableController.es.js";
4
3
  import { ConnectorController } from "./controllers/ConnectorController.es.js";
@@ -19,7 +18,6 @@ class NextInitiator {
19
18
  this.connector = new ConnectorController(this.editorAPI);
20
19
  this.page = new PageController(this.editorAPI);
21
20
  this.canvas = new CanvasController(this.editorAPI);
22
- this.brandKit = new BrandKitController(this.editorAPI);
23
21
  }
24
22
  }
25
23
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"NextInitiator.es.js","sources":["../../../src/next/NextInitiator.ts"],"sourcesContent":["import { Connection } from 'penpal';\nimport { EditorAPI, RuntimeConfigType } from '../types/CommonTypes';\nimport { BrandKitController } from './controllers/BrandKitController';\nimport { SubscriberController } from './controllers/SubscriberController';\nimport { VariableController } from './controllers/VariableController';\nimport { ConnectorController } from './controllers/ConnectorController';\nimport { PageController } from './controllers/PageController';\nimport { CanvasController } from '../controllers/CanvasController';\n\n/**\n * The next initiator is a split off on SDK level to tag next features.\n * The principle is that all breaking changes that we are anticipating, come into this section of the SDK.\n * This allows us to introduce breaking changes before bumping the SDK Major version, since we want to bundle some of them.\n * This way our major version can stay stable for longer, without sacrificing the flexibility we need to innovate.\n * Together with a major update, the functions and additions in this part of the SDK will be moved to the main part.\n * If you're using the next controller, you might need to import the typings also from the next types.\n * this can be referenced in your application as @chili-publish/studio-sdk/lib/src/next\n */\nexport class NextInitiator {\n private config: RuntimeConfigType;\n private connection: Connection;\n\n /**\n * @ignore\n */\n private editorAPI: EditorAPI;\n\n subscriber: SubscriberController;\n variable: VariableController;\n connector: ConnectorController;\n page: PageController;\n canvas: CanvasController;\n brandKit: BrandKitController;\n\n /**\n * The next initiator is a split off on SDK level to tag next features\n * The SDK should be configured clientside and it exposes all controllers to work with in other applications\n * @param config The configuration object where the SDK and editor can get configured\n */\n constructor(config: RuntimeConfigType, connection: Connection, editorAPI: EditorAPI) {\n this.config = config;\n this.connection = connection;\n this.editorAPI = editorAPI;\n\n this.subscriber = new SubscriberController(config);\n this.variable = new VariableController(this.editorAPI);\n this.connector = new ConnectorController(this.editorAPI);\n this.page = new PageController(this.editorAPI);\n this.canvas = new CanvasController(this.editorAPI);\n this.brandKit = new BrandKitController(this.editorAPI);\n }\n}\n"],"names":[],"mappings":";;;;;;AAkBO,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBvB,YAAY,QAA2B,YAAwB,WAAsB;AACjF,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,YAAY;AAEjB,SAAK,aAAa,IAAI,qBAAqB,MAAM;AACjD,SAAK,WAAW,IAAI,mBAAmB,KAAK,SAAS;AACrD,SAAK,YAAY,IAAI,oBAAoB,KAAK,SAAS;AACvD,SAAK,OAAO,IAAI,eAAe,KAAK,SAAS;AAC7C,SAAK,SAAS,IAAI,iBAAiB,KAAK,SAAS;AACjD,SAAK,WAAW,IAAI,mBAAmB,KAAK,SAAS;AAAA,EACzD;AACJ;"}
1
+ {"version":3,"file":"NextInitiator.es.js","sources":["../../../src/next/NextInitiator.ts"],"sourcesContent":["import { Connection } from 'penpal';\nimport { EditorAPI, RuntimeConfigType } from '../types/CommonTypes';\nimport { SubscriberController } from './controllers/SubscriberController';\nimport { VariableController } from './controllers/VariableController';\nimport { ConnectorController } from './controllers/ConnectorController';\nimport { PageController } from './controllers/PageController';\nimport { CanvasController } from '../controllers/CanvasController';\n\n/**\n * The next initiator is a split off on SDK level to tag next features.\n * The principle is that all breaking changes that we are anticipating, come into this section of the SDK.\n * This allows us to introduce breaking changes before bumping the SDK Major version, since we want to bundle some of them.\n * This way our major version can stay stable for longer, without sacrificing the flexibility we need to innovate.\n * Together with a major update, the functions and additions in this part of the SDK will be moved to the main part.\n * If you're using the next controller, you might need to import the typings also from the next types.\n * this can be referenced in your application as @chili-publish/studio-sdk/lib/src/next\n */\nexport class NextInitiator {\n private config: RuntimeConfigType;\n private connection: Connection;\n\n /**\n * @ignore\n */\n private editorAPI: EditorAPI;\n\n subscriber: SubscriberController;\n variable: VariableController;\n connector: ConnectorController;\n page: PageController;\n canvas: CanvasController;\n\n /**\n * The next initiator is a split off on SDK level to tag next features\n * The SDK should be configured clientside and it exposes all controllers to work with in other applications\n * @param config The configuration object where the SDK and editor can get configured\n */\n constructor(config: RuntimeConfigType, connection: Connection, editorAPI: EditorAPI) {\n this.config = config;\n this.connection = connection;\n this.editorAPI = editorAPI;\n\n this.subscriber = new SubscriberController(config);\n this.variable = new VariableController(this.editorAPI);\n this.connector = new ConnectorController(this.editorAPI);\n this.page = new PageController(this.editorAPI);\n this.canvas = new CanvasController(this.editorAPI);\n }\n}\n"],"names":[],"mappings":";;;;;AAiBO,MAAM,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAoBvB,YAAY,QAA2B,YAAwB,WAAsB;AACjF,SAAK,SAAS;AACd,SAAK,aAAa;AAClB,SAAK,YAAY;AAEjB,SAAK,aAAa,IAAI,qBAAqB,MAAM;AACjD,SAAK,WAAW,IAAI,mBAAmB,KAAK,SAAS;AACrD,SAAK,YAAY,IAAI,oBAAoB,KAAK,SAAS;AACvD,SAAK,OAAO,IAAI,eAAe,KAAK,SAAS;AAC7C,SAAK,SAAS,IAAI,iBAAiB,KAAK,SAAS;AAAA,EACrD;AACJ;"}
@@ -3,4 +3,3 @@ export type { ConnectorGrafxRegistration, ConnectorInstance, ConnectorLocalRegis
3
3
  export type { NextSubscribers } from './types/NextSubscribers';
4
4
  export type { ListVariable } from './types/VariableTypes';
5
5
  export type { PageSize } from './types/PageTypes';
6
- export type { APIBrandKit, APIBrandKitCharacterStyle, APIBrandKitColor, APIBrandKitFont, APIBrandKitMedia, APIBrandKitParagraphStyle, BrandKit, } from './types/BrandKitTypes';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const current = "2.27.0-rc.0";
3
+ const current = "2.28.latest";
4
4
  const engineInfo = {
5
5
  current
6
6
  };
@@ -1,4 +1,4 @@
1
- const current = "2.27.0-rc.0";
1
+ const current = "2.28.latest";
2
2
  const engineInfo = {
3
3
  current
4
4
  };
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const version = "1.44.0";
3
+ const version = "1.45.0";
4
4
  const packageInfo = {
5
5
  version
6
6
  };
@@ -1,4 +1,4 @@
1
- const version = "1.44.0";
1
+ const version = "1.45.0";
2
2
  const packageInfo = {
3
3
  version
4
4
  };