@sinch/functions-runtime 0.6.2 → 0.6.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.
- package/dist/bin/sinch-runtime.js +71 -12
- package/dist/bin/sinch-runtime.js.map +1 -1
- package/dist/{chunk-W3R4GR3E.js → chunk-H2JZGXXT.js} +581 -385
- package/dist/chunk-H2JZGXXT.js.map +1 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.js +1 -1
- package/dist/voice/v2.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-W3R4GR3E.js.map +0 -1
|
@@ -15630,11 +15630,11 @@ var require_mime_types = __commonJS({
|
|
|
15630
15630
|
}
|
|
15631
15631
|
return exts[0];
|
|
15632
15632
|
}
|
|
15633
|
-
function lookup(
|
|
15634
|
-
if (!
|
|
15633
|
+
function lookup(path7) {
|
|
15634
|
+
if (!path7 || typeof path7 !== "string") {
|
|
15635
15635
|
return false;
|
|
15636
15636
|
}
|
|
15637
|
-
var extension2 = extname("x." +
|
|
15637
|
+
var extension2 = extname("x." + path7).toLowerCase().slice(1);
|
|
15638
15638
|
if (!extension2) {
|
|
15639
15639
|
return false;
|
|
15640
15640
|
}
|
|
@@ -19077,13 +19077,13 @@ var require_view = __commonJS({
|
|
|
19077
19077
|
"../../node_modules/express/lib/view.js"(exports, module) {
|
|
19078
19078
|
"use strict";
|
|
19079
19079
|
var debug = require_src()("express:view");
|
|
19080
|
-
var
|
|
19081
|
-
var
|
|
19082
|
-
var dirname2 =
|
|
19083
|
-
var basename2 =
|
|
19084
|
-
var extname =
|
|
19085
|
-
var join3 =
|
|
19086
|
-
var resolve =
|
|
19080
|
+
var path7 = __require("path");
|
|
19081
|
+
var fs6 = __require("fs");
|
|
19082
|
+
var dirname2 = path7.dirname;
|
|
19083
|
+
var basename2 = path7.basename;
|
|
19084
|
+
var extname = path7.extname;
|
|
19085
|
+
var join3 = path7.join;
|
|
19086
|
+
var resolve = path7.resolve;
|
|
19087
19087
|
module.exports = View;
|
|
19088
19088
|
function View(name, options) {
|
|
19089
19089
|
var opts = options || {};
|
|
@@ -19112,17 +19112,17 @@ var require_view = __commonJS({
|
|
|
19112
19112
|
this.path = this.lookup(fileName);
|
|
19113
19113
|
}
|
|
19114
19114
|
View.prototype.lookup = function lookup(name) {
|
|
19115
|
-
var
|
|
19115
|
+
var path8;
|
|
19116
19116
|
var roots = [].concat(this.root);
|
|
19117
19117
|
debug('lookup "%s"', name);
|
|
19118
|
-
for (var i = 0; i < roots.length && !
|
|
19118
|
+
for (var i = 0; i < roots.length && !path8; i++) {
|
|
19119
19119
|
var root = roots[i];
|
|
19120
19120
|
var loc = resolve(root, name);
|
|
19121
19121
|
var dir = dirname2(loc);
|
|
19122
19122
|
var file = basename2(loc);
|
|
19123
|
-
|
|
19123
|
+
path8 = this.resolve(dir, file);
|
|
19124
19124
|
}
|
|
19125
|
-
return
|
|
19125
|
+
return path8;
|
|
19126
19126
|
};
|
|
19127
19127
|
View.prototype.render = function render(options, callback) {
|
|
19128
19128
|
var sync = true;
|
|
@@ -19144,21 +19144,21 @@ var require_view = __commonJS({
|
|
|
19144
19144
|
};
|
|
19145
19145
|
View.prototype.resolve = function resolve2(dir, file) {
|
|
19146
19146
|
var ext = this.ext;
|
|
19147
|
-
var
|
|
19148
|
-
var stat = tryStat(
|
|
19147
|
+
var path8 = join3(dir, file);
|
|
19148
|
+
var stat = tryStat(path8);
|
|
19149
19149
|
if (stat && stat.isFile()) {
|
|
19150
|
-
return
|
|
19150
|
+
return path8;
|
|
19151
19151
|
}
|
|
19152
|
-
|
|
19153
|
-
stat = tryStat(
|
|
19152
|
+
path8 = join3(dir, basename2(file, ext), "index" + ext);
|
|
19153
|
+
stat = tryStat(path8);
|
|
19154
19154
|
if (stat && stat.isFile()) {
|
|
19155
|
-
return
|
|
19155
|
+
return path8;
|
|
19156
19156
|
}
|
|
19157
19157
|
};
|
|
19158
|
-
function tryStat(
|
|
19159
|
-
debug('stat "%s"',
|
|
19158
|
+
function tryStat(path8) {
|
|
19159
|
+
debug('stat "%s"', path8);
|
|
19160
19160
|
try {
|
|
19161
|
-
return
|
|
19161
|
+
return fs6.statSync(path8);
|
|
19162
19162
|
} catch (e) {
|
|
19163
19163
|
return void 0;
|
|
19164
19164
|
}
|
|
@@ -19310,11 +19310,11 @@ var require_mime_types2 = __commonJS({
|
|
|
19310
19310
|
}
|
|
19311
19311
|
return exts[0];
|
|
19312
19312
|
}
|
|
19313
|
-
function lookup(
|
|
19314
|
-
if (!
|
|
19313
|
+
function lookup(path7) {
|
|
19314
|
+
if (!path7 || typeof path7 !== "string") {
|
|
19315
19315
|
return false;
|
|
19316
19316
|
}
|
|
19317
|
-
var extension2 = extname("x." +
|
|
19317
|
+
var extension2 = extname("x." + path7).toLowerCase().slice(1);
|
|
19318
19318
|
if (!extension2) {
|
|
19319
19319
|
return false;
|
|
19320
19320
|
}
|
|
@@ -20511,15 +20511,15 @@ var require_dist = __commonJS({
|
|
|
20511
20511
|
if (token.type === endType)
|
|
20512
20512
|
break;
|
|
20513
20513
|
if (token.type === "char" || token.type === "escape") {
|
|
20514
|
-
let
|
|
20514
|
+
let path7 = token.value;
|
|
20515
20515
|
let cur = tokens[pos];
|
|
20516
20516
|
while (cur.type === "char" || cur.type === "escape") {
|
|
20517
|
-
|
|
20517
|
+
path7 += cur.value;
|
|
20518
20518
|
cur = tokens[++pos];
|
|
20519
20519
|
}
|
|
20520
20520
|
output.push({
|
|
20521
20521
|
type: "text",
|
|
20522
|
-
value: encodePath(
|
|
20522
|
+
value: encodePath(path7)
|
|
20523
20523
|
});
|
|
20524
20524
|
continue;
|
|
20525
20525
|
}
|
|
@@ -20543,16 +20543,16 @@ var require_dist = __commonJS({
|
|
|
20543
20543
|
}
|
|
20544
20544
|
return new TokenData(consumeUntil("end"), str);
|
|
20545
20545
|
}
|
|
20546
|
-
function compile(
|
|
20546
|
+
function compile(path7, options = {}) {
|
|
20547
20547
|
const { encode: encode3 = encodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
20548
|
-
const data = typeof
|
|
20548
|
+
const data = typeof path7 === "object" ? path7 : parse2(path7, options);
|
|
20549
20549
|
const fn = tokensToFunction(data.tokens, delimiter, encode3);
|
|
20550
|
-
return function
|
|
20551
|
-
const [
|
|
20550
|
+
return function path8(params = {}) {
|
|
20551
|
+
const [path9, ...missing] = fn(params);
|
|
20552
20552
|
if (missing.length) {
|
|
20553
20553
|
throw new TypeError(`Missing parameters: ${missing.join(", ")}`);
|
|
20554
20554
|
}
|
|
20555
|
-
return
|
|
20555
|
+
return path9;
|
|
20556
20556
|
};
|
|
20557
20557
|
}
|
|
20558
20558
|
function tokensToFunction(tokens, delimiter, encode3) {
|
|
@@ -20608,9 +20608,9 @@ var require_dist = __commonJS({
|
|
|
20608
20608
|
return [encodeValue(value)];
|
|
20609
20609
|
};
|
|
20610
20610
|
}
|
|
20611
|
-
function match(
|
|
20611
|
+
function match(path7, options = {}) {
|
|
20612
20612
|
const { decode = decodeURIComponent, delimiter = DEFAULT_DELIMITER } = options;
|
|
20613
|
-
const { regexp, keys } = pathToRegexp(
|
|
20613
|
+
const { regexp, keys } = pathToRegexp(path7, options);
|
|
20614
20614
|
const decoders = keys.map((key) => {
|
|
20615
20615
|
if (decode === false)
|
|
20616
20616
|
return NOOP_VALUE;
|
|
@@ -20622,7 +20622,7 @@ var require_dist = __commonJS({
|
|
|
20622
20622
|
const m = regexp.exec(input);
|
|
20623
20623
|
if (!m)
|
|
20624
20624
|
return false;
|
|
20625
|
-
const
|
|
20625
|
+
const path8 = m[0];
|
|
20626
20626
|
const params = /* @__PURE__ */ Object.create(null);
|
|
20627
20627
|
for (let i = 1; i < m.length; i++) {
|
|
20628
20628
|
if (m[i] === void 0)
|
|
@@ -20631,15 +20631,15 @@ var require_dist = __commonJS({
|
|
|
20631
20631
|
const decoder = decoders[i - 1];
|
|
20632
20632
|
params[key.name] = decoder(m[i]);
|
|
20633
20633
|
}
|
|
20634
|
-
return { path:
|
|
20634
|
+
return { path: path8, params };
|
|
20635
20635
|
};
|
|
20636
20636
|
}
|
|
20637
|
-
function pathToRegexp(
|
|
20637
|
+
function pathToRegexp(path7, options = {}) {
|
|
20638
20638
|
const { delimiter = DEFAULT_DELIMITER, end = true, sensitive = false, trailing = true } = options;
|
|
20639
20639
|
const keys = [];
|
|
20640
20640
|
const flags = sensitive ? "" : "i";
|
|
20641
20641
|
const sources = [];
|
|
20642
|
-
for (const input of pathsToArray(
|
|
20642
|
+
for (const input of pathsToArray(path7, [])) {
|
|
20643
20643
|
const data = typeof input === "object" ? input : parse2(input, options);
|
|
20644
20644
|
for (const tokens of flatten(data.tokens, 0, [])) {
|
|
20645
20645
|
sources.push(toRegExpSource(tokens, delimiter, keys, data.originalPath));
|
|
@@ -20769,18 +20769,18 @@ var require_layer = __commonJS({
|
|
|
20769
20769
|
var TRAILING_SLASH_REGEXP = /\/+$/;
|
|
20770
20770
|
var MATCHING_GROUP_REGEXP = /\((?:\?<(.*?)>)?(?!\?)/g;
|
|
20771
20771
|
module.exports = Layer;
|
|
20772
|
-
function Layer(
|
|
20772
|
+
function Layer(path7, options, fn) {
|
|
20773
20773
|
if (!(this instanceof Layer)) {
|
|
20774
|
-
return new Layer(
|
|
20774
|
+
return new Layer(path7, options, fn);
|
|
20775
20775
|
}
|
|
20776
|
-
debug("new %o",
|
|
20776
|
+
debug("new %o", path7);
|
|
20777
20777
|
const opts = options || {};
|
|
20778
20778
|
this.handle = fn;
|
|
20779
20779
|
this.keys = [];
|
|
20780
20780
|
this.name = fn.name || "<anonymous>";
|
|
20781
20781
|
this.params = void 0;
|
|
20782
20782
|
this.path = void 0;
|
|
20783
|
-
this.slash =
|
|
20783
|
+
this.slash = path7 === "/" && opts.end === false;
|
|
20784
20784
|
function matcher(_path) {
|
|
20785
20785
|
if (_path instanceof RegExp) {
|
|
20786
20786
|
const keys = [];
|
|
@@ -20819,7 +20819,7 @@ var require_layer = __commonJS({
|
|
|
20819
20819
|
decode: decodeParam
|
|
20820
20820
|
});
|
|
20821
20821
|
}
|
|
20822
|
-
this.matchers = Array.isArray(
|
|
20822
|
+
this.matchers = Array.isArray(path7) ? path7.map(matcher) : [matcher(path7)];
|
|
20823
20823
|
}
|
|
20824
20824
|
Layer.prototype.handleError = function handleError(error, req, res, next) {
|
|
20825
20825
|
const fn = this.handle;
|
|
@@ -20859,9 +20859,9 @@ var require_layer = __commonJS({
|
|
|
20859
20859
|
next(err);
|
|
20860
20860
|
}
|
|
20861
20861
|
};
|
|
20862
|
-
Layer.prototype.match = function match(
|
|
20862
|
+
Layer.prototype.match = function match(path7) {
|
|
20863
20863
|
let match2;
|
|
20864
|
-
if (
|
|
20864
|
+
if (path7 != null) {
|
|
20865
20865
|
if (this.slash) {
|
|
20866
20866
|
this.params = {};
|
|
20867
20867
|
this.path = "";
|
|
@@ -20869,7 +20869,7 @@ var require_layer = __commonJS({
|
|
|
20869
20869
|
}
|
|
20870
20870
|
let i = 0;
|
|
20871
20871
|
while (!match2 && i < this.matchers.length) {
|
|
20872
|
-
match2 = this.matchers[i](
|
|
20872
|
+
match2 = this.matchers[i](path7);
|
|
20873
20873
|
i++;
|
|
20874
20874
|
}
|
|
20875
20875
|
}
|
|
@@ -20897,13 +20897,13 @@ var require_layer = __commonJS({
|
|
|
20897
20897
|
throw err;
|
|
20898
20898
|
}
|
|
20899
20899
|
}
|
|
20900
|
-
function loosen(
|
|
20901
|
-
if (
|
|
20902
|
-
return
|
|
20900
|
+
function loosen(path7) {
|
|
20901
|
+
if (path7 instanceof RegExp || path7 === "/") {
|
|
20902
|
+
return path7;
|
|
20903
20903
|
}
|
|
20904
|
-
return Array.isArray(
|
|
20904
|
+
return Array.isArray(path7) ? path7.map(function(p) {
|
|
20905
20905
|
return loosen(p);
|
|
20906
|
-
}) : String(
|
|
20906
|
+
}) : String(path7).replace(TRAILING_SLASH_REGEXP, "");
|
|
20907
20907
|
}
|
|
20908
20908
|
}
|
|
20909
20909
|
});
|
|
@@ -20919,9 +20919,9 @@ var require_route = __commonJS({
|
|
|
20919
20919
|
var flatten = Array.prototype.flat;
|
|
20920
20920
|
var methods = METHODS.map((method) => method.toLowerCase());
|
|
20921
20921
|
module.exports = Route;
|
|
20922
|
-
function Route(
|
|
20923
|
-
debug("new %o",
|
|
20924
|
-
this.path =
|
|
20922
|
+
function Route(path7) {
|
|
20923
|
+
debug("new %o", path7);
|
|
20924
|
+
this.path = path7;
|
|
20925
20925
|
this.stack = [];
|
|
20926
20926
|
this.methods = /* @__PURE__ */ Object.create(null);
|
|
20927
20927
|
}
|
|
@@ -21129,8 +21129,8 @@ var require_router = __commonJS({
|
|
|
21129
21129
|
if (++sync > 100) {
|
|
21130
21130
|
return setImmediate(next, err);
|
|
21131
21131
|
}
|
|
21132
|
-
const
|
|
21133
|
-
if (
|
|
21132
|
+
const path7 = getPathname(req);
|
|
21133
|
+
if (path7 == null) {
|
|
21134
21134
|
return done(layerError);
|
|
21135
21135
|
}
|
|
21136
21136
|
let layer;
|
|
@@ -21138,7 +21138,7 @@ var require_router = __commonJS({
|
|
|
21138
21138
|
let route;
|
|
21139
21139
|
while (match !== true && idx < stack.length) {
|
|
21140
21140
|
layer = stack[idx++];
|
|
21141
|
-
match = matchLayer(layer,
|
|
21141
|
+
match = matchLayer(layer, path7);
|
|
21142
21142
|
route = layer.route;
|
|
21143
21143
|
if (typeof match !== "boolean") {
|
|
21144
21144
|
layerError = layerError || match;
|
|
@@ -21176,18 +21176,18 @@ var require_router = __commonJS({
|
|
|
21176
21176
|
} else if (route) {
|
|
21177
21177
|
layer.handleRequest(req, res, next);
|
|
21178
21178
|
} else {
|
|
21179
|
-
trimPrefix(layer, layerError, layerPath,
|
|
21179
|
+
trimPrefix(layer, layerError, layerPath, path7);
|
|
21180
21180
|
}
|
|
21181
21181
|
sync = 0;
|
|
21182
21182
|
});
|
|
21183
21183
|
}
|
|
21184
|
-
function trimPrefix(layer, layerError, layerPath,
|
|
21184
|
+
function trimPrefix(layer, layerError, layerPath, path7) {
|
|
21185
21185
|
if (layerPath.length !== 0) {
|
|
21186
|
-
if (layerPath !==
|
|
21186
|
+
if (layerPath !== path7.substring(0, layerPath.length)) {
|
|
21187
21187
|
next(layerError);
|
|
21188
21188
|
return;
|
|
21189
21189
|
}
|
|
21190
|
-
const c =
|
|
21190
|
+
const c = path7[layerPath.length];
|
|
21191
21191
|
if (c && c !== "/") {
|
|
21192
21192
|
next(layerError);
|
|
21193
21193
|
return;
|
|
@@ -21211,7 +21211,7 @@ var require_router = __commonJS({
|
|
|
21211
21211
|
};
|
|
21212
21212
|
Router.prototype.use = function use(handler) {
|
|
21213
21213
|
let offset = 0;
|
|
21214
|
-
let
|
|
21214
|
+
let path7 = "/";
|
|
21215
21215
|
if (typeof handler !== "function") {
|
|
21216
21216
|
let arg = handler;
|
|
21217
21217
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -21219,7 +21219,7 @@ var require_router = __commonJS({
|
|
|
21219
21219
|
}
|
|
21220
21220
|
if (typeof arg !== "function") {
|
|
21221
21221
|
offset = 1;
|
|
21222
|
-
|
|
21222
|
+
path7 = handler;
|
|
21223
21223
|
}
|
|
21224
21224
|
}
|
|
21225
21225
|
const callbacks = flatten.call(slice.call(arguments, offset), Infinity);
|
|
@@ -21231,8 +21231,8 @@ var require_router = __commonJS({
|
|
|
21231
21231
|
if (typeof fn !== "function") {
|
|
21232
21232
|
throw new TypeError("argument handler must be a function");
|
|
21233
21233
|
}
|
|
21234
|
-
debug("use %o %s",
|
|
21235
|
-
const layer = new Layer(
|
|
21234
|
+
debug("use %o %s", path7, fn.name || "<anonymous>");
|
|
21235
|
+
const layer = new Layer(path7, {
|
|
21236
21236
|
sensitive: this.caseSensitive,
|
|
21237
21237
|
strict: false,
|
|
21238
21238
|
end: false
|
|
@@ -21242,9 +21242,9 @@ var require_router = __commonJS({
|
|
|
21242
21242
|
}
|
|
21243
21243
|
return this;
|
|
21244
21244
|
};
|
|
21245
|
-
Router.prototype.route = function route(
|
|
21246
|
-
const route2 = new Route(
|
|
21247
|
-
const layer = new Layer(
|
|
21245
|
+
Router.prototype.route = function route(path7) {
|
|
21246
|
+
const route2 = new Route(path7);
|
|
21247
|
+
const layer = new Layer(path7, {
|
|
21248
21248
|
sensitive: this.caseSensitive,
|
|
21249
21249
|
strict: this.strict,
|
|
21250
21250
|
end: true
|
|
@@ -21257,8 +21257,8 @@ var require_router = __commonJS({
|
|
|
21257
21257
|
return route2;
|
|
21258
21258
|
};
|
|
21259
21259
|
methods.concat("all").forEach(function(method) {
|
|
21260
|
-
Router.prototype[method] = function(
|
|
21261
|
-
const route = this.route(
|
|
21260
|
+
Router.prototype[method] = function(path7) {
|
|
21261
|
+
const route = this.route(path7);
|
|
21262
21262
|
route[method].apply(route, slice.call(arguments, 1));
|
|
21263
21263
|
return this;
|
|
21264
21264
|
};
|
|
@@ -21287,9 +21287,9 @@ var require_router = __commonJS({
|
|
|
21287
21287
|
const fqdnIndex = url2.substring(0, pathLength).indexOf("://");
|
|
21288
21288
|
return fqdnIndex !== -1 ? url2.substring(0, url2.indexOf("/", 3 + fqdnIndex)) : void 0;
|
|
21289
21289
|
}
|
|
21290
|
-
function matchLayer(layer,
|
|
21290
|
+
function matchLayer(layer, path7) {
|
|
21291
21291
|
try {
|
|
21292
|
-
return layer.match(
|
|
21292
|
+
return layer.match(path7);
|
|
21293
21293
|
} catch (err) {
|
|
21294
21294
|
return err;
|
|
21295
21295
|
}
|
|
@@ -21517,7 +21517,7 @@ var require_application = __commonJS({
|
|
|
21517
21517
|
};
|
|
21518
21518
|
app.use = function use(fn) {
|
|
21519
21519
|
var offset = 0;
|
|
21520
|
-
var
|
|
21520
|
+
var path7 = "/";
|
|
21521
21521
|
if (typeof fn !== "function") {
|
|
21522
21522
|
var arg = fn;
|
|
21523
21523
|
while (Array.isArray(arg) && arg.length !== 0) {
|
|
@@ -21525,7 +21525,7 @@ var require_application = __commonJS({
|
|
|
21525
21525
|
}
|
|
21526
21526
|
if (typeof arg !== "function") {
|
|
21527
21527
|
offset = 1;
|
|
21528
|
-
|
|
21528
|
+
path7 = fn;
|
|
21529
21529
|
}
|
|
21530
21530
|
}
|
|
21531
21531
|
var fns = flatten.call(slice.call(arguments, offset), Infinity);
|
|
@@ -21535,12 +21535,12 @@ var require_application = __commonJS({
|
|
|
21535
21535
|
var router = this.router;
|
|
21536
21536
|
fns.forEach(function(fn2) {
|
|
21537
21537
|
if (!fn2 || !fn2.handle || !fn2.set) {
|
|
21538
|
-
return router.use(
|
|
21538
|
+
return router.use(path7, fn2);
|
|
21539
21539
|
}
|
|
21540
|
-
debug(".use app under %s",
|
|
21541
|
-
fn2.mountpath =
|
|
21540
|
+
debug(".use app under %s", path7);
|
|
21541
|
+
fn2.mountpath = path7;
|
|
21542
21542
|
fn2.parent = this;
|
|
21543
|
-
router.use(
|
|
21543
|
+
router.use(path7, function mounted_app(req, res, next) {
|
|
21544
21544
|
var orig = req.app;
|
|
21545
21545
|
fn2.handle(req, res, function(err) {
|
|
21546
21546
|
Object.setPrototypeOf(req, orig.request);
|
|
@@ -21552,8 +21552,8 @@ var require_application = __commonJS({
|
|
|
21552
21552
|
}, this);
|
|
21553
21553
|
return this;
|
|
21554
21554
|
};
|
|
21555
|
-
app.route = function route(
|
|
21556
|
-
return this.router.route(
|
|
21555
|
+
app.route = function route(path7) {
|
|
21556
|
+
return this.router.route(path7);
|
|
21557
21557
|
};
|
|
21558
21558
|
app.engine = function engine(ext, fn) {
|
|
21559
21559
|
if (typeof fn !== "function") {
|
|
@@ -21596,7 +21596,7 @@ var require_application = __commonJS({
|
|
|
21596
21596
|
}
|
|
21597
21597
|
return this;
|
|
21598
21598
|
};
|
|
21599
|
-
app.path = function
|
|
21599
|
+
app.path = function path7() {
|
|
21600
21600
|
return this.parent ? this.parent.path() + this.mountpath : "";
|
|
21601
21601
|
};
|
|
21602
21602
|
app.enabled = function enabled(setting2) {
|
|
@@ -21612,17 +21612,17 @@ var require_application = __commonJS({
|
|
|
21612
21612
|
return this.set(setting2, false);
|
|
21613
21613
|
};
|
|
21614
21614
|
methods.forEach(function(method) {
|
|
21615
|
-
app[method] = function(
|
|
21615
|
+
app[method] = function(path7) {
|
|
21616
21616
|
if (method === "get" && arguments.length === 1) {
|
|
21617
|
-
return this.set(
|
|
21617
|
+
return this.set(path7);
|
|
21618
21618
|
}
|
|
21619
|
-
var route = this.route(
|
|
21619
|
+
var route = this.route(path7);
|
|
21620
21620
|
route[method].apply(route, slice.call(arguments, 1));
|
|
21621
21621
|
return this;
|
|
21622
21622
|
};
|
|
21623
21623
|
});
|
|
21624
|
-
app.all = function all3(
|
|
21625
|
-
var route = this.route(
|
|
21624
|
+
app.all = function all3(path7) {
|
|
21625
|
+
var route = this.route(path7);
|
|
21626
21626
|
var args = slice.call(arguments, 1);
|
|
21627
21627
|
for (var i = 0; i < methods.length; i++) {
|
|
21628
21628
|
route[methods[i]].apply(route, args);
|
|
@@ -22302,11 +22302,11 @@ var require_mime_types3 = __commonJS({
|
|
|
22302
22302
|
}
|
|
22303
22303
|
return exts[0];
|
|
22304
22304
|
}
|
|
22305
|
-
function lookup(
|
|
22306
|
-
if (!
|
|
22305
|
+
function lookup(path7) {
|
|
22306
|
+
if (!path7 || typeof path7 !== "string") {
|
|
22307
22307
|
return false;
|
|
22308
22308
|
}
|
|
22309
|
-
var extension2 = extname("x." +
|
|
22309
|
+
var extension2 = extname("x." + path7).toLowerCase().slice(1);
|
|
22310
22310
|
if (!extension2) {
|
|
22311
22311
|
return false;
|
|
22312
22312
|
}
|
|
@@ -22683,7 +22683,7 @@ var require_request = __commonJS({
|
|
|
22683
22683
|
var subdomains2 = !isIP(hostname) ? hostname.split(".").reverse() : [hostname];
|
|
22684
22684
|
return subdomains2.slice(offset);
|
|
22685
22685
|
});
|
|
22686
|
-
defineGetter(req, "path", function
|
|
22686
|
+
defineGetter(req, "path", function path7() {
|
|
22687
22687
|
return parse2(this).pathname;
|
|
22688
22688
|
});
|
|
22689
22689
|
defineGetter(req, "host", function host() {
|
|
@@ -23182,11 +23182,11 @@ var require_mime_types4 = __commonJS({
|
|
|
23182
23182
|
}
|
|
23183
23183
|
return exts[0];
|
|
23184
23184
|
}
|
|
23185
|
-
function lookup(
|
|
23186
|
-
if (!
|
|
23185
|
+
function lookup(path7) {
|
|
23186
|
+
if (!path7 || typeof path7 !== "string") {
|
|
23187
23187
|
return false;
|
|
23188
23188
|
}
|
|
23189
|
-
var extension2 = extname("x." +
|
|
23189
|
+
var extension2 = extname("x." + path7).toLowerCase().slice(1);
|
|
23190
23190
|
if (!extension2) {
|
|
23191
23191
|
return false;
|
|
23192
23192
|
}
|
|
@@ -23241,32 +23241,32 @@ var require_send = __commonJS({
|
|
|
23241
23241
|
var escapeHtml = require_escape_html();
|
|
23242
23242
|
var etag = require_etag();
|
|
23243
23243
|
var fresh = require_fresh();
|
|
23244
|
-
var
|
|
23244
|
+
var fs6 = __require("fs");
|
|
23245
23245
|
var mime = require_mime_types4();
|
|
23246
23246
|
var ms = require_ms();
|
|
23247
23247
|
var onFinished = require_on_finished();
|
|
23248
23248
|
var parseRange = require_range_parser();
|
|
23249
|
-
var
|
|
23249
|
+
var path7 = __require("path");
|
|
23250
23250
|
var statuses = require_statuses();
|
|
23251
23251
|
var Stream2 = __require("stream");
|
|
23252
23252
|
var util3 = __require("util");
|
|
23253
|
-
var extname =
|
|
23254
|
-
var join3 =
|
|
23255
|
-
var normalize =
|
|
23256
|
-
var resolve =
|
|
23257
|
-
var sep =
|
|
23253
|
+
var extname = path7.extname;
|
|
23254
|
+
var join3 = path7.join;
|
|
23255
|
+
var normalize = path7.normalize;
|
|
23256
|
+
var resolve = path7.resolve;
|
|
23257
|
+
var sep = path7.sep;
|
|
23258
23258
|
var BYTES_RANGE_REGEXP = /^ *bytes=/;
|
|
23259
23259
|
var MAX_MAXAGE = 60 * 60 * 24 * 365 * 1e3;
|
|
23260
23260
|
var UP_PATH_REGEXP = /(?:^|[\\/])\.\.(?:[\\/]|$)/;
|
|
23261
23261
|
module.exports = send;
|
|
23262
|
-
function send(req,
|
|
23263
|
-
return new SendStream(req,
|
|
23262
|
+
function send(req, path8, options) {
|
|
23263
|
+
return new SendStream(req, path8, options);
|
|
23264
23264
|
}
|
|
23265
|
-
function SendStream(req,
|
|
23265
|
+
function SendStream(req, path8, options) {
|
|
23266
23266
|
Stream2.call(this);
|
|
23267
23267
|
var opts = options || {};
|
|
23268
23268
|
this.options = opts;
|
|
23269
|
-
this.path =
|
|
23269
|
+
this.path = path8;
|
|
23270
23270
|
this.req = req;
|
|
23271
23271
|
this._acceptRanges = opts.acceptRanges !== void 0 ? Boolean(opts.acceptRanges) : true;
|
|
23272
23272
|
this._cacheControl = opts.cacheControl !== void 0 ? Boolean(opts.cacheControl) : true;
|
|
@@ -23380,10 +23380,10 @@ var require_send = __commonJS({
|
|
|
23380
23380
|
var lastModified = this.res.getHeader("Last-Modified");
|
|
23381
23381
|
return parseHttpDate(lastModified) <= parseHttpDate(ifRange);
|
|
23382
23382
|
};
|
|
23383
|
-
SendStream.prototype.redirect = function redirect(
|
|
23383
|
+
SendStream.prototype.redirect = function redirect(path8) {
|
|
23384
23384
|
var res = this.res;
|
|
23385
23385
|
if (hasListeners(this, "directory")) {
|
|
23386
|
-
this.emit("directory", res,
|
|
23386
|
+
this.emit("directory", res, path8);
|
|
23387
23387
|
return;
|
|
23388
23388
|
}
|
|
23389
23389
|
if (this.hasTrailingSlash()) {
|
|
@@ -23403,38 +23403,38 @@ var require_send = __commonJS({
|
|
|
23403
23403
|
SendStream.prototype.pipe = function pipe(res) {
|
|
23404
23404
|
var root = this._root;
|
|
23405
23405
|
this.res = res;
|
|
23406
|
-
var
|
|
23407
|
-
if (
|
|
23406
|
+
var path8 = decode(this.path);
|
|
23407
|
+
if (path8 === -1) {
|
|
23408
23408
|
this.error(400);
|
|
23409
23409
|
return res;
|
|
23410
23410
|
}
|
|
23411
|
-
if (~
|
|
23411
|
+
if (~path8.indexOf("\0")) {
|
|
23412
23412
|
this.error(400);
|
|
23413
23413
|
return res;
|
|
23414
23414
|
}
|
|
23415
23415
|
var parts;
|
|
23416
23416
|
if (root !== null) {
|
|
23417
|
-
if (
|
|
23418
|
-
|
|
23417
|
+
if (path8) {
|
|
23418
|
+
path8 = normalize("." + sep + path8);
|
|
23419
23419
|
}
|
|
23420
|
-
if (UP_PATH_REGEXP.test(
|
|
23421
|
-
debug('malicious path "%s"',
|
|
23420
|
+
if (UP_PATH_REGEXP.test(path8)) {
|
|
23421
|
+
debug('malicious path "%s"', path8);
|
|
23422
23422
|
this.error(403);
|
|
23423
23423
|
return res;
|
|
23424
23424
|
}
|
|
23425
|
-
parts =
|
|
23426
|
-
|
|
23425
|
+
parts = path8.split(sep);
|
|
23426
|
+
path8 = normalize(join3(root, path8));
|
|
23427
23427
|
} else {
|
|
23428
|
-
if (UP_PATH_REGEXP.test(
|
|
23429
|
-
debug('malicious path "%s"',
|
|
23428
|
+
if (UP_PATH_REGEXP.test(path8)) {
|
|
23429
|
+
debug('malicious path "%s"', path8);
|
|
23430
23430
|
this.error(403);
|
|
23431
23431
|
return res;
|
|
23432
23432
|
}
|
|
23433
|
-
parts = normalize(
|
|
23434
|
-
|
|
23433
|
+
parts = normalize(path8).split(sep);
|
|
23434
|
+
path8 = resolve(path8);
|
|
23435
23435
|
}
|
|
23436
23436
|
if (containsDotFile(parts)) {
|
|
23437
|
-
debug('%s dotfile "%s"', this._dotfiles,
|
|
23437
|
+
debug('%s dotfile "%s"', this._dotfiles, path8);
|
|
23438
23438
|
switch (this._dotfiles) {
|
|
23439
23439
|
case "allow":
|
|
23440
23440
|
break;
|
|
@@ -23448,13 +23448,13 @@ var require_send = __commonJS({
|
|
|
23448
23448
|
}
|
|
23449
23449
|
}
|
|
23450
23450
|
if (this._index.length && this.hasTrailingSlash()) {
|
|
23451
|
-
this.sendIndex(
|
|
23451
|
+
this.sendIndex(path8);
|
|
23452
23452
|
return res;
|
|
23453
23453
|
}
|
|
23454
|
-
this.sendFile(
|
|
23454
|
+
this.sendFile(path8);
|
|
23455
23455
|
return res;
|
|
23456
23456
|
};
|
|
23457
|
-
SendStream.prototype.send = function send2(
|
|
23457
|
+
SendStream.prototype.send = function send2(path8, stat) {
|
|
23458
23458
|
var len = stat.size;
|
|
23459
23459
|
var options = this.options;
|
|
23460
23460
|
var opts = {};
|
|
@@ -23466,9 +23466,9 @@ var require_send = __commonJS({
|
|
|
23466
23466
|
this.headersAlreadySent();
|
|
23467
23467
|
return;
|
|
23468
23468
|
}
|
|
23469
|
-
debug('pipe "%s"',
|
|
23470
|
-
this.setHeader(
|
|
23471
|
-
this.type(
|
|
23469
|
+
debug('pipe "%s"', path8);
|
|
23470
|
+
this.setHeader(path8, stat);
|
|
23471
|
+
this.type(path8);
|
|
23472
23472
|
if (this.isConditionalGET()) {
|
|
23473
23473
|
if (this.isPreconditionFailure()) {
|
|
23474
23474
|
this.error(412);
|
|
@@ -23517,30 +23517,30 @@ var require_send = __commonJS({
|
|
|
23517
23517
|
res.end();
|
|
23518
23518
|
return;
|
|
23519
23519
|
}
|
|
23520
|
-
this.stream(
|
|
23520
|
+
this.stream(path8, opts);
|
|
23521
23521
|
};
|
|
23522
|
-
SendStream.prototype.sendFile = function sendFile(
|
|
23522
|
+
SendStream.prototype.sendFile = function sendFile(path8) {
|
|
23523
23523
|
var i = 0;
|
|
23524
23524
|
var self2 = this;
|
|
23525
|
-
debug('stat "%s"',
|
|
23526
|
-
|
|
23527
|
-
var pathEndsWithSep =
|
|
23528
|
-
if (err && err.code === "ENOENT" && !extname(
|
|
23525
|
+
debug('stat "%s"', path8);
|
|
23526
|
+
fs6.stat(path8, function onstat(err, stat) {
|
|
23527
|
+
var pathEndsWithSep = path8[path8.length - 1] === sep;
|
|
23528
|
+
if (err && err.code === "ENOENT" && !extname(path8) && !pathEndsWithSep) {
|
|
23529
23529
|
return next(err);
|
|
23530
23530
|
}
|
|
23531
23531
|
if (err) return self2.onStatError(err);
|
|
23532
|
-
if (stat.isDirectory()) return self2.redirect(
|
|
23532
|
+
if (stat.isDirectory()) return self2.redirect(path8);
|
|
23533
23533
|
if (pathEndsWithSep) return self2.error(404);
|
|
23534
|
-
self2.emit("file",
|
|
23535
|
-
self2.send(
|
|
23534
|
+
self2.emit("file", path8, stat);
|
|
23535
|
+
self2.send(path8, stat);
|
|
23536
23536
|
});
|
|
23537
23537
|
function next(err) {
|
|
23538
23538
|
if (self2._extensions.length <= i) {
|
|
23539
23539
|
return err ? self2.onStatError(err) : self2.error(404);
|
|
23540
23540
|
}
|
|
23541
|
-
var p =
|
|
23541
|
+
var p = path8 + "." + self2._extensions[i++];
|
|
23542
23542
|
debug('stat "%s"', p);
|
|
23543
|
-
|
|
23543
|
+
fs6.stat(p, function(err2, stat) {
|
|
23544
23544
|
if (err2) return next(err2);
|
|
23545
23545
|
if (stat.isDirectory()) return next();
|
|
23546
23546
|
self2.emit("file", p, stat);
|
|
@@ -23548,7 +23548,7 @@ var require_send = __commonJS({
|
|
|
23548
23548
|
});
|
|
23549
23549
|
}
|
|
23550
23550
|
};
|
|
23551
|
-
SendStream.prototype.sendIndex = function sendIndex(
|
|
23551
|
+
SendStream.prototype.sendIndex = function sendIndex(path8) {
|
|
23552
23552
|
var i = -1;
|
|
23553
23553
|
var self2 = this;
|
|
23554
23554
|
function next(err) {
|
|
@@ -23556,9 +23556,9 @@ var require_send = __commonJS({
|
|
|
23556
23556
|
if (err) return self2.onStatError(err);
|
|
23557
23557
|
return self2.error(404);
|
|
23558
23558
|
}
|
|
23559
|
-
var p = join3(
|
|
23559
|
+
var p = join3(path8, self2._index[i]);
|
|
23560
23560
|
debug('stat "%s"', p);
|
|
23561
|
-
|
|
23561
|
+
fs6.stat(p, function(err2, stat) {
|
|
23562
23562
|
if (err2) return next(err2);
|
|
23563
23563
|
if (stat.isDirectory()) return next();
|
|
23564
23564
|
self2.emit("file", p, stat);
|
|
@@ -23567,10 +23567,10 @@ var require_send = __commonJS({
|
|
|
23567
23567
|
}
|
|
23568
23568
|
next();
|
|
23569
23569
|
};
|
|
23570
|
-
SendStream.prototype.stream = function stream5(
|
|
23570
|
+
SendStream.prototype.stream = function stream5(path8, options) {
|
|
23571
23571
|
var self2 = this;
|
|
23572
23572
|
var res = this.res;
|
|
23573
|
-
var stream6 =
|
|
23573
|
+
var stream6 = fs6.createReadStream(path8, options);
|
|
23574
23574
|
this.emit("stream", stream6);
|
|
23575
23575
|
stream6.pipe(res);
|
|
23576
23576
|
function cleanup() {
|
|
@@ -23585,17 +23585,17 @@ var require_send = __commonJS({
|
|
|
23585
23585
|
self2.emit("end");
|
|
23586
23586
|
});
|
|
23587
23587
|
};
|
|
23588
|
-
SendStream.prototype.type = function type(
|
|
23588
|
+
SendStream.prototype.type = function type(path8) {
|
|
23589
23589
|
var res = this.res;
|
|
23590
23590
|
if (res.getHeader("Content-Type")) return;
|
|
23591
|
-
var ext = extname(
|
|
23591
|
+
var ext = extname(path8);
|
|
23592
23592
|
var type2 = mime.contentType(ext) || "application/octet-stream";
|
|
23593
23593
|
debug("content-type %s", type2);
|
|
23594
23594
|
res.setHeader("Content-Type", type2);
|
|
23595
23595
|
};
|
|
23596
|
-
SendStream.prototype.setHeader = function setHeader(
|
|
23596
|
+
SendStream.prototype.setHeader = function setHeader(path8, stat) {
|
|
23597
23597
|
var res = this.res;
|
|
23598
|
-
this.emit("headers", res,
|
|
23598
|
+
this.emit("headers", res, path8, stat);
|
|
23599
23599
|
if (this._acceptRanges && !res.getHeader("Accept-Ranges")) {
|
|
23600
23600
|
debug("accept ranges");
|
|
23601
23601
|
res.setHeader("Accept-Ranges", "bytes");
|
|
@@ -23653,9 +23653,9 @@ var require_send = __commonJS({
|
|
|
23653
23653
|
}
|
|
23654
23654
|
return err instanceof Error ? createError(status, err, { expose: false }) : createError(status, err);
|
|
23655
23655
|
}
|
|
23656
|
-
function decode(
|
|
23656
|
+
function decode(path8) {
|
|
23657
23657
|
try {
|
|
23658
|
-
return decodeURIComponent(
|
|
23658
|
+
return decodeURIComponent(path8);
|
|
23659
23659
|
} catch (err) {
|
|
23660
23660
|
return -1;
|
|
23661
23661
|
}
|
|
@@ -23799,7 +23799,7 @@ var require_response = __commonJS({
|
|
|
23799
23799
|
var http3 = __require("http");
|
|
23800
23800
|
var onFinished = require_on_finished();
|
|
23801
23801
|
var mime = require_mime_types2();
|
|
23802
|
-
var
|
|
23802
|
+
var path7 = __require("path");
|
|
23803
23803
|
var pathIsAbsolute = __require("path").isAbsolute;
|
|
23804
23804
|
var statuses = require_statuses();
|
|
23805
23805
|
var sign = require_cookie_signature().sign;
|
|
@@ -23808,8 +23808,8 @@ var require_response = __commonJS({
|
|
|
23808
23808
|
var setCharset = require_utils3().setCharset;
|
|
23809
23809
|
var cookie = require_cookie();
|
|
23810
23810
|
var send = require_send();
|
|
23811
|
-
var extname =
|
|
23812
|
-
var resolve =
|
|
23811
|
+
var extname = path7.extname;
|
|
23812
|
+
var resolve = path7.resolve;
|
|
23813
23813
|
var vary = require_vary();
|
|
23814
23814
|
var { Buffer: Buffer2 } = __require("buffer");
|
|
23815
23815
|
var res = Object.create(http3.ServerResponse.prototype);
|
|
@@ -23955,26 +23955,26 @@ var require_response = __commonJS({
|
|
|
23955
23955
|
this.type("txt");
|
|
23956
23956
|
return this.send(body);
|
|
23957
23957
|
};
|
|
23958
|
-
res.sendFile = function sendFile(
|
|
23958
|
+
res.sendFile = function sendFile(path8, options, callback) {
|
|
23959
23959
|
var done = callback;
|
|
23960
23960
|
var req = this.req;
|
|
23961
23961
|
var res2 = this;
|
|
23962
23962
|
var next = req.next;
|
|
23963
23963
|
var opts = options || {};
|
|
23964
|
-
if (!
|
|
23964
|
+
if (!path8) {
|
|
23965
23965
|
throw new TypeError("path argument is required to res.sendFile");
|
|
23966
23966
|
}
|
|
23967
|
-
if (typeof
|
|
23967
|
+
if (typeof path8 !== "string") {
|
|
23968
23968
|
throw new TypeError("path must be a string to res.sendFile");
|
|
23969
23969
|
}
|
|
23970
23970
|
if (typeof options === "function") {
|
|
23971
23971
|
done = options;
|
|
23972
23972
|
opts = {};
|
|
23973
23973
|
}
|
|
23974
|
-
if (!opts.root && !pathIsAbsolute(
|
|
23974
|
+
if (!opts.root && !pathIsAbsolute(path8)) {
|
|
23975
23975
|
throw new TypeError("path must be absolute or specify root to res.sendFile");
|
|
23976
23976
|
}
|
|
23977
|
-
var pathname = encodeURI(
|
|
23977
|
+
var pathname = encodeURI(path8);
|
|
23978
23978
|
opts.etag = this.app.enabled("etag");
|
|
23979
23979
|
var file = send(req, pathname, opts);
|
|
23980
23980
|
sendfile(res2, file, opts, function(err) {
|
|
@@ -23985,7 +23985,7 @@ var require_response = __commonJS({
|
|
|
23985
23985
|
}
|
|
23986
23986
|
});
|
|
23987
23987
|
};
|
|
23988
|
-
res.download = function download(
|
|
23988
|
+
res.download = function download(path8, filename, options, callback) {
|
|
23989
23989
|
var done = callback;
|
|
23990
23990
|
var name = filename;
|
|
23991
23991
|
var opts = options || null;
|
|
@@ -24002,7 +24002,7 @@ var require_response = __commonJS({
|
|
|
24002
24002
|
opts = filename;
|
|
24003
24003
|
}
|
|
24004
24004
|
var headers = {
|
|
24005
|
-
"Content-Disposition": contentDisposition(name ||
|
|
24005
|
+
"Content-Disposition": contentDisposition(name || path8)
|
|
24006
24006
|
};
|
|
24007
24007
|
if (opts && opts.headers) {
|
|
24008
24008
|
var keys = Object.keys(opts.headers);
|
|
@@ -24015,7 +24015,7 @@ var require_response = __commonJS({
|
|
|
24015
24015
|
}
|
|
24016
24016
|
opts = Object.create(opts);
|
|
24017
24017
|
opts.headers = headers;
|
|
24018
|
-
var fullPath = !opts.root ? resolve(
|
|
24018
|
+
var fullPath = !opts.root ? resolve(path8) : path8;
|
|
24019
24019
|
return this.sendFile(fullPath, opts, done);
|
|
24020
24020
|
};
|
|
24021
24021
|
res.contentType = res.type = function contentType(type) {
|
|
@@ -24298,11 +24298,11 @@ var require_serve_static = __commonJS({
|
|
|
24298
24298
|
}
|
|
24299
24299
|
var forwardError = !fallthrough;
|
|
24300
24300
|
var originalUrl = parseUrl2.original(req);
|
|
24301
|
-
var
|
|
24302
|
-
if (
|
|
24303
|
-
|
|
24301
|
+
var path7 = parseUrl2(req).pathname;
|
|
24302
|
+
if (path7 === "/" && originalUrl.pathname.substr(-1) !== "/") {
|
|
24303
|
+
path7 = "";
|
|
24304
24304
|
}
|
|
24305
|
-
var stream5 = send(req,
|
|
24305
|
+
var stream5 = send(req, path7, opts);
|
|
24306
24306
|
stream5.on("directory", onDirectory);
|
|
24307
24307
|
if (setHeaders) {
|
|
24308
24308
|
stream5.on("headers", setHeaders);
|
|
@@ -27949,14 +27949,14 @@ var require_url_state_machine = __commonJS({
|
|
|
27949
27949
|
return url2.replace(/\u0009|\u000A|\u000D/g, "");
|
|
27950
27950
|
}
|
|
27951
27951
|
function shortenPath(url2) {
|
|
27952
|
-
const
|
|
27953
|
-
if (
|
|
27952
|
+
const path7 = url2.path;
|
|
27953
|
+
if (path7.length === 0) {
|
|
27954
27954
|
return;
|
|
27955
27955
|
}
|
|
27956
|
-
if (url2.scheme === "file" &&
|
|
27956
|
+
if (url2.scheme === "file" && path7.length === 1 && isNormalizedWindowsDriveLetter(path7[0])) {
|
|
27957
27957
|
return;
|
|
27958
27958
|
}
|
|
27959
|
-
|
|
27959
|
+
path7.pop();
|
|
27960
27960
|
}
|
|
27961
27961
|
function includesCredentials(url2) {
|
|
27962
27962
|
return url2.username !== "" || url2.password !== "";
|
|
@@ -30280,14 +30280,14 @@ var require_api_client = __commonJS({
|
|
|
30280
30280
|
* @param {string} [path] - An optional path for the request.
|
|
30281
30281
|
* @return {Promise<RequestOptions>} A promise that resolves to the prepared options for the HTTP request.
|
|
30282
30282
|
*/
|
|
30283
|
-
async prepareOptions(url2, method, queryParams, headers, body,
|
|
30283
|
+
async prepareOptions(url2, method, queryParams, headers, body, path7) {
|
|
30284
30284
|
const options = {
|
|
30285
30285
|
method,
|
|
30286
30286
|
headers: new node_fetch_1.Headers(filterUndefinedValues(headers)),
|
|
30287
30287
|
body,
|
|
30288
30288
|
queryParams: filterUndefinedValues(queryParams),
|
|
30289
30289
|
hostname: url2,
|
|
30290
|
-
path:
|
|
30290
|
+
path: path7
|
|
30291
30291
|
};
|
|
30292
30292
|
let opts = options;
|
|
30293
30293
|
if (this.apiClientOptions.requestPlugins) {
|
|
@@ -31159,7 +31159,7 @@ var require_authorization_helper = __commonJS({
|
|
|
31159
31159
|
return headerSignature === signature;
|
|
31160
31160
|
};
|
|
31161
31161
|
exports.validateWebhookSignature = validateWebhookSignature;
|
|
31162
|
-
var validateAuthenticationHeader2 = (applicationKey, applicationSecret, headers, body,
|
|
31162
|
+
var validateAuthenticationHeader2 = (applicationKey, applicationSecret, headers, body, path7, method) => {
|
|
31163
31163
|
const normalizedHeaders = normalizeHeaders(headers);
|
|
31164
31164
|
const authorization = getHeader(normalizedHeaders.authorization);
|
|
31165
31165
|
if (typeof authorization === "undefined") {
|
|
@@ -31175,7 +31175,7 @@ var require_authorization_helper = __commonJS({
|
|
|
31175
31175
|
return validateBasicAuth2(authorizationValue, applicationKey, applicationSecret);
|
|
31176
31176
|
}
|
|
31177
31177
|
if (authorizationScheme === "application") {
|
|
31178
|
-
return validateApplicationAuth(authorizationValue, normalizedHeaders, applicationKey, applicationSecret,
|
|
31178
|
+
return validateApplicationAuth(authorizationValue, normalizedHeaders, applicationKey, applicationSecret, path7, body, method);
|
|
31179
31179
|
}
|
|
31180
31180
|
console.error(`Scheme is not valid: ${authParts[0]}`);
|
|
31181
31181
|
return false;
|
|
@@ -31205,7 +31205,7 @@ var require_authorization_helper = __commonJS({
|
|
|
31205
31205
|
return crypto_1.default.createHmac("sha256", secret).update(signedData).digest("base64");
|
|
31206
31206
|
};
|
|
31207
31207
|
exports.calculateWebhookSignature = calculateWebhookSignature;
|
|
31208
|
-
var validateApplicationAuth = (authorizationValue, normalizedHeaders, applicationKey, applicationSecret,
|
|
31208
|
+
var validateApplicationAuth = (authorizationValue, normalizedHeaders, applicationKey, applicationSecret, path7, body, method) => {
|
|
31209
31209
|
const authKeyAndSecret = authorizationValue.split(":");
|
|
31210
31210
|
if (authKeyAndSecret.length !== 2) {
|
|
31211
31211
|
console.error("Invalid authorization value format provided");
|
|
@@ -31218,7 +31218,7 @@ var require_authorization_helper = __commonJS({
|
|
|
31218
31218
|
const contentType = getHeader(normalizedHeaders["content-type"]);
|
|
31219
31219
|
const hasBody = !!body;
|
|
31220
31220
|
const contentMD5 = hasBody ? (0, exports.calculateMD5)(body) : "";
|
|
31221
|
-
const stringToSign = buildStringToSign2(method.toUpperCase(), contentMD5, contentType, `x-timestamp:${normalizedHeaders["x-timestamp"]}`,
|
|
31221
|
+
const stringToSign = buildStringToSign2(method.toUpperCase(), contentMD5, contentType, `x-timestamp:${normalizedHeaders["x-timestamp"]}`, path7);
|
|
31222
31222
|
const signature = (0, exports.calculateSignature)(applicationSecret, stringToSign);
|
|
31223
31223
|
if (authKeyAndSecret[1] !== signature) {
|
|
31224
31224
|
console.error("Invalid signature");
|
|
@@ -44293,11 +44293,11 @@ var require_mime_types5 = __commonJS({
|
|
|
44293
44293
|
}
|
|
44294
44294
|
return exts[0];
|
|
44295
44295
|
}
|
|
44296
|
-
function lookup(
|
|
44297
|
-
if (!
|
|
44296
|
+
function lookup(path7) {
|
|
44297
|
+
if (!path7 || typeof path7 !== "string") {
|
|
44298
44298
|
return false;
|
|
44299
44299
|
}
|
|
44300
|
-
var extension2 = extname("x." +
|
|
44300
|
+
var extension2 = extname("x." + path7).toLowerCase().substr(1);
|
|
44301
44301
|
if (!extension2) {
|
|
44302
44302
|
return false;
|
|
44303
44303
|
}
|
|
@@ -44609,11 +44609,11 @@ var require_form_data = __commonJS({
|
|
|
44609
44609
|
"use strict";
|
|
44610
44610
|
var CombinedStream = require_combined_stream();
|
|
44611
44611
|
var util3 = __require("util");
|
|
44612
|
-
var
|
|
44612
|
+
var path7 = __require("path");
|
|
44613
44613
|
var http3 = __require("http");
|
|
44614
44614
|
var https3 = __require("https");
|
|
44615
44615
|
var parseUrl2 = __require("url").parse;
|
|
44616
|
-
var
|
|
44616
|
+
var fs6 = __require("fs");
|
|
44617
44617
|
var Stream2 = __require("stream").Stream;
|
|
44618
44618
|
var crypto4 = __require("crypto");
|
|
44619
44619
|
var mime = require_mime_types5();
|
|
@@ -44680,7 +44680,7 @@ var require_form_data = __commonJS({
|
|
|
44680
44680
|
if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
|
|
44681
44681
|
callback(null, value.end + 1 - (value.start ? value.start : 0));
|
|
44682
44682
|
} else {
|
|
44683
|
-
|
|
44683
|
+
fs6.stat(value.path, function(err, stat) {
|
|
44684
44684
|
if (err) {
|
|
44685
44685
|
callback(err);
|
|
44686
44686
|
return;
|
|
@@ -44737,11 +44737,11 @@ var require_form_data = __commonJS({
|
|
|
44737
44737
|
FormData3.prototype._getContentDisposition = function(value, options) {
|
|
44738
44738
|
var filename;
|
|
44739
44739
|
if (typeof options.filepath === "string") {
|
|
44740
|
-
filename =
|
|
44740
|
+
filename = path7.normalize(options.filepath).replace(/\\/g, "/");
|
|
44741
44741
|
} else if (options.filename || value && (value.name || value.path)) {
|
|
44742
|
-
filename =
|
|
44742
|
+
filename = path7.basename(options.filename || value && (value.name || value.path));
|
|
44743
44743
|
} else if (value && value.readable && hasOwn(value, "httpVersion")) {
|
|
44744
|
-
filename =
|
|
44744
|
+
filename = path7.basename(value.client._httpMessage.path || "");
|
|
44745
44745
|
}
|
|
44746
44746
|
if (filename) {
|
|
44747
44747
|
return 'filename="' + filename + '"';
|
|
@@ -44968,7 +44968,7 @@ var require_faxes_api = __commonJS({
|
|
|
44968
44968
|
var sdk_client_1 = require_dist2();
|
|
44969
44969
|
var fax_domain_api_1 = require_fax_domain_api();
|
|
44970
44970
|
var FormData3 = require_form_data();
|
|
44971
|
-
var
|
|
44971
|
+
var fs6 = __importStar(__require("fs"));
|
|
44972
44972
|
var FaxesApi = class extends fax_domain_api_1.FaxDomainApi {
|
|
44973
44973
|
constructor(lazyClient) {
|
|
44974
44974
|
super(lazyClient, "FaxesApi");
|
|
@@ -45124,7 +45124,7 @@ var require_faxes_api = __commonJS({
|
|
|
45124
45124
|
attachmentPaths = [String(requestData.filePaths)];
|
|
45125
45125
|
}
|
|
45126
45126
|
attachmentPaths.forEach((filePath) => {
|
|
45127
|
-
formData.append("file",
|
|
45127
|
+
formData.append("file", fs6.readFileSync(filePath), filePath.split("/").pop());
|
|
45128
45128
|
});
|
|
45129
45129
|
}
|
|
45130
45130
|
if (requestData.from) {
|
|
@@ -49393,11 +49393,11 @@ var require_callbacks_webhook6 = __commonJS({
|
|
|
49393
49393
|
* @param {string} method - Incoming request's HTTP method
|
|
49394
49394
|
* @return {boolean} - true if the authorization header is valid
|
|
49395
49395
|
*/
|
|
49396
|
-
validateAuthenticationHeader(headers, body,
|
|
49396
|
+
validateAuthenticationHeader(headers, body, path7, method) {
|
|
49397
49397
|
if (!this.sinchClientParameters.applicationKey || !this.sinchClientParameters.applicationSecret) {
|
|
49398
49398
|
throw new Error("The application key and secret must be defined");
|
|
49399
49399
|
}
|
|
49400
|
-
return (0, sdk_client_1.validateAuthenticationHeader)(this.sinchClientParameters.applicationKey, this.sinchClientParameters.applicationSecret, headers, body,
|
|
49400
|
+
return (0, sdk_client_1.validateAuthenticationHeader)(this.sinchClientParameters.applicationKey, this.sinchClientParameters.applicationSecret, headers, body, path7, method);
|
|
49401
49401
|
}
|
|
49402
49402
|
/**
|
|
49403
49403
|
* Reviver for a Verification Event.
|
|
@@ -49548,9 +49548,9 @@ var require_verification_status_api = __commonJS({
|
|
|
49548
49548
|
"Accept": "application/json"
|
|
49549
49549
|
};
|
|
49550
49550
|
const body = "";
|
|
49551
|
-
const
|
|
49552
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49553
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0,
|
|
49551
|
+
const path7 = `/verification/v1/verifications/id/${data["id"]}`;
|
|
49552
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49553
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0, path7);
|
|
49554
49554
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49555
49555
|
return this.client.processCall({
|
|
49556
49556
|
url: url2,
|
|
@@ -49575,9 +49575,9 @@ var require_verification_status_api = __commonJS({
|
|
|
49575
49575
|
verificationMethod = "callout";
|
|
49576
49576
|
}
|
|
49577
49577
|
const body = "";
|
|
49578
|
-
const
|
|
49579
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49580
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0,
|
|
49578
|
+
const path7 = `/verification/v1/verifications/${verificationMethod}/number/${data["endpoint"]}`;
|
|
49579
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49580
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0, path7);
|
|
49581
49581
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49582
49582
|
return this.client.processCall({
|
|
49583
49583
|
url: url2,
|
|
@@ -49598,9 +49598,9 @@ var require_verification_status_api = __commonJS({
|
|
|
49598
49598
|
"Accept": "application/json"
|
|
49599
49599
|
};
|
|
49600
49600
|
const body = "";
|
|
49601
|
-
const
|
|
49602
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49603
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0,
|
|
49601
|
+
const path7 = `/verification/v1/verifications/reference/${data["reference"]}`;
|
|
49602
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49603
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0, path7);
|
|
49604
49604
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49605
49605
|
return this.client.processCall({
|
|
49606
49606
|
url: url2,
|
|
@@ -49681,9 +49681,9 @@ var require_verifications_api = __commonJS({
|
|
|
49681
49681
|
"Accept": "application/json"
|
|
49682
49682
|
};
|
|
49683
49683
|
const body = data["reportSmsVerificationByIdRequestBody"] ? JSON.stringify(data["reportSmsVerificationByIdRequestBody"]) : "{}";
|
|
49684
|
-
const
|
|
49685
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49686
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0,
|
|
49684
|
+
const path7 = `/verification/v1/verifications/id/${data["id"]}`;
|
|
49685
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49686
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0, path7);
|
|
49687
49687
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49688
49688
|
return this.client.processCall({
|
|
49689
49689
|
url: url2,
|
|
@@ -49705,9 +49705,9 @@ var require_verifications_api = __commonJS({
|
|
|
49705
49705
|
"Accept": "application/json"
|
|
49706
49706
|
};
|
|
49707
49707
|
const body = data["reportFlashCallVerificationByIdRequestBody"] ? JSON.stringify(data["reportFlashCallVerificationByIdRequestBody"]) : "{}";
|
|
49708
|
-
const
|
|
49709
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49710
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0,
|
|
49708
|
+
const path7 = `/verification/v1/verifications/id/${data["id"]}`;
|
|
49709
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49710
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0, path7);
|
|
49711
49711
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49712
49712
|
return this.client.processCall({
|
|
49713
49713
|
url: url2,
|
|
@@ -49730,9 +49730,9 @@ var require_verifications_api = __commonJS({
|
|
|
49730
49730
|
};
|
|
49731
49731
|
const requestDataBody = this.performReportPhoneCallByIdRequestBodyTransformation(data.reportPhoneCallVerificationByIdRequestBody);
|
|
49732
49732
|
const body = requestDataBody ? JSON.stringify(requestDataBody) : "{}";
|
|
49733
|
-
const
|
|
49734
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49735
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0,
|
|
49733
|
+
const path7 = `/verification/v1/verifications/id/${data["id"]}`;
|
|
49734
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49735
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0, path7);
|
|
49736
49736
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49737
49737
|
return this.client.processCall({
|
|
49738
49738
|
url: url2,
|
|
@@ -49761,9 +49761,9 @@ var require_verifications_api = __commonJS({
|
|
|
49761
49761
|
"Accept": "application/json"
|
|
49762
49762
|
};
|
|
49763
49763
|
const body = data["reportCalloutVerificationByIdRequestBody"] ? JSON.stringify(data["reportCalloutVerificationByIdRequestBody"]) : "{}";
|
|
49764
|
-
const
|
|
49765
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49766
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0,
|
|
49764
|
+
const path7 = `/verification/v1/verifications/id/${data["id"]}`;
|
|
49765
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49766
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0, path7);
|
|
49767
49767
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49768
49768
|
return this.client.processCall({
|
|
49769
49769
|
url: url2,
|
|
@@ -49785,9 +49785,9 @@ var require_verifications_api = __commonJS({
|
|
|
49785
49785
|
"Accept": "application/json"
|
|
49786
49786
|
};
|
|
49787
49787
|
const body = data["reportWhatsAppVerificationByIdRequestBody"] ? JSON.stringify(data["reportWhatsAppVerificationByIdRequestBody"]) : "{}";
|
|
49788
|
-
const
|
|
49789
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49790
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0,
|
|
49788
|
+
const path7 = `/verification/v1/verifications/id/${data["id"]}`;
|
|
49789
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49790
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0, path7);
|
|
49791
49791
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49792
49792
|
return this.client.processCall({
|
|
49793
49793
|
url: url2,
|
|
@@ -49809,9 +49809,9 @@ var require_verifications_api = __commonJS({
|
|
|
49809
49809
|
"Accept": "application/json"
|
|
49810
49810
|
};
|
|
49811
49811
|
const body = data["reportSmsVerificationByIdentityRequestBody"] ? JSON.stringify(data["reportSmsVerificationByIdentityRequestBody"]) : "{}";
|
|
49812
|
-
const
|
|
49813
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49814
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0,
|
|
49812
|
+
const path7 = `/verification/v1/verifications/number/${data["endpoint"]}`;
|
|
49813
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49814
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0, path7);
|
|
49815
49815
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49816
49816
|
return this.client.processCall({
|
|
49817
49817
|
url: url2,
|
|
@@ -49833,9 +49833,9 @@ var require_verifications_api = __commonJS({
|
|
|
49833
49833
|
"Accept": "application/json"
|
|
49834
49834
|
};
|
|
49835
49835
|
const body = data["reportFlashCallVerificationByIdentityRequestBody"] ? JSON.stringify(data["reportFlashCallVerificationByIdentityRequestBody"]) : "{}";
|
|
49836
|
-
const
|
|
49837
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49838
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0,
|
|
49836
|
+
const path7 = `/verification/v1/verifications/number/${data["endpoint"]}`;
|
|
49837
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49838
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0, path7);
|
|
49839
49839
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49840
49840
|
return this.client.processCall({
|
|
49841
49841
|
url: url2,
|
|
@@ -49858,9 +49858,9 @@ var require_verifications_api = __commonJS({
|
|
|
49858
49858
|
};
|
|
49859
49859
|
const requestDataBody = this.performReportPhoneCallByIdentityRequestBodyTransformation(data.reportPhoneCallVerificationByIdentityRequestBody);
|
|
49860
49860
|
const body = requestDataBody ? JSON.stringify(requestDataBody) : "{}";
|
|
49861
|
-
const
|
|
49862
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49863
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0,
|
|
49861
|
+
const path7 = `/verification/v1/verifications/number/${data["endpoint"]}`;
|
|
49862
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49863
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0, path7);
|
|
49864
49864
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49865
49865
|
return this.client.processCall({
|
|
49866
49866
|
url: url2,
|
|
@@ -49889,9 +49889,9 @@ var require_verifications_api = __commonJS({
|
|
|
49889
49889
|
"Accept": "application/json"
|
|
49890
49890
|
};
|
|
49891
49891
|
const body = data["reportCalloutVerificationByIdentityRequestBody"] ? JSON.stringify(data["reportCalloutVerificationByIdentityRequestBody"]) : "{}";
|
|
49892
|
-
const
|
|
49893
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49894
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0,
|
|
49892
|
+
const path7 = `/verification/v1/verifications/number/${data["endpoint"]}`;
|
|
49893
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49894
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0, path7);
|
|
49895
49895
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49896
49896
|
return this.client.processCall({
|
|
49897
49897
|
url: url2,
|
|
@@ -49913,9 +49913,9 @@ var require_verifications_api = __commonJS({
|
|
|
49913
49913
|
"Accept": "application/json"
|
|
49914
49914
|
};
|
|
49915
49915
|
const body = data["reportWhatsAppVerificationByIdentityRequestBody"] ? JSON.stringify(data["reportWhatsAppVerificationByIdentityRequestBody"]) : "{}";
|
|
49916
|
-
const
|
|
49917
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49918
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0,
|
|
49916
|
+
const path7 = `/verification/v1/verifications/number/${data["endpoint"]}`;
|
|
49917
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49918
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PUT", getParams, headers, body || void 0, path7);
|
|
49919
49919
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49920
49920
|
return this.client.processCall({
|
|
49921
49921
|
url: url2,
|
|
@@ -49941,9 +49941,9 @@ var require_verifications_api = __commonJS({
|
|
|
49941
49941
|
}
|
|
49942
49942
|
const requestDataBody = this.performStartSmsRequestBodyTransformation(data.startVerificationWithSmsRequestBody);
|
|
49943
49943
|
const body = requestDataBody ? JSON.stringify(requestDataBody) : "{}";
|
|
49944
|
-
const
|
|
49945
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49946
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0,
|
|
49944
|
+
const path7 = "/verification/v1/verifications";
|
|
49945
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49946
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0, path7);
|
|
49947
49947
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49948
49948
|
return this.client.processCall({
|
|
49949
49949
|
url: url2,
|
|
@@ -49982,9 +49982,9 @@ var require_verifications_api = __commonJS({
|
|
|
49982
49982
|
"Accept": "application/json"
|
|
49983
49983
|
};
|
|
49984
49984
|
const body = data["startVerificationWithFlashCallRequestBody"] ? JSON.stringify(data["startVerificationWithFlashCallRequestBody"]) : "{}";
|
|
49985
|
-
const
|
|
49986
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
49987
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0,
|
|
49985
|
+
const path7 = "/verification/v1/verifications";
|
|
49986
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
49987
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0, path7);
|
|
49988
49988
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
49989
49989
|
return this.client.processCall({
|
|
49990
49990
|
url: url2,
|
|
@@ -50007,9 +50007,9 @@ var require_verifications_api = __commonJS({
|
|
|
50007
50007
|
};
|
|
50008
50008
|
const requestDataBody = this.performStartPhoneCallRequestBodyTransformation(data.startVerificationWithPhoneCallRequestBody);
|
|
50009
50009
|
const body = requestDataBody ? JSON.stringify(requestDataBody) : "{}";
|
|
50010
|
-
const
|
|
50011
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
50012
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0,
|
|
50010
|
+
const path7 = "/verification/v1/verifications";
|
|
50011
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
50012
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0, path7);
|
|
50013
50013
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
50014
50014
|
return this.client.processCall({
|
|
50015
50015
|
url: url2,
|
|
@@ -50039,9 +50039,9 @@ var require_verifications_api = __commonJS({
|
|
|
50039
50039
|
"Accept": "application/json"
|
|
50040
50040
|
};
|
|
50041
50041
|
const body = data["startDataVerificationRequestBody"] ? JSON.stringify(data["startDataVerificationRequestBody"]) : "{}";
|
|
50042
|
-
const
|
|
50043
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
50044
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0,
|
|
50042
|
+
const path7 = "/verification/v1/verifications";
|
|
50043
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
50044
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0, path7);
|
|
50045
50045
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
50046
50046
|
return this.client.processCall({
|
|
50047
50047
|
url: url2,
|
|
@@ -50063,9 +50063,9 @@ var require_verifications_api = __commonJS({
|
|
|
50063
50063
|
"Accept": "application/json"
|
|
50064
50064
|
};
|
|
50065
50065
|
const body = data["startVerificationWithWhatsAppRequestBody"] ? JSON.stringify(data["startVerificationWithWhatsAppRequestBody"]) : "{}";
|
|
50066
|
-
const
|
|
50067
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
50068
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0,
|
|
50066
|
+
const path7 = "/verification/v1/verifications";
|
|
50067
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
50068
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0, path7);
|
|
50069
50069
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
50070
50070
|
return this.client.processCall({
|
|
50071
50071
|
url: url2,
|
|
@@ -50088,9 +50088,9 @@ var require_verifications_api = __commonJS({
|
|
|
50088
50088
|
"Accept": "application/json"
|
|
50089
50089
|
};
|
|
50090
50090
|
const body = data["startVerificationWithCalloutRequestBody"] ? JSON.stringify(data["startVerificationWithCalloutRequestBody"]) : "{}";
|
|
50091
|
-
const
|
|
50092
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
50093
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0,
|
|
50091
|
+
const path7 = "/verification/v1/verifications";
|
|
50092
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
50093
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0, path7);
|
|
50094
50094
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
50095
50095
|
return this.client.processCall({
|
|
50096
50096
|
url: url2,
|
|
@@ -50113,9 +50113,9 @@ var require_verifications_api = __commonJS({
|
|
|
50113
50113
|
"Accept": "application/json"
|
|
50114
50114
|
};
|
|
50115
50115
|
const body = data["startSeamlessVerificationRequestBody"] ? JSON.stringify(data["startSeamlessVerificationRequestBody"]) : "{}";
|
|
50116
|
-
const
|
|
50117
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
50118
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0,
|
|
50116
|
+
const path7 = "/verification/v1/verifications";
|
|
50117
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
50118
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0, path7);
|
|
50119
50119
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
50120
50120
|
return this.client.processCall({
|
|
50121
50121
|
url: url2,
|
|
@@ -51312,9 +51312,9 @@ var require_applications_api = __commonJS({
|
|
|
51312
51312
|
"Accept": "application/json"
|
|
51313
51313
|
};
|
|
51314
51314
|
const body = "";
|
|
51315
|
-
const
|
|
51316
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51317
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0,
|
|
51315
|
+
const path7 = `/v1/calling/query/number/${data["number"].split(" ").join("")}`;
|
|
51316
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51317
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0, path7);
|
|
51318
51318
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51319
51319
|
return this.client.processCall({
|
|
51320
51320
|
url: url2,
|
|
@@ -51335,9 +51335,9 @@ var require_applications_api = __commonJS({
|
|
|
51335
51335
|
"Accept": "application/json"
|
|
51336
51336
|
};
|
|
51337
51337
|
const body = "";
|
|
51338
|
-
const
|
|
51339
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51340
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0,
|
|
51338
|
+
const path7 = `/v1/configuration/callbacks/applications/${data["applicationkey"]}`;
|
|
51339
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51340
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0, path7);
|
|
51341
51341
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51342
51342
|
return this.client.processCall({
|
|
51343
51343
|
url: url2,
|
|
@@ -51358,9 +51358,9 @@ var require_applications_api = __commonJS({
|
|
|
51358
51358
|
"Accept": "application/json"
|
|
51359
51359
|
};
|
|
51360
51360
|
const body = "";
|
|
51361
|
-
const
|
|
51362
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51363
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0,
|
|
51361
|
+
const path7 = "/v1/configuration/numbers";
|
|
51362
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51363
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0, path7);
|
|
51364
51364
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51365
51365
|
return this.client.processCall({
|
|
51366
51366
|
url: url2,
|
|
@@ -51381,9 +51381,9 @@ var require_applications_api = __commonJS({
|
|
|
51381
51381
|
"Accept": "application/json"
|
|
51382
51382
|
};
|
|
51383
51383
|
const body = data["unassignNumbersRequestBody"] ? JSON.stringify(data["unassignNumbersRequestBody"]) : "{}";
|
|
51384
|
-
const
|
|
51385
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51386
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "DELETE", getParams, headers, body || void 0,
|
|
51384
|
+
const path7 = "/v1/configuration/numbers";
|
|
51385
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51386
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "DELETE", getParams, headers, body || void 0, path7);
|
|
51387
51387
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51388
51388
|
return this.client.processCall({
|
|
51389
51389
|
url: url2,
|
|
@@ -51404,9 +51404,9 @@ var require_applications_api = __commonJS({
|
|
|
51404
51404
|
"Accept": "application/json"
|
|
51405
51405
|
};
|
|
51406
51406
|
const body = data["updateCallbacksRequestBody"] ? JSON.stringify(data["updateCallbacksRequestBody"]) : "{}";
|
|
51407
|
-
const
|
|
51408
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51409
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0,
|
|
51407
|
+
const path7 = `/v1/configuration/callbacks/applications/${data["applicationkey"]}`;
|
|
51408
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51409
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0, path7);
|
|
51410
51410
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51411
51411
|
return this.client.processCall({
|
|
51412
51412
|
url: url2,
|
|
@@ -51427,9 +51427,9 @@ var require_applications_api = __commonJS({
|
|
|
51427
51427
|
"Accept": "application/json"
|
|
51428
51428
|
};
|
|
51429
51429
|
const body = data["assignNumbersRequestBody"] ? JSON.stringify(data["assignNumbersRequestBody"]) : "{}";
|
|
51430
|
-
const
|
|
51431
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51432
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0,
|
|
51430
|
+
const path7 = "/v1/configuration/numbers";
|
|
51431
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51432
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body || void 0, path7);
|
|
51433
51433
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51434
51434
|
return this.client.processCall({
|
|
51435
51435
|
url: url2,
|
|
@@ -51508,11 +51508,11 @@ var require_callbacks_webhook7 = __commonJS({
|
|
|
51508
51508
|
* @param {string} method - Incoming request's HTTP method
|
|
51509
51509
|
* @return {boolean} - true if the authorization header is valid
|
|
51510
51510
|
*/
|
|
51511
|
-
validateAuthenticationHeader(headers, body,
|
|
51511
|
+
validateAuthenticationHeader(headers, body, path7, method) {
|
|
51512
51512
|
if (!this.sinchClientParameters.applicationKey || !this.sinchClientParameters.applicationSecret) {
|
|
51513
51513
|
throw new Error("The application key and secret must be defined");
|
|
51514
51514
|
}
|
|
51515
|
-
return (0, sdk_client_1.validateAuthenticationHeader)(this.sinchClientParameters.applicationKey, this.sinchClientParameters.applicationSecret, headers, body,
|
|
51515
|
+
return (0, sdk_client_1.validateAuthenticationHeader)(this.sinchClientParameters.applicationKey, this.sinchClientParameters.applicationSecret, headers, body, path7, method);
|
|
51516
51516
|
}
|
|
51517
51517
|
/**
|
|
51518
51518
|
* Reviver for a Voice Event.
|
|
@@ -51609,9 +51609,9 @@ var require_callouts_api = __commonJS({
|
|
|
51609
51609
|
"Accept": "application/json"
|
|
51610
51610
|
};
|
|
51611
51611
|
const body = data["ttsCalloutRequestBody"] ? JSON.stringify(data["ttsCalloutRequestBody"]) : "{}";
|
|
51612
|
-
const
|
|
51613
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51614
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body,
|
|
51612
|
+
const path7 = "/calling/v1/callouts";
|
|
51613
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51614
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body, path7);
|
|
51615
51615
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51616
51616
|
return this.client.processCall({
|
|
51617
51617
|
url: url2,
|
|
@@ -51632,9 +51632,9 @@ var require_callouts_api = __commonJS({
|
|
|
51632
51632
|
"Accept": "application/json"
|
|
51633
51633
|
};
|
|
51634
51634
|
const body = data["conferenceCalloutRequestBody"] ? JSON.stringify(data["conferenceCalloutRequestBody"]) : "{}";
|
|
51635
|
-
const
|
|
51636
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51637
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body,
|
|
51635
|
+
const path7 = "/calling/v1/callouts";
|
|
51636
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51637
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body, path7);
|
|
51638
51638
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51639
51639
|
return this.client.processCall({
|
|
51640
51640
|
url: url2,
|
|
@@ -51655,9 +51655,9 @@ var require_callouts_api = __commonJS({
|
|
|
51655
51655
|
"Accept": "application/json"
|
|
51656
51656
|
};
|
|
51657
51657
|
const body = data["customCalloutRequestBody"] ? JSON.stringify(data["customCalloutRequestBody"]) : "{}";
|
|
51658
|
-
const
|
|
51659
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51660
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body,
|
|
51658
|
+
const path7 = "/calling/v1/callouts";
|
|
51659
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51660
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "POST", getParams, headers, body, path7);
|
|
51661
51661
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51662
51662
|
return this.client.processCall({
|
|
51663
51663
|
url: url2,
|
|
@@ -51737,9 +51737,9 @@ var require_calls_api = __commonJS({
|
|
|
51737
51737
|
"Accept": "application/json"
|
|
51738
51738
|
};
|
|
51739
51739
|
const body = "";
|
|
51740
|
-
const
|
|
51741
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51742
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0,
|
|
51740
|
+
const path7 = `/calling/v1/calls/id/${data["callId"]}`;
|
|
51741
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51742
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0, path7);
|
|
51743
51743
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51744
51744
|
return this.client.processCall({
|
|
51745
51745
|
url: url2,
|
|
@@ -51760,9 +51760,9 @@ var require_calls_api = __commonJS({
|
|
|
51760
51760
|
"Accept": "application/json"
|
|
51761
51761
|
};
|
|
51762
51762
|
const body = data["manageWithCallLegRequestBody"] ? JSON.stringify(data["manageWithCallLegRequestBody"]) : "{}";
|
|
51763
|
-
const
|
|
51764
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51765
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PATCH", getParams, headers, body,
|
|
51763
|
+
const path7 = `/calling/v1/calls/id/${data["callId"]}/leg/${data["callLeg"]}`;
|
|
51764
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51765
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PATCH", getParams, headers, body, path7);
|
|
51766
51766
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51767
51767
|
return this.client.processCall({
|
|
51768
51768
|
url: url2,
|
|
@@ -51783,9 +51783,9 @@ var require_calls_api = __commonJS({
|
|
|
51783
51783
|
"Accept": "application/json"
|
|
51784
51784
|
};
|
|
51785
51785
|
const body = data["updateCallRequestBody"] ? JSON.stringify(data["updateCallRequestBody"]) : "{}";
|
|
51786
|
-
const
|
|
51787
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51788
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PATCH", getParams, headers, body,
|
|
51786
|
+
const path7 = `/calling/v1/calls/id/${data["callId"]}`;
|
|
51787
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51788
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PATCH", getParams, headers, body, path7);
|
|
51789
51789
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51790
51790
|
return this.client.processCall({
|
|
51791
51791
|
url: url2,
|
|
@@ -51875,9 +51875,9 @@ var require_conferences_api = __commonJS({
|
|
|
51875
51875
|
"Accept": "application/json"
|
|
51876
51876
|
};
|
|
51877
51877
|
const body = "";
|
|
51878
|
-
const
|
|
51879
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51880
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0,
|
|
51878
|
+
const path7 = `/calling/v1/conferences/id/${data["conferenceId"]}`;
|
|
51879
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51880
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "GET", getParams, headers, body || void 0, path7);
|
|
51881
51881
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51882
51882
|
return this.client.processCall({
|
|
51883
51883
|
url: url2,
|
|
@@ -51898,9 +51898,9 @@ var require_conferences_api = __commonJS({
|
|
|
51898
51898
|
"Accept": "application/json"
|
|
51899
51899
|
};
|
|
51900
51900
|
const body = "";
|
|
51901
|
-
const
|
|
51902
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51903
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "DELETE", getParams, headers, body,
|
|
51901
|
+
const path7 = `/calling/v1/conferences/id/${data["conferenceId"]}`;
|
|
51902
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51903
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "DELETE", getParams, headers, body, path7);
|
|
51904
51904
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51905
51905
|
return this.client.processCall({
|
|
51906
51906
|
url: url2,
|
|
@@ -51921,9 +51921,9 @@ var require_conferences_api = __commonJS({
|
|
|
51921
51921
|
"Accept": "application/json"
|
|
51922
51922
|
};
|
|
51923
51923
|
const body = "";
|
|
51924
|
-
const
|
|
51925
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51926
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "DELETE", getParams, headers, body,
|
|
51924
|
+
const path7 = `/calling/v1/conferences/id/${data["conferenceId"]}/${data["callId"]}`;
|
|
51925
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51926
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "DELETE", getParams, headers, body, path7);
|
|
51927
51927
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51928
51928
|
return this.client.processCall({
|
|
51929
51929
|
url: url2,
|
|
@@ -51944,9 +51944,9 @@ var require_conferences_api = __commonJS({
|
|
|
51944
51944
|
"Accept": "application/json"
|
|
51945
51945
|
};
|
|
51946
51946
|
const body = data["manageParticipantRequestBody"] ? JSON.stringify(data["manageParticipantRequestBody"]) : "{}";
|
|
51947
|
-
const
|
|
51948
|
-
const basePathUrl = this.client.apiClientOptions.hostname +
|
|
51949
|
-
const requestOptions = await this.client.prepareOptions(basePathUrl, "PATCH", getParams, headers, body,
|
|
51947
|
+
const path7 = `/calling/v1/conferences/id/${data["conferenceId"]}/${data["callId"]}`;
|
|
51948
|
+
const basePathUrl = this.client.apiClientOptions.hostname + path7;
|
|
51949
|
+
const requestOptions = await this.client.prepareOptions(basePathUrl, "PATCH", getParams, headers, body, path7);
|
|
51950
51950
|
const url2 = this.client.prepareUrl(requestOptions.hostname, requestOptions.queryParams);
|
|
51951
51951
|
return this.client.processCall({
|
|
51952
51952
|
url: url2,
|
|
@@ -60039,23 +60039,23 @@ var HttpTransport = class {
|
|
|
60039
60039
|
return { transport: "HttpTransport", projectId: this.projectId, host: this.host };
|
|
60040
60040
|
}
|
|
60041
60041
|
async createCall(body) {
|
|
60042
|
-
const
|
|
60043
|
-
const response = await this.request("POST",
|
|
60042
|
+
const path7 = this.serviceId ? `calls?serviceId=${encodeURIComponent(this.serviceId)}` : "calls";
|
|
60043
|
+
const response = await this.request("POST", path7, body);
|
|
60044
60044
|
return response;
|
|
60045
60045
|
}
|
|
60046
60046
|
async patchCall(target, commands2) {
|
|
60047
|
-
const
|
|
60048
|
-
await this.request("PATCH",
|
|
60047
|
+
const path7 = "callId" in target ? `calls/${encodeURIComponent(target.callId)}` : `sessions/${encodeURIComponent(target.sessionId)}/calls/${encodeURIComponent(target.callName)}`;
|
|
60048
|
+
await this.request("PATCH", path7, { commands: commands2 });
|
|
60049
60049
|
}
|
|
60050
60050
|
get authHeaders() {
|
|
60051
60051
|
const token = Buffer.from(`${this.#keyId}:${this.#keySecret}`).toString("base64");
|
|
60052
60052
|
return { Authorization: `Basic ${token}`, "Content-Type": "application/json" };
|
|
60053
60053
|
}
|
|
60054
|
-
async request(method,
|
|
60054
|
+
async request(method, path7, body) {
|
|
60055
60055
|
if (!this.projectId || !this.#keyId || !this.#keySecret) {
|
|
60056
60056
|
throw new Error("Voice API v2 needs PROJECT_ID, PROJECT_ID_API_KEY and PROJECT_ID_API_SECRET (the project Access Key pair, not the v1 application key).");
|
|
60057
60057
|
}
|
|
60058
|
-
const url2 = `${this.host}/v2/projects/${encodeURIComponent(this.projectId)}/${
|
|
60058
|
+
const url2 = `${this.host}/v2/projects/${encodeURIComponent(this.projectId)}/${path7}`;
|
|
60059
60059
|
const response = await this.fetchImpl(url2, {
|
|
60060
60060
|
method,
|
|
60061
60061
|
headers: this.authHeaders,
|
|
@@ -62583,8 +62583,8 @@ function buildVoiceSignedRequest(req) {
|
|
|
62583
62583
|
function isVoiceWebhookPath(pathname) {
|
|
62584
62584
|
return pathname === "/" || pathname === "/webhook/voice";
|
|
62585
62585
|
}
|
|
62586
|
-
function extractFunctionName(
|
|
62587
|
-
const pathname =
|
|
62586
|
+
function extractFunctionName(path7, body) {
|
|
62587
|
+
const pathname = path7.split("?")[0];
|
|
62588
62588
|
if (isVoiceWebhookPath(pathname)) {
|
|
62589
62589
|
if (body?.event && isVoiceV1Callback(body.event)) {
|
|
62590
62590
|
return body.event;
|
|
@@ -62609,10 +62609,10 @@ function generateRequestId() {
|
|
|
62609
62609
|
return `req_${Date.now()}_${Math.random().toString(36).substring(7)}`;
|
|
62610
62610
|
}
|
|
62611
62611
|
function findFunctionPath() {
|
|
62612
|
-
const
|
|
62612
|
+
const fs6 = requireCjs("fs");
|
|
62613
62613
|
const distPath = nodePath.join(process.cwd(), "dist", "function.js");
|
|
62614
62614
|
const rootPath = nodePath.join(process.cwd(), "function.js");
|
|
62615
|
-
if (
|
|
62615
|
+
if (fs6.existsSync(distPath)) {
|
|
62616
62616
|
return distPath;
|
|
62617
62617
|
}
|
|
62618
62618
|
return rootPath;
|
|
@@ -62838,8 +62838,8 @@ function createSinchRuntime() {
|
|
|
62838
62838
|
onStartup(handler) {
|
|
62839
62839
|
result2.startupHandlers.push(handler);
|
|
62840
62840
|
},
|
|
62841
|
-
onWebSocket(
|
|
62842
|
-
const normalizedPath =
|
|
62841
|
+
onWebSocket(path7, handler) {
|
|
62842
|
+
const normalizedPath = path7.startsWith("/") ? path7 : `/${path7}`;
|
|
62843
62843
|
result2.wsHandlers.set(normalizedPath, handler);
|
|
62844
62844
|
}
|
|
62845
62845
|
};
|
|
@@ -63519,7 +63519,7 @@ var ElevenLabsAutoConfigurator = class {
|
|
|
63519
63519
|
var AGENT_SAMPLE_RATE = 16e3;
|
|
63520
63520
|
var AGENT_STREAM_PATH = "/stream";
|
|
63521
63521
|
var AGENT_HEADER_TOKEN = "x-sinch-agent-token";
|
|
63522
|
-
function deriveSocketUrl(
|
|
63522
|
+
function deriveSocketUrl(path7) {
|
|
63523
63523
|
const fnName = process.env["FUNCTION_NAME"];
|
|
63524
63524
|
const apiUrl = process.env["API_URL"];
|
|
63525
63525
|
if (!fnName || !apiUrl)
|
|
@@ -63529,7 +63529,7 @@ function deriveSocketUrl(path6) {
|
|
|
63529
63529
|
const match = apiUrl.match(/api\.functions\.(\w+)\.sinchvoice\.org/);
|
|
63530
63530
|
if (!match)
|
|
63531
63531
|
return "";
|
|
63532
|
-
return `wss://${fnName}.fn-${match[1]}.sinch.com${
|
|
63532
|
+
return `wss://${fnName}.fn-${match[1]}.sinch.com${path7}`;
|
|
63533
63533
|
}
|
|
63534
63534
|
function isLocalDevUrl(url2) {
|
|
63535
63535
|
let hostname;
|
|
@@ -63550,10 +63550,10 @@ function isDeployed(context) {
|
|
|
63550
63550
|
function resolveAgentStreamUrl(context, override) {
|
|
63551
63551
|
return resolveSelfSocketUrl(AGENT_STREAM_PATH, "STREAM_URL", context, override);
|
|
63552
63552
|
}
|
|
63553
|
-
function resolveSelfSocketUrl(
|
|
63554
|
-
const url2 = override || (context?.host ? `wss://${context.host}${
|
|
63553
|
+
function resolveSelfSocketUrl(path7, envVar, context, override) {
|
|
63554
|
+
const url2 = override || (context?.host ? `wss://${context.host}${path7}` : "") || process.env[envVar] || deriveSocketUrl(path7);
|
|
63555
63555
|
if (!url2) {
|
|
63556
|
-
throw new Error(`WebSocket URL for ${
|
|
63556
|
+
throw new Error(`WebSocket URL for ${path7} cannot be determined \u2014 set ${envVar}, or ensure FUNCTION_NAME and API_URL are present.`);
|
|
63557
63557
|
}
|
|
63558
63558
|
if (isDeployed(context) && isLocalDevUrl(url2)) {
|
|
63559
63559
|
throw new Error(`Refusing ${url2} as this deployed function's media endpoint \u2014 it is a local development host the platform cannot reach, so the leg would fail instantly. This is almost always a ${envVar} left over from a 'sinch functions dev' tunnel. Unset it in the deployed environment, or pass the request-scoped context or an explicit URL.`);
|
|
@@ -63602,7 +63602,7 @@ var MAX_UNAUTHENTICATED_SOCKETS = 32;
|
|
|
63602
63602
|
var HANGUP_GRACE_MS = 1e3;
|
|
63603
63603
|
var RELAY_LEG2 = "relay";
|
|
63604
63604
|
function voiceRelay(options) {
|
|
63605
|
-
const
|
|
63605
|
+
const path7 = options.path ?? RELAY_PATH;
|
|
63606
63606
|
const pending = /* @__PURE__ */ new Map();
|
|
63607
63607
|
let unauthenticated = 0;
|
|
63608
63608
|
function takePending(token) {
|
|
@@ -63615,7 +63615,7 @@ function voiceRelay(options) {
|
|
|
63615
63615
|
}
|
|
63616
63616
|
function endpointFor(event, clientContext) {
|
|
63617
63617
|
const context = clientContext;
|
|
63618
|
-
const url2 = resolveSelfSocketUrl(
|
|
63618
|
+
const url2 = resolveSelfSocketUrl(path7, "RELAY_URL", context);
|
|
63619
63619
|
const voice = setting(options.voice, event.call, context, "voice");
|
|
63620
63620
|
const language = setting(options.language, event.call, context, "language");
|
|
63621
63621
|
const token = randomUUID();
|
|
@@ -63804,7 +63804,7 @@ function voiceRelay(options) {
|
|
|
63804
63804
|
}
|
|
63805
63805
|
return {
|
|
63806
63806
|
setup(runtime) {
|
|
63807
|
-
runtime.onWebSocket(
|
|
63807
|
+
runtime.onWebSocket(path7, ((ws, req) => handleRelay(ws, req)));
|
|
63808
63808
|
},
|
|
63809
63809
|
endpointFor
|
|
63810
63810
|
};
|
|
@@ -66001,8 +66001,8 @@ var FIRST_OUTPUT_TIMEOUT_MS = 3e3;
|
|
|
66001
66001
|
var RESPONSE_TIMEOUT_MS = 15e3;
|
|
66002
66002
|
function buildResponsesWsUrl(baseUrl) {
|
|
66003
66003
|
const base = resolveBaseUrl(baseUrl) ?? DEFAULT_RESPONSES_BASE_URL;
|
|
66004
|
-
const
|
|
66005
|
-
const url2 = new URL(base + (base.endsWith("/") ?
|
|
66004
|
+
const path7 = "/responses";
|
|
66005
|
+
const url2 = new URL(base + (base.endsWith("/") ? path7.slice(1) : path7));
|
|
66006
66006
|
url2.protocol = url2.protocol === "http:" ? "ws:" : "wss:";
|
|
66007
66007
|
return url2.toString();
|
|
66008
66008
|
}
|
|
@@ -71013,9 +71013,9 @@ function isVisitable(thing) {
|
|
|
71013
71013
|
function removeBrackets(key) {
|
|
71014
71014
|
return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key;
|
|
71015
71015
|
}
|
|
71016
|
-
function renderKey(
|
|
71017
|
-
if (!
|
|
71018
|
-
return
|
|
71016
|
+
function renderKey(path7, key, dots) {
|
|
71017
|
+
if (!path7) return key;
|
|
71018
|
+
return path7.concat(key).map(function each(token, i) {
|
|
71019
71019
|
token = removeBrackets(token);
|
|
71020
71020
|
return !dots && i ? "[" + token + "]" : token;
|
|
71021
71021
|
}).join(dots ? "." : "");
|
|
@@ -71069,13 +71069,13 @@ function toFormData(obj, formData, options) {
|
|
|
71069
71069
|
}
|
|
71070
71070
|
return value;
|
|
71071
71071
|
}
|
|
71072
|
-
function defaultVisitor(value, key,
|
|
71072
|
+
function defaultVisitor(value, key, path7) {
|
|
71073
71073
|
let arr = value;
|
|
71074
71074
|
if (utils_default.isReactNative(formData) && utils_default.isReactNativeBlob(value)) {
|
|
71075
|
-
formData.append(renderKey(
|
|
71075
|
+
formData.append(renderKey(path7, key, dots), convertValue(value));
|
|
71076
71076
|
return false;
|
|
71077
71077
|
}
|
|
71078
|
-
if (value && !
|
|
71078
|
+
if (value && !path7 && typeof value === "object") {
|
|
71079
71079
|
if (utils_default.endsWith(key, "{}")) {
|
|
71080
71080
|
key = metaTokens ? key : key.slice(0, -2);
|
|
71081
71081
|
value = JSON.stringify(value);
|
|
@@ -71094,7 +71094,7 @@ function toFormData(obj, formData, options) {
|
|
|
71094
71094
|
if (isVisitable(value)) {
|
|
71095
71095
|
return true;
|
|
71096
71096
|
}
|
|
71097
|
-
formData.append(renderKey(
|
|
71097
|
+
formData.append(renderKey(path7, key, dots), convertValue(value));
|
|
71098
71098
|
return false;
|
|
71099
71099
|
}
|
|
71100
71100
|
const stack = [];
|
|
@@ -71103,7 +71103,7 @@ function toFormData(obj, formData, options) {
|
|
|
71103
71103
|
convertValue,
|
|
71104
71104
|
isVisitable
|
|
71105
71105
|
});
|
|
71106
|
-
function build(value,
|
|
71106
|
+
function build(value, path7, depth = 0) {
|
|
71107
71107
|
if (utils_default.isUndefined(value)) return;
|
|
71108
71108
|
if (depth > maxDepth) {
|
|
71109
71109
|
throw new AxiosError_default(
|
|
@@ -71112,13 +71112,13 @@ function toFormData(obj, formData, options) {
|
|
|
71112
71112
|
);
|
|
71113
71113
|
}
|
|
71114
71114
|
if (stack.indexOf(value) !== -1) {
|
|
71115
|
-
throw Error("Circular reference detected in " +
|
|
71115
|
+
throw Error("Circular reference detected in " + path7.join("."));
|
|
71116
71116
|
}
|
|
71117
71117
|
stack.push(value);
|
|
71118
71118
|
utils_default.forEach(value, function each(el, key) {
|
|
71119
|
-
const result2 = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key,
|
|
71119
|
+
const result2 = !(utils_default.isUndefined(el) || el === null) && visitor.call(formData, el, utils_default.isString(key) ? key.trim() : key, path7, exposedHelpers);
|
|
71120
71120
|
if (result2 === true) {
|
|
71121
|
-
build(el,
|
|
71121
|
+
build(el, path7 ? path7.concat(key) : [key], depth + 1);
|
|
71122
71122
|
}
|
|
71123
71123
|
});
|
|
71124
71124
|
stack.pop();
|
|
@@ -71329,7 +71329,7 @@ var platform_default = {
|
|
|
71329
71329
|
// ../../node_modules/axios/lib/helpers/toURLEncodedForm.js
|
|
71330
71330
|
function toURLEncodedForm(data, options) {
|
|
71331
71331
|
return toFormData_default(data, new platform_default.classes.URLSearchParams(), {
|
|
71332
|
-
visitor: function(value, key,
|
|
71332
|
+
visitor: function(value, key, path7, helpers) {
|
|
71333
71333
|
if (platform_default.isNode && utils_default.isBuffer(value)) {
|
|
71334
71334
|
this.append(key, value.toString("base64"));
|
|
71335
71335
|
return false;
|
|
@@ -71359,11 +71359,11 @@ function arrayToObject(arr) {
|
|
|
71359
71359
|
return obj;
|
|
71360
71360
|
}
|
|
71361
71361
|
function formDataToJSON(formData) {
|
|
71362
|
-
function buildPath(
|
|
71363
|
-
let name =
|
|
71362
|
+
function buildPath(path7, value, target, index) {
|
|
71363
|
+
let name = path7[index++];
|
|
71364
71364
|
if (name === "__proto__") return true;
|
|
71365
71365
|
const isNumericKey = Number.isFinite(+name);
|
|
71366
|
-
const isLast = index >=
|
|
71366
|
+
const isLast = index >= path7.length;
|
|
71367
71367
|
name = !name && utils_default.isArray(target) ? target.length : name;
|
|
71368
71368
|
if (isLast) {
|
|
71369
71369
|
if (utils_default.hasOwnProp(target, name)) {
|
|
@@ -71376,7 +71376,7 @@ function formDataToJSON(formData) {
|
|
|
71376
71376
|
if (!target[name] || !utils_default.isObject(target[name])) {
|
|
71377
71377
|
target[name] = [];
|
|
71378
71378
|
}
|
|
71379
|
-
const result2 = buildPath(
|
|
71379
|
+
const result2 = buildPath(path7, value, target[name], index);
|
|
71380
71380
|
if (result2 && utils_default.isArray(target[name])) {
|
|
71381
71381
|
target[name] = arrayToObject(target[name]);
|
|
71382
71382
|
}
|
|
@@ -72774,9 +72774,9 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
72774
72774
|
auth = urlUsername + ":" + urlPassword;
|
|
72775
72775
|
}
|
|
72776
72776
|
auth && headers.delete("authorization");
|
|
72777
|
-
let
|
|
72777
|
+
let path7;
|
|
72778
72778
|
try {
|
|
72779
|
-
|
|
72779
|
+
path7 = buildURL(
|
|
72780
72780
|
parsed.pathname + parsed.search,
|
|
72781
72781
|
config.params,
|
|
72782
72782
|
config.paramsSerializer
|
|
@@ -72794,7 +72794,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
|
|
|
72794
72794
|
false
|
|
72795
72795
|
);
|
|
72796
72796
|
const options = Object.assign(/* @__PURE__ */ Object.create(null), {
|
|
72797
|
-
path:
|
|
72797
|
+
path: path7,
|
|
72798
72798
|
method,
|
|
72799
72799
|
headers: headers.toJSON(),
|
|
72800
72800
|
agents: { http: config.httpAgent, https: config.httpsAgent },
|
|
@@ -73133,14 +73133,14 @@ var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PUR
|
|
|
73133
73133
|
var cookies_default = platform_default.hasStandardBrowserEnv ? (
|
|
73134
73134
|
// Standard browser envs support document.cookie
|
|
73135
73135
|
{
|
|
73136
|
-
write(name, value, expires,
|
|
73136
|
+
write(name, value, expires, path7, domain, secure, sameSite) {
|
|
73137
73137
|
if (typeof document === "undefined") return;
|
|
73138
73138
|
const cookie = [`${name}=${encodeURIComponent(value)}`];
|
|
73139
73139
|
if (utils_default.isNumber(expires)) {
|
|
73140
73140
|
cookie.push(`expires=${new Date(expires).toUTCString()}`);
|
|
73141
73141
|
}
|
|
73142
|
-
if (utils_default.isString(
|
|
73143
|
-
cookie.push(`path=${
|
|
73142
|
+
if (utils_default.isString(path7)) {
|
|
73143
|
+
cookie.push(`path=${path7}`);
|
|
73144
73144
|
}
|
|
73145
73145
|
if (utils_default.isString(domain)) {
|
|
73146
73146
|
cookie.push(`domain=${domain}`);
|
|
@@ -74543,6 +74543,8 @@ var {
|
|
|
74543
74543
|
// src/tunnel/webhook-config.ts
|
|
74544
74544
|
var import_sdk_core2 = __toESM(require_dist11(), 1);
|
|
74545
74545
|
import { randomBytes } from "crypto";
|
|
74546
|
+
import fs4 from "fs";
|
|
74547
|
+
import path5 from "path";
|
|
74546
74548
|
var SINCH_FN_URL_PATTERN = /\.fn(-\w+)?\.sinch\.(?:com|io)/;
|
|
74547
74549
|
function isOurWebhook(target) {
|
|
74548
74550
|
return !!target && SINCH_FN_URL_PATTERN.test(target);
|
|
@@ -74554,8 +74556,24 @@ function deployedWebhookTarget(functionName) {
|
|
|
74554
74556
|
const domain = process.env.SINCH_FUNCTIONS_DOMAIN || FUNCTIONS_DOMAIN_DEFAULT;
|
|
74555
74557
|
return `https://${functionName}.${domain}/webhook/conversation`;
|
|
74556
74558
|
}
|
|
74557
|
-
|
|
74558
|
-
|
|
74559
|
+
var TUNNEL_GATEWAY_HOST_PATTERN = /^tunnel\.fn(-\w+)?\.sinch\.(com|io)$/;
|
|
74560
|
+
function isTunnelUrl(target, env = process.env) {
|
|
74561
|
+
if (!target) return false;
|
|
74562
|
+
let url2;
|
|
74563
|
+
try {
|
|
74564
|
+
url2 = new URL(target);
|
|
74565
|
+
} catch {
|
|
74566
|
+
return false;
|
|
74567
|
+
}
|
|
74568
|
+
if (TUNNEL_GATEWAY_HOST_PATTERN.test(url2.hostname)) return true;
|
|
74569
|
+
if (env.TUNNEL_GATEWAY_URL) {
|
|
74570
|
+
try {
|
|
74571
|
+
if (new URL(env.TUNNEL_GATEWAY_URL).host === url2.host) return true;
|
|
74572
|
+
} catch {
|
|
74573
|
+
}
|
|
74574
|
+
}
|
|
74575
|
+
const ingressPath = url2.pathname === "/ingress" || url2.pathname.startsWith("/ingress/");
|
|
74576
|
+
return ingressPath && url2.searchParams.has("tunnel");
|
|
74559
74577
|
}
|
|
74560
74578
|
async function configureConversationWebhooks(webhookUrl, config) {
|
|
74561
74579
|
try {
|
|
@@ -74584,8 +74602,10 @@ async function configureConversationWebhooks(webhookUrl, config) {
|
|
|
74584
74602
|
console.log("\u26A0\uFE0F No deployed webhook found \u2014 deploy first");
|
|
74585
74603
|
return;
|
|
74586
74604
|
}
|
|
74587
|
-
config.conversationWebhookId
|
|
74588
|
-
|
|
74605
|
+
if (config.conversationWebhookId !== deployedWebhook.id) {
|
|
74606
|
+
config.conversationWebhookId = deployedWebhook.id;
|
|
74607
|
+
config.originalTarget = deployedWebhook.target;
|
|
74608
|
+
}
|
|
74589
74609
|
const hmacSecret = randomBytes(32).toString("hex");
|
|
74590
74610
|
process.env.CONVERSATION_WEBHOOK_SECRET = hmacSecret;
|
|
74591
74611
|
resetSinchClients();
|
|
@@ -74660,26 +74680,81 @@ async function configureElevenLabs() {
|
|
|
74660
74680
|
}
|
|
74661
74681
|
}
|
|
74662
74682
|
var VOICE_V2_HOST = "https://voice.api.sinch.com";
|
|
74663
|
-
|
|
74664
|
-
const serviceId = env.VOICE_SERVICE_ID;
|
|
74665
|
-
if (!serviceId) return;
|
|
74683
|
+
function voiceServiceRequest(env) {
|
|
74666
74684
|
const projectId = env.PROJECT_ID;
|
|
74667
74685
|
const keyId = env.PROJECT_ID_API_KEY;
|
|
74668
74686
|
const keySecret = env.PROJECT_ID_API_SECRET;
|
|
74669
|
-
if (!projectId || !keyId || !keySecret)
|
|
74687
|
+
if (!projectId || !keyId || !keySecret) return null;
|
|
74688
|
+
return {
|
|
74689
|
+
baseUrl: `${VOICE_V2_HOST}/v2/projects/${encodeURIComponent(projectId)}/services`,
|
|
74690
|
+
headers: {
|
|
74691
|
+
Authorization: `Basic ${Buffer.from(`${keyId}:${keySecret}`).toString("base64")}`,
|
|
74692
|
+
"Content-Type": "application/json"
|
|
74693
|
+
}
|
|
74694
|
+
};
|
|
74695
|
+
}
|
|
74696
|
+
function staleVoiceWebhookAdvice(serviceId) {
|
|
74697
|
+
return ` Point it back at your deployed function with \`sinch functions deploy\` or \`sinch voice services update ${serviceId} --webhook-url <url>\`.`;
|
|
74698
|
+
}
|
|
74699
|
+
function defaultVoiceStatePath() {
|
|
74700
|
+
return path5.join(process.cwd(), ".sinch", "tunnel-voice-original.json");
|
|
74701
|
+
}
|
|
74702
|
+
function isTunnelBehavior(behavior, env) {
|
|
74703
|
+
return behavior?.type === "WEBHOOK" && isTunnelUrl(behavior.webhook?.url, env);
|
|
74704
|
+
}
|
|
74705
|
+
function writeVoiceState(stateFile, state) {
|
|
74706
|
+
try {
|
|
74707
|
+
fs4.mkdirSync(path5.dirname(stateFile), { recursive: true });
|
|
74708
|
+
fs4.writeFileSync(stateFile, JSON.stringify(state, null, 2));
|
|
74709
|
+
} catch (error) {
|
|
74710
|
+
console.log(
|
|
74711
|
+
`\u26A0\uFE0F Could not save Voice service state to ${stateFile}: ${error instanceof Error ? error.message : error}`
|
|
74712
|
+
);
|
|
74713
|
+
}
|
|
74714
|
+
}
|
|
74715
|
+
function readVoiceState(stateFile) {
|
|
74716
|
+
try {
|
|
74717
|
+
const parsed = JSON.parse(fs4.readFileSync(stateFile, "utf8"));
|
|
74718
|
+
if (typeof parsed?.serviceId === "string" && typeof parsed.callBehavior?.type === "string") {
|
|
74719
|
+
return parsed;
|
|
74720
|
+
}
|
|
74721
|
+
} catch {
|
|
74722
|
+
}
|
|
74723
|
+
return void 0;
|
|
74724
|
+
}
|
|
74725
|
+
function deleteVoiceState(stateFile) {
|
|
74726
|
+
try {
|
|
74727
|
+
fs4.rmSync(stateFile, { force: true });
|
|
74728
|
+
} catch {
|
|
74729
|
+
}
|
|
74730
|
+
}
|
|
74731
|
+
async function configureVoiceServiceWebhook(tunnelUrl, env = process.env, fetchImpl = globalThis.fetch, config = {}, stateFile = defaultVoiceStatePath()) {
|
|
74732
|
+
const serviceId = env.VOICE_SERVICE_ID;
|
|
74733
|
+
if (!serviceId) return;
|
|
74734
|
+
const request = voiceServiceRequest(env);
|
|
74735
|
+
if (!request) {
|
|
74670
74736
|
console.log(
|
|
74671
74737
|
"\u26A0\uFE0F VOICE_SERVICE_ID is set but PROJECT_ID, PROJECT_ID_API_KEY or PROJECT_ID_API_SECRET is missing - skipping Voice service webhook update"
|
|
74672
74738
|
);
|
|
74673
74739
|
return;
|
|
74674
74740
|
}
|
|
74675
|
-
const url2 = `${
|
|
74741
|
+
const url2 = `${request.baseUrl}/${encodeURIComponent(serviceId)}`;
|
|
74742
|
+
const alreadySaved = config.voiceServiceId === serviceId;
|
|
74743
|
+
let original = config.voiceOriginalCallBehavior;
|
|
74676
74744
|
try {
|
|
74745
|
+
if (!alreadySaved) {
|
|
74746
|
+
original = await resolveVoiceOriginal(
|
|
74747
|
+
url2,
|
|
74748
|
+
request.headers,
|
|
74749
|
+
serviceId,
|
|
74750
|
+
env,
|
|
74751
|
+
fetchImpl,
|
|
74752
|
+
stateFile
|
|
74753
|
+
);
|
|
74754
|
+
}
|
|
74677
74755
|
const response = await fetchImpl(url2, {
|
|
74678
74756
|
method: "PATCH",
|
|
74679
|
-
headers:
|
|
74680
|
-
Authorization: `Basic ${Buffer.from(`${keyId}:${keySecret}`).toString("base64")}`,
|
|
74681
|
-
"Content-Type": "application/json"
|
|
74682
|
-
},
|
|
74757
|
+
headers: request.headers,
|
|
74683
74758
|
body: JSON.stringify({
|
|
74684
74759
|
callBehavior: { type: "WEBHOOK", webhook: { url: tunnelUrl } }
|
|
74685
74760
|
})
|
|
@@ -74690,6 +74765,8 @@ async function configureVoiceServiceWebhook(tunnelUrl, env = process.env, fetchI
|
|
|
74690
74765
|
);
|
|
74691
74766
|
return;
|
|
74692
74767
|
}
|
|
74768
|
+
config.voiceServiceId = serviceId;
|
|
74769
|
+
config.voiceOriginalCallBehavior = original;
|
|
74693
74770
|
console.log(`\u2705 Updated Voice service webhook (${serviceId}) to ${tunnelUrl}`);
|
|
74694
74771
|
console.log("\u{1F4A1} Call the number bound to this service in Build to test your voice function!");
|
|
74695
74772
|
} catch (error) {
|
|
@@ -74699,6 +74776,88 @@ async function configureVoiceServiceWebhook(tunnelUrl, env = process.env, fetchI
|
|
|
74699
74776
|
);
|
|
74700
74777
|
}
|
|
74701
74778
|
}
|
|
74779
|
+
async function resolveVoiceOriginal(url2, headers, serviceId, env, fetchImpl, stateFile) {
|
|
74780
|
+
let behavior;
|
|
74781
|
+
try {
|
|
74782
|
+
const response = await fetchImpl(url2, { method: "GET", headers });
|
|
74783
|
+
if (!response.ok) {
|
|
74784
|
+
console.log(
|
|
74785
|
+
`\u26A0\uFE0F Could not read Voice service ${serviceId} (${response.status} ${response.statusText}): its webhook will not be restored when dev stops`
|
|
74786
|
+
);
|
|
74787
|
+
return void 0;
|
|
74788
|
+
}
|
|
74789
|
+
const service = await response.json();
|
|
74790
|
+
behavior = service?.callBehavior;
|
|
74791
|
+
} catch (error) {
|
|
74792
|
+
console.log(
|
|
74793
|
+
`\u26A0\uFE0F Could not read Voice service ${serviceId}: ${error instanceof Error ? error.message : error}: its webhook will not be restored when dev stops`
|
|
74794
|
+
);
|
|
74795
|
+
return void 0;
|
|
74796
|
+
}
|
|
74797
|
+
if (!isTunnelBehavior(behavior, env)) {
|
|
74798
|
+
if (behavior) writeVoiceState(stateFile, { serviceId, callBehavior: behavior });
|
|
74799
|
+
return behavior;
|
|
74800
|
+
}
|
|
74801
|
+
const persisted = readVoiceState(stateFile);
|
|
74802
|
+
if (persisted?.serviceId === serviceId && !isTunnelBehavior(persisted.callBehavior, env)) {
|
|
74803
|
+
console.log(
|
|
74804
|
+
`\u{1F527} Voice service ${serviceId} still points at an earlier tunnel (hot reload?); will restore the webhook saved in ${stateFile}`
|
|
74805
|
+
);
|
|
74806
|
+
return persisted.callBehavior;
|
|
74807
|
+
}
|
|
74808
|
+
console.log(
|
|
74809
|
+
`\u26A0\uFE0F Voice service ${serviceId} already points at a tunnel URL from an earlier dev session (${behavior?.webhook?.url}); it will not be restored to that when dev stops.`
|
|
74810
|
+
);
|
|
74811
|
+
return behavior;
|
|
74812
|
+
}
|
|
74813
|
+
async function cleanupVoiceServiceWebhook(config, env = process.env, fetchImpl = globalThis.fetch, stateFile = defaultVoiceStatePath()) {
|
|
74814
|
+
const serviceId = config.voiceServiceId;
|
|
74815
|
+
if (!serviceId) return;
|
|
74816
|
+
const original = config.voiceOriginalCallBehavior;
|
|
74817
|
+
config.voiceServiceId = void 0;
|
|
74818
|
+
config.voiceOriginalCallBehavior = void 0;
|
|
74819
|
+
if (!original) {
|
|
74820
|
+
deleteVoiceState(stateFile);
|
|
74821
|
+
console.log(
|
|
74822
|
+
`\u26A0\uFE0F Voice service ${serviceId} still points at the tunnel: its previous webhook was not known, so it was not restored.`
|
|
74823
|
+
);
|
|
74824
|
+
console.log(staleVoiceWebhookAdvice(serviceId));
|
|
74825
|
+
return;
|
|
74826
|
+
}
|
|
74827
|
+
if (isTunnelBehavior(original, env)) {
|
|
74828
|
+
deleteVoiceState(stateFile);
|
|
74829
|
+
console.log(
|
|
74830
|
+
`\u26A0\uFE0F Voice service ${serviceId} was not restored: its previous webhook was a stale tunnel URL (${original.webhook?.url}).`
|
|
74831
|
+
);
|
|
74832
|
+
console.log(staleVoiceWebhookAdvice(serviceId));
|
|
74833
|
+
return;
|
|
74834
|
+
}
|
|
74835
|
+
const request = voiceServiceRequest(env);
|
|
74836
|
+
if (!request) return;
|
|
74837
|
+
try {
|
|
74838
|
+
const response = await fetchImpl(`${request.baseUrl}/${encodeURIComponent(serviceId)}`, {
|
|
74839
|
+
method: "PATCH",
|
|
74840
|
+
headers: request.headers,
|
|
74841
|
+
body: JSON.stringify({ callBehavior: original })
|
|
74842
|
+
});
|
|
74843
|
+
if (!response.ok) {
|
|
74844
|
+
console.log(
|
|
74845
|
+
`\u26A0\uFE0F Could not restore Voice service webhook (${serviceId}): ${response.status} ${response.statusText}`
|
|
74846
|
+
);
|
|
74847
|
+
console.log(staleVoiceWebhookAdvice(serviceId));
|
|
74848
|
+
return;
|
|
74849
|
+
}
|
|
74850
|
+
deleteVoiceState(stateFile);
|
|
74851
|
+
const restoredTo = original.type === "WEBHOOK" ? original.webhook?.url : original.type;
|
|
74852
|
+
console.log(`\u{1F504} Restored Voice service webhook (${serviceId}) to: ${restoredTo}`);
|
|
74853
|
+
} catch (error) {
|
|
74854
|
+
console.log(
|
|
74855
|
+
`\u26A0\uFE0F Could not restore Voice service webhook (${serviceId}):`,
|
|
74856
|
+
error instanceof Error ? error.message : error
|
|
74857
|
+
);
|
|
74858
|
+
console.log(staleVoiceWebhookAdvice(serviceId));
|
|
74859
|
+
}
|
|
74860
|
+
}
|
|
74702
74861
|
|
|
74703
74862
|
// src/tunnel/ws-stream.ts
|
|
74704
74863
|
var UPGRADE_TIMEOUT_MS = 1e4;
|
|
@@ -74734,8 +74893,8 @@ var TunnelStreamManager = class {
|
|
|
74734
74893
|
this.log(`[WS] Ignoring duplicate ws_open for stream ${id}`);
|
|
74735
74894
|
return;
|
|
74736
74895
|
}
|
|
74737
|
-
const
|
|
74738
|
-
const url2 = `ws://localhost:${this.localPort}${
|
|
74896
|
+
const path7 = message.path ?? "/";
|
|
74897
|
+
const url2 = `ws://localhost:${this.localPort}${path7}${message.query ?? ""}`;
|
|
74739
74898
|
const protocols = message.protocol ? message.protocol.split(",").map((p) => p.trim()).filter(Boolean) : [];
|
|
74740
74899
|
this.log(`[WS] Opening tunnelled WebSocket ${id} to ${url2}`);
|
|
74741
74900
|
let socket;
|
|
@@ -74891,6 +75050,12 @@ function describe(error) {
|
|
|
74891
75050
|
return String(error);
|
|
74892
75051
|
}
|
|
74893
75052
|
|
|
75053
|
+
// src/tunnel/url.ts
|
|
75054
|
+
function buildTunnelUrl(publicUrl, tunnelId, path7) {
|
|
75055
|
+
const base = publicUrl.split(/[?#]/, 1)[0].replace(/\/+$/, "");
|
|
75056
|
+
return `${base}${path7 || ""}?tunnel=${tunnelId}`;
|
|
75057
|
+
}
|
|
75058
|
+
|
|
74894
75059
|
// src/tunnel/index.ts
|
|
74895
75060
|
var TUNNEL_GATEWAY_DEFAULT = "https://tunnel.fn.sinch.io";
|
|
74896
75061
|
var TunnelClient = class {
|
|
@@ -74906,6 +75071,10 @@ var TunnelClient = class {
|
|
|
74906
75071
|
webhookConfig = {};
|
|
74907
75072
|
welcomeResolver = null;
|
|
74908
75073
|
streams;
|
|
75074
|
+
/** Set by disconnect(). A reconnect after it would repoint the webhooks cleanup restored. */
|
|
75075
|
+
shuttingDown = false;
|
|
75076
|
+
/** The in-flight configureWebhooks(), so disconnect() can wait for it before restoring. */
|
|
75077
|
+
configuring = null;
|
|
74909
75078
|
constructor(localPort = 3e3) {
|
|
74910
75079
|
this.localPort = localPort;
|
|
74911
75080
|
this.streams = new TunnelStreamManager({
|
|
@@ -74949,6 +75118,7 @@ var TunnelClient = class {
|
|
|
74949
75118
|
return timestampPart + randomPart;
|
|
74950
75119
|
}
|
|
74951
75120
|
async connect() {
|
|
75121
|
+
this.shuttingDown = false;
|
|
74952
75122
|
if (process.env.SINCH_TUNNEL !== "true") {
|
|
74953
75123
|
console.log("Tunnel is disabled (set SINCH_TUNNEL=true to enable)");
|
|
74954
75124
|
return;
|
|
@@ -74992,12 +75162,14 @@ var TunnelClient = class {
|
|
|
74992
75162
|
console.error("Tunnel connection error:", error.message);
|
|
74993
75163
|
});
|
|
74994
75164
|
await welcomePromise;
|
|
75165
|
+
if (this.shuttingDown) return;
|
|
74995
75166
|
if (!this.tunnelUrl) {
|
|
74996
75167
|
throw new Error("Did not receive tunnel URL from gateway");
|
|
74997
75168
|
}
|
|
74998
75169
|
console.log("Tunnel connected successfully!");
|
|
74999
75170
|
this.startHeartbeat();
|
|
75000
|
-
|
|
75171
|
+
this.configuring = this.configureWebhooks();
|
|
75172
|
+
await this.configuring;
|
|
75001
75173
|
} catch (error) {
|
|
75002
75174
|
console.error("Failed to establish tunnel connection:", error.message);
|
|
75003
75175
|
this.scheduleReconnect();
|
|
@@ -75033,11 +75205,11 @@ var TunnelClient = class {
|
|
|
75033
75205
|
/**
|
|
75034
75206
|
* Build a full tunnel URL with optional sub-path and tunnel query param.
|
|
75035
75207
|
* e.g. buildTunnelUrl('/webhook/conversation') →
|
|
75036
|
-
* https://tunnel.fn.sinch.
|
|
75208
|
+
* https://tunnel.fn.sinch.io/ingress/webhook/conversation?tunnel=01KKT...
|
|
75209
|
+
* See ./url.ts for why the welcome URL's own query string is dropped.
|
|
75037
75210
|
*/
|
|
75038
|
-
buildTunnelUrl(
|
|
75039
|
-
|
|
75040
|
-
return `${base}${path6 || ""}?tunnel=${this.tunnelId}`;
|
|
75211
|
+
buildTunnelUrl(path7) {
|
|
75212
|
+
return buildTunnelUrl(this.tunnelUrl, this.tunnelId, path7);
|
|
75041
75213
|
}
|
|
75042
75214
|
handleWelcomeMessage(message) {
|
|
75043
75215
|
this.tunnelId = message.tunnelId || null;
|
|
@@ -75145,13 +75317,23 @@ var TunnelClient = class {
|
|
|
75145
75317
|
}
|
|
75146
75318
|
}
|
|
75147
75319
|
/**
|
|
75148
|
-
*
|
|
75320
|
+
* Restore every webhook the tunnel repointed. Run in parallel: this happens during
|
|
75321
|
+
* shutdown, under a timeout, and the two restores are independent.
|
|
75322
|
+
* The v1 application callback is still not restored (it was never saved).
|
|
75149
75323
|
*/
|
|
75150
75324
|
async cleanupWebhooks() {
|
|
75151
|
-
await
|
|
75325
|
+
await Promise.all([
|
|
75326
|
+
cleanupConversationWebhook(this.webhookConfig),
|
|
75327
|
+
cleanupVoiceServiceWebhook(this.webhookConfig)
|
|
75328
|
+
]);
|
|
75152
75329
|
}
|
|
75153
75330
|
async configureVoiceWebhooks() {
|
|
75154
|
-
await configureVoiceServiceWebhook(
|
|
75331
|
+
await configureVoiceServiceWebhook(
|
|
75332
|
+
this.buildTunnelUrl(),
|
|
75333
|
+
process.env,
|
|
75334
|
+
globalThis.fetch,
|
|
75335
|
+
this.webhookConfig
|
|
75336
|
+
);
|
|
75155
75337
|
try {
|
|
75156
75338
|
const appKey = process.env.VOICE_APPLICATION_KEY;
|
|
75157
75339
|
const appSecret = process.env.VOICE_APPLICATION_SECRET;
|
|
@@ -75211,6 +75393,7 @@ var TunnelClient = class {
|
|
|
75211
75393
|
}
|
|
75212
75394
|
}
|
|
75213
75395
|
scheduleReconnect() {
|
|
75396
|
+
if (this.shuttingDown) return;
|
|
75214
75397
|
if (this.reconnectAttempts >= this.maxReconnectAttempts) {
|
|
75215
75398
|
console.error("Max reconnection attempts reached. Giving up.");
|
|
75216
75399
|
return;
|
|
@@ -75218,17 +75401,30 @@ var TunnelClient = class {
|
|
|
75218
75401
|
this.reconnectAttempts++;
|
|
75219
75402
|
const delay = Math.min(this.reconnectDelay * Math.pow(2, this.reconnectAttempts - 1), 3e4);
|
|
75220
75403
|
console.log(`Attempting to reconnect in ${delay / 1e3} seconds...`);
|
|
75221
|
-
setTimeout(() =>
|
|
75404
|
+
setTimeout(() => {
|
|
75405
|
+
if (!this.shuttingDown) void this.connect();
|
|
75406
|
+
}, delay);
|
|
75222
75407
|
}
|
|
75408
|
+
/**
|
|
75409
|
+
* Stop the tunnel and restore every webhook it repointed.
|
|
75410
|
+
*
|
|
75411
|
+
* Order matters (#102 review): stop reconnects and close the socket first, so no new
|
|
75412
|
+
* welcome can start another configure; then wait for any configure already in flight, so
|
|
75413
|
+
* a PATCH that lands late (Ctrl+C between its GET and its PATCH) cannot overwrite the
|
|
75414
|
+
* restore; only then restore.
|
|
75415
|
+
*/
|
|
75223
75416
|
async disconnect() {
|
|
75417
|
+
this.shuttingDown = true;
|
|
75224
75418
|
this.stopHeartbeat();
|
|
75225
75419
|
this.streams.closeAll("Tunnel client shutting down");
|
|
75226
|
-
await this.cleanupWebhooks();
|
|
75227
75420
|
if (this.ws) {
|
|
75228
75421
|
this.ws.close();
|
|
75229
75422
|
this.ws = null;
|
|
75230
75423
|
}
|
|
75231
75424
|
this.isConnected = false;
|
|
75425
|
+
await this.configuring?.catch(() => {
|
|
75426
|
+
});
|
|
75427
|
+
await this.cleanupWebhooks();
|
|
75232
75428
|
}
|
|
75233
75429
|
getTunnelUrl() {
|
|
75234
75430
|
if (!this.tunnelUrl || !this.tunnelId) return null;
|
|
@@ -75247,8 +75443,8 @@ function getTunnelClient(localPort = 3e3) {
|
|
|
75247
75443
|
}
|
|
75248
75444
|
|
|
75249
75445
|
// src/secrets/index.ts
|
|
75250
|
-
import
|
|
75251
|
-
import
|
|
75446
|
+
import fs5 from "fs";
|
|
75447
|
+
import path6 from "path";
|
|
75252
75448
|
import os from "os";
|
|
75253
75449
|
import crypto3 from "crypto";
|
|
75254
75450
|
|
|
@@ -75529,12 +75725,12 @@ var SecretsLoader = class {
|
|
|
75529
75725
|
return false;
|
|
75530
75726
|
}
|
|
75531
75727
|
try {
|
|
75532
|
-
const envPath =
|
|
75533
|
-
if (!
|
|
75728
|
+
const envPath = path6.join(process.cwd(), ".env");
|
|
75729
|
+
if (!fs5.existsSync(envPath)) {
|
|
75534
75730
|
console.debug("[Secrets] No .env file found, skipping keychain load");
|
|
75535
75731
|
return false;
|
|
75536
75732
|
}
|
|
75537
|
-
const envContent =
|
|
75733
|
+
const envContent = fs5.readFileSync(envPath, "utf8");
|
|
75538
75734
|
const envLines = envContent.replace(/\r\n/g, "\n").split("\n");
|
|
75539
75735
|
const secretsToLoad = [];
|
|
75540
75736
|
envLines.forEach((line) => {
|
|
@@ -75626,9 +75822,9 @@ var SecretsLoader = class {
|
|
|
75626
75822
|
*/
|
|
75627
75823
|
getApplicationKeyFromConfig() {
|
|
75628
75824
|
try {
|
|
75629
|
-
const sinchJsonPath =
|
|
75630
|
-
if (
|
|
75631
|
-
const sinchConfig = JSON.parse(
|
|
75825
|
+
const sinchJsonPath = path6.join(process.cwd(), "sinch.json");
|
|
75826
|
+
if (fs5.existsSync(sinchJsonPath)) {
|
|
75827
|
+
const sinchConfig = JSON.parse(fs5.readFileSync(sinchJsonPath, "utf8"));
|
|
75632
75828
|
return sinchConfig.voiceAppId || sinchConfig.applicationKey || null;
|
|
75633
75829
|
}
|
|
75634
75830
|
} catch (error) {
|
|
@@ -75641,9 +75837,9 @@ var SecretsLoader = class {
|
|
|
75641
75837
|
*/
|
|
75642
75838
|
getFunctionNameFromConfig() {
|
|
75643
75839
|
try {
|
|
75644
|
-
const sinchJsonPath =
|
|
75645
|
-
if (
|
|
75646
|
-
const sinchConfig = JSON.parse(
|
|
75840
|
+
const sinchJsonPath = path6.join(process.cwd(), "sinch.json");
|
|
75841
|
+
if (fs5.existsSync(sinchJsonPath)) {
|
|
75842
|
+
const sinchConfig = JSON.parse(fs5.readFileSync(sinchJsonPath, "utf8"));
|
|
75647
75843
|
return sinchConfig.name || null;
|
|
75648
75844
|
}
|
|
75649
75845
|
} catch (error) {
|
|
@@ -75660,10 +75856,10 @@ var SecretsLoader = class {
|
|
|
75660
75856
|
readProfilePlaintext(field) {
|
|
75661
75857
|
try {
|
|
75662
75858
|
const home = os.homedir();
|
|
75663
|
-
const metaPath =
|
|
75859
|
+
const metaPath = path6.join(home, ".sinch", "config.json");
|
|
75664
75860
|
let activeProfile = "default";
|
|
75665
|
-
if (
|
|
75666
|
-
const meta = JSON.parse(
|
|
75861
|
+
if (fs5.existsSync(metaPath)) {
|
|
75862
|
+
const meta = JSON.parse(fs5.readFileSync(metaPath, "utf8"));
|
|
75667
75863
|
if (typeof meta.activeProfile === "string" && meta.activeProfile) {
|
|
75668
75864
|
activeProfile = meta.activeProfile;
|
|
75669
75865
|
}
|
|
@@ -75671,9 +75867,9 @@ var SecretsLoader = class {
|
|
|
75671
75867
|
if (/[\\/]/.test(activeProfile) || activeProfile.includes("..")) {
|
|
75672
75868
|
return null;
|
|
75673
75869
|
}
|
|
75674
|
-
const profilePath =
|
|
75675
|
-
if (!
|
|
75676
|
-
const profile = JSON.parse(
|
|
75870
|
+
const profilePath = path6.join(home, ".sinch", "profiles", `${activeProfile}.json`);
|
|
75871
|
+
if (!fs5.existsSync(profilePath)) return null;
|
|
75872
|
+
const profile = JSON.parse(fs5.readFileSync(profilePath, "utf8"));
|
|
75677
75873
|
const value = profile[field];
|
|
75678
75874
|
return typeof value === "string" && value.length > 0 ? value : null;
|
|
75679
75875
|
} catch (err) {
|
|
@@ -76223,4 +76419,4 @@ serve-static/index.js:
|
|
|
76223
76419
|
* MIT Licensed
|
|
76224
76420
|
*)
|
|
76225
76421
|
*/
|
|
76226
|
-
//# sourceMappingURL=chunk-
|
|
76422
|
+
//# sourceMappingURL=chunk-H2JZGXXT.js.map
|