@onify/flow-extensions 7.0.0 → 8.0.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/src/IO.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export class IOBase {
2
2
  constructor(parm) {
3
3
  this.name = parm.name;
4
- this.type = parm.definition && parm.definition.$type || 'string';
4
+ this.type = (parm.definition && parm.definition.$type) || 'string';
5
5
  this.behaviour = parm;
6
6
  }
7
7
  getValue(activity, executionMessage) {
@@ -18,12 +18,12 @@ class IOMap extends IOBase {
18
18
  getValue(activity, executionMessage) {
19
19
  const name = this.name;
20
20
  const entries = this.behaviour.definition.entries;
21
- if (!Array.isArray(entries)) return {[name]: {}};
21
+ if (!Array.isArray(entries)) return { [name]: {} };
22
22
 
23
23
  const environment = activity.environment;
24
24
 
25
25
  const result = {};
26
- for (const {key, value} of entries) {
26
+ for (const { key, value } of entries) {
27
27
  if (!key) continue;
28
28
 
29
29
  const val = environment.resolveExpression(value, executionMessage);
@@ -33,7 +33,7 @@ class IOMap extends IOBase {
33
33
  if (Array.isArray(current)) {
34
34
  current.push(val);
35
35
  } else {
36
- const items = result[key] = [];
36
+ const items = (result[key] = []);
37
37
  if (current !== undefined) items.push(current);
38
38
  items.push(val);
39
39
  }
@@ -42,7 +42,7 @@ class IOMap extends IOBase {
42
42
  }
43
43
  }
44
44
 
45
- return {[name]: result};
45
+ return { [name]: result };
46
46
  }
47
47
  }
48
48
 
@@ -55,7 +55,7 @@ export class IOList extends IOBase {
55
55
  const items = this.behaviour.definition.items;
56
56
 
57
57
  const result = [];
58
- if (!Array.isArray(items)) return {[name]: result};
58
+ if (!Array.isArray(items)) return { [name]: result };
59
59
 
60
60
  const environment = activity.environment;
61
61
  for (const item of items) {
@@ -80,7 +80,7 @@ export class IOScript extends IOBase {
80
80
  const name = this.name;
81
81
  const environment = activity.environment;
82
82
 
83
- const {fields, content, properties, ...rest} = executionMessage;
83
+ const { fields, content, properties, ...rest } = executionMessage;
84
84
  const scope = {
85
85
  id: this.id,
86
86
  type: this.type,
@@ -94,12 +94,12 @@ export class IOScript extends IOBase {
94
94
  ...rest,
95
95
  };
96
96
 
97
- const script = environment.scripts.getScript(definition.scriptFormat, {id: this.id});
97
+ const script = environment.scripts.getScript(definition.scriptFormat, { id: this.id });
98
98
 
99
99
  return new Promise((resolve, reject) => {
100
100
  return script.execute(scope, (err, result) => {
101
101
  if (err) return reject(err);
102
- resolve({[name]: result});
102
+ resolve({ [name]: result });
103
103
  });
104
104
  });
105
105
 
@@ -113,7 +113,7 @@ export class InputOutput {
113
113
  constructor(parentId, behaviour, context) {
114
114
  this.parentId = parentId;
115
115
  this.context = context;
116
- const {inputParameters, outputParameters} = behaviour;
116
+ const { inputParameters, outputParameters } = behaviour;
117
117
  this.input = this._map(parentId, inputParameters, 'input', context);
118
118
  this.output = this._map(parentId, outputParameters, 'output', context);
119
119
  }
@@ -145,7 +145,7 @@ export class InputOutput {
145
145
  }
146
146
  case 'camunda:Script': {
147
147
  const id = `${parentId}/${ioType}/${type}/${parm.name}`;
148
- const {scriptFormat, value, resource} = definition;
148
+ const { scriptFormat, value, resource } = definition;
149
149
 
150
150
  if (!value && !resource) break;
151
151
 
@@ -154,8 +154,8 @@ export class InputOutput {
154
154
  type: parm.$type,
155
155
  behaviour: {
156
156
  scriptFormat,
157
- ...(value && {script: value}),
158
- ...(resource && {resource}),
157
+ ...(value && { script: value }),
158
+ ...(resource && { resource }),
159
159
  },
160
160
  });
161
161
 
package/src/IOForm.js CHANGED
@@ -8,11 +8,11 @@ export default class IOForm {
8
8
  resolve(elementApi) {
9
9
  const form = {};
10
10
  for (const field of this.behaviour.fields) {
11
- const f = form[field.id] = {
11
+ const f = (form[field.id] = {
12
12
  ...field,
13
- ...(field.label && {defaultValue: elementApi.resolveExpression(field.label)}),
14
- ...(field.defaultValue && {defaultValue: elementApi.resolveExpression(field.defaultValue)}),
15
- };
13
+ ...(field.label && { defaultValue: elementApi.resolveExpression(field.label) }),
14
+ ...(field.defaultValue && { defaultValue: elementApi.resolveExpression(field.defaultValue) }),
15
+ });
16
16
  if (f.properties) {
17
17
  f.properties = new IOProperties(this.activity, f.properties).resolve(elementApi);
18
18
  }
@@ -6,7 +6,7 @@ export default class IOProperties {
6
6
  resolve(elementApi) {
7
7
  const properties = {};
8
8
 
9
- for (const {id, name, value} of this.behaviour.values) {
9
+ for (const { id, name, value } of this.behaviour.values) {
10
10
  properties[id || name] = elementApi.resolveExpression(value);
11
11
  }
12
12
 
@@ -1,65 +1,77 @@
1
- import { OnifyElementExtensions } from './OnifyElementExtensions.js';
2
-
3
- export class OnifyBoundaryEventExtensions extends OnifyElementExtensions {
4
- constructor(activity, context) {
5
- super(activity, context);
6
- this._syncFormatOnEnter = this._syncFormatOnEnter.bind(this);
7
- }
8
- activate(message) {
9
- const activity = this.activity;
10
- const formatQ = activity.broker.getQueue('format-run-q');
11
- const executionListeners = this.extensions.listeners;
12
-
13
- if (message.fields.redelivered && message.fields.routingKey === 'run.start') {
14
- activity.on('start', this._syncFormatOnEnter, { consumerTag: '_onify-extension-on-enter' });
15
- } else {
16
- activity.on('enter', this._syncFormatOnEnter, { consumerTag: '_onify-extension-on-enter' });
17
- }
18
-
19
- activity.on('activity.execution.completed', (elementApi) => {
20
- return this._onExecutionCompleted(elementApi, formatQ);
21
- }, { consumerTag: '_onify-extension-on-executed' });
22
-
23
- if (executionListeners?.onStart) {
24
- activity.on('start', async (elementApi) => {
25
- try {
26
- await executionListeners.execute('start', elementApi);
27
- } catch (err) {
28
- return activity.logger.error(`<${activity.id}> execution listener error`, err);
29
- }
30
- }, { consumerTag: '_onify-extension-on-listenerstart' });
31
- }
32
- if (executionListeners?.onEnd) {
33
- activity.on('end', (elementApi) => {
34
- this._executeExecutionListener('end', elementApi, formatQ);
35
- }, { consumerTag: '_onify-extension-on-listenerend' });
36
- }
37
- }
38
- _syncFormatOnEnter(elementApi) {
39
- try {
40
- var format = this._onEnterSync(elementApi);
41
- } catch (err) {
42
- return elementApi.broker.publish('format', 'run.enter.error', { error: err }, { persistent: false });
43
- }
44
-
45
- elementApi.broker.publish('format', 'run.enter.complete', format, { persistent: false });
46
- }
47
- _onEnterSync(elementApi) {
48
- const {format, properties, io} = this.extensions;
49
-
50
- const result = {};
51
- Object.assign(result, format.resolve(elementApi));
52
- Object.assign(elementApi.content, result);
53
-
54
- if (properties) {
55
- Object.assign(result, { properties: properties.resolve(elementApi) });
56
- Object.assign(elementApi.content, result);
57
- }
58
-
59
- if (io?.output?.length) {
60
- result.assignToOutput = true;
61
- }
62
-
63
- return result;
64
- }
65
- }
1
+ import { OnifyElementExtensions } from './OnifyElementExtensions.js';
2
+
3
+ export class OnifyBoundaryEventExtensions extends OnifyElementExtensions {
4
+ constructor(activity, context) {
5
+ super(activity, context);
6
+ this._syncFormatOnEnter = this._syncFormatOnEnter.bind(this);
7
+ }
8
+ activate(message) {
9
+ const activity = this.activity;
10
+ const formatQ = activity.broker.getQueue('format-run-q');
11
+ const executionListeners = this.extensions.listeners;
12
+
13
+ if (message.fields.redelivered && message.fields.routingKey === 'run.start') {
14
+ activity.on('start', this._syncFormatOnEnter, { consumerTag: '_onify-extension-on-enter' });
15
+ } else {
16
+ activity.on('enter', this._syncFormatOnEnter, { consumerTag: '_onify-extension-on-enter' });
17
+ }
18
+
19
+ activity.on(
20
+ 'activity.execution.completed',
21
+ (elementApi) => {
22
+ return this._onExecutionCompleted(elementApi, formatQ);
23
+ },
24
+ { consumerTag: '_onify-extension-on-executed' },
25
+ );
26
+
27
+ if (executionListeners?.onStart) {
28
+ activity.on(
29
+ 'start',
30
+ async (elementApi) => {
31
+ try {
32
+ await executionListeners.execute('start', elementApi);
33
+ } catch (err) {
34
+ return activity.logger.error(`<${activity.id}> execution listener error`, err);
35
+ }
36
+ },
37
+ { consumerTag: '_onify-extension-on-listenerstart' },
38
+ );
39
+ }
40
+ if (executionListeners?.onEnd) {
41
+ activity.on(
42
+ 'end',
43
+ (elementApi) => {
44
+ this._executeExecutionListener('end', elementApi, formatQ);
45
+ },
46
+ { consumerTag: '_onify-extension-on-listenerend' },
47
+ );
48
+ }
49
+ }
50
+ _syncFormatOnEnter(elementApi) {
51
+ try {
52
+ var format = this._onEnterSync(elementApi);
53
+ } catch (err) {
54
+ return elementApi.broker.publish('format', 'run.enter.error', { error: err }, { persistent: false });
55
+ }
56
+
57
+ elementApi.broker.publish('format', 'run.enter.complete', format, { persistent: false });
58
+ }
59
+ _onEnterSync(elementApi) {
60
+ const { format, properties, io } = this.extensions;
61
+
62
+ const result = {};
63
+ Object.assign(result, format.resolve(elementApi));
64
+ Object.assign(elementApi.content, result);
65
+
66
+ if (properties) {
67
+ Object.assign(result, { properties: properties.resolve(elementApi) });
68
+ Object.assign(elementApi.content, result);
69
+ }
70
+
71
+ if (io?.output?.length) {
72
+ result.assignToOutput = true;
73
+ }
74
+
75
+ return result;
76
+ }
77
+ }
@@ -1,141 +1,153 @@
1
- import {getExtensions} from './getExtensions.js';
2
-
3
- export class OnifyElementExtensions {
4
- constructor(activity, context) {
5
- this.activity = activity;
6
- this.context = context;
7
- this.formatQ = activity.broker.getQueue('format-run-q');
8
- this._asyncFormatOnEnter = this._asyncFormatOnEnter.bind(this);
9
-
10
- const { Service } = this.extensions = getExtensions(activity, context);
11
- if (Service) {
12
- activity.behaviour.Service = Service;
13
- }
14
- }
15
- activate(message) {
16
- const activity = this.activity;
17
- const executionListeners = this.extensions.listeners;
18
-
19
- if (message.fields.redelivered && message.fields.routingKey === 'run.start') {
20
- activity.on('start', this._asyncFormatOnEnter, {consumerTag: '_onify-extension-on-enter'});
21
- } else {
22
- activity.on('enter', this._asyncFormatOnEnter, {consumerTag: '_onify-extension-on-enter'});
23
- }
24
-
25
- activity.on('activity.execution.completed', (elementApi) => {
26
- return this._onExecutionCompleted(elementApi);
27
- }, {consumerTag: '_onify-extension-on-executed'});
28
-
29
- if (executionListeners?.onStart) {
30
- activity.on('start', (elementApi) => {
31
- this._executeExecutionListener('start', elementApi);
32
- }, {consumerTag: '_onify-extension-on-listenerstart'});
33
- }
34
-
35
- if (executionListeners?.onEnd) {
36
- activity.on('end', (elementApi) => {
37
- this._executeExecutionListener('end', elementApi);
38
- }, {consumerTag: '_onify-extension-on-listenerend'});
39
- }
40
- }
41
- deactivate() {
42
- const broker = this.activity.broker;
43
- broker.cancel('_onify-extension-on-enter');
44
- broker.cancel('_onify-extension-on-executed');
45
- broker.cancel('_onify-extension-on-listenerstart');
46
- broker.cancel('_onify-extension-on-listenerend');
47
- }
48
- async _asyncFormatOnEnter(elementApi) {
49
- this.formatQ.queueMessage({routingKey: 'run.enter.format'}, {endRoutingKey: 'run.enter.complete'}, {persistent: false});
50
-
51
- try {
52
- var format = await this._onEnterAsync(elementApi);
53
- } catch (err) {
54
- return elementApi.broker.publish('format', 'run.enter.error', {error: err}, {persistent: false});
55
- }
56
-
57
- elementApi.broker.publish('format', 'run.enter.complete', format, {persistent: false});
58
- }
59
- async _onExecutionCompleted(elementApi) {
60
- this.formatQ.queueMessage({routingKey: 'run.end.format'}, { endRoutingKey: 'run.end.complete' }, { persistent: false });
61
-
62
- try {
63
- var format = await this._onExecuted(elementApi);
64
- } catch (err) {
65
- return elementApi.broker.publish('format', 'run.end.error', { error: err }, {persistent: false});
66
- }
67
-
68
- elementApi.broker.publish('format', 'run.end.complete', { ...format }, {persistent: false});
69
- }
70
- async _onEnterAsync(elementApi) {
71
- const {format, properties, io, form} = this.extensions;
72
-
73
- const result = {};
74
- Object.assign(result, format.resolve(elementApi));
75
- Object.assign(elementApi.content, result);
76
-
77
- if (properties) {
78
- Object.assign(result, {properties: properties.resolve(elementApi)});
79
- Object.assign(elementApi.content, result);
80
- }
81
-
82
- if (io) {
83
- if (io.input?.length) {
84
- const input = await io.getInput(this.activity, elementApi);
85
- Object.assign(result, {input});
86
- Object.assign(elementApi.content, result);
87
- }
88
- if (io.output?.length) {
89
- result.assignToOutput = true;
90
- }
91
- }
92
-
93
- if (form) {
94
- Object.assign(result, {form: form.resolve(elementApi)});
95
- }
96
-
97
- return result;
98
- }
99
- async _onExecuted(elementApi) {
100
- const {properties, io} = this.extensions;
101
-
102
- const result = {};
103
- if (io?.output.length) {
104
- const output = await io.getOutput(this.activity, elementApi);
105
- Object.assign(result, {output});
106
- Object.assign(elementApi.content, {output});
107
- }
108
-
109
- if (properties) {
110
- const props = properties.resolve(elementApi);
111
- Object.assign(result, {properties: props});
112
- Object.assign(elementApi.content, {properties: props});
113
- }
114
-
115
- const {output, assignToOutput, resultVariable} = elementApi.content;
116
-
117
- if (output !== undefined && output !== null) {
118
- if (assignToOutput && typeof output === 'object') {
119
- Object.assign(this.activity.environment.output, output);
120
- } else if (resultVariable) {
121
- elementApi.environment.output[resultVariable] = output;
122
- }
123
- }
124
-
125
- return result;
126
- }
127
- async _executeExecutionListener(eventName, elementApi) {
128
- const routingKey = 'run.listener.' + eventName;
129
- const endRoutingKey = routingKey + '.complete';
130
-
131
- this.formatQ.queueMessage({ routingKey }, { endRoutingKey }, { persistent: false });
132
-
133
- try {
134
- var format = await this.extensions.listeners.execute(eventName, elementApi);
135
- } catch (err) {
136
- return elementApi.broker.publish('format', routingKey + '.error', { error: err }, { persistent: false });
137
- }
138
-
139
- elementApi.broker.publish('format', endRoutingKey, { ...format }, { persistent: false });
140
- }
141
- }
1
+ import { getExtensions } from './getExtensions.js';
2
+
3
+ export class OnifyElementExtensions {
4
+ constructor(activity, context) {
5
+ this.activity = activity;
6
+ this.context = context;
7
+ this.formatQ = activity.broker.getQueue('format-run-q');
8
+ this._asyncFormatOnEnter = this._asyncFormatOnEnter.bind(this);
9
+
10
+ const { Service } = (this.extensions = getExtensions(activity, context));
11
+ if (Service) {
12
+ activity.behaviour.Service = Service;
13
+ }
14
+ }
15
+ activate(message) {
16
+ const activity = this.activity;
17
+ const executionListeners = this.extensions.listeners;
18
+
19
+ if (message.fields.redelivered && message.fields.routingKey === 'run.start') {
20
+ activity.on('start', this._asyncFormatOnEnter, { consumerTag: '_onify-extension-on-enter' });
21
+ } else {
22
+ activity.on('enter', this._asyncFormatOnEnter, { consumerTag: '_onify-extension-on-enter' });
23
+ }
24
+
25
+ activity.on(
26
+ 'activity.execution.completed',
27
+ (elementApi) => {
28
+ return this._onExecutionCompleted(elementApi);
29
+ },
30
+ { consumerTag: '_onify-extension-on-executed' },
31
+ );
32
+
33
+ if (executionListeners?.onStart) {
34
+ activity.on(
35
+ 'start',
36
+ (elementApi) => {
37
+ this._executeExecutionListener('start', elementApi);
38
+ },
39
+ { consumerTag: '_onify-extension-on-listenerstart' },
40
+ );
41
+ }
42
+
43
+ if (executionListeners?.onEnd) {
44
+ activity.on(
45
+ 'end',
46
+ (elementApi) => {
47
+ this._executeExecutionListener('end', elementApi);
48
+ },
49
+ { consumerTag: '_onify-extension-on-listenerend' },
50
+ );
51
+ }
52
+ }
53
+ deactivate() {
54
+ const broker = this.activity.broker;
55
+ broker.cancel('_onify-extension-on-enter');
56
+ broker.cancel('_onify-extension-on-executed');
57
+ broker.cancel('_onify-extension-on-listenerstart');
58
+ broker.cancel('_onify-extension-on-listenerend');
59
+ }
60
+ async _asyncFormatOnEnter(elementApi) {
61
+ this.formatQ.queueMessage({ routingKey: 'run.enter.format' }, { endRoutingKey: 'run.enter.complete' }, { persistent: false });
62
+
63
+ try {
64
+ var format = await this._onEnterAsync(elementApi);
65
+ } catch (err) {
66
+ return elementApi.broker.publish('format', 'run.enter.error', { error: err }, { persistent: false });
67
+ }
68
+
69
+ elementApi.broker.publish('format', 'run.enter.complete', format, { persistent: false });
70
+ }
71
+ async _onExecutionCompleted(elementApi) {
72
+ this.formatQ.queueMessage({ routingKey: 'run.end.format' }, { endRoutingKey: 'run.end.complete' }, { persistent: false });
73
+
74
+ try {
75
+ var format = await this._onExecuted(elementApi);
76
+ } catch (err) {
77
+ return elementApi.broker.publish('format', 'run.end.error', { error: err }, { persistent: false });
78
+ }
79
+
80
+ elementApi.broker.publish('format', 'run.end.complete', { ...format }, { persistent: false });
81
+ }
82
+ async _onEnterAsync(elementApi) {
83
+ const { format, properties, io, form } = this.extensions;
84
+
85
+ const result = {};
86
+ Object.assign(result, format.resolve(elementApi));
87
+ Object.assign(elementApi.content, result);
88
+
89
+ if (properties) {
90
+ Object.assign(result, { properties: properties.resolve(elementApi) });
91
+ Object.assign(elementApi.content, result);
92
+ }
93
+
94
+ if (io) {
95
+ if (io.input?.length) {
96
+ const input = await io.getInput(this.activity, elementApi);
97
+ Object.assign(result, { input });
98
+ Object.assign(elementApi.content, result);
99
+ }
100
+ if (io.output?.length) {
101
+ result.assignToOutput = true;
102
+ }
103
+ }
104
+
105
+ if (form) {
106
+ Object.assign(result, { form: form.resolve(elementApi) });
107
+ }
108
+
109
+ return result;
110
+ }
111
+ async _onExecuted(elementApi) {
112
+ const { properties, io } = this.extensions;
113
+
114
+ const result = {};
115
+ if (io?.output.length) {
116
+ const output = await io.getOutput(this.activity, elementApi);
117
+ Object.assign(result, { output });
118
+ Object.assign(elementApi.content, { output });
119
+ }
120
+
121
+ if (properties) {
122
+ const props = properties.resolve(elementApi);
123
+ Object.assign(result, { properties: props });
124
+ Object.assign(elementApi.content, { properties: props });
125
+ }
126
+
127
+ const { output, assignToOutput, resultVariable } = elementApi.content;
128
+
129
+ if (output !== undefined && output !== null) {
130
+ if (assignToOutput && typeof output === 'object') {
131
+ Object.assign(this.activity.environment.output, output);
132
+ } else if (resultVariable) {
133
+ elementApi.environment.output[resultVariable] = output;
134
+ }
135
+ }
136
+
137
+ return result;
138
+ }
139
+ async _executeExecutionListener(eventName, elementApi) {
140
+ const routingKey = 'run.listener.' + eventName;
141
+ const endRoutingKey = routingKey + '.complete';
142
+
143
+ this.formatQ.queueMessage({ routingKey }, { endRoutingKey }, { persistent: false });
144
+
145
+ try {
146
+ var format = await this.extensions.listeners.execute(eventName, elementApi);
147
+ } catch (err) {
148
+ return elementApi.broker.publish('format', routingKey + '.error', { error: err }, { persistent: false });
149
+ }
150
+
151
+ elementApi.broker.publish('format', endRoutingKey, { ...format }, { persistent: false });
152
+ }
153
+ }
@@ -1,40 +1,49 @@
1
- import {FormatError} from './Errors.js';
2
- import {getExtensions} from './getExtensions.js';
3
-
4
- export class OnifyProcessExtensions {
5
- constructor(bp, context) {
6
- this.process = bp;
7
- this.context = context;
8
- this.extensions = getExtensions(bp, context);
9
- this._activate();
10
- }
11
- _activate() {
12
- const bp = this.process;
13
- bp.on('process.enter', (elementApi) => {
14
- try {
15
- const result = this._onEnter(elementApi);
16
- const environment = elementApi.environment;
17
- environment.assignVariables(result);
18
- } catch (err) {
19
- elementApi.broker.publish('event', 'process.error', {
20
- ...elementApi.content,
21
- error: new FormatError(bp.id, err),
22
- }, {mandatory: true, type: 'error'});
23
- }
24
- }, {consumerTag: '_onify-extension-on-enter'});
25
- }
26
- _onEnter(elementApi) {
27
- const {format, properties} = this.extensions;
28
- const result = {};
29
-
30
- Object.assign(result, format.resolve(elementApi));
31
- Object.assign(elementApi.content, result);
32
-
33
- if (properties) {
34
- Object.assign(result, properties.resolve(elementApi));
35
- Object.assign(elementApi.content, result);
36
- }
37
-
38
- return result;
39
- }
40
- }
1
+ import { FormatError } from './Errors.js';
2
+ import { getExtensions } from './getExtensions.js';
3
+
4
+ export class OnifyProcessExtensions {
5
+ constructor(bp, context) {
6
+ this.process = bp;
7
+ this.context = context;
8
+ this.extensions = getExtensions(bp, context);
9
+ this._activate();
10
+ }
11
+ _activate() {
12
+ const bp = this.process;
13
+ bp.on(
14
+ 'process.enter',
15
+ (elementApi) => {
16
+ try {
17
+ const result = this._onEnter(elementApi);
18
+ const environment = elementApi.environment;
19
+ environment.assignVariables(result);
20
+ } catch (err) {
21
+ elementApi.broker.publish(
22
+ 'event',
23
+ 'process.error',
24
+ {
25
+ ...elementApi.content,
26
+ error: new FormatError(bp.id, err),
27
+ },
28
+ { mandatory: true, type: 'error' },
29
+ );
30
+ }
31
+ },
32
+ { consumerTag: '_onify-extension-on-enter' },
33
+ );
34
+ }
35
+ _onEnter(elementApi) {
36
+ const { format, properties } = this.extensions;
37
+ const result = {};
38
+
39
+ Object.assign(result, format.resolve(elementApi));
40
+ Object.assign(elementApi.content, result);
41
+
42
+ if (properties) {
43
+ Object.assign(result, properties.resolve(elementApi));
44
+ Object.assign(elementApi.content, result);
45
+ }
46
+
47
+ return result;
48
+ }
49
+ }