@digipair/skill-basic 0.45.3 → 0.45.4
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
CHANGED
@@ -23,9 +23,17 @@ let BasicService = class BasicService {
|
|
23
23
|
context.variables[name] = result;
|
24
24
|
return result;
|
25
25
|
}
|
26
|
+
async base64ToBuffer(params, _pinsSettingsList, context) {
|
27
|
+
const { base64 } = params;
|
28
|
+
const data = base64.replace(/^data:\/\w+;base64,/, '');
|
29
|
+
const buffer = Buffer.from(data, 'base64');
|
30
|
+
return buffer;
|
31
|
+
}
|
26
32
|
};
|
27
33
|
const transform = (params, pinsSettingsList, context)=>new BasicService().transform(params, pinsSettingsList, context);
|
28
34
|
const setVariable = (params, pinsSettingsList, context)=>new BasicService().setVariable(params, pinsSettingsList, context);
|
35
|
+
const base64ToBuffer = (params, pinsSettingsList, context)=>new BasicService().setVariable(params, pinsSettingsList, context);
|
29
36
|
|
37
|
+
exports.base64ToBuffer = base64ToBuffer;
|
30
38
|
exports.setVariable = setVariable;
|
31
39
|
exports.transform = transform;
|
package/index.esm.js
CHANGED
@@ -23899,14 +23899,14 @@ function indent(str, spaces) {
|
|
23899
23899
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
23900
23900
|
// match is required
|
23901
23901
|
if (!match) {
|
23902
|
-
return tokens = tokens1,
|
23902
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
|
23903
23903
|
v: nextMatch1
|
23904
23904
|
};
|
23905
23905
|
}
|
23906
23906
|
var token = match.token, offset = match.offset;
|
23907
23907
|
i1 += offset;
|
23908
23908
|
if (token === " ") {
|
23909
|
-
return tokens = tokens1,
|
23909
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
23910
23910
|
}
|
23911
23911
|
tokens1 = _to_consumable_array$1(tokens1).concat([
|
23912
23912
|
token
|
@@ -23925,7 +23925,7 @@ function indent(str, spaces) {
|
|
23925
23925
|
if (contextKeys.some(function(el) {
|
23926
23926
|
return el.startsWith(name);
|
23927
23927
|
})) {
|
23928
|
-
return tokens = tokens1,
|
23928
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
23929
23929
|
}
|
23930
23930
|
if (dateTimeIdentifiers.some(function(el) {
|
23931
23931
|
return el === name;
|
@@ -23944,9 +23944,9 @@ function indent(str, spaces) {
|
|
23944
23944
|
if (dateTimeIdentifiers.some(function(el) {
|
23945
23945
|
return el.startsWith(name);
|
23946
23946
|
})) {
|
23947
|
-
return tokens = tokens1,
|
23947
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, "continue";
|
23948
23948
|
}
|
23949
|
-
return tokens = tokens1,
|
23949
|
+
return tokens = tokens1, i = i1, nextMatch = nextMatch1, {
|
23950
23950
|
v: nextMatch1
|
23951
23951
|
};
|
23952
23952
|
};
|
@@ -27972,8 +27972,15 @@ let BasicService = class BasicService {
|
|
27972
27972
|
context.variables[name] = result;
|
27973
27973
|
return result;
|
27974
27974
|
}
|
27975
|
+
async base64ToBuffer(params, _pinsSettingsList, context) {
|
27976
|
+
const { base64 } = params;
|
27977
|
+
const data = base64.replace(/^data:\/\w+;base64,/, '');
|
27978
|
+
const buffer = Buffer.from(data, 'base64');
|
27979
|
+
return buffer;
|
27980
|
+
}
|
27975
27981
|
};
|
27976
27982
|
const transform = (params, pinsSettingsList, context)=>new BasicService().transform(params, pinsSettingsList, context);
|
27977
27983
|
const setVariable = (params, pinsSettingsList, context)=>new BasicService().setVariable(params, pinsSettingsList, context);
|
27984
|
+
const base64ToBuffer = (params, pinsSettingsList, context)=>new BasicService().setVariable(params, pinsSettingsList, context);
|
27978
27985
|
|
27979
|
-
export { setVariable, transform };
|
27986
|
+
export { base64ToBuffer, setVariable, transform };
|
package/package.json
CHANGED
package/schema.fr.json
CHANGED
@@ -78,6 +78,25 @@
|
|
78
78
|
],
|
79
79
|
"x-events": []
|
80
80
|
}
|
81
|
+
},
|
82
|
+
"/base64ToBuffer": {
|
83
|
+
"post": {
|
84
|
+
"tags": ["web", "service", "spatial"],
|
85
|
+
"summary": "Convertir base64 en buffer",
|
86
|
+
"description": "Convertit un fichier base64 en buffer",
|
87
|
+
"parameters": [
|
88
|
+
{
|
89
|
+
"name": "base64",
|
90
|
+
"summary": "Base64",
|
91
|
+
"required": true,
|
92
|
+
"description": "Fichier en base64",
|
93
|
+
"schema": {
|
94
|
+
"type": "string"
|
95
|
+
}
|
96
|
+
}
|
97
|
+
],
|
98
|
+
"x-events": []
|
99
|
+
}
|
81
100
|
}
|
82
101
|
},
|
83
102
|
"components": {
|
package/schema.json
CHANGED
@@ -78,6 +78,25 @@
|
|
78
78
|
],
|
79
79
|
"x-events": []
|
80
80
|
}
|
81
|
+
},
|
82
|
+
"/base64ToBuffer": {
|
83
|
+
"post": {
|
84
|
+
"tags": ["web", "service", "spatial"],
|
85
|
+
"summary": "Convert base64 to buffer",
|
86
|
+
"description": "Converts a base64 string to a buffer.",
|
87
|
+
"parameters": [
|
88
|
+
{
|
89
|
+
"name": "base64",
|
90
|
+
"summary": "Base64",
|
91
|
+
"required": true,
|
92
|
+
"description": "Base64 file",
|
93
|
+
"schema": {
|
94
|
+
"type": "string"
|
95
|
+
}
|
96
|
+
}
|
97
|
+
],
|
98
|
+
"x-events": []
|
99
|
+
}
|
81
100
|
}
|
82
101
|
},
|
83
102
|
"components": {
|
@@ -1,3 +1,4 @@
|
|
1
1
|
import { PinsSettings } from '@digipair/engine';
|
2
2
|
export declare const transform: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
3
3
|
export declare const setVariable: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
4
|
+
export declare const base64ToBuffer: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
File without changes
|