@dolbyio/dolbyio-rest-apis-client 3.4.4 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +41 -2
- package/dist/communications/remix.js +8 -6
- package/dist/communications/streaming.d.ts +4 -2
- package/dist/communications/streaming.js +14 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +4 -2
- package/dist/internal/httpHelpers.d.ts +8 -0
- package/dist/internal/httpHelpers.js +36 -2
- package/dist/streaming/cluster.d.ts +3 -0
- package/dist/streaming/cluster.js +78 -0
- package/dist/streaming/director.d.ts +24 -0
- package/dist/streaming/director.js +107 -0
- package/dist/streaming/geo.d.ts +27 -0
- package/dist/streaming/geo.js +110 -0
- package/dist/streaming/index.d.ts +7 -0
- package/dist/streaming/index.js +21 -0
- package/dist/streaming/internal/httpHelpers.d.ts +41 -0
- package/dist/streaming/internal/httpHelpers.js +172 -0
- package/dist/streaming/internal/urls.d.ts +2 -0
- package/dist/streaming/internal/urls.js +10 -0
- package/dist/streaming/publishToken.d.ts +9 -0
- package/dist/streaming/publishToken.js +284 -0
- package/dist/streaming/stream.d.ts +2 -0
- package/dist/streaming/stream.js +76 -0
- package/dist/streaming/subscribeToken.d.ts +6 -0
- package/dist/streaming/subscribeToken.js +182 -0
- package/dist/streaming/types/cluster.d.ts +14 -0
- package/dist/streaming/types/cluster.js +5 -0
- package/dist/streaming/types/core.d.ts +4 -0
- package/dist/streaming/types/core.js +5 -0
- package/dist/streaming/types/director.d.ts +14 -0
- package/dist/streaming/types/director.js +5 -0
- package/dist/streaming/types/geo.d.ts +4 -0
- package/dist/streaming/types/geo.js +5 -0
- package/dist/streaming/types/publishToken.d.ts +63 -0
- package/dist/streaming/types/publishToken.js +5 -0
- package/dist/streaming/types/subscribeToken.d.ts +43 -0
- package/dist/streaming/types/subscribeToken.js +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.update = exports.read = void 0;
|
|
8
|
+
var _httpHelpers = require("./internal/httpHelpers");
|
|
9
|
+
var _urls = require("./internal/urls");
|
|
10
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
/**
|
|
14
|
+
* Read Account Geo Restrictions.
|
|
15
|
+
*
|
|
16
|
+
* Gets account wide geo restrictions. If a Token (either Publish or Subscribe) does not define any geo restrictions, the account wide rules are used.
|
|
17
|
+
*
|
|
18
|
+
* @link https://docs.dolby.io/streaming-apis/reference/geo_geo
|
|
19
|
+
*
|
|
20
|
+
* @param apiSecret The API secret.
|
|
21
|
+
*
|
|
22
|
+
* @returns A `GeoRestrictions` object through a `Promise`.
|
|
23
|
+
*/
|
|
24
|
+
var read = /*#__PURE__*/function () {
|
|
25
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(apiSecret) {
|
|
26
|
+
var options;
|
|
27
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
28
|
+
while (1) {
|
|
29
|
+
switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
options = {
|
|
32
|
+
hostname: _urls.SAPI_HOSTNAME,
|
|
33
|
+
path: '/api/geo/account',
|
|
34
|
+
headers: {
|
|
35
|
+
Accept: 'application/json',
|
|
36
|
+
Authorization: "Bearer ".concat(apiSecret)
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
_context.next = 3;
|
|
40
|
+
return (0, _httpHelpers.sendGet)(options);
|
|
41
|
+
case 3:
|
|
42
|
+
return _context.abrupt("return", _context.sent);
|
|
43
|
+
case 4:
|
|
44
|
+
case "end":
|
|
45
|
+
return _context.stop();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}, _callee);
|
|
49
|
+
}));
|
|
50
|
+
return function read(_x) {
|
|
51
|
+
return _ref.apply(this, arguments);
|
|
52
|
+
};
|
|
53
|
+
}();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Update Account Geo Restrictions
|
|
57
|
+
*
|
|
58
|
+
* Update account wide geo restrictions.
|
|
59
|
+
*
|
|
60
|
+
* @link https://docs.dolby.io/streaming-apis/reference/geo_updategeo
|
|
61
|
+
*
|
|
62
|
+
* @param apiSecret The API secret.
|
|
63
|
+
* @param allowedCountries The publishing token. An empty array [] removes all rules.
|
|
64
|
+
* @param deniedCountries The publishing token. An empty array [] removes all rules.
|
|
65
|
+
*
|
|
66
|
+
* @returns A `GeoRestrictions` object through a `Promise`.
|
|
67
|
+
*/
|
|
68
|
+
exports.read = read;
|
|
69
|
+
var update = /*#__PURE__*/function () {
|
|
70
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(apiSecret) {
|
|
71
|
+
var allowedCountries,
|
|
72
|
+
deniedCountries,
|
|
73
|
+
body,
|
|
74
|
+
options,
|
|
75
|
+
_args2 = arguments;
|
|
76
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
77
|
+
while (1) {
|
|
78
|
+
switch (_context2.prev = _context2.next) {
|
|
79
|
+
case 0:
|
|
80
|
+
allowedCountries = _args2.length > 1 && _args2[1] !== undefined ? _args2[1] : null;
|
|
81
|
+
deniedCountries = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : null;
|
|
82
|
+
body = {};
|
|
83
|
+
if (allowedCountries) body['updateAllowedCountries'] = allowedCountries;
|
|
84
|
+
if (deniedCountries) body['updateDeniedCountries'] = deniedCountries;
|
|
85
|
+
options = {
|
|
86
|
+
hostname: _urls.SAPI_HOSTNAME,
|
|
87
|
+
path: '/api/geo/account',
|
|
88
|
+
headers: {
|
|
89
|
+
Accept: 'application/json',
|
|
90
|
+
'Content-Type': 'application/json',
|
|
91
|
+
Authorization: "Bearer ".concat(apiSecret)
|
|
92
|
+
},
|
|
93
|
+
body: JSON.stringify(body)
|
|
94
|
+
};
|
|
95
|
+
_context2.next = 8;
|
|
96
|
+
return (0, _httpHelpers.sendPost)(options);
|
|
97
|
+
case 8:
|
|
98
|
+
return _context2.abrupt("return", _context2.sent);
|
|
99
|
+
case 9:
|
|
100
|
+
case "end":
|
|
101
|
+
return _context2.stop();
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}, _callee2);
|
|
105
|
+
}));
|
|
106
|
+
return function update(_x2) {
|
|
107
|
+
return _ref2.apply(this, arguments);
|
|
108
|
+
};
|
|
109
|
+
}();
|
|
110
|
+
exports.update = update;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as cluster from './cluster';
|
|
2
|
+
import * as director from './director';
|
|
3
|
+
import * as geo from './geo';
|
|
4
|
+
import * as publishToken from './publishToken';
|
|
5
|
+
import * as stream from './stream';
|
|
6
|
+
import * as subscribeToken from './subscribeToken';
|
|
7
|
+
export { cluster, director, geo, publishToken, stream, subscribeToken };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.subscribeToken = exports.stream = exports.publishToken = exports.geo = exports.director = exports.cluster = void 0;
|
|
8
|
+
var cluster = _interopRequireWildcard(require("./cluster"));
|
|
9
|
+
exports.cluster = cluster;
|
|
10
|
+
var director = _interopRequireWildcard(require("./director"));
|
|
11
|
+
exports.director = director;
|
|
12
|
+
var geo = _interopRequireWildcard(require("./geo"));
|
|
13
|
+
exports.geo = geo;
|
|
14
|
+
var publishToken = _interopRequireWildcard(require("./publishToken"));
|
|
15
|
+
exports.publishToken = publishToken;
|
|
16
|
+
var stream = _interopRequireWildcard(require("./stream"));
|
|
17
|
+
exports.stream = stream;
|
|
18
|
+
var subscribeToken = _interopRequireWildcard(require("./subscribeToken"));
|
|
19
|
+
exports.subscribeToken = subscribeToken;
|
|
20
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as httpHelpers from '../../internal/httpHelpers';
|
|
2
|
+
/**
|
|
3
|
+
* Sends a GET request.
|
|
4
|
+
*
|
|
5
|
+
* @param options Request options.
|
|
6
|
+
*
|
|
7
|
+
* @returns A `TData` object through a Promise.
|
|
8
|
+
*/
|
|
9
|
+
export declare function sendGet<TData>(options: httpHelpers.RequestOptions): Promise<TData>;
|
|
10
|
+
/**
|
|
11
|
+
* Sends a POST request.
|
|
12
|
+
*
|
|
13
|
+
* @param options Request options.
|
|
14
|
+
*
|
|
15
|
+
* @returns A `TData` object through a Promise.
|
|
16
|
+
*/
|
|
17
|
+
export declare function sendPost<TData>(options: httpHelpers.RequestOptions): Promise<TData>;
|
|
18
|
+
/**
|
|
19
|
+
* Sends a PUT request.
|
|
20
|
+
*
|
|
21
|
+
* @param options Request options.
|
|
22
|
+
*
|
|
23
|
+
* @returns A JSON payload object through a Promise.
|
|
24
|
+
*/
|
|
25
|
+
export declare function sendPut<TData>(options: httpHelpers.RequestOptions): Promise<TData>;
|
|
26
|
+
/**
|
|
27
|
+
* Sends a DELETE request.
|
|
28
|
+
*
|
|
29
|
+
* @param options Request options.
|
|
30
|
+
*
|
|
31
|
+
* @returns A `TData` object through a Promise.
|
|
32
|
+
*/
|
|
33
|
+
export declare function sendDelete<TData>(options: httpHelpers.RequestOptions): Promise<TData>;
|
|
34
|
+
/**
|
|
35
|
+
* Sends a PATCH request.
|
|
36
|
+
*
|
|
37
|
+
* @param options Request options.
|
|
38
|
+
*
|
|
39
|
+
* @returns A `TData` object through a Promise.
|
|
40
|
+
*/
|
|
41
|
+
export declare function sendPatch<TData>(options: httpHelpers.RequestOptions): Promise<TData>;
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.sendDelete = sendDelete;
|
|
7
|
+
exports.sendGet = sendGet;
|
|
8
|
+
exports.sendPatch = sendPatch;
|
|
9
|
+
exports.sendPost = sendPost;
|
|
10
|
+
exports.sendPut = sendPut;
|
|
11
|
+
var httpHelpers = _interopRequireWildcard(require("../../internal/httpHelpers"));
|
|
12
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
15
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
16
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
17
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
18
|
+
/**
|
|
19
|
+
* Sends a GET request.
|
|
20
|
+
*
|
|
21
|
+
* @param options Request options.
|
|
22
|
+
*
|
|
23
|
+
* @returns A `TData` object through a Promise.
|
|
24
|
+
*/
|
|
25
|
+
function sendGet(_x) {
|
|
26
|
+
return _sendGet.apply(this, arguments);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Sends a POST request.
|
|
30
|
+
*
|
|
31
|
+
* @param options Request options.
|
|
32
|
+
*
|
|
33
|
+
* @returns A `TData` object through a Promise.
|
|
34
|
+
*/
|
|
35
|
+
function _sendGet() {
|
|
36
|
+
_sendGet = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options) {
|
|
37
|
+
var response;
|
|
38
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
39
|
+
while (1) {
|
|
40
|
+
switch (_context.prev = _context.next) {
|
|
41
|
+
case 0:
|
|
42
|
+
_context.next = 2;
|
|
43
|
+
return httpHelpers.sendGet(options);
|
|
44
|
+
case 2:
|
|
45
|
+
response = _context.sent;
|
|
46
|
+
return _context.abrupt("return", response.data);
|
|
47
|
+
case 4:
|
|
48
|
+
case "end":
|
|
49
|
+
return _context.stop();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}, _callee);
|
|
53
|
+
}));
|
|
54
|
+
return _sendGet.apply(this, arguments);
|
|
55
|
+
}
|
|
56
|
+
function sendPost(_x2) {
|
|
57
|
+
return _sendPost.apply(this, arguments);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Sends a PUT request.
|
|
61
|
+
*
|
|
62
|
+
* @param options Request options.
|
|
63
|
+
*
|
|
64
|
+
* @returns A JSON payload object through a Promise.
|
|
65
|
+
*/
|
|
66
|
+
function _sendPost() {
|
|
67
|
+
_sendPost = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(options) {
|
|
68
|
+
var response;
|
|
69
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
70
|
+
while (1) {
|
|
71
|
+
switch (_context2.prev = _context2.next) {
|
|
72
|
+
case 0:
|
|
73
|
+
_context2.next = 2;
|
|
74
|
+
return httpHelpers.sendPost(options);
|
|
75
|
+
case 2:
|
|
76
|
+
response = _context2.sent;
|
|
77
|
+
return _context2.abrupt("return", response.data);
|
|
78
|
+
case 4:
|
|
79
|
+
case "end":
|
|
80
|
+
return _context2.stop();
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}, _callee2);
|
|
84
|
+
}));
|
|
85
|
+
return _sendPost.apply(this, arguments);
|
|
86
|
+
}
|
|
87
|
+
function sendPut(_x3) {
|
|
88
|
+
return _sendPut.apply(this, arguments);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Sends a DELETE request.
|
|
92
|
+
*
|
|
93
|
+
* @param options Request options.
|
|
94
|
+
*
|
|
95
|
+
* @returns A `TData` object through a Promise.
|
|
96
|
+
*/
|
|
97
|
+
function _sendPut() {
|
|
98
|
+
_sendPut = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(options) {
|
|
99
|
+
var response;
|
|
100
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
101
|
+
while (1) {
|
|
102
|
+
switch (_context3.prev = _context3.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
_context3.next = 2;
|
|
105
|
+
return httpHelpers.sendPut(options);
|
|
106
|
+
case 2:
|
|
107
|
+
response = _context3.sent;
|
|
108
|
+
return _context3.abrupt("return", response.data);
|
|
109
|
+
case 4:
|
|
110
|
+
case "end":
|
|
111
|
+
return _context3.stop();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}, _callee3);
|
|
115
|
+
}));
|
|
116
|
+
return _sendPut.apply(this, arguments);
|
|
117
|
+
}
|
|
118
|
+
function sendDelete(_x4) {
|
|
119
|
+
return _sendDelete.apply(this, arguments);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Sends a PATCH request.
|
|
123
|
+
*
|
|
124
|
+
* @param options Request options.
|
|
125
|
+
*
|
|
126
|
+
* @returns A `TData` object through a Promise.
|
|
127
|
+
*/
|
|
128
|
+
function _sendDelete() {
|
|
129
|
+
_sendDelete = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(options) {
|
|
130
|
+
var response;
|
|
131
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
132
|
+
while (1) {
|
|
133
|
+
switch (_context4.prev = _context4.next) {
|
|
134
|
+
case 0:
|
|
135
|
+
_context4.next = 2;
|
|
136
|
+
return httpHelpers.sendDelete(options);
|
|
137
|
+
case 2:
|
|
138
|
+
response = _context4.sent;
|
|
139
|
+
return _context4.abrupt("return", response.data);
|
|
140
|
+
case 4:
|
|
141
|
+
case "end":
|
|
142
|
+
return _context4.stop();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}, _callee4);
|
|
146
|
+
}));
|
|
147
|
+
return _sendDelete.apply(this, arguments);
|
|
148
|
+
}
|
|
149
|
+
function sendPatch(_x5) {
|
|
150
|
+
return _sendPatch.apply(this, arguments);
|
|
151
|
+
}
|
|
152
|
+
function _sendPatch() {
|
|
153
|
+
_sendPatch = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(options) {
|
|
154
|
+
var response;
|
|
155
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
156
|
+
while (1) {
|
|
157
|
+
switch (_context5.prev = _context5.next) {
|
|
158
|
+
case 0:
|
|
159
|
+
_context5.next = 2;
|
|
160
|
+
return httpHelpers.sendPatch(options);
|
|
161
|
+
case 2:
|
|
162
|
+
response = _context5.sent;
|
|
163
|
+
return _context5.abrupt("return", response.data);
|
|
164
|
+
case 4:
|
|
165
|
+
case "end":
|
|
166
|
+
return _context5.stop();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}, _callee5);
|
|
170
|
+
}));
|
|
171
|
+
return _sendPatch.apply(this, arguments);
|
|
172
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SAPI_HOSTNAME = exports.SAPI_DIRECTOR_HOSTNAME = void 0;
|
|
7
|
+
var SAPI_HOSTNAME = 'api.millicast.com';
|
|
8
|
+
exports.SAPI_HOSTNAME = SAPI_HOSTNAME;
|
|
9
|
+
var SAPI_DIRECTOR_HOSTNAME = 'director.millicast.com';
|
|
10
|
+
exports.SAPI_DIRECTOR_HOSTNAME = SAPI_DIRECTOR_HOSTNAME;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ActivePublishToken, CreatePublishToken, PublishToken, UpdatePublishToken, DisablePublishTokenResponse } from './types/publishToken';
|
|
2
|
+
export declare const read: (apiSecret: string, tokenId: number) => Promise<PublishToken>;
|
|
3
|
+
export declare const deleteToken: (apiSecret: string, tokenId: number) => Promise<boolean>;
|
|
4
|
+
export declare const update: (apiSecret: string, tokenId: number, publishToken: UpdatePublishToken) => Promise<PublishToken>;
|
|
5
|
+
export declare const list: (apiSecret: string, sortBy: 'Name' | 'AddedOn', page: number, itemsOnPage: number, isDescending?: boolean) => Promise<PublishToken[]>;
|
|
6
|
+
export declare const create: (apiSecret: string, publishToken: CreatePublishToken) => Promise<PublishToken>;
|
|
7
|
+
export declare const getActivePublishTokenId: (apiSecret: string, streamId: string) => Promise<ActivePublishToken>;
|
|
8
|
+
export declare const getAllActivePublishTokenId: (apiSecret: string) => Promise<ActivePublishToken>;
|
|
9
|
+
export declare const disable: (apiSecret: string, tokenIds: number[]) => Promise<DisablePublishTokenResponse>;
|