@apify/utilities 2.4.0 → 2.5.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/index.js +56 -13
- package/index.js.map +1 -1
- package/index.mjs +56 -13
- package/index.mjs.map +1 -1
- package/package.json +4 -4
- package/webhook_payload_template.d.ts +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apify/utilities",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"description": "Tools and constants shared across Apify projects.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"module": "./index.mjs",
|
|
@@ -43,11 +43,11 @@
|
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@apify/consts": "^2.
|
|
47
|
-
"@apify/log": "^2.2.
|
|
46
|
+
"@apify/consts": "^2.14.0",
|
|
47
|
+
"@apify/log": "^2.2.14"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/create-hmac": "^1.1.0"
|
|
51
51
|
},
|
|
52
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "d570c3fbfd8bee76c9cb49d52529da20cc7bb178"
|
|
53
53
|
}
|
|
@@ -63,7 +63,9 @@ export declare class WebhookPayloadTemplate {
|
|
|
63
63
|
* Parse also validates the template structure, so it can be used
|
|
64
64
|
* to check validity of the template JSON and usage of allowedVariables.
|
|
65
65
|
*/
|
|
66
|
-
static parse(payloadTemplate: string, allowedVariables?: Set<string> | null, context?: Record<string, any
|
|
66
|
+
static parse(payloadTemplate: string, allowedVariables?: Set<string> | null, context?: Record<string, any>, options?: {
|
|
67
|
+
interpolateStrings?: boolean;
|
|
68
|
+
}): Record<string, any>;
|
|
67
69
|
/**
|
|
68
70
|
* Stringify an object into a webhook payload template.
|
|
69
71
|
* Values created using `getTemplateVariable('foo.bar')`
|
|
@@ -97,11 +99,16 @@ export declare class WebhookPayloadTemplate {
|
|
|
97
99
|
*/
|
|
98
100
|
static getVariable(variableName: string): JsonVariable;
|
|
99
101
|
private _parse;
|
|
102
|
+
private _interpolate;
|
|
103
|
+
private _interpolateString;
|
|
104
|
+
private _interpolateObject;
|
|
105
|
+
private _interpolateArray;
|
|
100
106
|
private _findPositionOfNextVariable;
|
|
101
107
|
private _isVariableInsideString;
|
|
102
108
|
private _countUnescapedDoubleQuotesUpToIndex;
|
|
103
109
|
private _replaceVariable;
|
|
104
110
|
private _validateVariableName;
|
|
111
|
+
private _getVariableValue;
|
|
105
112
|
private _getVariableReplacement;
|
|
106
113
|
}
|
|
107
114
|
export {};
|