@chili-publish/studio-sdk 1.44.1 → 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,5 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ var APIColorType = /* @__PURE__ */ ((APIColorType2) => {
4
+ APIColorType2["rgb"] = "rgb";
5
+ APIColorType2["hex"] = "hex";
6
+ APIColorType2["cmyk"] = "cmyk";
7
+ APIColorType2["spotCmyk"] = "spotCmyk";
8
+ APIColorType2["spotRgb"] = "spotRgb";
9
+ APIColorType2["spotHex"] = "spotHex";
10
+ return APIColorType2;
11
+ })(APIColorType || {});
3
12
  var ColorType = /* @__PURE__ */ ((ColorType2) => {
4
13
  ColorType2["rgb"] = "rgb";
5
14
  ColorType2["hex"] = "hex";
@@ -18,6 +27,7 @@ var ColorUsageType = /* @__PURE__ */ ((ColorUsageType2) => {
18
27
  ColorUsageType2["stylekit"] = "brandKit";
19
28
  return ColorUsageType2;
20
29
  })(ColorUsageType || {});
30
+ exports.APIColorType = APIColorType;
21
31
  exports.ColorType = ColorType;
22
32
  exports.ColorUsageType = ColorUsageType;
23
33
  //# sourceMappingURL=ColorStyleTypes.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ColorStyleTypes.cjs.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n | RGBColor\n | CMYKColor\n | HSLColor\n | GrayColor\n | SpotColor\n | HexColor\n | SpotColorCMYK\n | SpotColorRGB\n | SpotColorHEX;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n id: string;\n name: string;\n color: Color;\n};\n\nexport type ColorUsageUpdate = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: ColorUpdate;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n /**\n * Indicates if the color will be applied or not.\n */\n isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: Color;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n};\n\nexport enum ColorUsageType {\n /**\n * The color is defined locally on the object\n */\n local = 'local',\n /**\n * The color is referencing a document color\n */\n brandKit = 'brandKit',\n /**\n * @deprecated use brandKit instead\n *\n * The color is referencing a brand kit color\n */\n stylekit = 'brandKit',\n}\n"],"names":["ColorType","ColorUsageType"],"mappings":";;AAUO,IAAK,8BAAAA,eAAL;AACHA,aAAA,KAAA,IAAM;AACNA,aAAA,KAAA,IAAM;AACNA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AAINA,aAAA,MAAA,IAAO;AACPA,aAAA,UAAA,IAAW;AACXA,aAAA,SAAA,IAAU;AACVA,aAAA,SAAA,IAAU;AAZF,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAyIL,IAAK,mCAAAC,oBAAL;AAIHA,kBAAA,OAAA,IAAQ;AAIRA,kBAAA,UAAA,IAAW;AAMXA,kBAAA,UAAA,IAAW;AAdH,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;;;"}
1
+ {"version":3,"file":"ColorStyleTypes.cjs.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n | RGBColor\n | CMYKColor\n | HSLColor\n | GrayColor\n | SpotColor\n | HexColor\n | SpotColorCMYK\n | SpotColorRGB\n | SpotColorHEX;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n id: string;\n name: string;\n color: Color;\n};\n\nexport type ColorUsageUpdate = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: ColorUpdate;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n /**\n * Indicates if the color will be applied or not.\n */\n isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: Color;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n};\n\nexport enum ColorUsageType {\n /**\n * The color is defined locally on the object\n */\n local = 'local',\n /**\n * The color is referencing a document color\n */\n brandKit = 'brandKit',\n /**\n * @deprecated use brandKit instead\n *\n * The color is referencing a brand kit color\n */\n stylekit = 'brandKit',\n}\n"],"names":["APIColorType","ColorType","ColorUsageType"],"mappings":";;AAEO,IAAK,iCAAAA,kBAAL;AACHA,gBAAA,KAAA,IAAM;AACNA,gBAAA,KAAA,IAAM;AACNA,gBAAA,MAAA,IAAO;AACPA,gBAAA,UAAA,IAAW;AACXA,gBAAA,SAAA,IAAU;AACVA,gBAAA,SAAA,IAAU;AANF,SAAAA;AAAA,GAAA,gBAAA,CAAA,CAAA;AAQL,IAAK,8BAAAC,eAAL;AACHA,aAAA,KAAA,IAAM;AACNA,aAAA,KAAA,IAAM;AACNA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AAINA,aAAA,MAAA,IAAO;AACPA,aAAA,UAAA,IAAW;AACXA,aAAA,SAAA,IAAU;AACVA,aAAA,SAAA,IAAU;AAZF,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAyIL,IAAK,mCAAAC,oBAAL;AAIHA,kBAAA,OAAA,IAAQ;AAIRA,kBAAA,UAAA,IAAW;AAMXA,kBAAA,UAAA,IAAW;AAdH,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;;;;"}
@@ -1,3 +1,12 @@
1
+ var APIColorType = /* @__PURE__ */ ((APIColorType2) => {
2
+ APIColorType2["rgb"] = "rgb";
3
+ APIColorType2["hex"] = "hex";
4
+ APIColorType2["cmyk"] = "cmyk";
5
+ APIColorType2["spotCmyk"] = "spotCmyk";
6
+ APIColorType2["spotRgb"] = "spotRgb";
7
+ APIColorType2["spotHex"] = "spotHex";
8
+ return APIColorType2;
9
+ })(APIColorType || {});
1
10
  var ColorType = /* @__PURE__ */ ((ColorType2) => {
2
11
  ColorType2["rgb"] = "rgb";
3
12
  ColorType2["hex"] = "hex";
@@ -17,6 +26,7 @@ var ColorUsageType = /* @__PURE__ */ ((ColorUsageType2) => {
17
26
  return ColorUsageType2;
18
27
  })(ColorUsageType || {});
19
28
  export {
29
+ APIColorType,
20
30
  ColorType,
21
31
  ColorUsageType
22
32
  };
@@ -1 +1 @@
1
- {"version":3,"file":"ColorStyleTypes.es.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n | RGBColor\n | CMYKColor\n | HSLColor\n | GrayColor\n | SpotColor\n | HexColor\n | SpotColorCMYK\n | SpotColorRGB\n | SpotColorHEX;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n id: string;\n name: string;\n color: Color;\n};\n\nexport type ColorUsageUpdate = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: ColorUpdate;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n /**\n * Indicates if the color will be applied or not.\n */\n isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: Color;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n};\n\nexport enum ColorUsageType {\n /**\n * The color is defined locally on the object\n */\n local = 'local',\n /**\n * The color is referencing a document color\n */\n brandKit = 'brandKit',\n /**\n * @deprecated use brandKit instead\n *\n * The color is referencing a brand kit color\n */\n stylekit = 'brandKit',\n}\n"],"names":["ColorType","ColorUsageType"],"mappings":"AAUO,IAAK,8BAAAA,eAAL;AACHA,aAAA,KAAA,IAAM;AACNA,aAAA,KAAA,IAAM;AACNA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AAINA,aAAA,MAAA,IAAO;AACPA,aAAA,UAAA,IAAW;AACXA,aAAA,SAAA,IAAU;AACVA,aAAA,SAAA,IAAU;AAZF,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAyIL,IAAK,mCAAAC,oBAAL;AAIHA,kBAAA,OAAA,IAAQ;AAIRA,kBAAA,UAAA,IAAW;AAMXA,kBAAA,UAAA,IAAW;AAdH,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"ColorStyleTypes.es.js","sources":["../../../src/types/ColorStyleTypes.ts"],"sourcesContent":["import { Id } from './CommonTypes';\n\nexport enum APIColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n spotCmyk = 'spotCmyk',\n spotRgb = 'spotRgb',\n spotHex = 'spotHex',\n}\nexport enum ColorType {\n rgb = 'rgb',\n hex = 'hex',\n cmyk = 'cmyk',\n gray = 'gray',\n hsl = 'hsl',\n /**\n * @deprecated Use spotCMYK or spotRGB instead\n */\n spot = 'spot',\n spotCMYK = 'spotCMYK',\n spotRGB = 'spotRGB',\n spotHEX = 'spotHEX',\n}\n\nexport type RGBColor = {\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type CMYKColor = {\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type HSLColor = {\n h: number;\n s: number;\n l: number;\n type: ColorType;\n};\n\nexport type GrayColor = {\n g: number;\n type: ColorType;\n};\n\n/**\n * @deprecated Use SpotColorCMYK or SpotColorRGB instead\n */\nexport type SpotColor = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorCMYK = {\n spotName: string;\n c: number;\n m: number;\n y: number;\n k: number;\n type: ColorType;\n};\n\nexport type SpotColorRGB = {\n spotName: string;\n r: number;\n g: number;\n b: number;\n type: ColorType;\n};\n\nexport type SpotColorHEX = {\n spotName: string;\n value: string;\n type: ColorType;\n};\n\nexport type HexColor = {\n value: string;\n type: ColorType;\n};\n\nexport type Color =\n | RGBColor\n | CMYKColor\n | HSLColor\n | GrayColor\n | SpotColor\n | HexColor\n | SpotColorCMYK\n | SpotColorRGB\n | SpotColorHEX;\n\nexport type ColorUpdate = Color;\n\nexport type DocumentColor = {\n id: string;\n name: string;\n color: Color;\n};\n\nexport type ColorUsageUpdate = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: ColorUpdate;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n /**\n * Indicates if the color will be applied or not.\n */\n isApplied?: boolean;\n};\n\nexport type ColorUsage = {\n /**\n * Reference to the brand kit color, can only be used if it is a brand kit color.\n */\n id?: Id;\n /**\n * The local color object, can only be used if it is a local color.\n */\n color?: Color;\n type: ColorUsageType;\n /**\n * Opacity of the color (0-100) where 0 = fully transparent.\n */\n opacity?: number;\n};\n\nexport enum ColorUsageType {\n /**\n * The color is defined locally on the object\n */\n local = 'local',\n /**\n * The color is referencing a document color\n */\n brandKit = 'brandKit',\n /**\n * @deprecated use brandKit instead\n *\n * The color is referencing a brand kit color\n */\n stylekit = 'brandKit',\n}\n"],"names":["APIColorType","ColorType","ColorUsageType"],"mappings":"AAEO,IAAK,iCAAAA,kBAAL;AACHA,gBAAA,KAAA,IAAM;AACNA,gBAAA,KAAA,IAAM;AACNA,gBAAA,MAAA,IAAO;AACPA,gBAAA,UAAA,IAAW;AACXA,gBAAA,SAAA,IAAU;AACVA,gBAAA,SAAA,IAAU;AANF,SAAAA;AAAA,GAAA,gBAAA,CAAA,CAAA;AAQL,IAAK,8BAAAC,eAAL;AACHA,aAAA,KAAA,IAAM;AACNA,aAAA,KAAA,IAAM;AACNA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AACPA,aAAA,KAAA,IAAM;AAINA,aAAA,MAAA,IAAO;AACPA,aAAA,UAAA,IAAW;AACXA,aAAA,SAAA,IAAU;AACVA,aAAA,SAAA,IAAU;AAZF,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAyIL,IAAK,mCAAAC,oBAAL;AAIHA,kBAAA,OAAA,IAAQ;AAIRA,kBAAA,UAAA,IAAW;AAMXA,kBAAA,UAAA,IAAW;AAdH,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;"}
@@ -11,6 +11,7 @@ var LogCategory = /* @__PURE__ */ ((LogCategory2) => {
11
11
  LogCategory2["connector"] = "connector";
12
12
  LogCategory2["event"] = "event";
13
13
  LogCategory2["engine"] = "engine";
14
+ LogCategory2["sdk"] = "sdk";
14
15
  return LogCategory2;
15
16
  })(LogCategory || {});
16
17
  var CallbackErrorBehavior = /* @__PURE__ */ ((CallbackErrorBehavior2) => {
@@ -1 +1 @@
1
- {"version":3,"file":"CommonTypes.cjs.js","sources":["../../../src/types/CommonTypes.ts"],"sourcesContent":["import { CallSender } from 'penpal';\nimport { ConnectorInstance, DocumentAction, DocumentFontFamily, ToolType, ViewMode } from '..';\nimport { EngineCallbackHandler } from '../utils/EngineCallbackHandler';\nimport { EngineEvent } from '../utils/EngineEvent';\nimport { AnimationPlaybackType, FrameAnimationType } from './AnimationTypes';\nimport { BarcodeFrameValidationResult } from './BarcodeTypes';\nimport { CharacterStyle } from './CharacterStyleTypes';\nimport { DocumentColor } from './ColorStyleTypes';\nimport { StudioOptionsDeltaUpdate, StudioStyling } from './ConfigurationTypes';\nimport { AuthCredentials, AuthRefreshRequest, ConnectorEvent } from './ConnectorTypes';\nimport { DocumentIssue, DocumentType, UndoState } from './DocumentTypes';\nimport { EngineEditMode } from './EngineEditModeTypes';\nimport type { FrameType } from './FrameTypes';\nimport { Frame, FrameLayoutType, FrameTypeEnum } from './FrameTypes';\nimport { LayoutListItemType, LayoutPropertiesType, LayoutWithFrameProperties, MeasurementUnit } from './LayoutTypes';\nimport { Page, PageSize } from './PageTypes';\nimport { ParagraphStyle } from './ParagraphStyleTypes';\nimport { CornerRadiusUpdateModel } from './ShapeTypes';\nimport { SelectedTextStyle } from './TextStyleTypes';\nimport { Variable } from './VariableTypes';\nimport { Viewport } from './ViewportTypes';\nimport { BrandKitMedia } from './BrandKitTypes';\nimport { AsyncError } from '../exceptions';\n\nexport type Id = string;\nexport type BaseConfigType = {\n editorLink?: string;\n editorId?: string;\n chiliEnvironmentUrl?: string;\n documentType?: DocumentType;\n studioStyling?: StudioStyling;\n studioOptions?: StudioOptionsDeltaUpdate;\n /**\n * Whether the engine should cache query calls.\n * When enabled it will cache the query calls regardless of the cache control headers.\n */\n enableQueryCallCache?: boolean;\n enableNextSubscribers?: {\n onVariableListChanged: boolean;\n };\n logging?: {\n logLevel?: LogLevel;\n logger?: LoggerFunction;\n };\n /**\n * Callback function that is called when an error occurs during iframe setup or connection.\n * @param error The error that occurred during setup or connection\n */\n onConnectionError?: (error: Error) => void;\n};\n\nexport type LoggerFunction = (logLevel: LogLevel, category: LogCategory, message: string) => void;\n\nexport enum LogLevel {\n info = 'info',\n warn = 'warn',\n error = 'error',\n}\n\nexport enum LogCategory {\n general = 'general',\n connector = 'connector',\n event = 'event',\n engine = 'engine',\n}\n\n/**\n * Defines the behavior when encountering an error in the event / handler callback.\n */\nexport enum CallbackErrorBehavior {\n /**\n * Throws an error when encountering an error in a callback.\n */\n throw = 'throw',\n\n /**\n * Logs the error when encountering an error in a callback.\n */\n log = 'log',\n}\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type ManagedCallbacksConfigType = {\n handlers: {\n onAuthExpired: EngineCallbackHandler<\n (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>\n >;\n onViewportRequested: EngineCallbackHandler<() => Viewport | null>;\n };\n events: {\n onActionsChanged: EngineEvent<(state: DocumentAction[]) => MaybePromise<void>>;\n onStateChanged: EngineEvent<() => MaybePromise<void>>;\n onDocumentLoaded: EngineEvent<() => MaybePromise<void>>;\n onSelectedFramesLayoutChanged: EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>;\n onFramesLayoutChanged: EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>;\n onSelectedFramesContentChanged: EngineEvent<(state: Frame[]) => MaybePromise<void>>;\n onPageSelectionChanged: EngineEvent<(id: Id) => MaybePromise<void>>;\n onSelectedLayoutPropertiesChanged: EngineEvent<(state: LayoutPropertiesType) => MaybePromise<void>>;\n onSelectedLayoutUnitChanged: EngineEvent<(unit: MeasurementUnit) => MaybePromise<void>>;\n onScrubberPositionChanged: EngineEvent<(state: AnimationPlaybackType) => MaybePromise<void>>;\n onFrameAnimationsChanged: EngineEvent<(animationState: FrameAnimationType[]) => MaybePromise<void>>;\n onVariableListChanged: EngineEvent<(variableList: Variable[]) => MaybePromise<void>>;\n onSelectedToolChanged: EngineEvent<(tool: ToolType) => MaybePromise<void>>;\n onUndoStackStateChanged: EngineEvent<(undoStackState: UndoState) => MaybePromise<void>>;\n onSelectedLayoutFramesChanged: EngineEvent<(frames: SelectedLayoutFrame[]) => MaybePromise<void>>;\n onSelectedTextStyleChanged: EngineEvent<(styles: SelectedTextStyle) => MaybePromise<void>>;\n onColorsChanged: EngineEvent<(colors: DocumentColor[]) => MaybePromise<void>>;\n onParagraphStylesChanged: EngineEvent<(paragraphStyles: ParagraphStyle[]) => MaybePromise<void>>;\n onCharacterStylesChanged: EngineEvent<(characterStyles: CharacterStyle[]) => MaybePromise<void>>;\n onFontFamiliesChanged: EngineEvent<(fontFamilies: DocumentFontFamily[]) => MaybePromise<void>>;\n onSelectedLayoutIdChanged: EngineEvent<(layoutId: string) => MaybePromise<void>>;\n onLayoutsChanged: EngineEvent<(layouts: LayoutListItemType[]) => MaybePromise<void>>;\n onConnectorEvent: EngineEvent<(event: ConnectorEvent) => MaybePromise<void>>;\n onConnectorsChanged: EngineEvent<(connectors: ConnectorInstance[]) => MaybePromise<void>>;\n onZoomChanged: EngineEvent<(scaleFactor: number) => MaybePromise<void>>;\n onSelectedPageIdChanged: EngineEvent<(pageId: Id) => MaybePromise<void>>;\n onPagesChanged: EngineEvent<(pages: Page[]) => MaybePromise<void>>;\n onPageSnapshotInvalidated: EngineEvent<(pageId: Id) => MaybePromise<void>>;\n onPageSizeChanged: EngineEvent<(pageSize: PageSize) => MaybePromise<void>>;\n onShapeCornerRadiusChanged: EngineEvent<(cornerRadius: CornerRadiusUpdateModel) => MaybePromise<void>>;\n onCropActiveFrameIdChanged: EngineEvent<(id?: Id) => MaybePromise<void>>;\n onAsyncError: EngineEvent<(asyncError: AsyncError) => MaybePromise<void>>;\n onViewModeChanged: EngineEvent<(tool: ViewMode) => MaybePromise<void>>;\n onBarcodeValidationChanged: EngineEvent<\n (validationResults: BarcodeFrameValidationResult[]) => MaybePromise<void>\n >;\n onDataSourceIdChanged: EngineEvent<(connectorId?: Id) => MaybePromise<void>>;\n onInjectedDataChanged: EngineEvent<(variableId: Id) => MaybePromise<void>>;\n onDocumentIssueListChanged: EngineEvent<(documentIssues: DocumentIssue[]) => MaybePromise<void>>;\n onCustomUndoDataChanged: EngineEvent<(customData: Record<string, string>) => MaybePromise<void>>;\n onEngineEditModeChanged: EngineEvent<(engineEditMode: EngineEditMode) => MaybePromise<void>>;\n onBrandKitMediaChanged: EngineEvent<(brandKitMedia: BrandKitMedia[]) => MaybePromise<void>>;\n };\n};\n\nexport type InitialCallbacksConfigType = {\n /**\n * @deprecated use `events.onActionsChanged` instead\n */\n onActionsChanged?: (state: DocumentAction[]) => void;\n\n /**\n * @deprecated use `events.onStateChanged` instead\n */\n onStateChanged?: () => void;\n\n /**\n * @deprecated use `events.onAuthExpired` instead\n */\n onAuthExpired?: (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>;\n\n /**\n * @deprecated use `events.onViewportRequested` instead\n */\n onViewportRequested?: () => Viewport | null;\n\n /**\n * @deprecated use `events.onDocumentLoaded` instead\n */\n onDocumentLoaded?: () => void;\n\n /**\n * @deprecated use `onSelectedFramesLayoutChanged` instead\n *\n */\n onSelectedFrameLayoutChanged?: (state: FrameLayoutType) => void;\n\n /**\n * @deprecated use `events.onSelectedFramesLayoutChanged` instead\n */\n onSelectedFramesLayoutChanged?: (states: FrameLayoutType[]) => void;\n\n /**\n * @deprecated use `events.onFramesLayoutChanged` instead\n */\n onFramesLayoutChanged?: (states: FrameLayoutType[]) => void;\n\n /**\n * @deprecated use `onSelectedFramesContentChanged` instead\n */\n onSelectedFrameContentChanged?: (state: Frame | null) => void;\n\n /**\n * @deprecated use `events.onSelectedFramesContentChanged` instead\n */\n onSelectedFramesContentChanged?: (state: Frame[]) => void;\n\n /**\n * @deprecated use `onSelectedPageIdChanged` instead\n */\n onPageSelectionChanged?: (id: Id) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutPropertiesChanged` instead\n */\n onSelectedLayoutPropertiesChanged?: (state: LayoutPropertiesType) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutUnitChanged` instead\n */\n onSelectedLayoutUnitChanged?: (unit: MeasurementUnit) => void;\n\n /**\n * @deprecated use `events.onScrubberPositionChanged` instead\n */\n onScrubberPositionChanged?: (state: AnimationPlaybackType) => void;\n\n /**\n * @deprecated use `events.onFrameAnimationsChanged` instead\n */\n onFrameAnimationsChanged?: (animationState: FrameAnimationType[]) => void;\n\n /**\n * @deprecated use `events.onVariableListChanged` instead\n */\n onVariableListChanged?: (variableList: Variable[]) => void;\n\n /**\n * @deprecated use `events.onSelectedToolChanged` instead\n */\n onSelectedToolChanged?: (tool: ToolType) => void;\n\n /**\n * @deprecated use `events.onUndoStackStateChanged` instead\n */\n onUndoStackStateChanged?: (undoStackState: UndoState) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutFramesChanged` instead\n */\n onSelectedLayoutFramesChanged?: (frames: SelectedLayoutFrame[]) => void;\n\n /**\n * @deprecated use `events.onSelectedTextStyleChanged` instead\n */\n onSelectedTextStyleChanged?: (styles: SelectedTextStyle) => void;\n\n /**\n * @deprecated use `events.onColorsChanged` instead\n */\n onColorsChanged?: (colors: DocumentColor[]) => void;\n\n /**\n * @deprecated use `events.onParagraphStylesChanged` instead\n */\n onParagraphStylesChanged?: (paragraphStyles: ParagraphStyle[]) => void;\n\n /**\n * @deprecated use `events.onCharacterStylesChanged` instead\n */\n onCharacterStylesChanged?: (characterStyles: CharacterStyle[]) => void;\n\n /**\n * @deprecated use `events.onFontFamiliesChanged` instead\n */\n onFontFamiliesChanged?: (fontFamilies: DocumentFontFamily[]) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutIdChanged` instead\n */\n onSelectedLayoutIdChanged?: (layoutId: string) => void;\n\n /**\n * @deprecated use `events.onLayoutsChanged` instead\n */\n onLayoutsChanged?: (layouts: LayoutListItemType[]) => void;\n\n /**\n * @deprecated use `events.onConnectorEvent` instead\n */\n onConnectorEvent?: (event: ConnectorEvent) => void;\n\n /**\n * @deprecated use `events.onConnectorsChanged` instead\n */\n onConnectorsChanged?: (connectors: ConnectorInstance[]) => void;\n\n /**\n * @deprecated use `events.onZoomChanged` instead\n */\n onZoomChanged?: (scaleFactor: number) => void;\n\n /**\n *\n * @deprecated use `events.onSelectedPageIdChanged` instead\n */\n onSelectedPageIdChanged?: (pageId: Id) => void;\n\n /**\n *\n * @deprecated use `events.onPagesChanged` instead\n */\n onPagesChanged?: (pages: Page[]) => void;\n\n /**\n *\n * @deprecated use `events.onPageSnapshotInvalidated` instead\n */\n onPageSnapshotInvalidated?: (pageId: Id) => void;\n\n /**\n * @deprecated use `events.onPageSizeChanged` instead\n */\n onPageSizeChanged?: (pageSize: PageSize) => void;\n\n /**\n * @deprecated use `events.onShapeCornerRadiusChanged` instead\n */\n onShapeCornerRadiusChanged?: (cornerRadius: CornerRadiusUpdateModel) => void;\n\n /**\n * @deprecated use `events.onCropActiveFrameIdChanged` instead\n */\n onCropActiveFrameIdChanged?: (id?: Id) => void;\n\n /**\n * @deprecated use `events.onAsyncError` instead\n */\n onAsyncError?: (asyncError: AsyncError) => void;\n\n /**\n * @deprecated use `events.onViewModeChanged` instead\n */\n onViewModeChanged?: (tool: ViewMode) => void;\n\n /**\n * @deprecated use `events.onBarcodeValidationChanged` instead\n */\n onBarcodeValidationChanged?: (validationResults: BarcodeFrameValidationResult[]) => void;\n\n /**\n * @deprecated use `events.onDataSourceIdChanged` instead\n */\n onDataSourceIdChanged?: (connectorId?: Id) => void;\n\n /**\n * @deprecated use `events.onInjectedDataChanged` instead\n */\n onInjectedDataChanged?: (variableId: Id) => void;\n\n /**\n * @deprecated use `events.onDocumentIssueListChanged` instead\n */\n onDocumentIssueListChanged?: (documentIssues: DocumentIssue[]) => void;\n\n /**\n * @deprecated use `events.onCustomUndoDataChanged` instead\n */\n onCustomUndoDataChanged?: (customData: Record<string, string>) => void;\n\n /**\n * @deprecated use `events.onEngineEditModeChanged` instead\n */\n onEngineEditModeChanged?: (engineEditMode: EngineEditMode) => void;\n\n /**\n * @deprecated use `events.onBrandKitMediaChanged` instead\n */\n onBrandKitMediaChanged?: (brandKitMedia: BrandKitMedia[]) => void;\n};\n\nexport type ConfigType = InitialCallbacksConfigType & BaseConfigType;\nexport type RuntimeConfigType = ConfigType & ManagedCallbacksConfigType;\n\nexport type EditorResponseError = string;\n\nexport interface EditorResponse<T> {\n success: boolean;\n status: number;\n data?: string | null;\n error?: EditorResponseError | null;\n parsedData: T | null;\n}\n\nexport interface EditorRawAPI extends CallSender {\n [index: string]: <T>(...args: unknown[]) => Promise<T>;\n}\n\nexport interface EditorAPI extends CallSender {\n [index: string]: <T>(...args: unknown[]) => Promise<EditorResponse<T>>;\n}\n\nexport type PageType = {\n id: Id;\n number: number;\n width: number | null;\n height: number | null;\n frames: FrameType[];\n};\n\nexport type InitialStateType = {\n layouts: LayoutWithFrameProperties[];\n selectedLayoutId: Id;\n pages: PageType[];\n variables: Variable[];\n};\n\nexport interface PropertyState<T> {\n value: T;\n isOverride: boolean;\n isReadOnly: boolean;\n}\n\nexport interface HasOverrideState {\n isOverride: boolean;\n isReadOnly: boolean;\n}\n\nexport interface SelectedLayoutFrame {\n id: Id;\n name: string;\n type: FrameTypeEnum;\n isVisible: boolean;\n}\n\nexport type PrivateData = Record<string, string>;\n\nexport class SDKUnauthorizedError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n"],"names":["LogLevel","LogCategory","CallbackErrorBehavior"],"mappings":";;AAqDO,IAAK,6BAAAA,cAAL;AACHA,YAAA,MAAA,IAAO;AACPA,YAAA,MAAA,IAAO;AACPA,YAAA,OAAA,IAAQ;AAHA,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;AAML,IAAK,gCAAAC,iBAAL;AACHA,eAAA,SAAA,IAAU;AACVA,eAAA,WAAA,IAAY;AACZA,eAAA,OAAA,IAAQ;AACRA,eAAA,QAAA,IAAS;AAJD,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAUL,IAAK,0CAAAC,2BAAL;AAIHA,yBAAA,OAAA,IAAQ;AAKRA,yBAAA,KAAA,IAAM;AATE,SAAAA;AAAA,GAAA,yBAAA,CAAA,CAAA;AA6VL,MAAM,6BAA6B,MAAM;AAAA,EAC5C,YAAY,SAAiB;AACzB,UAAM,OAAO;AAAA,EACjB;AACJ;;;;;"}
1
+ {"version":3,"file":"CommonTypes.cjs.js","sources":["../../../src/types/CommonTypes.ts"],"sourcesContent":["import { CallSender } from 'penpal';\nimport { ConnectorInstance, DocumentAction, DocumentFontFamily, ToolType, ViewMode } from '..';\nimport { EngineCallbackHandler } from '../utils/EngineCallbackHandler';\nimport { EngineEvent } from '../utils/EngineEvent';\nimport { AnimationPlaybackType, FrameAnimationType } from './AnimationTypes';\nimport { BarcodeFrameValidationResult } from './BarcodeTypes';\nimport { CharacterStyle } from './CharacterStyleTypes';\nimport { DocumentColor } from './ColorStyleTypes';\nimport { StudioOptionsDeltaUpdate, StudioStyling } from './ConfigurationTypes';\nimport { AuthCredentials, AuthRefreshRequest, ConnectorEvent } from './ConnectorTypes';\nimport { DocumentIssue, DocumentType, UndoState } from './DocumentTypes';\nimport { EngineEditMode } from './EngineEditModeTypes';\nimport type { FrameType } from './FrameTypes';\nimport { Frame, FrameLayoutType, FrameTypeEnum } from './FrameTypes';\nimport { LayoutListItemType, LayoutPropertiesType, LayoutWithFrameProperties, MeasurementUnit } from './LayoutTypes';\nimport { Page, PageSize } from './PageTypes';\nimport { ParagraphStyle } from './ParagraphStyleTypes';\nimport { CornerRadiusUpdateModel } from './ShapeTypes';\nimport { SelectedTextStyle } from './TextStyleTypes';\nimport { Variable } from './VariableTypes';\nimport { Viewport } from './ViewportTypes';\nimport { BrandKitMedia } from './BrandKitTypes';\nimport { AsyncError } from '../exceptions';\n\nexport type Id = string;\nexport type BaseConfigType = {\n editorLink?: string;\n editorId?: string;\n chiliEnvironmentUrl?: string;\n documentType?: DocumentType;\n studioStyling?: StudioStyling;\n studioOptions?: StudioOptionsDeltaUpdate;\n /**\n * Whether the engine should cache query calls.\n * When enabled it will cache the query calls regardless of the cache control headers.\n */\n enableQueryCallCache?: boolean;\n enableNextSubscribers?: {\n onVariableListChanged: boolean;\n };\n logging?: {\n logLevel?: LogLevel;\n logger?: LoggerFunction;\n };\n /**\n * Callback function that is called when an error occurs during iframe setup or connection.\n * @param error The error that occurred during setup or connection\n */\n onConnectionError?: (error: Error) => void;\n};\n\nexport type LoggerFunction = (logLevel: LogLevel, category: LogCategory, message: string) => void;\n\nexport enum LogLevel {\n info = 'info',\n warn = 'warn',\n error = 'error',\n}\n\nexport enum LogCategory {\n general = 'general',\n connector = 'connector',\n event = 'event',\n engine = 'engine',\n sdk = 'sdk',\n}\n\n/**\n * Defines the behavior when encountering an error in the event / handler callback.\n */\nexport enum CallbackErrorBehavior {\n /**\n * Throws an error when encountering an error in a callback.\n */\n throw = 'throw',\n\n /**\n * Logs the error when encountering an error in a callback.\n */\n log = 'log',\n}\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type ManagedCallbacksConfigType = {\n handlers: {\n onAuthExpired: EngineCallbackHandler<\n (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>\n >;\n onViewportRequested: EngineCallbackHandler<() => Viewport | null>;\n };\n events: {\n onActionsChanged: EngineEvent<(state: DocumentAction[]) => MaybePromise<void>>;\n onStateChanged: EngineEvent<() => MaybePromise<void>>;\n onDocumentLoaded: EngineEvent<() => MaybePromise<void>>;\n onSelectedFramesLayoutChanged: EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>;\n onFramesLayoutChanged: EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>;\n onSelectedFramesContentChanged: EngineEvent<(state: Frame[]) => MaybePromise<void>>;\n onPageSelectionChanged: EngineEvent<(id: Id) => MaybePromise<void>>;\n onSelectedLayoutPropertiesChanged: EngineEvent<(state: LayoutPropertiesType) => MaybePromise<void>>;\n onSelectedLayoutUnitChanged: EngineEvent<(unit: MeasurementUnit) => MaybePromise<void>>;\n onScrubberPositionChanged: EngineEvent<(state: AnimationPlaybackType) => MaybePromise<void>>;\n onFrameAnimationsChanged: EngineEvent<(animationState: FrameAnimationType[]) => MaybePromise<void>>;\n onVariableListChanged: EngineEvent<(variableList: Variable[]) => MaybePromise<void>>;\n onSelectedToolChanged: EngineEvent<(tool: ToolType) => MaybePromise<void>>;\n onUndoStackStateChanged: EngineEvent<(undoStackState: UndoState) => MaybePromise<void>>;\n onSelectedLayoutFramesChanged: EngineEvent<(frames: SelectedLayoutFrame[]) => MaybePromise<void>>;\n onSelectedTextStyleChanged: EngineEvent<(styles: SelectedTextStyle) => MaybePromise<void>>;\n onColorsChanged: EngineEvent<(colors: DocumentColor[]) => MaybePromise<void>>;\n onParagraphStylesChanged: EngineEvent<(paragraphStyles: ParagraphStyle[]) => MaybePromise<void>>;\n onCharacterStylesChanged: EngineEvent<(characterStyles: CharacterStyle[]) => MaybePromise<void>>;\n onFontFamiliesChanged: EngineEvent<(fontFamilies: DocumentFontFamily[]) => MaybePromise<void>>;\n onSelectedLayoutIdChanged: EngineEvent<(layoutId: string) => MaybePromise<void>>;\n onLayoutsChanged: EngineEvent<(layouts: LayoutListItemType[]) => MaybePromise<void>>;\n onConnectorEvent: EngineEvent<(event: ConnectorEvent) => MaybePromise<void>>;\n onConnectorsChanged: EngineEvent<(connectors: ConnectorInstance[]) => MaybePromise<void>>;\n onZoomChanged: EngineEvent<(scaleFactor: number) => MaybePromise<void>>;\n onSelectedPageIdChanged: EngineEvent<(pageId: Id) => MaybePromise<void>>;\n onPagesChanged: EngineEvent<(pages: Page[]) => MaybePromise<void>>;\n onPageSnapshotInvalidated: EngineEvent<(pageId: Id) => MaybePromise<void>>;\n onPageSizeChanged: EngineEvent<(pageSize: PageSize) => MaybePromise<void>>;\n onShapeCornerRadiusChanged: EngineEvent<(cornerRadius: CornerRadiusUpdateModel) => MaybePromise<void>>;\n onCropActiveFrameIdChanged: EngineEvent<(id?: Id) => MaybePromise<void>>;\n onAsyncError: EngineEvent<(asyncError: AsyncError) => MaybePromise<void>>;\n onViewModeChanged: EngineEvent<(tool: ViewMode) => MaybePromise<void>>;\n onBarcodeValidationChanged: EngineEvent<\n (validationResults: BarcodeFrameValidationResult[]) => MaybePromise<void>\n >;\n onDataSourceIdChanged: EngineEvent<(connectorId?: Id) => MaybePromise<void>>;\n onInjectedDataChanged: EngineEvent<(variableId: Id) => MaybePromise<void>>;\n onDocumentIssueListChanged: EngineEvent<(documentIssues: DocumentIssue[]) => MaybePromise<void>>;\n onCustomUndoDataChanged: EngineEvent<(customData: Record<string, string>) => MaybePromise<void>>;\n onEngineEditModeChanged: EngineEvent<(engineEditMode: EngineEditMode) => MaybePromise<void>>;\n onBrandKitMediaChanged: EngineEvent<(brandKitMedia: BrandKitMedia[]) => MaybePromise<void>>;\n };\n};\n\nexport type InitialCallbacksConfigType = {\n /**\n * @deprecated use `events.onActionsChanged` instead\n */\n onActionsChanged?: (state: DocumentAction[]) => void;\n\n /**\n * @deprecated use `events.onStateChanged` instead\n */\n onStateChanged?: () => void;\n\n /**\n * @deprecated use `events.onAuthExpired` instead\n */\n onAuthExpired?: (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>;\n\n /**\n * @deprecated use `events.onViewportRequested` instead\n */\n onViewportRequested?: () => Viewport | null;\n\n /**\n * @deprecated use `events.onDocumentLoaded` instead\n */\n onDocumentLoaded?: () => void;\n\n /**\n * @deprecated use `onSelectedFramesLayoutChanged` instead\n *\n */\n onSelectedFrameLayoutChanged?: (state: FrameLayoutType) => void;\n\n /**\n * @deprecated use `events.onSelectedFramesLayoutChanged` instead\n */\n onSelectedFramesLayoutChanged?: (states: FrameLayoutType[]) => void;\n\n /**\n * @deprecated use `events.onFramesLayoutChanged` instead\n */\n onFramesLayoutChanged?: (states: FrameLayoutType[]) => void;\n\n /**\n * @deprecated use `onSelectedFramesContentChanged` instead\n */\n onSelectedFrameContentChanged?: (state: Frame | null) => void;\n\n /**\n * @deprecated use `events.onSelectedFramesContentChanged` instead\n */\n onSelectedFramesContentChanged?: (state: Frame[]) => void;\n\n /**\n * @deprecated use `onSelectedPageIdChanged` instead\n */\n onPageSelectionChanged?: (id: Id) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutPropertiesChanged` instead\n */\n onSelectedLayoutPropertiesChanged?: (state: LayoutPropertiesType) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutUnitChanged` instead\n */\n onSelectedLayoutUnitChanged?: (unit: MeasurementUnit) => void;\n\n /**\n * @deprecated use `events.onScrubberPositionChanged` instead\n */\n onScrubberPositionChanged?: (state: AnimationPlaybackType) => void;\n\n /**\n * @deprecated use `events.onFrameAnimationsChanged` instead\n */\n onFrameAnimationsChanged?: (animationState: FrameAnimationType[]) => void;\n\n /**\n * @deprecated use `events.onVariableListChanged` instead\n */\n onVariableListChanged?: (variableList: Variable[]) => void;\n\n /**\n * @deprecated use `events.onSelectedToolChanged` instead\n */\n onSelectedToolChanged?: (tool: ToolType) => void;\n\n /**\n * @deprecated use `events.onUndoStackStateChanged` instead\n */\n onUndoStackStateChanged?: (undoStackState: UndoState) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutFramesChanged` instead\n */\n onSelectedLayoutFramesChanged?: (frames: SelectedLayoutFrame[]) => void;\n\n /**\n * @deprecated use `events.onSelectedTextStyleChanged` instead\n */\n onSelectedTextStyleChanged?: (styles: SelectedTextStyle) => void;\n\n /**\n * @deprecated use `events.onColorsChanged` instead\n */\n onColorsChanged?: (colors: DocumentColor[]) => void;\n\n /**\n * @deprecated use `events.onParagraphStylesChanged` instead\n */\n onParagraphStylesChanged?: (paragraphStyles: ParagraphStyle[]) => void;\n\n /**\n * @deprecated use `events.onCharacterStylesChanged` instead\n */\n onCharacterStylesChanged?: (characterStyles: CharacterStyle[]) => void;\n\n /**\n * @deprecated use `events.onFontFamiliesChanged` instead\n */\n onFontFamiliesChanged?: (fontFamilies: DocumentFontFamily[]) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutIdChanged` instead\n */\n onSelectedLayoutIdChanged?: (layoutId: string) => void;\n\n /**\n * @deprecated use `events.onLayoutsChanged` instead\n */\n onLayoutsChanged?: (layouts: LayoutListItemType[]) => void;\n\n /**\n * @deprecated use `events.onConnectorEvent` instead\n */\n onConnectorEvent?: (event: ConnectorEvent) => void;\n\n /**\n * @deprecated use `events.onConnectorsChanged` instead\n */\n onConnectorsChanged?: (connectors: ConnectorInstance[]) => void;\n\n /**\n * @deprecated use `events.onZoomChanged` instead\n */\n onZoomChanged?: (scaleFactor: number) => void;\n\n /**\n *\n * @deprecated use `events.onSelectedPageIdChanged` instead\n */\n onSelectedPageIdChanged?: (pageId: Id) => void;\n\n /**\n *\n * @deprecated use `events.onPagesChanged` instead\n */\n onPagesChanged?: (pages: Page[]) => void;\n\n /**\n *\n * @deprecated use `events.onPageSnapshotInvalidated` instead\n */\n onPageSnapshotInvalidated?: (pageId: Id) => void;\n\n /**\n * @deprecated use `events.onPageSizeChanged` instead\n */\n onPageSizeChanged?: (pageSize: PageSize) => void;\n\n /**\n * @deprecated use `events.onShapeCornerRadiusChanged` instead\n */\n onShapeCornerRadiusChanged?: (cornerRadius: CornerRadiusUpdateModel) => void;\n\n /**\n * @deprecated use `events.onCropActiveFrameIdChanged` instead\n */\n onCropActiveFrameIdChanged?: (id?: Id) => void;\n\n /**\n * @deprecated use `events.onAsyncError` instead\n */\n onAsyncError?: (asyncError: AsyncError) => void;\n\n /**\n * @deprecated use `events.onViewModeChanged` instead\n */\n onViewModeChanged?: (tool: ViewMode) => void;\n\n /**\n * @deprecated use `events.onBarcodeValidationChanged` instead\n */\n onBarcodeValidationChanged?: (validationResults: BarcodeFrameValidationResult[]) => void;\n\n /**\n * @deprecated use `events.onDataSourceIdChanged` instead\n */\n onDataSourceIdChanged?: (connectorId?: Id) => void;\n\n /**\n * @deprecated use `events.onInjectedDataChanged` instead\n */\n onInjectedDataChanged?: (variableId: Id) => void;\n\n /**\n * @deprecated use `events.onDocumentIssueListChanged` instead\n */\n onDocumentIssueListChanged?: (documentIssues: DocumentIssue[]) => void;\n\n /**\n * @deprecated use `events.onCustomUndoDataChanged` instead\n */\n onCustomUndoDataChanged?: (customData: Record<string, string>) => void;\n\n /**\n * @deprecated use `events.onEngineEditModeChanged` instead\n */\n onEngineEditModeChanged?: (engineEditMode: EngineEditMode) => void;\n\n /**\n * @deprecated use `events.onBrandKitMediaChanged` instead\n */\n onBrandKitMediaChanged?: (brandKitMedia: BrandKitMedia[]) => void;\n};\n\nexport type ConfigType = InitialCallbacksConfigType & BaseConfigType;\nexport type RuntimeConfigType = ConfigType & ManagedCallbacksConfigType;\n\nexport type EditorResponseError = string;\n\nexport interface EditorResponse<T> {\n success: boolean;\n status: number;\n data?: string | null;\n error?: EditorResponseError | null;\n parsedData: T | null;\n}\n\nexport interface EditorRawAPI extends CallSender {\n [index: string]: <T>(...args: unknown[]) => Promise<T>;\n}\n\nexport interface EditorAPI extends CallSender {\n [index: string]: <T>(...args: unknown[]) => Promise<EditorResponse<T>>;\n}\n\nexport type PageType = {\n id: Id;\n number: number;\n width: number | null;\n height: number | null;\n frames: FrameType[];\n};\n\nexport type InitialStateType = {\n layouts: LayoutWithFrameProperties[];\n selectedLayoutId: Id;\n pages: PageType[];\n variables: Variable[];\n};\n\nexport interface PropertyState<T> {\n value: T;\n isOverride: boolean;\n isReadOnly: boolean;\n}\n\nexport interface HasOverrideState {\n isOverride: boolean;\n isReadOnly: boolean;\n}\n\nexport interface SelectedLayoutFrame {\n id: Id;\n name: string;\n type: FrameTypeEnum;\n isVisible: boolean;\n}\n\nexport type PrivateData = Record<string, string>;\n\nexport class SDKUnauthorizedError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n"],"names":["LogLevel","LogCategory","CallbackErrorBehavior"],"mappings":";;AAqDO,IAAK,6BAAAA,cAAL;AACHA,YAAA,MAAA,IAAO;AACPA,YAAA,MAAA,IAAO;AACPA,YAAA,OAAA,IAAQ;AAHA,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;AAML,IAAK,gCAAAC,iBAAL;AACHA,eAAA,SAAA,IAAU;AACVA,eAAA,WAAA,IAAY;AACZA,eAAA,OAAA,IAAQ;AACRA,eAAA,QAAA,IAAS;AACTA,eAAA,KAAA,IAAM;AALE,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAWL,IAAK,0CAAAC,2BAAL;AAIHA,yBAAA,OAAA,IAAQ;AAKRA,yBAAA,KAAA,IAAM;AATE,SAAAA;AAAA,GAAA,yBAAA,CAAA,CAAA;AA6VL,MAAM,6BAA6B,MAAM;AAAA,EAC5C,YAAY,SAAiB;AACzB,UAAM,OAAO;AAAA,EACjB;AACJ;;;;;"}
@@ -56,7 +56,8 @@ export declare enum LogCategory {
56
56
  general = "general",
57
57
  connector = "connector",
58
58
  event = "event",
59
- engine = "engine"
59
+ engine = "engine",
60
+ sdk = "sdk"
60
61
  }
61
62
  /**
62
63
  * Defines the behavior when encountering an error in the event / handler callback.
@@ -9,6 +9,7 @@ var LogCategory = /* @__PURE__ */ ((LogCategory2) => {
9
9
  LogCategory2["connector"] = "connector";
10
10
  LogCategory2["event"] = "event";
11
11
  LogCategory2["engine"] = "engine";
12
+ LogCategory2["sdk"] = "sdk";
12
13
  return LogCategory2;
13
14
  })(LogCategory || {});
14
15
  var CallbackErrorBehavior = /* @__PURE__ */ ((CallbackErrorBehavior2) => {
@@ -1 +1 @@
1
- {"version":3,"file":"CommonTypes.es.js","sources":["../../../src/types/CommonTypes.ts"],"sourcesContent":["import { CallSender } from 'penpal';\nimport { ConnectorInstance, DocumentAction, DocumentFontFamily, ToolType, ViewMode } from '..';\nimport { EngineCallbackHandler } from '../utils/EngineCallbackHandler';\nimport { EngineEvent } from '../utils/EngineEvent';\nimport { AnimationPlaybackType, FrameAnimationType } from './AnimationTypes';\nimport { BarcodeFrameValidationResult } from './BarcodeTypes';\nimport { CharacterStyle } from './CharacterStyleTypes';\nimport { DocumentColor } from './ColorStyleTypes';\nimport { StudioOptionsDeltaUpdate, StudioStyling } from './ConfigurationTypes';\nimport { AuthCredentials, AuthRefreshRequest, ConnectorEvent } from './ConnectorTypes';\nimport { DocumentIssue, DocumentType, UndoState } from './DocumentTypes';\nimport { EngineEditMode } from './EngineEditModeTypes';\nimport type { FrameType } from './FrameTypes';\nimport { Frame, FrameLayoutType, FrameTypeEnum } from './FrameTypes';\nimport { LayoutListItemType, LayoutPropertiesType, LayoutWithFrameProperties, MeasurementUnit } from './LayoutTypes';\nimport { Page, PageSize } from './PageTypes';\nimport { ParagraphStyle } from './ParagraphStyleTypes';\nimport { CornerRadiusUpdateModel } from './ShapeTypes';\nimport { SelectedTextStyle } from './TextStyleTypes';\nimport { Variable } from './VariableTypes';\nimport { Viewport } from './ViewportTypes';\nimport { BrandKitMedia } from './BrandKitTypes';\nimport { AsyncError } from '../exceptions';\n\nexport type Id = string;\nexport type BaseConfigType = {\n editorLink?: string;\n editorId?: string;\n chiliEnvironmentUrl?: string;\n documentType?: DocumentType;\n studioStyling?: StudioStyling;\n studioOptions?: StudioOptionsDeltaUpdate;\n /**\n * Whether the engine should cache query calls.\n * When enabled it will cache the query calls regardless of the cache control headers.\n */\n enableQueryCallCache?: boolean;\n enableNextSubscribers?: {\n onVariableListChanged: boolean;\n };\n logging?: {\n logLevel?: LogLevel;\n logger?: LoggerFunction;\n };\n /**\n * Callback function that is called when an error occurs during iframe setup or connection.\n * @param error The error that occurred during setup or connection\n */\n onConnectionError?: (error: Error) => void;\n};\n\nexport type LoggerFunction = (logLevel: LogLevel, category: LogCategory, message: string) => void;\n\nexport enum LogLevel {\n info = 'info',\n warn = 'warn',\n error = 'error',\n}\n\nexport enum LogCategory {\n general = 'general',\n connector = 'connector',\n event = 'event',\n engine = 'engine',\n}\n\n/**\n * Defines the behavior when encountering an error in the event / handler callback.\n */\nexport enum CallbackErrorBehavior {\n /**\n * Throws an error when encountering an error in a callback.\n */\n throw = 'throw',\n\n /**\n * Logs the error when encountering an error in a callback.\n */\n log = 'log',\n}\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type ManagedCallbacksConfigType = {\n handlers: {\n onAuthExpired: EngineCallbackHandler<\n (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>\n >;\n onViewportRequested: EngineCallbackHandler<() => Viewport | null>;\n };\n events: {\n onActionsChanged: EngineEvent<(state: DocumentAction[]) => MaybePromise<void>>;\n onStateChanged: EngineEvent<() => MaybePromise<void>>;\n onDocumentLoaded: EngineEvent<() => MaybePromise<void>>;\n onSelectedFramesLayoutChanged: EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>;\n onFramesLayoutChanged: EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>;\n onSelectedFramesContentChanged: EngineEvent<(state: Frame[]) => MaybePromise<void>>;\n onPageSelectionChanged: EngineEvent<(id: Id) => MaybePromise<void>>;\n onSelectedLayoutPropertiesChanged: EngineEvent<(state: LayoutPropertiesType) => MaybePromise<void>>;\n onSelectedLayoutUnitChanged: EngineEvent<(unit: MeasurementUnit) => MaybePromise<void>>;\n onScrubberPositionChanged: EngineEvent<(state: AnimationPlaybackType) => MaybePromise<void>>;\n onFrameAnimationsChanged: EngineEvent<(animationState: FrameAnimationType[]) => MaybePromise<void>>;\n onVariableListChanged: EngineEvent<(variableList: Variable[]) => MaybePromise<void>>;\n onSelectedToolChanged: EngineEvent<(tool: ToolType) => MaybePromise<void>>;\n onUndoStackStateChanged: EngineEvent<(undoStackState: UndoState) => MaybePromise<void>>;\n onSelectedLayoutFramesChanged: EngineEvent<(frames: SelectedLayoutFrame[]) => MaybePromise<void>>;\n onSelectedTextStyleChanged: EngineEvent<(styles: SelectedTextStyle) => MaybePromise<void>>;\n onColorsChanged: EngineEvent<(colors: DocumentColor[]) => MaybePromise<void>>;\n onParagraphStylesChanged: EngineEvent<(paragraphStyles: ParagraphStyle[]) => MaybePromise<void>>;\n onCharacterStylesChanged: EngineEvent<(characterStyles: CharacterStyle[]) => MaybePromise<void>>;\n onFontFamiliesChanged: EngineEvent<(fontFamilies: DocumentFontFamily[]) => MaybePromise<void>>;\n onSelectedLayoutIdChanged: EngineEvent<(layoutId: string) => MaybePromise<void>>;\n onLayoutsChanged: EngineEvent<(layouts: LayoutListItemType[]) => MaybePromise<void>>;\n onConnectorEvent: EngineEvent<(event: ConnectorEvent) => MaybePromise<void>>;\n onConnectorsChanged: EngineEvent<(connectors: ConnectorInstance[]) => MaybePromise<void>>;\n onZoomChanged: EngineEvent<(scaleFactor: number) => MaybePromise<void>>;\n onSelectedPageIdChanged: EngineEvent<(pageId: Id) => MaybePromise<void>>;\n onPagesChanged: EngineEvent<(pages: Page[]) => MaybePromise<void>>;\n onPageSnapshotInvalidated: EngineEvent<(pageId: Id) => MaybePromise<void>>;\n onPageSizeChanged: EngineEvent<(pageSize: PageSize) => MaybePromise<void>>;\n onShapeCornerRadiusChanged: EngineEvent<(cornerRadius: CornerRadiusUpdateModel) => MaybePromise<void>>;\n onCropActiveFrameIdChanged: EngineEvent<(id?: Id) => MaybePromise<void>>;\n onAsyncError: EngineEvent<(asyncError: AsyncError) => MaybePromise<void>>;\n onViewModeChanged: EngineEvent<(tool: ViewMode) => MaybePromise<void>>;\n onBarcodeValidationChanged: EngineEvent<\n (validationResults: BarcodeFrameValidationResult[]) => MaybePromise<void>\n >;\n onDataSourceIdChanged: EngineEvent<(connectorId?: Id) => MaybePromise<void>>;\n onInjectedDataChanged: EngineEvent<(variableId: Id) => MaybePromise<void>>;\n onDocumentIssueListChanged: EngineEvent<(documentIssues: DocumentIssue[]) => MaybePromise<void>>;\n onCustomUndoDataChanged: EngineEvent<(customData: Record<string, string>) => MaybePromise<void>>;\n onEngineEditModeChanged: EngineEvent<(engineEditMode: EngineEditMode) => MaybePromise<void>>;\n onBrandKitMediaChanged: EngineEvent<(brandKitMedia: BrandKitMedia[]) => MaybePromise<void>>;\n };\n};\n\nexport type InitialCallbacksConfigType = {\n /**\n * @deprecated use `events.onActionsChanged` instead\n */\n onActionsChanged?: (state: DocumentAction[]) => void;\n\n /**\n * @deprecated use `events.onStateChanged` instead\n */\n onStateChanged?: () => void;\n\n /**\n * @deprecated use `events.onAuthExpired` instead\n */\n onAuthExpired?: (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>;\n\n /**\n * @deprecated use `events.onViewportRequested` instead\n */\n onViewportRequested?: () => Viewport | null;\n\n /**\n * @deprecated use `events.onDocumentLoaded` instead\n */\n onDocumentLoaded?: () => void;\n\n /**\n * @deprecated use `onSelectedFramesLayoutChanged` instead\n *\n */\n onSelectedFrameLayoutChanged?: (state: FrameLayoutType) => void;\n\n /**\n * @deprecated use `events.onSelectedFramesLayoutChanged` instead\n */\n onSelectedFramesLayoutChanged?: (states: FrameLayoutType[]) => void;\n\n /**\n * @deprecated use `events.onFramesLayoutChanged` instead\n */\n onFramesLayoutChanged?: (states: FrameLayoutType[]) => void;\n\n /**\n * @deprecated use `onSelectedFramesContentChanged` instead\n */\n onSelectedFrameContentChanged?: (state: Frame | null) => void;\n\n /**\n * @deprecated use `events.onSelectedFramesContentChanged` instead\n */\n onSelectedFramesContentChanged?: (state: Frame[]) => void;\n\n /**\n * @deprecated use `onSelectedPageIdChanged` instead\n */\n onPageSelectionChanged?: (id: Id) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutPropertiesChanged` instead\n */\n onSelectedLayoutPropertiesChanged?: (state: LayoutPropertiesType) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutUnitChanged` instead\n */\n onSelectedLayoutUnitChanged?: (unit: MeasurementUnit) => void;\n\n /**\n * @deprecated use `events.onScrubberPositionChanged` instead\n */\n onScrubberPositionChanged?: (state: AnimationPlaybackType) => void;\n\n /**\n * @deprecated use `events.onFrameAnimationsChanged` instead\n */\n onFrameAnimationsChanged?: (animationState: FrameAnimationType[]) => void;\n\n /**\n * @deprecated use `events.onVariableListChanged` instead\n */\n onVariableListChanged?: (variableList: Variable[]) => void;\n\n /**\n * @deprecated use `events.onSelectedToolChanged` instead\n */\n onSelectedToolChanged?: (tool: ToolType) => void;\n\n /**\n * @deprecated use `events.onUndoStackStateChanged` instead\n */\n onUndoStackStateChanged?: (undoStackState: UndoState) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutFramesChanged` instead\n */\n onSelectedLayoutFramesChanged?: (frames: SelectedLayoutFrame[]) => void;\n\n /**\n * @deprecated use `events.onSelectedTextStyleChanged` instead\n */\n onSelectedTextStyleChanged?: (styles: SelectedTextStyle) => void;\n\n /**\n * @deprecated use `events.onColorsChanged` instead\n */\n onColorsChanged?: (colors: DocumentColor[]) => void;\n\n /**\n * @deprecated use `events.onParagraphStylesChanged` instead\n */\n onParagraphStylesChanged?: (paragraphStyles: ParagraphStyle[]) => void;\n\n /**\n * @deprecated use `events.onCharacterStylesChanged` instead\n */\n onCharacterStylesChanged?: (characterStyles: CharacterStyle[]) => void;\n\n /**\n * @deprecated use `events.onFontFamiliesChanged` instead\n */\n onFontFamiliesChanged?: (fontFamilies: DocumentFontFamily[]) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutIdChanged` instead\n */\n onSelectedLayoutIdChanged?: (layoutId: string) => void;\n\n /**\n * @deprecated use `events.onLayoutsChanged` instead\n */\n onLayoutsChanged?: (layouts: LayoutListItemType[]) => void;\n\n /**\n * @deprecated use `events.onConnectorEvent` instead\n */\n onConnectorEvent?: (event: ConnectorEvent) => void;\n\n /**\n * @deprecated use `events.onConnectorsChanged` instead\n */\n onConnectorsChanged?: (connectors: ConnectorInstance[]) => void;\n\n /**\n * @deprecated use `events.onZoomChanged` instead\n */\n onZoomChanged?: (scaleFactor: number) => void;\n\n /**\n *\n * @deprecated use `events.onSelectedPageIdChanged` instead\n */\n onSelectedPageIdChanged?: (pageId: Id) => void;\n\n /**\n *\n * @deprecated use `events.onPagesChanged` instead\n */\n onPagesChanged?: (pages: Page[]) => void;\n\n /**\n *\n * @deprecated use `events.onPageSnapshotInvalidated` instead\n */\n onPageSnapshotInvalidated?: (pageId: Id) => void;\n\n /**\n * @deprecated use `events.onPageSizeChanged` instead\n */\n onPageSizeChanged?: (pageSize: PageSize) => void;\n\n /**\n * @deprecated use `events.onShapeCornerRadiusChanged` instead\n */\n onShapeCornerRadiusChanged?: (cornerRadius: CornerRadiusUpdateModel) => void;\n\n /**\n * @deprecated use `events.onCropActiveFrameIdChanged` instead\n */\n onCropActiveFrameIdChanged?: (id?: Id) => void;\n\n /**\n * @deprecated use `events.onAsyncError` instead\n */\n onAsyncError?: (asyncError: AsyncError) => void;\n\n /**\n * @deprecated use `events.onViewModeChanged` instead\n */\n onViewModeChanged?: (tool: ViewMode) => void;\n\n /**\n * @deprecated use `events.onBarcodeValidationChanged` instead\n */\n onBarcodeValidationChanged?: (validationResults: BarcodeFrameValidationResult[]) => void;\n\n /**\n * @deprecated use `events.onDataSourceIdChanged` instead\n */\n onDataSourceIdChanged?: (connectorId?: Id) => void;\n\n /**\n * @deprecated use `events.onInjectedDataChanged` instead\n */\n onInjectedDataChanged?: (variableId: Id) => void;\n\n /**\n * @deprecated use `events.onDocumentIssueListChanged` instead\n */\n onDocumentIssueListChanged?: (documentIssues: DocumentIssue[]) => void;\n\n /**\n * @deprecated use `events.onCustomUndoDataChanged` instead\n */\n onCustomUndoDataChanged?: (customData: Record<string, string>) => void;\n\n /**\n * @deprecated use `events.onEngineEditModeChanged` instead\n */\n onEngineEditModeChanged?: (engineEditMode: EngineEditMode) => void;\n\n /**\n * @deprecated use `events.onBrandKitMediaChanged` instead\n */\n onBrandKitMediaChanged?: (brandKitMedia: BrandKitMedia[]) => void;\n};\n\nexport type ConfigType = InitialCallbacksConfigType & BaseConfigType;\nexport type RuntimeConfigType = ConfigType & ManagedCallbacksConfigType;\n\nexport type EditorResponseError = string;\n\nexport interface EditorResponse<T> {\n success: boolean;\n status: number;\n data?: string | null;\n error?: EditorResponseError | null;\n parsedData: T | null;\n}\n\nexport interface EditorRawAPI extends CallSender {\n [index: string]: <T>(...args: unknown[]) => Promise<T>;\n}\n\nexport interface EditorAPI extends CallSender {\n [index: string]: <T>(...args: unknown[]) => Promise<EditorResponse<T>>;\n}\n\nexport type PageType = {\n id: Id;\n number: number;\n width: number | null;\n height: number | null;\n frames: FrameType[];\n};\n\nexport type InitialStateType = {\n layouts: LayoutWithFrameProperties[];\n selectedLayoutId: Id;\n pages: PageType[];\n variables: Variable[];\n};\n\nexport interface PropertyState<T> {\n value: T;\n isOverride: boolean;\n isReadOnly: boolean;\n}\n\nexport interface HasOverrideState {\n isOverride: boolean;\n isReadOnly: boolean;\n}\n\nexport interface SelectedLayoutFrame {\n id: Id;\n name: string;\n type: FrameTypeEnum;\n isVisible: boolean;\n}\n\nexport type PrivateData = Record<string, string>;\n\nexport class SDKUnauthorizedError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n"],"names":["LogLevel","LogCategory","CallbackErrorBehavior"],"mappings":"AAqDO,IAAK,6BAAAA,cAAL;AACHA,YAAA,MAAA,IAAO;AACPA,YAAA,MAAA,IAAO;AACPA,YAAA,OAAA,IAAQ;AAHA,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;AAML,IAAK,gCAAAC,iBAAL;AACHA,eAAA,SAAA,IAAU;AACVA,eAAA,WAAA,IAAY;AACZA,eAAA,OAAA,IAAQ;AACRA,eAAA,QAAA,IAAS;AAJD,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAUL,IAAK,0CAAAC,2BAAL;AAIHA,yBAAA,OAAA,IAAQ;AAKRA,yBAAA,KAAA,IAAM;AATE,SAAAA;AAAA,GAAA,yBAAA,CAAA,CAAA;AA6VL,MAAM,6BAA6B,MAAM;AAAA,EAC5C,YAAY,SAAiB;AACzB,UAAM,OAAO;AAAA,EACjB;AACJ;"}
1
+ {"version":3,"file":"CommonTypes.es.js","sources":["../../../src/types/CommonTypes.ts"],"sourcesContent":["import { CallSender } from 'penpal';\nimport { ConnectorInstance, DocumentAction, DocumentFontFamily, ToolType, ViewMode } from '..';\nimport { EngineCallbackHandler } from '../utils/EngineCallbackHandler';\nimport { EngineEvent } from '../utils/EngineEvent';\nimport { AnimationPlaybackType, FrameAnimationType } from './AnimationTypes';\nimport { BarcodeFrameValidationResult } from './BarcodeTypes';\nimport { CharacterStyle } from './CharacterStyleTypes';\nimport { DocumentColor } from './ColorStyleTypes';\nimport { StudioOptionsDeltaUpdate, StudioStyling } from './ConfigurationTypes';\nimport { AuthCredentials, AuthRefreshRequest, ConnectorEvent } from './ConnectorTypes';\nimport { DocumentIssue, DocumentType, UndoState } from './DocumentTypes';\nimport { EngineEditMode } from './EngineEditModeTypes';\nimport type { FrameType } from './FrameTypes';\nimport { Frame, FrameLayoutType, FrameTypeEnum } from './FrameTypes';\nimport { LayoutListItemType, LayoutPropertiesType, LayoutWithFrameProperties, MeasurementUnit } from './LayoutTypes';\nimport { Page, PageSize } from './PageTypes';\nimport { ParagraphStyle } from './ParagraphStyleTypes';\nimport { CornerRadiusUpdateModel } from './ShapeTypes';\nimport { SelectedTextStyle } from './TextStyleTypes';\nimport { Variable } from './VariableTypes';\nimport { Viewport } from './ViewportTypes';\nimport { BrandKitMedia } from './BrandKitTypes';\nimport { AsyncError } from '../exceptions';\n\nexport type Id = string;\nexport type BaseConfigType = {\n editorLink?: string;\n editorId?: string;\n chiliEnvironmentUrl?: string;\n documentType?: DocumentType;\n studioStyling?: StudioStyling;\n studioOptions?: StudioOptionsDeltaUpdate;\n /**\n * Whether the engine should cache query calls.\n * When enabled it will cache the query calls regardless of the cache control headers.\n */\n enableQueryCallCache?: boolean;\n enableNextSubscribers?: {\n onVariableListChanged: boolean;\n };\n logging?: {\n logLevel?: LogLevel;\n logger?: LoggerFunction;\n };\n /**\n * Callback function that is called when an error occurs during iframe setup or connection.\n * @param error The error that occurred during setup or connection\n */\n onConnectionError?: (error: Error) => void;\n};\n\nexport type LoggerFunction = (logLevel: LogLevel, category: LogCategory, message: string) => void;\n\nexport enum LogLevel {\n info = 'info',\n warn = 'warn',\n error = 'error',\n}\n\nexport enum LogCategory {\n general = 'general',\n connector = 'connector',\n event = 'event',\n engine = 'engine',\n sdk = 'sdk',\n}\n\n/**\n * Defines the behavior when encountering an error in the event / handler callback.\n */\nexport enum CallbackErrorBehavior {\n /**\n * Throws an error when encountering an error in a callback.\n */\n throw = 'throw',\n\n /**\n * Logs the error when encountering an error in a callback.\n */\n log = 'log',\n}\n\nexport type MaybePromise<T> = T | Promise<T>;\n\nexport type ManagedCallbacksConfigType = {\n handlers: {\n onAuthExpired: EngineCallbackHandler<\n (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>\n >;\n onViewportRequested: EngineCallbackHandler<() => Viewport | null>;\n };\n events: {\n onActionsChanged: EngineEvent<(state: DocumentAction[]) => MaybePromise<void>>;\n onStateChanged: EngineEvent<() => MaybePromise<void>>;\n onDocumentLoaded: EngineEvent<() => MaybePromise<void>>;\n onSelectedFramesLayoutChanged: EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>;\n onFramesLayoutChanged: EngineEvent<(states: FrameLayoutType[]) => MaybePromise<void>>;\n onSelectedFramesContentChanged: EngineEvent<(state: Frame[]) => MaybePromise<void>>;\n onPageSelectionChanged: EngineEvent<(id: Id) => MaybePromise<void>>;\n onSelectedLayoutPropertiesChanged: EngineEvent<(state: LayoutPropertiesType) => MaybePromise<void>>;\n onSelectedLayoutUnitChanged: EngineEvent<(unit: MeasurementUnit) => MaybePromise<void>>;\n onScrubberPositionChanged: EngineEvent<(state: AnimationPlaybackType) => MaybePromise<void>>;\n onFrameAnimationsChanged: EngineEvent<(animationState: FrameAnimationType[]) => MaybePromise<void>>;\n onVariableListChanged: EngineEvent<(variableList: Variable[]) => MaybePromise<void>>;\n onSelectedToolChanged: EngineEvent<(tool: ToolType) => MaybePromise<void>>;\n onUndoStackStateChanged: EngineEvent<(undoStackState: UndoState) => MaybePromise<void>>;\n onSelectedLayoutFramesChanged: EngineEvent<(frames: SelectedLayoutFrame[]) => MaybePromise<void>>;\n onSelectedTextStyleChanged: EngineEvent<(styles: SelectedTextStyle) => MaybePromise<void>>;\n onColorsChanged: EngineEvent<(colors: DocumentColor[]) => MaybePromise<void>>;\n onParagraphStylesChanged: EngineEvent<(paragraphStyles: ParagraphStyle[]) => MaybePromise<void>>;\n onCharacterStylesChanged: EngineEvent<(characterStyles: CharacterStyle[]) => MaybePromise<void>>;\n onFontFamiliesChanged: EngineEvent<(fontFamilies: DocumentFontFamily[]) => MaybePromise<void>>;\n onSelectedLayoutIdChanged: EngineEvent<(layoutId: string) => MaybePromise<void>>;\n onLayoutsChanged: EngineEvent<(layouts: LayoutListItemType[]) => MaybePromise<void>>;\n onConnectorEvent: EngineEvent<(event: ConnectorEvent) => MaybePromise<void>>;\n onConnectorsChanged: EngineEvent<(connectors: ConnectorInstance[]) => MaybePromise<void>>;\n onZoomChanged: EngineEvent<(scaleFactor: number) => MaybePromise<void>>;\n onSelectedPageIdChanged: EngineEvent<(pageId: Id) => MaybePromise<void>>;\n onPagesChanged: EngineEvent<(pages: Page[]) => MaybePromise<void>>;\n onPageSnapshotInvalidated: EngineEvent<(pageId: Id) => MaybePromise<void>>;\n onPageSizeChanged: EngineEvent<(pageSize: PageSize) => MaybePromise<void>>;\n onShapeCornerRadiusChanged: EngineEvent<(cornerRadius: CornerRadiusUpdateModel) => MaybePromise<void>>;\n onCropActiveFrameIdChanged: EngineEvent<(id?: Id) => MaybePromise<void>>;\n onAsyncError: EngineEvent<(asyncError: AsyncError) => MaybePromise<void>>;\n onViewModeChanged: EngineEvent<(tool: ViewMode) => MaybePromise<void>>;\n onBarcodeValidationChanged: EngineEvent<\n (validationResults: BarcodeFrameValidationResult[]) => MaybePromise<void>\n >;\n onDataSourceIdChanged: EngineEvent<(connectorId?: Id) => MaybePromise<void>>;\n onInjectedDataChanged: EngineEvent<(variableId: Id) => MaybePromise<void>>;\n onDocumentIssueListChanged: EngineEvent<(documentIssues: DocumentIssue[]) => MaybePromise<void>>;\n onCustomUndoDataChanged: EngineEvent<(customData: Record<string, string>) => MaybePromise<void>>;\n onEngineEditModeChanged: EngineEvent<(engineEditMode: EngineEditMode) => MaybePromise<void>>;\n onBrandKitMediaChanged: EngineEvent<(brandKitMedia: BrandKitMedia[]) => MaybePromise<void>>;\n };\n};\n\nexport type InitialCallbacksConfigType = {\n /**\n * @deprecated use `events.onActionsChanged` instead\n */\n onActionsChanged?: (state: DocumentAction[]) => void;\n\n /**\n * @deprecated use `events.onStateChanged` instead\n */\n onStateChanged?: () => void;\n\n /**\n * @deprecated use `events.onAuthExpired` instead\n */\n onAuthExpired?: (authRefreshRequest: AuthRefreshRequest) => Promise<AuthCredentials | null>;\n\n /**\n * @deprecated use `events.onViewportRequested` instead\n */\n onViewportRequested?: () => Viewport | null;\n\n /**\n * @deprecated use `events.onDocumentLoaded` instead\n */\n onDocumentLoaded?: () => void;\n\n /**\n * @deprecated use `onSelectedFramesLayoutChanged` instead\n *\n */\n onSelectedFrameLayoutChanged?: (state: FrameLayoutType) => void;\n\n /**\n * @deprecated use `events.onSelectedFramesLayoutChanged` instead\n */\n onSelectedFramesLayoutChanged?: (states: FrameLayoutType[]) => void;\n\n /**\n * @deprecated use `events.onFramesLayoutChanged` instead\n */\n onFramesLayoutChanged?: (states: FrameLayoutType[]) => void;\n\n /**\n * @deprecated use `onSelectedFramesContentChanged` instead\n */\n onSelectedFrameContentChanged?: (state: Frame | null) => void;\n\n /**\n * @deprecated use `events.onSelectedFramesContentChanged` instead\n */\n onSelectedFramesContentChanged?: (state: Frame[]) => void;\n\n /**\n * @deprecated use `onSelectedPageIdChanged` instead\n */\n onPageSelectionChanged?: (id: Id) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutPropertiesChanged` instead\n */\n onSelectedLayoutPropertiesChanged?: (state: LayoutPropertiesType) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutUnitChanged` instead\n */\n onSelectedLayoutUnitChanged?: (unit: MeasurementUnit) => void;\n\n /**\n * @deprecated use `events.onScrubberPositionChanged` instead\n */\n onScrubberPositionChanged?: (state: AnimationPlaybackType) => void;\n\n /**\n * @deprecated use `events.onFrameAnimationsChanged` instead\n */\n onFrameAnimationsChanged?: (animationState: FrameAnimationType[]) => void;\n\n /**\n * @deprecated use `events.onVariableListChanged` instead\n */\n onVariableListChanged?: (variableList: Variable[]) => void;\n\n /**\n * @deprecated use `events.onSelectedToolChanged` instead\n */\n onSelectedToolChanged?: (tool: ToolType) => void;\n\n /**\n * @deprecated use `events.onUndoStackStateChanged` instead\n */\n onUndoStackStateChanged?: (undoStackState: UndoState) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutFramesChanged` instead\n */\n onSelectedLayoutFramesChanged?: (frames: SelectedLayoutFrame[]) => void;\n\n /**\n * @deprecated use `events.onSelectedTextStyleChanged` instead\n */\n onSelectedTextStyleChanged?: (styles: SelectedTextStyle) => void;\n\n /**\n * @deprecated use `events.onColorsChanged` instead\n */\n onColorsChanged?: (colors: DocumentColor[]) => void;\n\n /**\n * @deprecated use `events.onParagraphStylesChanged` instead\n */\n onParagraphStylesChanged?: (paragraphStyles: ParagraphStyle[]) => void;\n\n /**\n * @deprecated use `events.onCharacterStylesChanged` instead\n */\n onCharacterStylesChanged?: (characterStyles: CharacterStyle[]) => void;\n\n /**\n * @deprecated use `events.onFontFamiliesChanged` instead\n */\n onFontFamiliesChanged?: (fontFamilies: DocumentFontFamily[]) => void;\n\n /**\n * @deprecated use `events.onSelectedLayoutIdChanged` instead\n */\n onSelectedLayoutIdChanged?: (layoutId: string) => void;\n\n /**\n * @deprecated use `events.onLayoutsChanged` instead\n */\n onLayoutsChanged?: (layouts: LayoutListItemType[]) => void;\n\n /**\n * @deprecated use `events.onConnectorEvent` instead\n */\n onConnectorEvent?: (event: ConnectorEvent) => void;\n\n /**\n * @deprecated use `events.onConnectorsChanged` instead\n */\n onConnectorsChanged?: (connectors: ConnectorInstance[]) => void;\n\n /**\n * @deprecated use `events.onZoomChanged` instead\n */\n onZoomChanged?: (scaleFactor: number) => void;\n\n /**\n *\n * @deprecated use `events.onSelectedPageIdChanged` instead\n */\n onSelectedPageIdChanged?: (pageId: Id) => void;\n\n /**\n *\n * @deprecated use `events.onPagesChanged` instead\n */\n onPagesChanged?: (pages: Page[]) => void;\n\n /**\n *\n * @deprecated use `events.onPageSnapshotInvalidated` instead\n */\n onPageSnapshotInvalidated?: (pageId: Id) => void;\n\n /**\n * @deprecated use `events.onPageSizeChanged` instead\n */\n onPageSizeChanged?: (pageSize: PageSize) => void;\n\n /**\n * @deprecated use `events.onShapeCornerRadiusChanged` instead\n */\n onShapeCornerRadiusChanged?: (cornerRadius: CornerRadiusUpdateModel) => void;\n\n /**\n * @deprecated use `events.onCropActiveFrameIdChanged` instead\n */\n onCropActiveFrameIdChanged?: (id?: Id) => void;\n\n /**\n * @deprecated use `events.onAsyncError` instead\n */\n onAsyncError?: (asyncError: AsyncError) => void;\n\n /**\n * @deprecated use `events.onViewModeChanged` instead\n */\n onViewModeChanged?: (tool: ViewMode) => void;\n\n /**\n * @deprecated use `events.onBarcodeValidationChanged` instead\n */\n onBarcodeValidationChanged?: (validationResults: BarcodeFrameValidationResult[]) => void;\n\n /**\n * @deprecated use `events.onDataSourceIdChanged` instead\n */\n onDataSourceIdChanged?: (connectorId?: Id) => void;\n\n /**\n * @deprecated use `events.onInjectedDataChanged` instead\n */\n onInjectedDataChanged?: (variableId: Id) => void;\n\n /**\n * @deprecated use `events.onDocumentIssueListChanged` instead\n */\n onDocumentIssueListChanged?: (documentIssues: DocumentIssue[]) => void;\n\n /**\n * @deprecated use `events.onCustomUndoDataChanged` instead\n */\n onCustomUndoDataChanged?: (customData: Record<string, string>) => void;\n\n /**\n * @deprecated use `events.onEngineEditModeChanged` instead\n */\n onEngineEditModeChanged?: (engineEditMode: EngineEditMode) => void;\n\n /**\n * @deprecated use `events.onBrandKitMediaChanged` instead\n */\n onBrandKitMediaChanged?: (brandKitMedia: BrandKitMedia[]) => void;\n};\n\nexport type ConfigType = InitialCallbacksConfigType & BaseConfigType;\nexport type RuntimeConfigType = ConfigType & ManagedCallbacksConfigType;\n\nexport type EditorResponseError = string;\n\nexport interface EditorResponse<T> {\n success: boolean;\n status: number;\n data?: string | null;\n error?: EditorResponseError | null;\n parsedData: T | null;\n}\n\nexport interface EditorRawAPI extends CallSender {\n [index: string]: <T>(...args: unknown[]) => Promise<T>;\n}\n\nexport interface EditorAPI extends CallSender {\n [index: string]: <T>(...args: unknown[]) => Promise<EditorResponse<T>>;\n}\n\nexport type PageType = {\n id: Id;\n number: number;\n width: number | null;\n height: number | null;\n frames: FrameType[];\n};\n\nexport type InitialStateType = {\n layouts: LayoutWithFrameProperties[];\n selectedLayoutId: Id;\n pages: PageType[];\n variables: Variable[];\n};\n\nexport interface PropertyState<T> {\n value: T;\n isOverride: boolean;\n isReadOnly: boolean;\n}\n\nexport interface HasOverrideState {\n isOverride: boolean;\n isReadOnly: boolean;\n}\n\nexport interface SelectedLayoutFrame {\n id: Id;\n name: string;\n type: FrameTypeEnum;\n isVisible: boolean;\n}\n\nexport type PrivateData = Record<string, string>;\n\nexport class SDKUnauthorizedError extends Error {\n constructor(message: string) {\n super(message);\n }\n}\n"],"names":["LogLevel","LogCategory","CallbackErrorBehavior"],"mappings":"AAqDO,IAAK,6BAAAA,cAAL;AACHA,YAAA,MAAA,IAAO;AACPA,YAAA,MAAA,IAAO;AACPA,YAAA,OAAA,IAAQ;AAHA,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;AAML,IAAK,gCAAAC,iBAAL;AACHA,eAAA,SAAA,IAAU;AACVA,eAAA,WAAA,IAAY;AACZA,eAAA,OAAA,IAAQ;AACRA,eAAA,QAAA,IAAS;AACTA,eAAA,KAAA,IAAM;AALE,SAAAA;AAAA,GAAA,eAAA,CAAA,CAAA;AAWL,IAAK,0CAAAC,2BAAL;AAIHA,yBAAA,OAAA,IAAQ;AAKRA,yBAAA,KAAA,IAAM;AATE,SAAAA;AAAA,GAAA,yBAAA,CAAA,CAAA;AA6VL,MAAM,6BAA6B,MAAM;AAAA,EAC5C,YAAY,SAAiB;AACzB,UAAM,OAAO;AAAA,EACjB;AACJ;"}
@@ -51,14 +51,18 @@ var ConnectorRegistrationSource = /* @__PURE__ */ ((ConnectorRegistrationSource2
51
51
  return ConnectorRegistrationSource2;
52
52
  })(ConnectorRegistrationSource || {});
53
53
  class ConnectorMapping {
54
- constructor(contextProperty, mapFrom, sourceValue, direction = "engineToConnector") {
54
+ constructor(contextProperty, mapFrom, sourceValue, direction = "engineToConnector", sourceField) {
55
55
  this.direction = "engineToConnector";
56
56
  this.name = contextProperty;
57
57
  this.direction = direction;
58
58
  if (mapFrom === "var") {
59
- this.value = `${mapFrom}.${sourceValue}`;
59
+ this.value = `var.${sourceValue}`;
60
+ this.id = sourceValue;
61
+ this.type = "var";
62
+ this.sourceField = sourceField;
60
63
  } else {
61
64
  this.value = sourceValue;
65
+ this.type = "value";
62
66
  }
63
67
  }
64
68
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectorTypes.cjs.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n value: string;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `${mapFrom}.${sourceValue}`;\n } else {\n this.value = sourceValue;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(message: string, public type: UploadAssetValidationErrorType) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedAuth"],"mappings":";;AAUO,IAAK,wCAAAA,yBAAL;AACHA,uBAAAA,qBAAA,UAAO,CAAA,IAAP;AACAA,uBAAAA,qBAAA,gBAAa,CAAA,IAAb;AAFQ,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAKL,IAAK,yDAAAC,0CAAL;AACHA,wCAAA,kBAAA,IAAmB;AACnBA,wCAAA,mBAAA,IAAoB;AAFZ,SAAAA;AAAA,GAAA,wCAAA,CAAA,CAAA;AAKL,IAAK,8BAAAC,eAAL;AACHA,aAAA,MAAA,IAAO;AACPA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AACHA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,MAAA,IAAO;AAIPA,iBAAA,YAAA,IAAa;AAPL,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAUL,IAAK,2BAAAC,YAAL;AACHA,UAAA,MAAA,IAAO;AACPA,UAAA,MAAA,IAAO;AACPA,UAAA,IAAA,IAAK;AAHG,SAAAA;AAAA,GAAA,UAAA,CAAA,CAAA;AAML,IAAK,8BAAAC,eAAL;AACHA,aAAA,WAAA,IAAY;AACZA,aAAA,YAAA,IA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ectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n id?: Id;\n sourceField?: string; // for data source variables\n type: ConnectorMappingSource;\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */\n value: string;\n id?: Id;\n type: ConnectorMappingSource.variable;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n sourceField?: string; // for data source variables\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n id?: Id;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `var.${sourceValue}`;\n this.id = sourceValue as Id;\n this.type = ConnectorMappingSource.variable;\n this.sourceField = sourceField;\n } else {\n this.value = sourceValue;\n this.type = ConnectorMappingSource.value;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(message: string, public type: UploadAssetValidationErrorType) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedAuth"],"mappings":";;AAUO,IAAK,wCAAAA,yBAAL;AACHA,uBAAAA,qBAAA,UAAO,CAAA,IAAP;AACAA,uBAAAA,qBAAA,gBAAa,CAAA,IAAb;AAFQ,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAKL,IAAK,yDAAAC,0CAAL;AACHA,wCAAA,kBAAA,IAAmB;AACnBA,wCAAA,mBAAA,IAAoB;AAFZ,SAAAA;AAAA,GAAA,wCAAA,CAAA,CAAA;AAKL,IAAK,8BAAAC,eAAL;AACHA,aAAA,MAAA,IAAO;AACPA,aAAA,YAAA,IAAa;AAFL,SAAAA;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AAe;AADP,SAAAA;AAAA,GAAA,kCAAA,CAAA,CAAA;AAIL,MAAM,mCAAmC,MAAM;AAAA,EAClD,YAAY,SAAwB,MAAsC;AACtE,UAAM,OAAO;AADmB,SAAA,OAAA;AAAA,EAEpC;AACJ;AAEO,IAAK,2CAAAC,4BAAL;AACHA,0BAAA,WAAA,IAAY;AACZA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,6BAAA,IAA8B;AAC9BA,0BAAA,iBAAA,IAAkB;AAClBA,0BAAA,MAAA,IAAO;AANC,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -90,20 +90,29 @@ export declare enum ConnectorRegistrationSource {
90
90
  export interface EngineToConnectorMapping {
91
91
  name: string;
92
92
  value: ContextDictionary[keyof ContextDictionary];
93
+ id?: Id;
94
+ sourceField?: string;
95
+ type: ConnectorMappingSource;
93
96
  direction: ConnectorMappingDirection.engineToConnector;
94
97
  }
95
98
  export interface ConnectorToEngineMapping {
96
99
  name: string;
100
+ /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */
97
101
  value: string;
102
+ id?: Id;
103
+ type: ConnectorMappingSource.variable;
98
104
  direction: ConnectorMappingDirection.connectorToEngine;
99
105
  }
100
106
  export type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;
101
107
  export declare class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {
102
108
  name: string;
103
109
  value: any;
110
+ sourceField?: string;
104
111
  direction: any;
112
+ type: any;
113
+ id?: Id;
105
114
  constructor(contextProperty: string, mapFrom: ConnectorMappingSource.variable, sourceValue: string, direction: ConnectorMappingDirection.connectorToEngine);
106
- constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number, direction?: ConnectorMappingDirection.engineToConnector);
115
+ constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number, direction?: ConnectorMappingDirection.engineToConnector, sourceField?: string);
107
116
  constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);
108
117
  }
109
118
  export type ConnectorState = {
@@ -49,14 +49,18 @@ var ConnectorRegistrationSource = /* @__PURE__ */ ((ConnectorRegistrationSource2
49
49
  return ConnectorRegistrationSource2;
50
50
  })(ConnectorRegistrationSource || {});
51
51
  class ConnectorMapping {
52
- constructor(contextProperty, mapFrom, sourceValue, direction = "engineToConnector") {
52
+ constructor(contextProperty, mapFrom, sourceValue, direction = "engineToConnector", sourceField) {
53
53
  this.direction = "engineToConnector";
54
54
  this.name = contextProperty;
55
55
  this.direction = direction;
56
56
  if (mapFrom === "var") {
57
- this.value = `${mapFrom}.${sourceValue}`;
57
+ this.value = `var.${sourceValue}`;
58
+ this.id = sourceValue;
59
+ this.type = "var";
60
+ this.sourceField = sourceField;
58
61
  } else {
59
62
  this.value = sourceValue;
63
+ this.type = "value";
60
64
  }
61
65
  }
62
66
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectorTypes.es.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n value: string;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `${mapFrom}.${sourceValue}`;\n } else {\n this.value = sourceValue;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(message: string, public type: UploadAssetValidationErrorType) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupport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UAAU;AAAA,EACnB;AACJ;AAEO,IAAK,4CAAAC,6BAAL;AACHA,2BAAA,YAAA,IAAa;AACbA,2BAAA,WAAA,IAAY;AAFJ,SAAAA;AAAA,GAAA,2BAAA,CAAA,CAAA;AAOL,IAAK,wCAAAC,yBAAL;AACHA,uBAAA,YAAA,IAAa;AACbA,uBAAA,KAAA,IAAM;AAFE,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAuCL,IAAK,mDAAAC,oCAAL;AACHA,kCAAA,cAAA,IAAe;AADP,SAAAA;AAAA,GAAA,kCAAA,CAAA,CAAA;AAIL,MAAM,mCAAmC,MAAM;AAAA,EAClD,YAAY,SAAwB,MAAsC;AACtE,UAAM,OAAO;AADmB,SAAA,OAAA;AAAA,EAEpC;AACJ;AAEO,IAAK,2CAAAC,4BAAL;AACHA,0BAAA,WAAA,IAAY;AACZA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,yBAAA,IAA0B;AAC1BA,0BAAA,6BAAA,IAA8B;AAC9BA,0BAAA,iBAAA,IAAkB;AAClBA,0BAAA,MAAA,IAAO;AANC,SAAAA;AAAA,GAAA,0BAAA,CAAA,CAAA;"}
1
+ {"version":3,"file":"ConnectorTypes.es.js","sources":["../../../src/types/ConnectorTypes.ts"],"sourcesContent":["import type {\n Dictionary as ContextDictionary,\n ConnectorConfigOptions as GenericConnectorConfigOptions,\n ConnectorConfigValue as GenericConnectorConfigValue,\n QueryPage as QueryResult,\n} from '@chili-studio/connector-types';\nimport { Id } from './CommonTypes';\n\nexport type { FilePointer, QueryOptions } from '@chili-studio/connector-types';\n\nexport enum DeprecatedMediaType {\n file = 0,\n collection = 1,\n}\n\nexport enum DeprecatedMediaConnectorDownloadType {\n LowResolutionWeb = 'lowresWeb',\n HighResolutionWeb = 'highresWeb',\n}\n\nexport enum MediaType {\n file = 'file',\n collection = 'collection',\n}\n\nexport enum ConnectorType {\n media = 'media',\n fonts = 'fonts',\n data = 'data',\n /**\n * @experimental This is still experimental and might change in future releases.\n */\n components = 'components',\n}\n\nexport enum SortBy {\n name = 'name',\n path = 'relativePath',\n id = 'id',\n}\n\nexport enum SortOrder {\n ascending = 'asc',\n descending = 'desc',\n}\n\nexport enum ConnectorConfigValueType {\n text = 'text',\n boolean = 'boolean',\n number = 'number',\n}\n\nexport enum ConnectorConfigContextType {\n query = 'query',\n upload = 'upload',\n}\n\nexport type ConnectorConfigValue = GenericConnectorConfigValue<ConnectorConfigValueType, ConnectorConfigContextType>;\nexport type ConnectorConfigOptions = GenericConnectorConfigOptions<\n ConnectorConfigValueType,\n ConnectorConfigContextType\n>;\n\ninterface ConnectorRegistrationBase {\n /**\n * Url to the connector.\n *\n * - If source is `url`, this must be a publicly accessible url.\n *\n * - If source is `grafx`, this must be the full url to the connector GET endpoint on GraFx Environment API.\n */\n url: string;\n\n /**\n * Connector source type.\n */\n source: ConnectorRegistrationSource;\n}\n\nexport interface ConnectorUrlRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.url;\n}\n\nexport interface ConnectorGrafxRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.grafx;\n}\n\nexport interface ConnectorLocalRegistration extends ConnectorRegistrationBase {\n source: ConnectorRegistrationSource.local;\n}\n\nexport type ConnectorRegistration = ConnectorUrlRegistration | ConnectorGrafxRegistration | ConnectorLocalRegistration;\n\nexport type ConnectorInstance = {\n id: Id;\n name: string;\n iconUrl: string;\n source: ConnectorRegistration;\n};\n\nexport enum ConnectorRegistrationSource {\n /**\n * Connector is hosted on a publicly accessible link.\n */\n url = 'url',\n\n /**\n * Connector is hosted on GraFx Environment API.\n */\n grafx = 'grafx',\n\n /**\n * Connector is embedded in the document.\n * Note: This is a temporary type; only to be used internally.\n */\n local = 'local',\n}\n\nexport interface EngineToConnectorMapping {\n name: string;\n value: ContextDictionary[keyof ContextDictionary];\n id?: Id;\n sourceField?: string; // for data source variables\n type: ConnectorMappingSource;\n direction: ConnectorMappingDirection.engineToConnector;\n}\n\nexport interface ConnectorToEngineMapping {\n name: string;\n /** @deprecated Use id instead. This property holds a string representation of the id in the form: var.<id> */\n value: string;\n id?: Id;\n type: ConnectorMappingSource.variable;\n direction: ConnectorMappingDirection.connectorToEngine;\n}\n\nexport type ConnectorMappingType = EngineToConnectorMapping | ConnectorToEngineMapping;\n\nexport class ConnectorMapping implements EngineToConnectorMapping, ConnectorToEngineMapping {\n name: string;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any;\n sourceField?: string; // for data source variables\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n direction: any = ConnectorMappingDirection.engineToConnector;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n type: any;\n id?: Id;\n\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource.variable,\n sourceValue: string,\n direction: ConnectorMappingDirection.connectorToEngine,\n );\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction?: ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n );\n constructor(contextProperty: string, mapFrom: ConnectorMappingSource, sourceValue: string | boolean | number);\n constructor(\n contextProperty: string,\n mapFrom: ConnectorMappingSource,\n sourceValue: string | boolean | number,\n direction = ConnectorMappingDirection.engineToConnector,\n sourceField?: string,\n ) {\n this.name = contextProperty;\n this.direction = direction;\n\n if (mapFrom === ConnectorMappingSource.variable) {\n this.value = `var.${sourceValue}`;\n this.id = sourceValue as Id;\n this.type = ConnectorMappingSource.variable;\n this.sourceField = sourceField;\n } else {\n this.value = sourceValue;\n this.type = ConnectorMappingSource.value;\n }\n }\n}\n\nexport type ConnectorState = {\n id: Id;\n type: ConnectorStateType;\n};\n\nexport type ConnectorEvent = {\n id: Id;\n type: ConnectorEventType;\n};\n\nexport type QueryPage<T> = Omit<QueryResult<T>, 'links'> & {\n nextPageToken?: string;\n};\n\nexport enum ConnectorMappingSource {\n variable = 'var',\n value = 'value',\n}\n\n/**\n * Direction of the Connector Mapping.\n */\nexport enum ConnectorMappingDirection {\n /**\n * Indicates the mapping will propagate a value to the connector. This\n * mapping might cause the linked connector to refresh.\n */\n engineToConnector = 'engineToConnector',\n\n /**\n * Indicates the mapping will propagate a value from inside the connector\n * to the engine. AKA \"reverse mapping\".\n */\n connectorToEngine = 'connectorToEngine',\n}\n\nexport enum ConnectorStateType {\n /**\n * Connector loading process has started.\n * Any SDK methods that required the connector id, will start working now.\n */\n loading = 'loading',\n\n /**\n * Connector loading completed.\n */\n loaded = 'loaded',\n\n /**\n * Connector is running in QuickJS.\n */\n\n running = 'running',\n\n /**\n * Connector is fully configured and has the correct authentication information.\n * At this point the connector is ready to make requests.\n */\n ready = 'ready',\n\n /**\n * Something went wrong, the connector is in error state.\n * Check the error message for more information.\n */\n error = 'error',\n}\n\nexport enum ConnectorEventType {\n /**\n * This event will be triggered by the following state changes of the connector\n * - loading\n * - loaded\n * - running\n * - ready\n * - error\n */\n stateChanged = 'stateChanged',\n\n /**\n * Authentication information is changed\n */\n authChanged = 'authChanged',\n\n /**\n * Connector configuration changed that requires the connector to be reloaded in QuickJS.\n * This will trigger multiple 'stateChanged' events while it is reloading.\n * Wait until 'ready'-stateChanged event is received to start using the connector again.\n */\n reloadRequired = 'reloadRequired',\n\n /**\n * Connector is unregistered and no longer exists inside the editor engine.\n * Don't use the 'connectorId' after receiving this event.\n */\n unloaded = 'unloaded',\n}\n\n/**\n * Hardcoded grafx media connector until we get it from the environment.\n */\nexport const grafxMediaConnectorRegistration: ConnectorLocalRegistration = {\n url: 'grafx-media.json',\n source: ConnectorRegistrationSource.local,\n};\n\n/**\n * Grafx token to return to the engine when it expires.\n */\nexport class GrafxTokenAuthCredentials {\n token: string;\n type = AuthCredentialsTypeEnum.grafxToken;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(token: string, headers?: Record<string, string>) {\n this.token = token;\n this.headers = headers;\n }\n}\n\n/**\n * Notification to return to the engine whenever a 3rd party auth (user impersonation)\n * has been renewed by the integration.\n */\nexport class RefreshedAuthCredendentials {\n type = AuthCredentialsTypeEnum.refreshed;\n /**\n * Optional HTTP headers to send with connector requests (e.g. Authorization).\n */\n headers?: Record<string, string>;\n\n constructor(headers?: Record<string, string>) {\n this.headers = headers;\n }\n}\n\nexport enum AuthCredentialsTypeEnum {\n grafxToken = 'grafxToken',\n refreshed = 'refreshed',\n}\n\nexport type AuthCredentials = GrafxTokenAuthCredentials | RefreshedAuthCredendentials;\n\nexport enum AuthRefreshTypeEnum {\n grafxToken = 'grafxToken',\n any = 'any',\n}\n\nexport type GrafxAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.grafxToken;\n};\n\n/**\n * @param connectorId connector id\n * @param remoteConnectorId remote connector id\n * @param headerValue the value of the X-GRAFX-UNAUTHORIZED header. This\n * will notify that the dam authentication expired if it went through the\n * proxy.\n * Example: \"Static, 1234\", \"OAuthClientCredentials, 5678\"\n * If the http request did not go through the proxy, headerValue is null.\n */\nexport type AnyAuthRefreshRequest = {\n type: AuthRefreshTypeEnum.any;\n connectorId: Id;\n remoteConnectorId: Id;\n headerValue: string | null;\n connectorDefinition: ConnectorDefinition;\n};\n\nexport type AuthRefreshRequest = GrafxAuthRefreshRequest | AnyAuthRefreshRequest;\n\nexport type ConnectorOptions = ContextDictionary;\nexport type MetaData = ContextDictionary;\n\nexport type UploadValidationConfiguration = {\n minWidthPixels?: number | null;\n maxWidthPixels?: number | null;\n minHeightPixels?: number | null;\n maxHeightPixels?: number | null;\n mimeTypes?: string[];\n};\n\nexport enum UploadAssetValidationErrorType {\n minDimension = 'minDimension',\n}\n\nexport class UploadAssetValidationError extends Error {\n constructor(message: string, public type: UploadAssetValidationErrorType) {\n super(message);\n }\n}\n\nexport enum ConnectorSupportedAuth {\n StaticKey = 'staticKey',\n OAuth2ClientCredentials = 'oAuth2ClientCredentials',\n OAuth2AuthorizationCode = 'oAuth2AuthorizationCode',\n OAuth2ResourceOwnerPassword = 'oAuth2ResourceOwnerPassword',\n OAuth2JwtBearer = 'oAuth2JwtBearer',\n None = 'none',\n}\n\ninterface ConnectorDefinition {\n id: Id;\n name: string;\n type: ConnectorType;\n supportedAuthentication: { browser: ConnectorSupportedAuth[]; server: ConnectorSupportedAuth[] };\n externalSourceId?: string | null;\n}\n"],"names":["DeprecatedMediaType","DeprecatedMediaConnectorDownloadType","MediaType","ConnectorType","SortBy","SortOrder","ConnectorConfigValueType","ConnectorConfigContextType","ConnectorRegistrationSource","ConnectorMappingSource","ConnectorMappingDirection","ConnectorStateType","ConnectorEventType","AuthCredentialsTypeEnum","AuthRefreshTypeEnum","UploadAssetValidationErrorType","ConnectorSupportedAuth"],"mappings":"AAUO,IAAK,wCAAAA,yBAAL;AACHA,uBAAAA,qBAAA,UAAO,CAAA,IAAP;AACAA,uBAAAA,qBAAA,gBAAa,CAAA,IAAb;AAFQ,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAKL,IAAK,yDAAAC,0CAAL;AACHA,wCAAA,kBAAA,IAAmB;AACnBA,wCAAA,mBAAA,IAAoB;AAFZ,SAAAA;AAAA,GAAA,wCAAA,CAAA,CAAA;AAKL,IAAK,8BAAAC,eAAL;AACHA,aAAA,MAAA,IAAO;AACPA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AACHA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,OAAA,IAAQ;AACRA,iBAAA,MAAA,IAAO;AAIPA,iBAAA,YAAA,IAAa;AAPL,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAUL,IAAK,2BAAAC,YAAL;AACHA,UAAA,MAAA,IAAO;AACPA,UAAA,MAAA,IAAO;AACPA,UAAA,IAAA,IAAK;AAHG,SAAAA;AAAA,GAAA,UAAA,CAAA,CAAA;AAML,IAAK,8BAAAC,eAAL;AACHA,aAAA,WAAA,IAAY;AACZA,aAAA,YAAA,IAAa;AAFL,SAAAA;AAAA,GAAA,aAAA,CAA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