Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4823.js (118.4 MB)
128 lines
3.6 KiB
TypeScript
128 lines
3.6 KiB
TypeScript
// Module ID: 16734
|
|
// Function ID: 16735
|
|
// Name: vibegrationsExternalConnections
|
|
// Dependencies: [2]
|
|
// Exports: beginExternalAuthorization, endExternalAuthorization, externalAuthErrorCode, externalAuthErrorCopy, externalAuthErrorFor, externalConnectionOffers
|
|
|
|
// Module 16734 (vibegrationsExternalConnections)
|
|
import size from "module_2" /* 2 */;
|
|
|
|
function externalConnectionOffer(nextResult) {
|
|
let tmp = null;
|
|
if (typeof nextResult.type === "string") {
|
|
tmp = null;
|
|
if ("" !== nextResult.type) {
|
|
tmp = null;
|
|
if (typeof nextResult.label === "string") {
|
|
tmp = null;
|
|
if ("" !== str3.trim()) {
|
|
let str = "finish-setup";
|
|
if (nextResult.configured) {
|
|
str = "authorize";
|
|
}
|
|
tmp = str;
|
|
}
|
|
str3 = nextResult.label;
|
|
}
|
|
}
|
|
}
|
|
return tmp;
|
|
}
|
|
let set = new Set(["bad_request", "bad_connection_type", "unknown_project", "not_declared", "not_configured", "not_deployed", "child_error", "child_malformed", "child_unavailable"]);
|
|
const result = size.fileFinishedImporting("modules/vibegrations/vibegrationsExternalConnections.tsx");
|
|
|
|
export { externalConnectionOffer };
|
|
export const externalConnectionOffers = function externalConnectionOffers(arg0) {
|
|
const items = [];
|
|
set = new Set();
|
|
const iter = arg0[Symbol.iterator]();
|
|
const nextResult = iter.next();
|
|
while (iter !== undefined) {
|
|
let tmp2 = nextResult;
|
|
let tmp4 = externalConnectionOffer(nextResult);
|
|
let hasItem = null == tmp4;
|
|
let tmp5 = tmp4;
|
|
if (!hasItem) {
|
|
hasItem = set.has(tmp2.type);
|
|
}
|
|
if (!hasItem) {
|
|
let addResult = set.add(tmp2.type);
|
|
let obj = { connection: tmp2, offer: null };
|
|
obj.offer = tmp5;
|
|
let arr = items.push(obj);
|
|
}
|
|
continue;
|
|
}
|
|
return items;
|
|
};
|
|
export const beginExternalAuthorization = function beginExternalAuthorization(has, arg1) {
|
|
if (has.has(arg1)) {
|
|
return null;
|
|
} else {
|
|
const _Set = Set;
|
|
set = new Set(has);
|
|
set.add(arg1);
|
|
return set;
|
|
}
|
|
};
|
|
export const endExternalAuthorization = function endExternalAuthorization(has, arg1) {
|
|
if (has.has(arg1)) {
|
|
const _Set = Set;
|
|
set = new Set(has);
|
|
set.delete(arg1);
|
|
return set;
|
|
} else {
|
|
return has;
|
|
}
|
|
};
|
|
export const externalAuthErrorCode = function externalAuthErrorCode(error) {
|
|
let tmp = null;
|
|
if (typeof error === "string") {
|
|
tmp = null;
|
|
if (set.has(error)) {
|
|
tmp = error;
|
|
}
|
|
}
|
|
return tmp;
|
|
};
|
|
export const externalAuthErrorFor = function externalAuthErrorFor(status, arg1) {
|
|
if ("not_configured" === arg1) {
|
|
return "not_configured";
|
|
} else if ("not_deployed" === arg1) {
|
|
return "not_deployed";
|
|
} else {
|
|
if ("not_declared" !== arg1) {
|
|
if ("unknown_project" !== arg1) {
|
|
if ("child_error" !== arg1) {
|
|
if ("child_malformed" !== arg1) {
|
|
if ("child_unavailable" !== arg1) {
|
|
if ("bad_request" !== arg1) {
|
|
if ("bad_connection_type" !== arg1) {
|
|
let str7 = "not_declared";
|
|
if (404 !== status) {
|
|
let str8 = "unknown";
|
|
if (status >= 500) {
|
|
str8 = "unavailable";
|
|
}
|
|
str7 = str8;
|
|
}
|
|
return str7;
|
|
}
|
|
}
|
|
return "unknown";
|
|
}
|
|
}
|
|
}
|
|
return "unavailable";
|
|
}
|
|
}
|
|
return "not_declared";
|
|
}
|
|
};
|
|
export function externalAuthErrorCopy(arg0) {
|
|
let str = "generic";
|
|
if ("not_configured" === arg0) {
|
|
str = "setup";
|
|
}
|
|
return str;
|
|
}
|