@digipair/skill-s3 0.136.1 → 0.136.3

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.
@@ -0,0 +1,316 @@
1
+ import { B as evaluateCondition, D as EndpointError, F as evaluateExpression, G as getEndpointHeaders, J as getEndpointProperties, K as getEndpointUrl } from './index.esm3.js';
2
+
3
+ function _class_call_check$1(instance, Constructor) {
4
+ if (!(instance instanceof Constructor)) {
5
+ throw new TypeError("Cannot call a class as a function");
6
+ }
7
+ }
8
+ function _defineProperties$1(target, props) {
9
+ for(var i = 0; i < props.length; i++){
10
+ var descriptor = props[i];
11
+ descriptor.enumerable = descriptor.enumerable || false;
12
+ descriptor.configurable = true;
13
+ if ("value" in descriptor) descriptor.writable = true;
14
+ Object.defineProperty(target, descriptor.key, descriptor);
15
+ }
16
+ }
17
+ function _create_class$1(Constructor, protoProps, staticProps) {
18
+ if (staticProps) _defineProperties$1(Constructor, staticProps);
19
+ return Constructor;
20
+ }
21
+ function _define_property(obj, key, value) {
22
+ if (key in obj) {
23
+ Object.defineProperty(obj, key, {
24
+ value: value,
25
+ enumerable: true,
26
+ configurable: true,
27
+ writable: true
28
+ });
29
+ } else {
30
+ obj[key] = value;
31
+ }
32
+ return obj;
33
+ }
34
+ var BinaryDecisionDiagram = /*#__PURE__*/ function() {
35
+ function BinaryDecisionDiagram(bdd, root, conditions, results) {
36
+ _class_call_check$1(this, BinaryDecisionDiagram);
37
+ _define_property(this, "nodes", void 0);
38
+ _define_property(this, "root", void 0);
39
+ _define_property(this, "conditions", void 0);
40
+ _define_property(this, "results", void 0);
41
+ this.nodes = bdd;
42
+ this.root = root;
43
+ this.conditions = conditions;
44
+ this.results = results;
45
+ }
46
+ _create_class$1(BinaryDecisionDiagram, null, [
47
+ {
48
+ key: "from",
49
+ value: function from(bdd, root, conditions, results) {
50
+ return new BinaryDecisionDiagram(bdd, root, conditions, results);
51
+ }
52
+ }
53
+ ]);
54
+ return BinaryDecisionDiagram;
55
+ }();
56
+
57
+ function _array_like_to_array(arr, len) {
58
+ if (len == null || len > arr.length) len = arr.length;
59
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
60
+ return arr2;
61
+ }
62
+ function _array_with_holes(arr) {
63
+ if (Array.isArray(arr)) return arr;
64
+ }
65
+ function _iterable_to_array_limit(arr, i) {
66
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
67
+ if (_i == null) return;
68
+ var _arr = [];
69
+ var _n = true;
70
+ var _d = false;
71
+ var _s, _e;
72
+ try {
73
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
74
+ _arr.push(_s.value);
75
+ if (i && _arr.length === i) break;
76
+ }
77
+ } catch (err) {
78
+ _d = true;
79
+ _e = err;
80
+ } finally{
81
+ try {
82
+ if (!_n && _i["return"] != null) _i["return"]();
83
+ } finally{
84
+ if (_d) throw _e;
85
+ }
86
+ }
87
+ return _arr;
88
+ }
89
+ function _non_iterable_rest() {
90
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
91
+ }
92
+ function _sliced_to_array(arr, i) {
93
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
94
+ }
95
+ function _unsupported_iterable_to_array(o, minLen) {
96
+ if (!o) return;
97
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
98
+ var n = Object.prototype.toString.call(o).slice(8, -1);
99
+ if (n === "Object" && o.constructor) n = o.constructor.name;
100
+ if (n === "Map" || n === "Set") return Array.from(n);
101
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
102
+ }
103
+ var RESULT = 100000000;
104
+ var decideEndpoint = function(bdd, options) {
105
+ var nodes = bdd.nodes, root = bdd.root, results = bdd.results, conditions = bdd.conditions;
106
+ var ref = root;
107
+ var referenceRecord = {};
108
+ var closure = {
109
+ referenceRecord: referenceRecord,
110
+ endpointParams: options.endpointParams,
111
+ logger: options.logger
112
+ };
113
+ while(ref !== 1 && ref !== -1 && ref < RESULT){
114
+ var node_i = 3 * (Math.abs(ref) - 1);
115
+ var _ref = [
116
+ nodes[node_i],
117
+ nodes[node_i + 1],
118
+ nodes[node_i + 2]
119
+ ], condition_i = _ref[0], highRef = _ref[1], lowRef = _ref[2];
120
+ var _conditions_condition_i = _sliced_to_array(conditions[condition_i], 3), fn = _conditions_condition_i[0], argv = _conditions_condition_i[1], assign = _conditions_condition_i[2];
121
+ var evaluation = evaluateCondition({
122
+ fn: fn,
123
+ assign: assign,
124
+ argv: argv
125
+ }, closure);
126
+ if (evaluation.toAssign) {
127
+ var _evaluation_toAssign = evaluation.toAssign, name = _evaluation_toAssign.name, value = _evaluation_toAssign.value;
128
+ referenceRecord[name] = value;
129
+ }
130
+ ref = ref >= 0 === evaluation.result ? highRef : lowRef;
131
+ }
132
+ if (ref >= RESULT) {
133
+ var result = results[ref - RESULT];
134
+ if (result[0] === -1) {
135
+ var _result = _sliced_to_array(result, 2), errorExpression = _result[1];
136
+ throw new EndpointError(evaluateExpression(errorExpression, "Error", closure));
137
+ }
138
+ var _result1 = _sliced_to_array(result, 3), url = _result1[0], properties = _result1[1], headers = _result1[2];
139
+ return {
140
+ url: getEndpointUrl(url, closure),
141
+ properties: getEndpointProperties(properties, closure),
142
+ headers: getEndpointHeaders(headers !== null && headers !== void 0 ? headers : {}, closure)
143
+ };
144
+ }
145
+ throw new EndpointError("No matching endpoint.");
146
+ };
147
+
148
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
149
+ try {
150
+ var info = gen[key](arg);
151
+ var value = info.value;
152
+ } catch (error) {
153
+ reject(error);
154
+ return;
155
+ }
156
+ if (info.done) {
157
+ resolve(value);
158
+ } else {
159
+ Promise.resolve(value).then(_next, _throw);
160
+ }
161
+ }
162
+ function _async_to_generator(fn) {
163
+ return function() {
164
+ var self = this, args = arguments;
165
+ return new Promise(function(resolve, reject) {
166
+ var gen = fn.apply(self, args);
167
+ function _next(value) {
168
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
169
+ }
170
+ function _throw(err) {
171
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
172
+ }
173
+ _next(undefined);
174
+ });
175
+ };
176
+ }
177
+ function _class_call_check(instance, Constructor) {
178
+ if (!(instance instanceof Constructor)) {
179
+ throw new TypeError("Cannot call a class as a function");
180
+ }
181
+ }
182
+ function _defineProperties(target, props) {
183
+ for(var i = 0; i < props.length; i++){
184
+ var descriptor = props[i];
185
+ descriptor.enumerable = descriptor.enumerable || false;
186
+ descriptor.configurable = true;
187
+ if ("value" in descriptor) descriptor.writable = true;
188
+ Object.defineProperty(target, descriptor.key, descriptor);
189
+ }
190
+ }
191
+ function _create_class(Constructor, protoProps, staticProps) {
192
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
193
+ return Constructor;
194
+ }
195
+ function _ts_generator(thisArg, body) {
196
+ var f, y, t, g, _ = {
197
+ label: 0,
198
+ sent: function() {
199
+ if (t[0] & 1) throw t[1];
200
+ return t[1];
201
+ },
202
+ trys: [],
203
+ ops: []
204
+ };
205
+ return g = {
206
+ next: verb(0),
207
+ "throw": verb(1),
208
+ "return": verb(2)
209
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
210
+ return this;
211
+ }), g;
212
+ function verb(n) {
213
+ return function(v) {
214
+ return step([
215
+ n,
216
+ v
217
+ ]);
218
+ };
219
+ }
220
+ function step(op) {
221
+ if (f) throw new TypeError("Generator is already executing.");
222
+ while(_)try {
223
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
224
+ if (y = 0, t) op = [
225
+ op[0] & 2,
226
+ t.value
227
+ ];
228
+ switch(op[0]){
229
+ case 0:
230
+ case 1:
231
+ t = op;
232
+ break;
233
+ case 4:
234
+ _.label++;
235
+ return {
236
+ value: op[1],
237
+ done: false
238
+ };
239
+ case 5:
240
+ _.label++;
241
+ y = op[1];
242
+ op = [
243
+ 0
244
+ ];
245
+ continue;
246
+ case 7:
247
+ op = _.ops.pop();
248
+ _.trys.pop();
249
+ continue;
250
+ default:
251
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
252
+ _ = 0;
253
+ continue;
254
+ }
255
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
256
+ _.label = op[1];
257
+ break;
258
+ }
259
+ if (op[0] === 6 && _.label < t[1]) {
260
+ _.label = t[1];
261
+ t = op;
262
+ break;
263
+ }
264
+ if (t && _.label < t[2]) {
265
+ _.label = t[2];
266
+ _.ops.push(op);
267
+ break;
268
+ }
269
+ if (t[2]) _.ops.pop();
270
+ _.trys.pop();
271
+ continue;
272
+ }
273
+ op = body.call(thisArg, _);
274
+ } catch (e) {
275
+ op = [
276
+ 6,
277
+ e
278
+ ];
279
+ y = 0;
280
+ } finally{
281
+ f = t = 0;
282
+ }
283
+ if (op[0] & 5) throw op[1];
284
+ return {
285
+ value: op[0] ? op[1] : void 0,
286
+ done: true
287
+ };
288
+ }
289
+ }
290
+ var NoAuthSigner = /*#__PURE__*/ function() {
291
+ function NoAuthSigner() {
292
+ _class_call_check(this, NoAuthSigner);
293
+ }
294
+ _create_class(NoAuthSigner, [
295
+ {
296
+ key: "sign",
297
+ value: function sign(httpRequest, identity, signingProperties) {
298
+ return _async_to_generator(function() {
299
+ return _ts_generator(this, function(_state) {
300
+ return [
301
+ 2,
302
+ httpRequest
303
+ ];
304
+ });
305
+ })();
306
+ }
307
+ }
308
+ ]);
309
+ return NoAuthSigner;
310
+ }();
311
+
312
+ var version = "3.997.20";
313
+ var packageInfo = {
314
+ version: version};
315
+
316
+ export { BinaryDecisionDiagram as B, NoAuthSigner as N, decideEndpoint as d, packageInfo as p };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digipair/skill-s3",
3
- "version": "0.136.1",
3
+ "version": "0.136.3",
4
4
  "main": "./dist/index.cjs.js",
5
5
  "module": "./dist/index.esm.js",
6
6
  "types": "./dist/index.d.ts",