@digipair/skill-web 0.70.4 → 0.71.1
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/index.cjs.js +5 -4
- package/index.esm.js +18 -13
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -11010,12 +11010,12 @@ let WebService = class WebService {
|
|
|
11010
11010
|
if (context.request.method === 'POST' && ((_context_request_body = context.request.body) == null ? void 0 : _context_request_body.type) === 'DIGIPAIR_EXECUTE_FACTORY') {
|
|
11011
11011
|
const param = context.request.body.params.path.split('[')[0];
|
|
11012
11012
|
const pinsSettingsList = this.findFactoryPinsSettings(context.request.body.params.path, params[param]);
|
|
11013
|
-
return JSON.stringify(await engine.executePinsList(pinsSettingsList, this.mergeConttext(context.request.body.context, context)));
|
|
11013
|
+
return JSON.stringify(await engine.executePinsList(pinsSettingsList, this.mergeConttext(context.request.body.context, context), `${context.request.body.params.path}.execute`));
|
|
11014
11014
|
}
|
|
11015
11015
|
const path = context.protected.req.path.replace(/\/$/g, '');
|
|
11016
11016
|
var _context_request_headers_xforwardedproto;
|
|
11017
11017
|
const baseUrl = ((_context_request_headers_xforwardedproto = context.request.headers['x-forwarded-proto']) != null ? _context_request_headers_xforwardedproto : context.protected.req.protocol) + '://' + context.request.headers.host + (context.request.params.length <= 0 || context.request.params[0] === '' ? path : path.substring(0, path.length - context.request.params.join('/').length - 1)) + '/__digipair_www__';
|
|
11018
|
-
await engine.executePinsList(factoryInitialize, context);
|
|
11018
|
+
await engine.executePinsList(factoryInitialize, context, `${context.__PATH__}.factoryInitialize`);
|
|
11019
11019
|
const html = `
|
|
11020
11020
|
<!DOCTYPE html>
|
|
11021
11021
|
<html style="${styleHtml}">
|
|
@@ -11054,9 +11054,10 @@ let WebService = class WebService {
|
|
|
11054
11054
|
},
|
|
11055
11055
|
variables: ${JSON.stringify(context.variables || {})},
|
|
11056
11056
|
request: ${JSON.stringify(context.request || {})},
|
|
11057
|
+
__PATH__: '${context.__PATH__}',
|
|
11057
11058
|
};
|
|
11058
11059
|
|
|
11059
|
-
await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserInitialize', browserInitialize))}, context);
|
|
11060
|
+
await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserInitialize', browserInitialize))}, context, context.__PATH__ + '.browserInitialize');
|
|
11060
11061
|
|
|
11061
11062
|
const pinsList = ${JSON.stringify(this.prepareBrowserPinsSettings('body', body))};
|
|
11062
11063
|
document.querySelectorAll('body > [data-digipair-pins]').forEach((element) => element.remove()); // Remove SSR elements
|
|
@@ -11066,7 +11067,7 @@ let WebService = class WebService {
|
|
|
11066
11067
|
}
|
|
11067
11068
|
|
|
11068
11069
|
setTimeout(async () => {
|
|
11069
|
-
await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserLoad', browserLoad))}, context);
|
|
11070
|
+
await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserLoad', browserLoad))}, context, context.__PATH__ + '.browserLoad');
|
|
11070
11071
|
}, 1);
|
|
11071
11072
|
|
|
11072
11073
|
window.addEventListener('beforeunload', (event) => {
|
package/index.esm.js
CHANGED
|
@@ -23903,14 +23903,14 @@ function indent(str, spaces) {
|
|
|
23903
23903
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
23904
23904
|
// match is required
|
|
23905
23905
|
if (!match) {
|
|
23906
|
-
return nextMatch = nextMatch1,
|
|
23906
|
+
return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
|
|
23907
23907
|
v: nextMatch1
|
|
23908
23908
|
};
|
|
23909
23909
|
}
|
|
23910
23910
|
var token = match.token, offset = match.offset;
|
|
23911
23911
|
i1 += offset;
|
|
23912
23912
|
if (token === " ") {
|
|
23913
|
-
return nextMatch = nextMatch1,
|
|
23913
|
+
return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
|
|
23914
23914
|
}
|
|
23915
23915
|
tokens1 = _to_consumable_array$1(tokens1).concat([
|
|
23916
23916
|
token
|
|
@@ -23929,7 +23929,7 @@ function indent(str, spaces) {
|
|
|
23929
23929
|
if (contextKeys.some(function(el) {
|
|
23930
23930
|
return el.startsWith(name);
|
|
23931
23931
|
})) {
|
|
23932
|
-
return nextMatch = nextMatch1,
|
|
23932
|
+
return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
|
|
23933
23933
|
}
|
|
23934
23934
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23935
23935
|
return el === name;
|
|
@@ -23948,9 +23948,9 @@ function indent(str, spaces) {
|
|
|
23948
23948
|
if (dateTimeIdentifiers.some(function(el) {
|
|
23949
23949
|
return el.startsWith(name);
|
|
23950
23950
|
})) {
|
|
23951
|
-
return nextMatch = nextMatch1,
|
|
23951
|
+
return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
|
|
23952
23952
|
}
|
|
23953
|
-
return nextMatch = nextMatch1,
|
|
23953
|
+
return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
|
|
23954
23954
|
v: nextMatch1
|
|
23955
23955
|
};
|
|
23956
23956
|
};
|
|
@@ -27839,7 +27839,8 @@ var _globalInstance___DIGIPAIR_CONFIG__;
|
|
|
27839
27839
|
const _config = globalInstance.__DIGIPAIR_CONFIG__ = (_globalInstance___DIGIPAIR_CONFIG__ = globalInstance.__DIGIPAIR_CONFIG__) != null ? _globalInstance___DIGIPAIR_CONFIG__ : {
|
|
27840
27840
|
LIBRARIES: {},
|
|
27841
27841
|
BASE_URL: 'https://cdn.jsdelivr.net/npm',
|
|
27842
|
-
ALIAS: []
|
|
27842
|
+
ALIAS: [],
|
|
27843
|
+
LOGGER: (level, path, message, context, data)=>{}
|
|
27843
27844
|
};
|
|
27844
27845
|
const isRemoteVersion = /^https?:\/\/[^\s/$.?#].[^\s]*$/;
|
|
27845
27846
|
const isPinsSettings = (value)=>{
|
|
@@ -27880,6 +27881,7 @@ const applyTemplate = (value, context)=>{
|
|
|
27880
27881
|
};
|
|
27881
27882
|
const executePins = async (settingsOrigin, context = {})=>{
|
|
27882
27883
|
var _settings_conditions, _settings_conditions1;
|
|
27884
|
+
_config.LOGGER('INFO', context.__PATH__, 'execute:start', context);
|
|
27883
27885
|
let settings = preparePinsSettings(settingsOrigin, context);
|
|
27884
27886
|
const alias = _config.ALIAS.find((alias)=>settings.library.split(':')[0] === alias.name);
|
|
27885
27887
|
const config = context.config || {};
|
|
@@ -27927,6 +27929,7 @@ const executePins = async (settingsOrigin, context = {})=>{
|
|
|
27927
27929
|
}
|
|
27928
27930
|
results.push(itemResult);
|
|
27929
27931
|
}
|
|
27932
|
+
_config.LOGGER('INFO', context.__PATH__, 'execute:end', context, results);
|
|
27930
27933
|
return results;
|
|
27931
27934
|
}
|
|
27932
27935
|
if (typeof ((_settings_conditions1 = settings.conditions) == null ? void 0 : _settings_conditions1.if) !== 'undefined' && !settings.conditions.if) {
|
|
@@ -27939,7 +27942,7 @@ const executePins = async (settingsOrigin, context = {})=>{
|
|
|
27939
27942
|
}
|
|
27940
27943
|
return await pins(settings.properties, settings.pins, context);
|
|
27941
27944
|
};
|
|
27942
|
-
const executePinsList = async (pinsSettingsList, context)=>{
|
|
27945
|
+
const executePinsList = async (pinsSettingsList, context, path = 'root')=>{
|
|
27943
27946
|
let previous = {};
|
|
27944
27947
|
for(let i = 0; i < pinsSettingsList.length; i++){
|
|
27945
27948
|
const settings = pinsSettingsList[i];
|
|
@@ -27949,7 +27952,8 @@ const executePinsList = async (pinsSettingsList, context)=>{
|
|
|
27949
27952
|
parent: {
|
|
27950
27953
|
previous: context.previous,
|
|
27951
27954
|
parent: context.parent
|
|
27952
|
-
}
|
|
27955
|
+
},
|
|
27956
|
+
__PATH__: `${path}[${i}]`
|
|
27953
27957
|
}));
|
|
27954
27958
|
} catch (error) {
|
|
27955
27959
|
if (error === 'DIGIPAIR_CONDITIONS_IF_FALSE') {
|
|
@@ -28019,7 +28023,7 @@ const generateElementFromPins = async (pinsSettings, parent, context, document =
|
|
|
28019
28023
|
const event = _event;
|
|
28020
28024
|
executePinsList(pinsList, _extends({}, context, {
|
|
28021
28025
|
event: event.detail
|
|
28022
|
-
}));
|
|
28026
|
+
}), `${context.__PATH__}.events[${key}]`);
|
|
28023
28027
|
});
|
|
28024
28028
|
});
|
|
28025
28029
|
const pinsList = settings.pins || [];
|
|
@@ -39041,12 +39045,12 @@ let WebService = class WebService {
|
|
|
39041
39045
|
if (context.request.method === 'POST' && ((_context_request_body = context.request.body) == null ? void 0 : _context_request_body.type) === 'DIGIPAIR_EXECUTE_FACTORY') {
|
|
39042
39046
|
const param = context.request.body.params.path.split('[')[0];
|
|
39043
39047
|
const pinsSettingsList = this.findFactoryPinsSettings(context.request.body.params.path, params[param]);
|
|
39044
|
-
return JSON.stringify(await executePinsList(pinsSettingsList, this.mergeConttext(context.request.body.context, context)));
|
|
39048
|
+
return JSON.stringify(await executePinsList(pinsSettingsList, this.mergeConttext(context.request.body.context, context), `${context.request.body.params.path}.execute`));
|
|
39045
39049
|
}
|
|
39046
39050
|
const path = context.protected.req.path.replace(/\/$/g, '');
|
|
39047
39051
|
var _context_request_headers_xforwardedproto;
|
|
39048
39052
|
const baseUrl = ((_context_request_headers_xforwardedproto = context.request.headers['x-forwarded-proto']) != null ? _context_request_headers_xforwardedproto : context.protected.req.protocol) + '://' + context.request.headers.host + (context.request.params.length <= 0 || context.request.params[0] === '' ? path : path.substring(0, path.length - context.request.params.join('/').length - 1)) + '/__digipair_www__';
|
|
39049
|
-
await executePinsList(factoryInitialize, context);
|
|
39053
|
+
await executePinsList(factoryInitialize, context, `${context.__PATH__}.factoryInitialize`);
|
|
39050
39054
|
const html = `
|
|
39051
39055
|
<!DOCTYPE html>
|
|
39052
39056
|
<html style="${styleHtml}">
|
|
@@ -39085,9 +39089,10 @@ let WebService = class WebService {
|
|
|
39085
39089
|
},
|
|
39086
39090
|
variables: ${JSON.stringify(context.variables || {})},
|
|
39087
39091
|
request: ${JSON.stringify(context.request || {})},
|
|
39092
|
+
__PATH__: '${context.__PATH__}',
|
|
39088
39093
|
};
|
|
39089
39094
|
|
|
39090
|
-
await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserInitialize', browserInitialize))}, context);
|
|
39095
|
+
await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserInitialize', browserInitialize))}, context, context.__PATH__ + '.browserInitialize');
|
|
39091
39096
|
|
|
39092
39097
|
const pinsList = ${JSON.stringify(this.prepareBrowserPinsSettings('body', body))};
|
|
39093
39098
|
document.querySelectorAll('body > [data-digipair-pins]').forEach((element) => element.remove()); // Remove SSR elements
|
|
@@ -39097,7 +39102,7 @@ let WebService = class WebService {
|
|
|
39097
39102
|
}
|
|
39098
39103
|
|
|
39099
39104
|
setTimeout(async () => {
|
|
39100
|
-
await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserLoad', browserLoad))}, context);
|
|
39105
|
+
await executePinsList(${JSON.stringify(this.prepareBrowserPinsSettings('browserLoad', browserLoad))}, context, context.__PATH__ + '.browserLoad');
|
|
39101
39106
|
}, 1);
|
|
39102
39107
|
|
|
39103
39108
|
window.addEventListener('beforeunload', (event) => {
|