@chili-publish/studio-sdk 1.12.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/_bundles/main.js +1 -1
- package/_bundles/main.js.map +1 -1
- package/_bundles/report.html +2 -2
- package/lib/editor-engine.json +1 -1
- package/lib/package.json +1 -1
- package/lib/src/controllers/ConfigurationController.d.ts +6 -6
- package/lib/src/controllers/ConfigurationController.js +31 -23
- package/lib/src/controllers/ConfigurationController.js.map +1 -1
- package/lib/src/controllers/ConnectorController.d.ts +2 -2
- package/lib/src/controllers/ConnectorController.js +35 -6
- package/lib/src/controllers/ConnectorController.js.map +1 -1
- package/lib/src/controllers/FrameController.d.ts +85 -1
- package/lib/src/controllers/FrameController.js +169 -0
- package/lib/src/controllers/FrameController.js.map +1 -1
- package/lib/src/controllers/SubscriberController.d.ts +5 -1
- package/lib/src/controllers/SubscriberController.js +7 -2
- package/lib/src/controllers/SubscriberController.js.map +1 -1
- package/lib/src/controllers/VariableController.d.ts +55 -0
- package/lib/src/controllers/VariableController.js +101 -3
- package/lib/src/controllers/VariableController.js.map +1 -1
- package/lib/src/index.d.ts +3 -3
- package/lib/src/index.js +1 -1
- package/lib/src/index.js.map +1 -1
- package/lib/src/next/NextInitiator.d.ts +2 -0
- package/lib/src/next/NextInitiator.js +2 -0
- package/lib/src/next/NextInitiator.js.map +1 -1
- package/lib/src/next/controllers/ConnectorController.d.ts +43 -0
- package/lib/src/next/controllers/ConnectorController.js +79 -0
- package/lib/src/next/controllers/ConnectorController.js.map +1 -0
- package/lib/src/next/controllers/SubscriberController.d.ts +5 -0
- package/lib/src/next/controllers/SubscriberController.js +8 -0
- package/lib/src/next/controllers/SubscriberController.js.map +1 -1
- package/lib/src/next/controllers/VariableController.d.ts +10 -0
- package/lib/src/next/controllers/VariableController.js +14 -0
- package/lib/src/next/controllers/VariableController.js.map +1 -1
- package/lib/src/next/index.d.ts +1 -0
- package/lib/src/next/tests/controllers/ConnectorController.test.js +72 -0
- package/lib/src/next/tests/controllers/ConnectorController.test.js.map +1 -0
- package/lib/src/next/tests/controllers/SubscriberContoller.test.d.ts +1 -0
- package/lib/src/next/tests/controllers/SubscriberContoller.test.js +44 -0
- package/lib/src/next/tests/controllers/SubscriberContoller.test.js.map +1 -0
- package/lib/src/next/tests/controllers/VariableController.test.js +34 -1
- package/lib/src/next/tests/controllers/VariableController.test.js.map +1 -1
- package/lib/src/next/types/ConnectorTypes.d.ts +44 -0
- package/lib/src/next/types/ConnectorTypes.js +22 -0
- package/lib/src/next/types/ConnectorTypes.js.map +1 -0
- package/lib/src/next/types/VariableTypes.d.ts +13 -1
- package/lib/src/next/types/VariableTypes.js +11 -1
- package/lib/src/next/types/VariableTypes.js.map +1 -1
- package/lib/src/sdk.d.ts +2 -1
- package/lib/src/sdk.js +7 -6
- package/lib/src/sdk.js.map +1 -1
- package/lib/src/tests/__mocks__/localConfig.d.ts +2 -0
- package/lib/src/tests/__mocks__/localConfig.js +4 -0
- package/lib/src/tests/__mocks__/localConfig.js.map +1 -0
- package/lib/src/tests/controllers/ConnectorController.test.js +54 -10
- package/lib/src/tests/controllers/ConnectorController.test.js.map +1 -1
- package/lib/src/tests/controllers/FrameController.test.js +99 -1
- package/lib/src/tests/controllers/FrameController.test.js.map +1 -1
- package/lib/src/tests/controllers/SubscriberContoller.test.js +36 -6
- package/lib/src/tests/controllers/SubscriberContoller.test.js.map +1 -1
- package/lib/src/tests/controllers/VariableController.test.js +62 -1
- package/lib/src/tests/controllers/VariableController.test.js.map +1 -1
- package/lib/src/tests/utils/ConnectorCompatibilityTools.test.d.ts +1 -0
- package/lib/src/tests/utils/ConnectorCompatibilityTools.test.js +74 -0
- package/lib/src/tests/utils/ConnectorCompatibilityTools.test.js.map +1 -0
- package/lib/src/tests/utils/LocalConfigurationDecorator.test.d.ts +1 -0
- package/lib/src/tests/utils/LocalConfigurationDecorator.test.js +61 -0
- package/lib/src/tests/utils/LocalConfigurationDecorator.test.js.map +1 -0
- package/lib/src/types/ConnectorTypes.d.ts +2 -2
- package/lib/src/types/ConnectorTypes.js +1 -1
- package/lib/src/types/FrameTypes.d.ts +43 -0
- package/lib/src/types/FrameTypes.js +7 -0
- package/lib/src/types/FrameTypes.js.map +1 -1
- package/lib/src/types/VariableTypes.d.ts +28 -0
- package/lib/src/types/VariableTypes.js.map +1 -1
- package/lib/src/utils/ConnectorCompatibilityTools.d.ts +17 -0
- package/lib/src/utils/ConnectorCompatibilityTools.js +54 -0
- package/lib/src/utils/ConnectorCompatibilityTools.js.map +1 -0
- package/lib/src/utils/LocalConfigurationDecorator.d.ts +23 -0
- package/lib/src/utils/LocalConfigurationDecorator.js +76 -0
- package/lib/src/utils/LocalConfigurationDecorator.js.map +1 -0
- package/package.json +1 -1
- package/lib/src/tests/controllers/ConfigurationConnectorController.test.js +0 -54
- package/lib/src/tests/controllers/ConfigurationConnectorController.test.js.map +0 -1
- /package/lib/src/{tests/controllers/ConfigurationConnectorController.test.d.ts → next/tests/controllers/ConnectorController.test.d.ts} +0 -0
|
@@ -18,6 +18,7 @@ export declare type FrameLayoutType = {
|
|
|
18
18
|
minCopyfitting: PropertyState<number>;
|
|
19
19
|
maxCopyfitting: PropertyState<number>;
|
|
20
20
|
enableCopyfitting: PropertyState<boolean>;
|
|
21
|
+
autoGrow: AutoGrowSettings;
|
|
21
22
|
} | null;
|
|
22
23
|
export declare type FrameType = {
|
|
23
24
|
id: Id;
|
|
@@ -139,6 +140,48 @@ export declare type CropSettings = {
|
|
|
139
140
|
export declare type NoCropSettings = {
|
|
140
141
|
type: 'noCrop';
|
|
141
142
|
};
|
|
143
|
+
export declare type AutoGrowSettings = {
|
|
144
|
+
enabled: PropertyState<boolean>;
|
|
145
|
+
minWidth: PropertyState<number>;
|
|
146
|
+
maxWidth: PropertyState<number>;
|
|
147
|
+
minHeight: PropertyState<number>;
|
|
148
|
+
maxHeight: PropertyState<number>;
|
|
149
|
+
directions: PropertyState<Array<AutoGrowDirection>>;
|
|
150
|
+
};
|
|
151
|
+
export interface AutoGrowDeltaUpdate {
|
|
152
|
+
enabled?: {
|
|
153
|
+
value: boolean;
|
|
154
|
+
};
|
|
155
|
+
minWidth?: {
|
|
156
|
+
value: string | null;
|
|
157
|
+
};
|
|
158
|
+
maxWidth?: {
|
|
159
|
+
value: string | null;
|
|
160
|
+
};
|
|
161
|
+
minHeight?: {
|
|
162
|
+
value: string | null;
|
|
163
|
+
};
|
|
164
|
+
maxHeight?: {
|
|
165
|
+
value: string | null;
|
|
166
|
+
};
|
|
167
|
+
directions?: {
|
|
168
|
+
value: Array<AutoGrowDirection>;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
export interface AutoGrowResetUpdate {
|
|
172
|
+
resetEnabled?: boolean;
|
|
173
|
+
resetMinWidth?: boolean;
|
|
174
|
+
resetMaxWidth?: boolean;
|
|
175
|
+
resetMinHeight?: boolean;
|
|
176
|
+
resetMaxHeight?: boolean;
|
|
177
|
+
resetDirections?: boolean;
|
|
178
|
+
}
|
|
179
|
+
export declare enum AutoGrowDirection {
|
|
180
|
+
top = "top",
|
|
181
|
+
bottom = "bottom",
|
|
182
|
+
left = "left",
|
|
183
|
+
right = "right"
|
|
184
|
+
}
|
|
142
185
|
export declare enum ImageSourceTypeEnum {
|
|
143
186
|
url = "url",
|
|
144
187
|
variable = "variable",
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export var AutoGrowDirection;
|
|
2
|
+
(function (AutoGrowDirection) {
|
|
3
|
+
AutoGrowDirection["top"] = "top";
|
|
4
|
+
AutoGrowDirection["bottom"] = "bottom";
|
|
5
|
+
AutoGrowDirection["left"] = "left";
|
|
6
|
+
AutoGrowDirection["right"] = "right";
|
|
7
|
+
})(AutoGrowDirection || (AutoGrowDirection = {}));
|
|
1
8
|
export var ImageSourceTypeEnum;
|
|
2
9
|
(function (ImageSourceTypeEnum) {
|
|
3
10
|
ImageSourceTypeEnum["url"] = "url";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FrameTypes.js","sourceRoot":"","sources":["../../../src/types/FrameTypes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FrameTypes.js","sourceRoot":"","sources":["../../../src/types/FrameTypes.ts"],"names":[],"mappings":"AA0MA,MAAM,CAAN,IAAY,iBAKX;AALD,WAAY,iBAAiB;IACzB,gCAAW,CAAA;IACX,sCAAiB,CAAA;IACjB,kCAAa,CAAA;IACb,oCAAe,CAAA;AACnB,CAAC,EALW,iBAAiB,KAAjB,iBAAiB,QAK5B;AAED,MAAM,CAAN,IAAY,mBAIX;AAJD,WAAY,mBAAmB;IAC3B,kCAAW,CAAA;IACX,4CAAqB,CAAA;IACrB,8CAAuB,CAAA;AAC3B,CAAC,EAJW,mBAAmB,KAAnB,mBAAmB,QAI9B;AAED,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACrB,8BAAa,CAAA;IACb,gCAAe,CAAA;IACf,gCAAe,CAAA;IACf,oCAAmB,CAAA;AACvB,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC7B,8CAAqB,CAAA;IACrB,sCAAa,CAAA;AACjB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAED,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,4CAA2B,CAAA;IAC3B,4CAA2B,CAAA;IAC3B,8BAAa,CAAA;AACjB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACrB,0CAAyB,CAAA;IACzB,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;AACrB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB;AAED,MAAM,CAAN,IAAY,aAKX;AALD,WAAY,aAAa;IACrB,4BAAW,CAAA;IACX,kCAAiB,CAAA;IACjB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;AACvB,CAAC,EALW,aAAa,KAAb,aAAa,QAKxB;AAED,MAAM,CAAN,IAAY,SAiBX;AAjBD,WAAY,SAAS;IACjB,8BAAiB,CAAA;IACjB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,8BAAiB,CAAA;IACjB,gCAAmB,CAAA;IACnB,sCAAyB,CAAA;IACzB,oCAAuB,CAAA;IACvB,oCAAuB,CAAA;IACvB,oCAAuB,CAAA;IACvB,sCAAyB,CAAA;IACzB,oCAAuB,CAAA;IACvB,kCAAqB,CAAA;IACrB,wBAAW,CAAA;IACX,sCAAyB,CAAA;IACzB,4BAAe,CAAA;IACf,sCAAyB,CAAA;AAC7B,CAAC,EAjBW,SAAS,KAAT,SAAS,QAiBpB;AAED,MAAM,CAAN,IAAY,OAGX;AAHD,WAAY,OAAO;IACf,sBAAW,CAAA;IACX,wBAAa,CAAA;AACjB,CAAC,EAHW,OAAO,KAAP,OAAO,QAGlB;AAED,MAAM,CAAN,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC1B,mDAA6B,CAAA;IAC7B,+CAAyB,CAAA;IACzB,mDAA6B,CAAA;IAC7B,mDAA6B,CAAA;AACjC,CAAC,EALW,kBAAkB,KAAlB,kBAAkB,QAK7B"}
|
|
@@ -40,6 +40,8 @@ export interface Variable {
|
|
|
40
40
|
isReadonly: boolean;
|
|
41
41
|
isRequired: boolean;
|
|
42
42
|
occurrences: number;
|
|
43
|
+
placeholder?: string | null;
|
|
44
|
+
helpText?: string | null;
|
|
43
45
|
}
|
|
44
46
|
export interface ImageVariable extends Variable {
|
|
45
47
|
value?: ConnectorImageVariableSource;
|
|
@@ -51,12 +53,16 @@ export interface ListVariableItem {
|
|
|
51
53
|
export interface ListVariable extends Variable {
|
|
52
54
|
items: string[];
|
|
53
55
|
selected?: string;
|
|
56
|
+
prefix?: ValueWithStyle;
|
|
57
|
+
suffix?: ValueWithStyle;
|
|
54
58
|
}
|
|
55
59
|
export interface BooleanVariable extends Variable {
|
|
56
60
|
value: boolean;
|
|
57
61
|
}
|
|
58
62
|
export interface ShortTextVariable extends Variable {
|
|
59
63
|
value: string;
|
|
64
|
+
prefix?: ValueWithStyle;
|
|
65
|
+
suffix?: ValueWithStyle;
|
|
60
66
|
}
|
|
61
67
|
export interface NumberVariable extends Variable {
|
|
62
68
|
value: number;
|
|
@@ -68,6 +74,8 @@ export interface NumberVariable extends Variable {
|
|
|
68
74
|
maxValue?: number;
|
|
69
75
|
showStepper: boolean;
|
|
70
76
|
stepSize: number;
|
|
77
|
+
prefix?: ValueWithStyle;
|
|
78
|
+
suffix?: ValueWithStyle;
|
|
71
79
|
}
|
|
72
80
|
export interface DateVariable extends Variable {
|
|
73
81
|
value?: string;
|
|
@@ -76,10 +84,16 @@ export interface DateVariable extends Variable {
|
|
|
76
84
|
endDate?: DateRestriction;
|
|
77
85
|
excludedDays: Day[];
|
|
78
86
|
locale: Locale;
|
|
87
|
+
prefix?: ValueWithStyle;
|
|
88
|
+
suffix?: ValueWithStyle;
|
|
79
89
|
}
|
|
80
90
|
export declare type LongTextVariable = ShortTextVariable;
|
|
81
91
|
export declare type GroupVariable = Variable;
|
|
82
92
|
export declare type DateRestriction = RelativeDate | AbsoluteDate;
|
|
93
|
+
export interface ValueWithStyle {
|
|
94
|
+
value?: string;
|
|
95
|
+
style?: string;
|
|
96
|
+
}
|
|
83
97
|
export interface RelativeDate {
|
|
84
98
|
offset: number;
|
|
85
99
|
type: 'relative';
|
|
@@ -155,3 +169,17 @@ export interface NumberVariablePropertiesDeltaUpdate {
|
|
|
155
169
|
value: string;
|
|
156
170
|
};
|
|
157
171
|
}
|
|
172
|
+
export interface PrefixSuffixDeltaUpdate {
|
|
173
|
+
prefix?: {
|
|
174
|
+
value: string | null;
|
|
175
|
+
};
|
|
176
|
+
suffix?: {
|
|
177
|
+
value: string | null;
|
|
178
|
+
};
|
|
179
|
+
prefixCharacterStyleId?: {
|
|
180
|
+
value: string | null;
|
|
181
|
+
};
|
|
182
|
+
suffixCharacterStyleId?: {
|
|
183
|
+
value: string | null;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VariableTypes.js","sourceRoot":"","sources":["../../../src/types/VariableTypes.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACpB,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,iCAAiB,CAAA;IACjB,6BAAa,CAAA;AACjB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB;
|
|
1
|
+
{"version":3,"file":"VariableTypes.js","sourceRoot":"","sources":["../../../src/types/VariableTypes.ts"],"names":[],"mappings":"AAwBA,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACpB,uCAAuB,CAAA;IACvB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,6BAAa,CAAA;IACb,mCAAmB,CAAA;IACnB,+BAAe,CAAA;IACf,iCAAiB,CAAA;IACjB,6BAAa,CAAA;AACjB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB;AAwFD,MAAM,CAAN,IAAY,GAQX;AARD,WAAY,GAAG;IACX,wBAAiB,CAAA;IACjB,0BAAmB,CAAA;IACnB,8BAAuB,CAAA;IACvB,4BAAqB,CAAA;IACrB,wBAAiB,CAAA;IACjB,4BAAqB,CAAA;IACrB,wBAAiB,CAAA;AACrB,CAAC,EARW,GAAG,KAAH,GAAG,QAQd;AAED,MAAM,CAAN,IAAY,MAcX;AAdD,WAAY,MAAM;IACd,yBAAe,CAAA;IACf,mBAAS,CAAA;IACT,mBAAS,CAAA;IACT,mBAAS,CAAA;IACT,mBAAS,CAAA;IACT,mBAAS,CAAA;IACT,mBAAS,CAAA;IACT,mBAAS,CAAA;IACT,mBAAS,CAAA;IACT,mBAAS,CAAA;IACT,yBAAe,CAAA;IACf,yBAAe,CAAA;IACf,mBAAS,CAAA;AACb,CAAC,EAdW,MAAM,KAAN,MAAM,QAcjB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ConnectorInstance, ConnectorRegistration } from '../types/ConnectorTypes';
|
|
2
|
+
import * as Next from '../next/types/ConnectorTypes';
|
|
3
|
+
export declare class ConnectorCompatibilityTools {
|
|
4
|
+
/**
|
|
5
|
+
* Since `ConnectorGrafxRegistration` uses `RemoteConnectorId` instead of `url` on the engine side,
|
|
6
|
+
* we extract that `id` from the source `url`
|
|
7
|
+
* **/
|
|
8
|
+
makeConnectorSourceForwardsCompatible: (registration: ConnectorRegistration | Next.ConnectorGrafxRegistration) => ConnectorRegistration | Next.ConnectorGrafxRegistration;
|
|
9
|
+
makeMultipleConnectorsBackwardsCompatible: (connectors: Next.ConnectorInstance[], baseUrl: string | undefined) => ConnectorInstance[];
|
|
10
|
+
makeSingleConnectorBackwardsCompatible: (connector: Next.ConnectorInstance, baseUrl: string | undefined) => ConnectorInstance;
|
|
11
|
+
/**
|
|
12
|
+
* Since `ConnectorGrafxRegistration` uses `RemoteConnectorId` instead of `url` on the engine side,
|
|
13
|
+
* we generate that `url` from the `baseUrl` and `id`
|
|
14
|
+
* **/
|
|
15
|
+
makeConnectorSourceBackwardsCompatible: (connector: Next.ConnectorGrafxRegistration, baseUrl: string | undefined) => ConnectorRegistration;
|
|
16
|
+
private isSourceMigrated;
|
|
17
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { ConnectorRegistrationSource } from '../types/ConnectorTypes';
|
|
2
|
+
export class ConnectorCompatibilityTools {
|
|
3
|
+
constructor() {
|
|
4
|
+
/**
|
|
5
|
+
* Since `ConnectorGrafxRegistration` uses `RemoteConnectorId` instead of `url` on the engine side,
|
|
6
|
+
* we extract that `id` from the source `url`
|
|
7
|
+
* **/
|
|
8
|
+
this.makeConnectorSourceForwardsCompatible = (registration) => {
|
|
9
|
+
if (registration.source != ConnectorRegistrationSource.grafx) {
|
|
10
|
+
return registration;
|
|
11
|
+
}
|
|
12
|
+
if (this.isSourceMigrated(registration)) {
|
|
13
|
+
return registration;
|
|
14
|
+
}
|
|
15
|
+
let url = registration.url;
|
|
16
|
+
while (url.endsWith('/')) {
|
|
17
|
+
url = url.substring(0, url.length - 1);
|
|
18
|
+
}
|
|
19
|
+
const pathChunks = url.split('/');
|
|
20
|
+
// `RemoteConnectorId` is always the very last part of the URL
|
|
21
|
+
const remoteConnectorId = pathChunks[pathChunks.length - 1];
|
|
22
|
+
return { id: remoteConnectorId, source: ConnectorRegistrationSource.grafx };
|
|
23
|
+
};
|
|
24
|
+
this.makeMultipleConnectorsBackwardsCompatible = (connectors, baseUrl) => connectors.map((connector) => this.makeSingleConnectorBackwardsCompatible(connector, baseUrl));
|
|
25
|
+
this.makeSingleConnectorBackwardsCompatible = (connector, baseUrl) => {
|
|
26
|
+
if (connector.source.source != ConnectorRegistrationSource.grafx) {
|
|
27
|
+
return connector;
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
id: connector.id,
|
|
31
|
+
name: connector.name,
|
|
32
|
+
iconUrl: connector.iconUrl,
|
|
33
|
+
source: this.makeConnectorSourceBackwardsCompatible(connector.source, baseUrl),
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Since `ConnectorGrafxRegistration` uses `RemoteConnectorId` instead of `url` on the engine side,
|
|
38
|
+
* we generate that `url` from the `baseUrl` and `id`
|
|
39
|
+
* **/
|
|
40
|
+
this.makeConnectorSourceBackwardsCompatible = (connector, baseUrl) => {
|
|
41
|
+
let url = baseUrl;
|
|
42
|
+
while (url === null || url === void 0 ? void 0 : url.endsWith('/')) {
|
|
43
|
+
url = url.substring(0, url.length - 1);
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
url: `${url}/connectors/${connector.id}`,
|
|
47
|
+
source: ConnectorRegistrationSource.grafx,
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
// Helps to promote a correct type
|
|
51
|
+
this.isSourceMigrated = (registration) => 'id' in registration;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=ConnectorCompatibilityTools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectorCompatibilityTools.js","sourceRoot":"","sources":["../../../src/utils/ConnectorCompatibilityTools.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAGhH,MAAM,OAAO,2BAA2B;IAAxC;QACI;;;cAGM;QACN,0CAAqC,GAAG,CACpC,YAAqE,EACd,EAAE;YACzD,IAAI,YAAY,CAAC,MAAM,IAAI,2BAA2B,CAAC,KAAK,EAAE;gBAC1D,OAAO,YAAY,CAAC;aACvB;YAED,IAAI,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAAE;gBACrC,OAAO,YAAY,CAAC;aACvB;YAED,IAAI,GAAG,GAAG,YAAY,CAAC,GAAG,CAAC;YAE3B,OAAO,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACtB,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;aAC1C;YAED,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAClC,8DAA8D;YAC9D,MAAM,iBAAiB,GAAG,UAAU,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAE5D,OAAO,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,EAAE,2BAA2B,CAAC,KAAK,EAAE,CAAC;QAChF,CAAC,CAAC;QAEF,8CAAyC,GAAG,CACxC,UAAoC,EACpC,OAA2B,EACR,EAAE,CACrB,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,IAAI,CAAC,sCAAsC,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;QAEnG,2CAAsC,GAAG,CACrC,SAAiC,EACjC,OAA2B,EACV,EAAE;YACnB,IAAI,SAAS,CAAC,MAAM,CAAC,MAAM,IAAI,2BAA2B,CAAC,KAAK,EAAE;gBAC9D,OAAO,SAA8B,CAAC;aACzC;YAED,OAAO;gBACH,EAAE,EAAE,SAAS,CAAC,EAAE;gBAChB,IAAI,EAAE,SAAS,CAAC,IAAI;gBACpB,OAAO,EAAE,SAAS,CAAC,OAAO;gBAC1B,MAAM,EAAE,IAAI,CAAC,sCAAsC,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC;aACjF,CAAC;QACN,CAAC,CAAC;QAEF;;;cAGM;QACN,2CAAsC,GAAG,CACrC,SAA0C,EAC1C,OAA2B,EACN,EAAE;YACvB,IAAI,GAAG,GAAG,OAAO,CAAC;YAElB,OAAO,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACvB,GAAG,GAAG,GAAG,CAAC,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;aAC1C;YAED,OAAO;gBACH,GAAG,EAAE,GAAG,GAAG,eAAe,SAAS,CAAC,EAAE,EAAE;gBACxC,MAAM,EAAE,2BAA2B,CAAC,KAAK;aAC5C,CAAC;QACN,CAAC,CAAC;QAEF,kCAAkC;QAC1B,qBAAgB,GAAG,CACvB,YAAqE,EACtB,EAAE,CAAC,IAAI,IAAI,YAAY,CAAC;IAC/E,CAAC;CAAA"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { WellKnownConfigurationKeys } from '../types/ConfigurationTypes';
|
|
2
|
+
import { ConfigurationController } from '../controllers/ConfigurationController';
|
|
3
|
+
import { EditorAPI } from '../types/CommonTypes';
|
|
4
|
+
export declare class LocalConfigurationDecorator extends ConfigurationController {
|
|
5
|
+
#private;
|
|
6
|
+
/**
|
|
7
|
+
* @ignore
|
|
8
|
+
*/
|
|
9
|
+
constructor(editorAPI: EditorAPI, localConfig: Map<string, string>);
|
|
10
|
+
/**
|
|
11
|
+
* This method returns the value for a given configuration key. If a value was not found in the configuration store,
|
|
12
|
+
* this method returns an error. The key cannot be null.
|
|
13
|
+
* @returns value for a given configuration key
|
|
14
|
+
*/
|
|
15
|
+
getValue(key: WellKnownConfigurationKeys | string): Promise<import("../types/CommonTypes").EditorResponse<string>>;
|
|
16
|
+
/**
|
|
17
|
+
* This method sets or overrides the value for a given key.
|
|
18
|
+
* Null values are not allowed for both key and value,
|
|
19
|
+
* using them will result in an error.
|
|
20
|
+
* @returns
|
|
21
|
+
*/
|
|
22
|
+
setValue(key: WellKnownConfigurationKeys | string, value: string): Promise<import("../types/CommonTypes").EditorResponse<null>>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
11
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
13
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
14
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
15
|
+
};
|
|
16
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
17
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
18
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
19
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
20
|
+
};
|
|
21
|
+
var _LocalConfigurationDecorator_localConfig;
|
|
22
|
+
import { getEditorResponseData } from './EditorResponseData';
|
|
23
|
+
import { ConfigurationController } from '../controllers/ConfigurationController';
|
|
24
|
+
export class LocalConfigurationDecorator extends ConfigurationController {
|
|
25
|
+
/**
|
|
26
|
+
* @ignore
|
|
27
|
+
*/
|
|
28
|
+
constructor(editorAPI, localConfig) {
|
|
29
|
+
super(editorAPI);
|
|
30
|
+
/**
|
|
31
|
+
* @ignore
|
|
32
|
+
*/
|
|
33
|
+
_LocalConfigurationDecorator_localConfig.set(this, void 0);
|
|
34
|
+
__classPrivateFieldSet(this, _LocalConfigurationDecorator_localConfig, localConfig, "f");
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* This method returns the value for a given configuration key. If a value was not found in the configuration store,
|
|
38
|
+
* this method returns an error. The key cannot be null.
|
|
39
|
+
* @returns value for a given configuration key
|
|
40
|
+
*/
|
|
41
|
+
getValue(key) {
|
|
42
|
+
const _super = Object.create(null, {
|
|
43
|
+
getValue: { get: () => super.getValue }
|
|
44
|
+
});
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const value = __classPrivateFieldGet(this, _LocalConfigurationDecorator_localConfig, "f").get(key);
|
|
47
|
+
if (value != null) {
|
|
48
|
+
return getEditorResponseData({
|
|
49
|
+
status: 200,
|
|
50
|
+
success: true,
|
|
51
|
+
parsedData: value,
|
|
52
|
+
data: value,
|
|
53
|
+
}, false);
|
|
54
|
+
}
|
|
55
|
+
return _super.getValue.call(this, key);
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* This method sets or overrides the value for a given key.
|
|
60
|
+
* Null values are not allowed for both key and value,
|
|
61
|
+
* using them will result in an error.
|
|
62
|
+
* @returns
|
|
63
|
+
*/
|
|
64
|
+
setValue(key, value) {
|
|
65
|
+
const _super = Object.create(null, {
|
|
66
|
+
setValue: { get: () => super.setValue }
|
|
67
|
+
});
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const res = _super.setValue.call(this, key, value);
|
|
70
|
+
__classPrivateFieldGet(this, _LocalConfigurationDecorator_localConfig, "f").set(key, value);
|
|
71
|
+
return res;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
_LocalConfigurationDecorator_localConfig = new WeakMap();
|
|
76
|
+
//# sourceMappingURL=LocalConfigurationDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalConfigurationDecorator.js","sourceRoot":"","sources":["../../../src/utils/LocalConfigurationDecorator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wCAAwC,CAAC;AAGjF,MAAM,OAAO,2BAA4B,SAAQ,uBAAuB;IAMpE;;OAEG;IACH,YAAY,SAAoB,EAAE,WAAgC;QAC9D,KAAK,CAAC,SAAS,CAAC,CAAC;QATrB;;WAEG;QACH,2DAAkC;QAO9B,uBAAA,IAAI,4CAAgB,WAAW,MAAA,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACG,QAAQ,CAAC,GAAwC;;;;;YACnD,MAAM,KAAK,GAAG,uBAAA,IAAI,gDAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACzC,IAAI,KAAK,IAAI,IAAI,EAAE;gBACf,OAAO,qBAAqB,CACxB;oBACI,MAAM,EAAE,GAAG;oBACX,OAAO,EAAE,IAAI;oBACb,UAAU,EAAE,KAAK;oBACjB,IAAI,EAAE,KAAK;iBACd,EACD,KAAK,CACR,CAAC;aACL;YAED,OAAO,OAAM,QAAQ,YAAC,GAAG,EAAE;QAC/B,CAAC;KAAA;IAED;;;;;OAKG;IACG,QAAQ,CAAC,GAAwC,EAAE,KAAa;;;;;YAClE,MAAM,GAAG,GAAG,OAAM,QAAQ,YAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YACvC,uBAAA,IAAI,gDAAa,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;YAClC,OAAO,GAAG,CAAC;QACf,CAAC;KAAA;CACJ"}
|
package/package.json
CHANGED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
|
-
import { ConfigurationController } from '../../controllers/ConfigurationController';
|
|
11
|
-
import { defaultStudioOptions } from '../../types/ConfigurationTypes';
|
|
12
|
-
import { getEditorResponseData, castToEditorResponse } from '../../utils/EditorResponseData';
|
|
13
|
-
let mockedConfigurationController;
|
|
14
|
-
const mockEditorApi = {
|
|
15
|
-
setConfigValue: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
16
|
-
getConfigValue: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
17
|
-
getEngineSessionId: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
18
|
-
updateStudioOptions: () => __awaiter(void 0, void 0, void 0, function* () { return getEditorResponseData(castToEditorResponse(null)); }),
|
|
19
|
-
};
|
|
20
|
-
beforeEach(() => {
|
|
21
|
-
mockedConfigurationController = new ConfigurationController(mockEditorApi);
|
|
22
|
-
jest.spyOn(mockEditorApi, 'setConfigValue');
|
|
23
|
-
jest.spyOn(mockEditorApi, 'getConfigValue');
|
|
24
|
-
jest.spyOn(mockEditorApi, 'getEngineSessionId');
|
|
25
|
-
jest.spyOn(mockEditorApi, 'updateStudioOptions');
|
|
26
|
-
});
|
|
27
|
-
afterEach(() => {
|
|
28
|
-
jest.restoreAllMocks();
|
|
29
|
-
});
|
|
30
|
-
describe('ConfigurationController', () => {
|
|
31
|
-
const configKey = 'dam';
|
|
32
|
-
const configValue = 'm123';
|
|
33
|
-
it('Should call the setValue method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
-
yield mockedConfigurationController.setValue(configKey, configValue);
|
|
35
|
-
expect(mockEditorApi.setConfigValue).toHaveBeenCalledTimes(1);
|
|
36
|
-
expect(mockEditorApi.setConfigValue).toHaveBeenCalledWith(configKey, configValue);
|
|
37
|
-
}));
|
|
38
|
-
it('Should call the getValue method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
39
|
-
yield mockedConfigurationController.getValue(configKey);
|
|
40
|
-
expect(mockEditorApi.getConfigValue).toHaveBeenCalledTimes(1);
|
|
41
|
-
expect(mockEditorApi.getConfigValue).toHaveBeenCalledWith(configKey);
|
|
42
|
-
}));
|
|
43
|
-
it('Should call the getEngineSessionId method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
44
|
-
yield mockedConfigurationController.getEngineSessionId();
|
|
45
|
-
expect(mockEditorApi.getEngineSessionId).toHaveBeenCalledTimes(1);
|
|
46
|
-
}));
|
|
47
|
-
it('Should call the setStudioOptions method', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
48
|
-
const options = defaultStudioOptions;
|
|
49
|
-
yield mockedConfigurationController.updateStudioOptions(options);
|
|
50
|
-
expect(mockEditorApi.updateStudioOptions).toHaveBeenCalledTimes(1);
|
|
51
|
-
expect(mockEditorApi.updateStudioOptions).toHaveBeenCalledWith(JSON.stringify(options));
|
|
52
|
-
}));
|
|
53
|
-
});
|
|
54
|
-
//# sourceMappingURL=ConfigurationConnectorController.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ConfigurationConnectorController.test.js","sourceRoot":"","sources":["../../../../src/tests/controllers/ConfigurationConnectorController.test.ts"],"names":[],"mappings":"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"}
|