firebase-app-distribution
Version:
A library that uses Firebase App Distribution APIs.
80 lines (78 loc) • 2.79 kB
JavaScript
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __typeError = (msg) => {
throw TypeError(msg);
};
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a, b) => {
for (var prop in b || (b = {}))
if (__hasOwnProp.call(b, prop))
__defNormalProp(a, prop, b[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b)) {
if (__propIsEnum.call(b, prop))
__defNormalProp(a, prop, b[prop]);
}
return a;
};
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
var __async = (__this, __arguments, generator) => {
return new Promise((resolve, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e) {
reject(e);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e) {
reject(e);
}
};
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// src/utils.ts
var APP_DISTRIBUTION_ENDPOINT = "https://firebaseappdistribution.googleapis.com";
var ENDPOINT_VERSION = "v1";
var AUTH_SCOPES = [
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/firebase"
];
function makeRequest(input, init) {
return __async(this, null, function* () {
const response = yield fetch(input, init);
if (response.status !== 200) {
const errMessage = yield response.text();
throw new Error(
`Request failed with status code ${response.status} and message: ${errMessage}`
);
}
const responseText = yield response.text();
const responseObj = JSON.parse(responseText);
return responseObj;
});
}
export {
__spreadValues,
__spreadProps,
__privateAdd,
__privateMethod,
__async,
APP_DISTRIBUTION_ENDPOINT,
ENDPOINT_VERSION,
AUTH_SCOPES,
makeRequest
};
//# sourceMappingURL=chunk-PTPJZ7KZ.mjs.map