This commit is contained in:
Cam
2023-11-16 10:25:52 -06:00
parent 8efdd06780
commit ae8e7acf5e
522 changed files with 106240 additions and 1 deletions

View File

@ -0,0 +1,60 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/environment/dirs.ts
var dirs_exports = {};
__export(dirs_exports, {
configFile: () => configFile,
environmentFile: () => environmentFile,
identitiesDir: () => identitiesDir,
identityFile: () => identityFile,
metadataFile: () => metadataFile,
rootDir: () => rootDir
});
module.exports = __toCommonJS(dirs_exports);
var import_os = require("os");
var import_node_path = require("path");
function rootDir() {
return (0, import_node_path.join)((0, import_os.homedir)(), ".zrok");
}
function metadataFile() {
return (0, import_node_path.join)(rootDir(), "metadata.json");
}
function configFile() {
return (0, import_node_path.join)(rootDir(), "config.json");
}
function environmentFile() {
return (0, import_node_path.join)(rootDir(), "environment.json");
}
function identitiesDir() {
return (0, import_node_path.join)(rootDir(), "identities");
}
function identityFile(name) {
return (0, import_node_path.join)(identitiesDir(), name + ".json");
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
configFile,
environmentFile,
identitiesDir,
identityFile,
metadataFile,
rootDir
});
//# sourceMappingURL=dirs.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/environment/dirs.ts"],"sourcesContent":["import { homedir } from \"os\"\nimport { join } from \"node:path\"\n\nexport function rootDir(): string {\n return join(homedir(), \".zrok\")\n}\n\nexport function metadataFile(): string {\n return join(rootDir(), \"metadata.json\")\n}\n\nexport function configFile(): string {\n return join(rootDir(), \"config.json\")\n}\n\nexport function environmentFile(): string {\n return join(rootDir(), \"environment.json\")\n}\n\nexport function identitiesDir(): string {\n return join(rootDir(), \"identities\")\n}\n\nexport function identityFile(name: string): string {\n return join(identitiesDir(), name + \".json\")\n}"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAAwB;AACxB,uBAAqB;AAEd,SAAS,UAAkB;AAC9B,aAAO,2BAAK,mBAAQ,GAAG,OAAO;AAClC;AAEO,SAAS,eAAuB;AACnC,aAAO,uBAAK,QAAQ,GAAG,eAAe;AAC1C;AAEO,SAAS,aAAqB;AACjC,aAAO,uBAAK,QAAQ,GAAG,aAAa;AACxC;AAEO,SAAS,kBAA0B;AACtC,aAAO,uBAAK,QAAQ,GAAG,kBAAkB;AAC7C;AAEO,SAAS,gBAAwB;AACpC,aAAO,uBAAK,QAAQ,GAAG,YAAY;AACvC;AAEO,SAAS,aAAa,MAAsB;AAC/C,aAAO,uBAAK,cAAc,GAAG,OAAO,OAAO;AAC/C;","names":[]}

View File

@ -0,0 +1,30 @@
// src/environment/dirs.ts
import { homedir } from "os";
import { join } from "path";
function rootDir() {
return join(homedir(), ".zrok");
}
function metadataFile() {
return join(rootDir(), "metadata.json");
}
function configFile() {
return join(rootDir(), "config.json");
}
function environmentFile() {
return join(rootDir(), "environment.json");
}
function identitiesDir() {
return join(rootDir(), "identities");
}
function identityFile(name) {
return join(identitiesDir(), name + ".json");
}
export {
configFile,
environmentFile,
identitiesDir,
identityFile,
metadataFile,
rootDir
};
//# sourceMappingURL=dirs.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../src/environment/dirs.ts"],"sourcesContent":["import { homedir } from \"os\"\nimport { join } from \"node:path\"\n\nexport function rootDir(): string {\n return join(homedir(), \".zrok\")\n}\n\nexport function metadataFile(): string {\n return join(rootDir(), \"metadata.json\")\n}\n\nexport function configFile(): string {\n return join(rootDir(), \"config.json\")\n}\n\nexport function environmentFile(): string {\n return join(rootDir(), \"environment.json\")\n}\n\nexport function identitiesDir(): string {\n return join(rootDir(), \"identities\")\n}\n\nexport function identityFile(name: string): string {\n return join(identitiesDir(), name + \".json\")\n}"],"mappings":";AAAA,SAAS,eAAe;AACxB,SAAS,YAAY;AAEd,SAAS,UAAkB;AAC9B,SAAO,KAAK,QAAQ,GAAG,OAAO;AAClC;AAEO,SAAS,eAAuB;AACnC,SAAO,KAAK,QAAQ,GAAG,eAAe;AAC1C;AAEO,SAAS,aAAqB;AACjC,SAAO,KAAK,QAAQ,GAAG,aAAa;AACxC;AAEO,SAAS,kBAA0B;AACtC,SAAO,KAAK,QAAQ,GAAG,kBAAkB;AAC7C;AAEO,SAAS,gBAAwB;AACpC,SAAO,KAAK,QAAQ,GAAG,YAAY;AACvC;AAEO,SAAS,aAAa,MAAsB;AAC/C,SAAO,KAAK,cAAc,GAAG,OAAO,OAAO;AAC/C;","names":[]}

949
sdk/node/sdk_ts/dist/environment/root.js vendored Normal file
View File

@ -0,0 +1,949 @@
"use strict";
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
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 __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
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/environment/root.ts
var root_exports = {};
__export(root_exports, {
ApiEndpoint: () => ApiEndpoint,
Assert: () => Assert,
Config: () => Config,
Environment: () => Environment,
Load: () => Load,
Metadata: () => Metadata,
Root: () => Root
});
module.exports = __toCommonJS(root_exports);
// src/environment/dirs.ts
var import_os = require("os");
var import_node_path = require("path");
function rootDir() {
return (0, import_node_path.join)((0, import_os.homedir)(), ".zrok");
}
function metadataFile() {
return (0, import_node_path.join)(rootDir(), "metadata.json");
}
function configFile() {
return (0, import_node_path.join)(rootDir(), "config.json");
}
function environmentFile() {
return (0, import_node_path.join)(rootDir(), "environment.json");
}
function identitiesDir() {
return (0, import_node_path.join)(rootDir(), "identities");
}
function identityFile(name) {
return (0, import_node_path.join)(identitiesDir(), name + ".json");
}
// src/environment/root.ts
var import_node_fs = __toESM(require("fs"));
// src/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
var RequiredError = class extends Error {
constructor(field, msg) {
super(msg);
this.field = field;
this.name = "RequiredError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var TextApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return yield this.raw.text();
});
}
};
// src/zrok/api/models/SparkDataSample.ts
function SparkDataSampleFromJSON(json) {
return SparkDataSampleFromJSONTyped(json, false);
}
function SparkDataSampleFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"rx": !exists(json, "rx") ? void 0 : json["rx"],
"tx": !exists(json, "tx") ? void 0 : json["tx"]
};
}
// src/zrok/api/models/Environment.ts
function EnvironmentFromJSON(json) {
return EnvironmentFromJSONTyped(json, false);
}
function EnvironmentFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"description": !exists(json, "description") ? void 0 : json["description"],
"host": !exists(json, "host") ? void 0 : json["host"],
"address": !exists(json, "address") ? void 0 : json["address"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"activity": !exists(json, "activity") ? void 0 : json["activity"].map(SparkDataSampleFromJSON),
"limited": !exists(json, "limited") ? void 0 : json["limited"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/Frontend.ts
function FrontendFromJSON(json) {
return FrontendFromJSONTyped(json, false);
}
function FrontendFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"id": !exists(json, "id") ? void 0 : json["id"],
"shrToken": !exists(json, "shrToken") ? void 0 : json["shrToken"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/Share.ts
function ShareFromJSON(json) {
return ShareFromJSONTyped(json, false);
}
function ShareFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"token": !exists(json, "token") ? void 0 : json["token"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"shareMode": !exists(json, "shareMode") ? void 0 : json["shareMode"],
"backendMode": !exists(json, "backendMode") ? void 0 : json["backendMode"],
"frontendSelection": !exists(json, "frontendSelection") ? void 0 : json["frontendSelection"],
"frontendEndpoint": !exists(json, "frontendEndpoint") ? void 0 : json["frontendEndpoint"],
"backendProxyEndpoint": !exists(json, "backendProxyEndpoint") ? void 0 : json["backendProxyEndpoint"],
"reserved": !exists(json, "reserved") ? void 0 : json["reserved"],
"activity": !exists(json, "activity") ? void 0 : json["activity"].map(SparkDataSampleFromJSON),
"limited": !exists(json, "limited") ? void 0 : json["limited"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/EnvironmentAndResources.ts
function EnvironmentAndResourcesFromJSON(json) {
return EnvironmentAndResourcesFromJSONTyped(json, false);
}
function EnvironmentAndResourcesFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"environment": !exists(json, "environment") ? void 0 : EnvironmentFromJSON(json["environment"]),
"frontends": !exists(json, "frontends") ? void 0 : json["frontends"].map(FrontendFromJSON),
"shares": !exists(json, "shares") ? void 0 : json["shares"].map(ShareFromJSON)
};
}
// src/zrok/api/models/MetricsSample.ts
function MetricsSampleFromJSON(json) {
return MetricsSampleFromJSONTyped(json, false);
}
function MetricsSampleFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"rx": !exists(json, "rx") ? void 0 : json["rx"],
"tx": !exists(json, "tx") ? void 0 : json["tx"],
"timestamp": !exists(json, "timestamp") ? void 0 : json["timestamp"]
};
}
// src/zrok/api/models/Metrics.ts
function MetricsFromJSON(json) {
return MetricsFromJSONTyped(json, false);
}
function MetricsFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"scope": !exists(json, "scope") ? void 0 : json["scope"],
"id": !exists(json, "id") ? void 0 : json["id"],
"period": !exists(json, "period") ? void 0 : json["period"],
"samples": !exists(json, "samples") ? void 0 : json["samples"].map(MetricsSampleFromJSON)
};
}
// src/zrok/api/models/PasswordRequirements.ts
function PasswordRequirementsFromJSON(json) {
return PasswordRequirementsFromJSONTyped(json, false);
}
function PasswordRequirementsFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"length": !exists(json, "length") ? void 0 : json["length"],
"requireCapital": !exists(json, "requireCapital") ? void 0 : json["requireCapital"],
"requireNumeric": !exists(json, "requireNumeric") ? void 0 : json["requireNumeric"],
"requireSpecial": !exists(json, "requireSpecial") ? void 0 : json["requireSpecial"],
"validSpecialCharacters": !exists(json, "validSpecialCharacters") ? void 0 : json["validSpecialCharacters"]
};
}
// src/zrok/api/models/ModelConfiguration.ts
function ModelConfigurationFromJSON(json) {
return ModelConfigurationFromJSONTyped(json, false);
}
function ModelConfigurationFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"version": !exists(json, "version") ? void 0 : json["version"],
"touLink": !exists(json, "touLink") ? void 0 : json["touLink"],
"invitesOpen": !exists(json, "invitesOpen") ? void 0 : json["invitesOpen"],
"requiresInviteToken": !exists(json, "requiresInviteToken") ? void 0 : json["requiresInviteToken"],
"inviteTokenContact": !exists(json, "inviteTokenContact") ? void 0 : json["inviteTokenContact"],
"passwordRequirements": !exists(json, "passwordRequirements") ? void 0 : PasswordRequirementsFromJSON(json["passwordRequirements"])
};
}
// src/zrok/api/models/Overview.ts
function OverviewFromJSON(json) {
return OverviewFromJSONTyped(json, false);
}
function OverviewFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"accountLimited": !exists(json, "accountLimited") ? void 0 : json["accountLimited"],
"environments": !exists(json, "environments") ? void 0 : json["environments"].map(EnvironmentAndResourcesFromJSON)
};
}
// src/zrok/api/apis/MetadataApi.ts
var MetadataApi = class extends BaseAPI {
/**
*/
_configurationRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
const response = yield this.request({
path: `/configuration`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => ModelConfigurationFromJSON(jsonValue));
});
}
/**
*/
_configuration(initOverrides) {
return __async(this, null, function* () {
const response = yield this._configurationRaw(initOverrides);
return yield response.value();
});
}
/**
*/
getAccountDetailRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/account`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => jsonValue.map(EnvironmentFromJSON));
});
}
/**
*/
getAccountDetail(initOverrides) {
return __async(this, null, function* () {
const response = yield this.getAccountDetailRaw(initOverrides);
return yield response.value();
});
}
/**
*/
getAccountMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/account`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getAccountMetrics() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.getAccountMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getEnvironmentDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.envZId === null || requestParameters.envZId === void 0) {
throw new RequiredError("envZId", "Required parameter requestParameters.envZId was null or undefined when calling getEnvironmentDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/environment/{envZId}`.replace(`{${"envZId"}}`, encodeURIComponent(String(requestParameters.envZId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => EnvironmentAndResourcesFromJSON(jsonValue));
});
}
/**
*/
getEnvironmentDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getEnvironmentDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getEnvironmentMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.envId === null || requestParameters.envId === void 0) {
throw new RequiredError("envId", "Required parameter requestParameters.envId was null or undefined when calling getEnvironmentMetrics.");
}
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/environment/{envId}`.replace(`{${"envId"}}`, encodeURIComponent(String(requestParameters.envId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getEnvironmentMetrics(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getEnvironmentMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getFrontendDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.feId === null || requestParameters.feId === void 0) {
throw new RequiredError("feId", "Required parameter requestParameters.feId was null or undefined when calling getFrontendDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/frontend/{feId}`.replace(`{${"feId"}}`, encodeURIComponent(String(requestParameters.feId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => FrontendFromJSON(jsonValue));
});
}
/**
*/
getFrontendDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getFrontendDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getShareDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.shrToken === null || requestParameters.shrToken === void 0) {
throw new RequiredError("shrToken", "Required parameter requestParameters.shrToken was null or undefined when calling getShareDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/share/{shrToken}`.replace(`{${"shrToken"}}`, encodeURIComponent(String(requestParameters.shrToken))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => ShareFromJSON(jsonValue));
});
}
/**
*/
getShareDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getShareDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getShareMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.shrToken === null || requestParameters.shrToken === void 0) {
throw new RequiredError("shrToken", "Required parameter requestParameters.shrToken was null or undefined when calling getShareMetrics.");
}
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/share/{shrToken}`.replace(`{${"shrToken"}}`, encodeURIComponent(String(requestParameters.shrToken))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getShareMetrics(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getShareMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
overviewRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/overview`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => OverviewFromJSON(jsonValue));
});
}
/**
*/
overview(initOverrides) {
return __async(this, null, function* () {
const response = yield this.overviewRaw(initOverrides);
return yield response.value();
});
}
/**
*/
versionRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
const response = yield this.request({
path: `/version`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new JSONApiResponse(response);
} else {
return new TextApiResponse(response);
}
});
}
/**
*/
version(initOverrides) {
return __async(this, null, function* () {
const response = yield this.versionRaw(initOverrides);
return yield response.value();
});
}
};
// src/environment/root.ts
var V = "v0.4";
var Metadata = class {
constructor(V2, RootPath = "") {
this.V = V2;
this.RootPath = RootPath;
}
};
var ApiEndpoint = class {
constructor(endpoint, frm) {
this.endpoint = endpoint;
this.frm = frm;
}
};
var Config = class {
constructor(ApiEndpoint2) {
this.ApiEndpoint = ApiEndpoint2;
}
};
var Environment = class {
constructor(Token, ZitiIdentity, ApiEndpoint2) {
this.Token = Token;
this.ZitiIdentity = ZitiIdentity;
this.ApiEndpoint = ApiEndpoint2;
}
};
var Root = class {
constructor(meta = new Metadata(V, rootDir()), cfg, env) {
this.meta = meta;
this.cfg = cfg;
this.env = env;
}
HasConfig() {
return this.cfg !== void 0 && Object.keys(this.cfg).length === 0;
}
Client() {
let apiEndpoint = this.ApiEndpoint();
let conf = new Configuration({
basePath: apiEndpoint.endpoint + "/api/v1",
accessToken: this.env.Token
});
let mapi = new MetadataApi(conf);
let ver = mapi.version();
const regex = new RegExp("^(refs/(heads|tags)/)?" + V);
ver.then((v) => {
console.log("got version " + v);
if (!regex.test(v)) {
throw new Error("Expected a '" + V + "' version, received: '" + v + "'");
}
});
return conf;
}
ApiEndpoint() {
let apiEndpoint = "https://api.zrok.io";
let frm = "binary";
if (this.cfg.ApiEndpoint != "") {
apiEndpoint = this.cfg.ApiEndpoint;
frm = "config";
}
let env = process.env.ZROK_API_ENDPOINT;
if (env != null) {
apiEndpoint = env;
frm = "ZROK_API_ENDPOINT";
}
if (this.IsEnabled()) {
apiEndpoint = this.env.ApiEndpoint;
frm = "env";
}
return new ApiEndpoint(apiEndpoint.replace(/\/+$/, ""), frm);
}
IsEnabled() {
return this.env !== void 0 && Object.keys(this.env).length > 0;
}
PublicIdentityName() {
return "public";
}
EnvironmentIdentityName() {
return "environment";
}
ZitiIdentityName(name) {
return identityFile(name);
}
};
function Assert() {
if (rootExists()) {
let meta = loadMetadata();
return meta.V == V;
}
return false;
}
function Load() {
if (rootExists()) {
return new Root(loadMetadata(), loadConfig(), loadEnvironment());
}
throw new Error("unable to load root. Does not exist");
}
function rootExists() {
return import_node_fs.default.existsSync(metadataFile());
}
function loadMetadata() {
let mf = metadataFile();
let data = import_node_fs.default.readFileSync(mf);
let serial = JSON.parse(data.toString());
return new Metadata(serial.v);
}
function loadConfig() {
let cf = configFile();
let data = import_node_fs.default.readFileSync(cf);
let serial = JSON.parse(data.toString());
return new Config(serial.api_endpoint);
}
function loadEnvironment() {
let ef = environmentFile();
let data = import_node_fs.default.readFileSync(ef);
let serial = JSON.parse(data.toString());
return new Environment(serial.zrok_token, serial.ziti_identity, serial.api_endpoint);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ApiEndpoint,
Assert,
Config,
Environment,
Load,
Metadata,
Root
});
//# sourceMappingURL=root.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,909 @@
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 __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 __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/environment/dirs.ts
import { homedir } from "os";
import { join } from "path";
function rootDir() {
return join(homedir(), ".zrok");
}
function metadataFile() {
return join(rootDir(), "metadata.json");
}
function configFile() {
return join(rootDir(), "config.json");
}
function environmentFile() {
return join(rootDir(), "environment.json");
}
function identitiesDir() {
return join(rootDir(), "identities");
}
function identityFile(name) {
return join(identitiesDir(), name + ".json");
}
// src/environment/root.ts
import fs from "fs";
// src/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
var RequiredError = class extends Error {
constructor(field, msg) {
super(msg);
this.field = field;
this.name = "RequiredError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var TextApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return yield this.raw.text();
});
}
};
// src/zrok/api/models/SparkDataSample.ts
function SparkDataSampleFromJSON(json) {
return SparkDataSampleFromJSONTyped(json, false);
}
function SparkDataSampleFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"rx": !exists(json, "rx") ? void 0 : json["rx"],
"tx": !exists(json, "tx") ? void 0 : json["tx"]
};
}
// src/zrok/api/models/Environment.ts
function EnvironmentFromJSON(json) {
return EnvironmentFromJSONTyped(json, false);
}
function EnvironmentFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"description": !exists(json, "description") ? void 0 : json["description"],
"host": !exists(json, "host") ? void 0 : json["host"],
"address": !exists(json, "address") ? void 0 : json["address"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"activity": !exists(json, "activity") ? void 0 : json["activity"].map(SparkDataSampleFromJSON),
"limited": !exists(json, "limited") ? void 0 : json["limited"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/Frontend.ts
function FrontendFromJSON(json) {
return FrontendFromJSONTyped(json, false);
}
function FrontendFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"id": !exists(json, "id") ? void 0 : json["id"],
"shrToken": !exists(json, "shrToken") ? void 0 : json["shrToken"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/Share.ts
function ShareFromJSON(json) {
return ShareFromJSONTyped(json, false);
}
function ShareFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"token": !exists(json, "token") ? void 0 : json["token"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"shareMode": !exists(json, "shareMode") ? void 0 : json["shareMode"],
"backendMode": !exists(json, "backendMode") ? void 0 : json["backendMode"],
"frontendSelection": !exists(json, "frontendSelection") ? void 0 : json["frontendSelection"],
"frontendEndpoint": !exists(json, "frontendEndpoint") ? void 0 : json["frontendEndpoint"],
"backendProxyEndpoint": !exists(json, "backendProxyEndpoint") ? void 0 : json["backendProxyEndpoint"],
"reserved": !exists(json, "reserved") ? void 0 : json["reserved"],
"activity": !exists(json, "activity") ? void 0 : json["activity"].map(SparkDataSampleFromJSON),
"limited": !exists(json, "limited") ? void 0 : json["limited"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/EnvironmentAndResources.ts
function EnvironmentAndResourcesFromJSON(json) {
return EnvironmentAndResourcesFromJSONTyped(json, false);
}
function EnvironmentAndResourcesFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"environment": !exists(json, "environment") ? void 0 : EnvironmentFromJSON(json["environment"]),
"frontends": !exists(json, "frontends") ? void 0 : json["frontends"].map(FrontendFromJSON),
"shares": !exists(json, "shares") ? void 0 : json["shares"].map(ShareFromJSON)
};
}
// src/zrok/api/models/MetricsSample.ts
function MetricsSampleFromJSON(json) {
return MetricsSampleFromJSONTyped(json, false);
}
function MetricsSampleFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"rx": !exists(json, "rx") ? void 0 : json["rx"],
"tx": !exists(json, "tx") ? void 0 : json["tx"],
"timestamp": !exists(json, "timestamp") ? void 0 : json["timestamp"]
};
}
// src/zrok/api/models/Metrics.ts
function MetricsFromJSON(json) {
return MetricsFromJSONTyped(json, false);
}
function MetricsFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"scope": !exists(json, "scope") ? void 0 : json["scope"],
"id": !exists(json, "id") ? void 0 : json["id"],
"period": !exists(json, "period") ? void 0 : json["period"],
"samples": !exists(json, "samples") ? void 0 : json["samples"].map(MetricsSampleFromJSON)
};
}
// src/zrok/api/models/PasswordRequirements.ts
function PasswordRequirementsFromJSON(json) {
return PasswordRequirementsFromJSONTyped(json, false);
}
function PasswordRequirementsFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"length": !exists(json, "length") ? void 0 : json["length"],
"requireCapital": !exists(json, "requireCapital") ? void 0 : json["requireCapital"],
"requireNumeric": !exists(json, "requireNumeric") ? void 0 : json["requireNumeric"],
"requireSpecial": !exists(json, "requireSpecial") ? void 0 : json["requireSpecial"],
"validSpecialCharacters": !exists(json, "validSpecialCharacters") ? void 0 : json["validSpecialCharacters"]
};
}
// src/zrok/api/models/ModelConfiguration.ts
function ModelConfigurationFromJSON(json) {
return ModelConfigurationFromJSONTyped(json, false);
}
function ModelConfigurationFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"version": !exists(json, "version") ? void 0 : json["version"],
"touLink": !exists(json, "touLink") ? void 0 : json["touLink"],
"invitesOpen": !exists(json, "invitesOpen") ? void 0 : json["invitesOpen"],
"requiresInviteToken": !exists(json, "requiresInviteToken") ? void 0 : json["requiresInviteToken"],
"inviteTokenContact": !exists(json, "inviteTokenContact") ? void 0 : json["inviteTokenContact"],
"passwordRequirements": !exists(json, "passwordRequirements") ? void 0 : PasswordRequirementsFromJSON(json["passwordRequirements"])
};
}
// src/zrok/api/models/Overview.ts
function OverviewFromJSON(json) {
return OverviewFromJSONTyped(json, false);
}
function OverviewFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"accountLimited": !exists(json, "accountLimited") ? void 0 : json["accountLimited"],
"environments": !exists(json, "environments") ? void 0 : json["environments"].map(EnvironmentAndResourcesFromJSON)
};
}
// src/zrok/api/apis/MetadataApi.ts
var MetadataApi = class extends BaseAPI {
/**
*/
_configurationRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
const response = yield this.request({
path: `/configuration`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => ModelConfigurationFromJSON(jsonValue));
});
}
/**
*/
_configuration(initOverrides) {
return __async(this, null, function* () {
const response = yield this._configurationRaw(initOverrides);
return yield response.value();
});
}
/**
*/
getAccountDetailRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/account`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => jsonValue.map(EnvironmentFromJSON));
});
}
/**
*/
getAccountDetail(initOverrides) {
return __async(this, null, function* () {
const response = yield this.getAccountDetailRaw(initOverrides);
return yield response.value();
});
}
/**
*/
getAccountMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/account`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getAccountMetrics() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.getAccountMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getEnvironmentDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.envZId === null || requestParameters.envZId === void 0) {
throw new RequiredError("envZId", "Required parameter requestParameters.envZId was null or undefined when calling getEnvironmentDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/environment/{envZId}`.replace(`{${"envZId"}}`, encodeURIComponent(String(requestParameters.envZId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => EnvironmentAndResourcesFromJSON(jsonValue));
});
}
/**
*/
getEnvironmentDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getEnvironmentDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getEnvironmentMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.envId === null || requestParameters.envId === void 0) {
throw new RequiredError("envId", "Required parameter requestParameters.envId was null or undefined when calling getEnvironmentMetrics.");
}
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/environment/{envId}`.replace(`{${"envId"}}`, encodeURIComponent(String(requestParameters.envId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getEnvironmentMetrics(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getEnvironmentMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getFrontendDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.feId === null || requestParameters.feId === void 0) {
throw new RequiredError("feId", "Required parameter requestParameters.feId was null or undefined when calling getFrontendDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/frontend/{feId}`.replace(`{${"feId"}}`, encodeURIComponent(String(requestParameters.feId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => FrontendFromJSON(jsonValue));
});
}
/**
*/
getFrontendDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getFrontendDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getShareDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.shrToken === null || requestParameters.shrToken === void 0) {
throw new RequiredError("shrToken", "Required parameter requestParameters.shrToken was null or undefined when calling getShareDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/share/{shrToken}`.replace(`{${"shrToken"}}`, encodeURIComponent(String(requestParameters.shrToken))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => ShareFromJSON(jsonValue));
});
}
/**
*/
getShareDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getShareDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getShareMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.shrToken === null || requestParameters.shrToken === void 0) {
throw new RequiredError("shrToken", "Required parameter requestParameters.shrToken was null or undefined when calling getShareMetrics.");
}
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/share/{shrToken}`.replace(`{${"shrToken"}}`, encodeURIComponent(String(requestParameters.shrToken))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getShareMetrics(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getShareMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
overviewRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/overview`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => OverviewFromJSON(jsonValue));
});
}
/**
*/
overview(initOverrides) {
return __async(this, null, function* () {
const response = yield this.overviewRaw(initOverrides);
return yield response.value();
});
}
/**
*/
versionRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
const response = yield this.request({
path: `/version`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new JSONApiResponse(response);
} else {
return new TextApiResponse(response);
}
});
}
/**
*/
version(initOverrides) {
return __async(this, null, function* () {
const response = yield this.versionRaw(initOverrides);
return yield response.value();
});
}
};
// src/environment/root.ts
var V = "v0.4";
var Metadata = class {
constructor(V2, RootPath = "") {
this.V = V2;
this.RootPath = RootPath;
}
};
var ApiEndpoint = class {
constructor(endpoint, frm) {
this.endpoint = endpoint;
this.frm = frm;
}
};
var Config = class {
constructor(ApiEndpoint2) {
this.ApiEndpoint = ApiEndpoint2;
}
};
var Environment = class {
constructor(Token, ZitiIdentity, ApiEndpoint2) {
this.Token = Token;
this.ZitiIdentity = ZitiIdentity;
this.ApiEndpoint = ApiEndpoint2;
}
};
var Root = class {
constructor(meta = new Metadata(V, rootDir()), cfg, env) {
this.meta = meta;
this.cfg = cfg;
this.env = env;
}
HasConfig() {
return this.cfg !== void 0 && Object.keys(this.cfg).length === 0;
}
Client() {
let apiEndpoint = this.ApiEndpoint();
let conf = new Configuration({
basePath: apiEndpoint.endpoint + "/api/v1",
accessToken: this.env.Token
});
let mapi = new MetadataApi(conf);
let ver = mapi.version();
const regex = new RegExp("^(refs/(heads|tags)/)?" + V);
ver.then((v) => {
console.log("got version " + v);
if (!regex.test(v)) {
throw new Error("Expected a '" + V + "' version, received: '" + v + "'");
}
});
return conf;
}
ApiEndpoint() {
let apiEndpoint = "https://api.zrok.io";
let frm = "binary";
if (this.cfg.ApiEndpoint != "") {
apiEndpoint = this.cfg.ApiEndpoint;
frm = "config";
}
let env = process.env.ZROK_API_ENDPOINT;
if (env != null) {
apiEndpoint = env;
frm = "ZROK_API_ENDPOINT";
}
if (this.IsEnabled()) {
apiEndpoint = this.env.ApiEndpoint;
frm = "env";
}
return new ApiEndpoint(apiEndpoint.replace(/\/+$/, ""), frm);
}
IsEnabled() {
return this.env !== void 0 && Object.keys(this.env).length > 0;
}
PublicIdentityName() {
return "public";
}
EnvironmentIdentityName() {
return "environment";
}
ZitiIdentityName(name) {
return identityFile(name);
}
};
function Assert() {
if (rootExists()) {
let meta = loadMetadata();
return meta.V == V;
}
return false;
}
function Load() {
if (rootExists()) {
return new Root(loadMetadata(), loadConfig(), loadEnvironment());
}
throw new Error("unable to load root. Does not exist");
}
function rootExists() {
return fs.existsSync(metadataFile());
}
function loadMetadata() {
let mf = metadataFile();
let data = fs.readFileSync(mf);
let serial = JSON.parse(data.toString());
return new Metadata(serial.v);
}
function loadConfig() {
let cf = configFile();
let data = fs.readFileSync(cf);
let serial = JSON.parse(data.toString());
return new Config(serial.api_endpoint);
}
function loadEnvironment() {
let ef = environmentFile();
let data = fs.readFileSync(ef);
let serial = JSON.parse(data.toString());
return new Environment(serial.zrok_token, serial.ziti_identity, serial.api_endpoint);
}
export {
ApiEndpoint,
Assert,
Config,
Environment,
Load,
Metadata,
Root
};
//# sourceMappingURL=root.mjs.map

File diff suppressed because one or more lines are too long

1461
sdk/node/sdk_ts/dist/index.js vendored Normal file

File diff suppressed because it is too large Load Diff

1
sdk/node/sdk_ts/dist/index.js.map vendored Normal file

File diff suppressed because one or more lines are too long

1394
sdk/node/sdk_ts/dist/index.mjs vendored Normal file

File diff suppressed because it is too large Load Diff

1
sdk/node/sdk_ts/dist/index.mjs.map vendored Normal file

File diff suppressed because one or more lines are too long

3392
sdk/node/sdk_ts/dist/zrok/api/api.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

3301
sdk/node/sdk_ts/dist/zrok/api/api.mjs vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

3271
sdk/node/sdk_ts/dist/zrok/api/api/apis.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

3224
sdk/node/sdk_ts/dist/zrok/api/api/apis.mjs vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,594 @@
"use strict";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
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 __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
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/zrok/api/apis/AccountApi.ts
var AccountApi_exports = {};
__export(AccountApi_exports, {
AccountApi: () => AccountApi
});
module.exports = __toCommonJS(AccountApi_exports);
// src/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var VoidApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return void 0;
});
}
};
var TextApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return yield this.raw.text();
});
}
};
// src/zrok/api/models/InviteRequest.ts
function InviteRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"email": value.email,
"token": value.token
};
}
// src/zrok/api/models/LoginRequest.ts
function LoginRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"email": value.email,
"password": value.password
};
}
// src/zrok/api/models/RegisterRequest.ts
function RegisterRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"token": value.token,
"password": value.password
};
}
// src/zrok/api/models/RegisterResponse.ts
function RegisterResponseFromJSON(json) {
return RegisterResponseFromJSONTyped(json, false);
}
function RegisterResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"token": !exists(json, "token") ? void 0 : json["token"]
};
}
// src/zrok/api/models/ResetPasswordRequest.ts
function ResetPasswordRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"token": value.token,
"password": value.password
};
}
// src/zrok/api/models/ResetPasswordRequestRequest.ts
function ResetPasswordRequestRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"emailAddress": value.emailAddress
};
}
// src/zrok/api/models/VerifyRequest.ts
function VerifyRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"token": value.token
};
}
// src/zrok/api/models/VerifyResponse.ts
function VerifyResponseFromJSON(json) {
return VerifyResponseFromJSONTyped(json, false);
}
function VerifyResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"email": !exists(json, "email") ? void 0 : json["email"]
};
}
// src/zrok/api/apis/AccountApi.ts
var AccountApi = class extends BaseAPI {
/**
*/
inviteRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/invite`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: InviteRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
invite() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.inviteRaw(requestParameters, initOverrides);
});
}
/**
*/
loginRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/login`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: LoginRequestToJSON(requestParameters.body)
}, initOverrides);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new JSONApiResponse(response);
} else {
return new TextApiResponse(response);
}
});
}
/**
*/
login() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.loginRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
registerRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/register`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: RegisterRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => RegisterResponseFromJSON(jsonValue));
});
}
/**
*/
register() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.registerRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
resetPasswordRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/resetPassword`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ResetPasswordRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
resetPassword() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.resetPasswordRaw(requestParameters, initOverrides);
});
}
/**
*/
resetPasswordRequestRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/resetPasswordRequest`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ResetPasswordRequestRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
resetPasswordRequest() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.resetPasswordRequestRaw(requestParameters, initOverrides);
});
}
/**
*/
verifyRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/verify`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: VerifyRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => VerifyResponseFromJSON(jsonValue));
});
}
/**
*/
verify() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.verifyRaw(requestParameters, initOverrides);
return yield response.value();
});
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
AccountApi
});
//# sourceMappingURL=AccountApi.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,570 @@
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 __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 __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/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var VoidApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return void 0;
});
}
};
var TextApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return yield this.raw.text();
});
}
};
// src/zrok/api/models/InviteRequest.ts
function InviteRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"email": value.email,
"token": value.token
};
}
// src/zrok/api/models/LoginRequest.ts
function LoginRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"email": value.email,
"password": value.password
};
}
// src/zrok/api/models/RegisterRequest.ts
function RegisterRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"token": value.token,
"password": value.password
};
}
// src/zrok/api/models/RegisterResponse.ts
function RegisterResponseFromJSON(json) {
return RegisterResponseFromJSONTyped(json, false);
}
function RegisterResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"token": !exists(json, "token") ? void 0 : json["token"]
};
}
// src/zrok/api/models/ResetPasswordRequest.ts
function ResetPasswordRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"token": value.token,
"password": value.password
};
}
// src/zrok/api/models/ResetPasswordRequestRequest.ts
function ResetPasswordRequestRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"emailAddress": value.emailAddress
};
}
// src/zrok/api/models/VerifyRequest.ts
function VerifyRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"token": value.token
};
}
// src/zrok/api/models/VerifyResponse.ts
function VerifyResponseFromJSON(json) {
return VerifyResponseFromJSONTyped(json, false);
}
function VerifyResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"email": !exists(json, "email") ? void 0 : json["email"]
};
}
// src/zrok/api/apis/AccountApi.ts
var AccountApi = class extends BaseAPI {
/**
*/
inviteRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/invite`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: InviteRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
invite() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.inviteRaw(requestParameters, initOverrides);
});
}
/**
*/
loginRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/login`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: LoginRequestToJSON(requestParameters.body)
}, initOverrides);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new JSONApiResponse(response);
} else {
return new TextApiResponse(response);
}
});
}
/**
*/
login() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.loginRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
registerRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/register`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: RegisterRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => RegisterResponseFromJSON(jsonValue));
});
}
/**
*/
register() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.registerRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
resetPasswordRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/resetPassword`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ResetPasswordRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
resetPassword() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.resetPasswordRaw(requestParameters, initOverrides);
});
}
/**
*/
resetPasswordRequestRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/resetPasswordRequest`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ResetPasswordRequestRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
resetPasswordRequest() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.resetPasswordRequestRaw(requestParameters, initOverrides);
});
}
/**
*/
verifyRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
const response = yield this.request({
path: `/verify`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: VerifyRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => VerifyResponseFromJSON(jsonValue));
});
}
/**
*/
verify() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.verifyRaw(requestParameters, initOverrides);
return yield response.value();
});
}
};
export {
AccountApi
};
//# sourceMappingURL=AccountApi.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,602 @@
"use strict";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
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 __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
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/zrok/api/apis/AdminApi.ts
var AdminApi_exports = {};
__export(AdminApi_exports, {
AdminApi: () => AdminApi
});
module.exports = __toCommonJS(AdminApi_exports);
// src/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var VoidApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return void 0;
});
}
};
// src/zrok/api/models/CreateFrontendRequest.ts
function CreateFrontendRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"zId": value.zId,
"url_template": value.urlTemplate,
"public_name": value.publicName
};
}
// src/zrok/api/models/CreateFrontendResponse.ts
function CreateFrontendResponseFromJSON(json) {
return CreateFrontendResponseFromJSONTyped(json, false);
}
function CreateFrontendResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"token": !exists(json, "token") ? void 0 : json["token"]
};
}
// src/zrok/api/models/CreateIdentity201Response.ts
function CreateIdentity201ResponseFromJSON(json) {
return CreateIdentity201ResponseFromJSONTyped(json, false);
}
function CreateIdentity201ResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"identity": !exists(json, "identity") ? void 0 : json["identity"],
"cfg": !exists(json, "cfg") ? void 0 : json["cfg"]
};
}
// src/zrok/api/models/CreateIdentityRequest.ts
function CreateIdentityRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"name": value.name
};
}
// src/zrok/api/models/DeleteFrontendRequest.ts
function DeleteFrontendRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"frontendToken": value.frontendToken
};
}
// src/zrok/api/models/InviteTokenGenerateRequest.ts
function InviteTokenGenerateRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"tokens": value.tokens
};
}
// src/zrok/api/models/PublicFrontend.ts
function PublicFrontendFromJSON(json) {
return PublicFrontendFromJSONTyped(json, false);
}
function PublicFrontendFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"token": !exists(json, "token") ? void 0 : json["token"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"urlTemplate": !exists(json, "urlTemplate") ? void 0 : json["urlTemplate"],
"publicName": !exists(json, "publicName") ? void 0 : json["publicName"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/UpdateFrontendRequest.ts
function UpdateFrontendRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"frontendToken": value.frontendToken,
"publicName": value.publicName,
"urlTemplate": value.urlTemplate
};
}
// src/zrok/api/apis/AdminApi.ts
var AdminApi = class extends BaseAPI {
/**
*/
createFrontendRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/frontend`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: CreateFrontendRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => CreateFrontendResponseFromJSON(jsonValue));
});
}
/**
*/
createFrontend() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.createFrontendRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
createIdentityRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/identity`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: CreateIdentityRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => CreateIdentity201ResponseFromJSON(jsonValue));
});
}
/**
*/
createIdentity() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.createIdentityRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
deleteFrontendRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/frontend`,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
body: DeleteFrontendRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
deleteFrontend() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.deleteFrontendRaw(requestParameters, initOverrides);
});
}
/**
*/
inviteTokenGenerateRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/invite/token/generate`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: InviteTokenGenerateRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
inviteTokenGenerate() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.inviteTokenGenerateRaw(requestParameters, initOverrides);
});
}
/**
*/
listFrontendsRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/frontends`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PublicFrontendFromJSON));
});
}
/**
*/
listFrontends(initOverrides) {
return __async(this, null, function* () {
const response = yield this.listFrontendsRaw(initOverrides);
return yield response.value();
});
}
/**
*/
updateFrontendRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/frontend`,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: UpdateFrontendRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
updateFrontend() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.updateFrontendRaw(requestParameters, initOverrides);
});
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
AdminApi
});
//# sourceMappingURL=AdminApi.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,578 @@
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 __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 __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/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var VoidApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return void 0;
});
}
};
// src/zrok/api/models/CreateFrontendRequest.ts
function CreateFrontendRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"zId": value.zId,
"url_template": value.urlTemplate,
"public_name": value.publicName
};
}
// src/zrok/api/models/CreateFrontendResponse.ts
function CreateFrontendResponseFromJSON(json) {
return CreateFrontendResponseFromJSONTyped(json, false);
}
function CreateFrontendResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"token": !exists(json, "token") ? void 0 : json["token"]
};
}
// src/zrok/api/models/CreateIdentity201Response.ts
function CreateIdentity201ResponseFromJSON(json) {
return CreateIdentity201ResponseFromJSONTyped(json, false);
}
function CreateIdentity201ResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"identity": !exists(json, "identity") ? void 0 : json["identity"],
"cfg": !exists(json, "cfg") ? void 0 : json["cfg"]
};
}
// src/zrok/api/models/CreateIdentityRequest.ts
function CreateIdentityRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"name": value.name
};
}
// src/zrok/api/models/DeleteFrontendRequest.ts
function DeleteFrontendRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"frontendToken": value.frontendToken
};
}
// src/zrok/api/models/InviteTokenGenerateRequest.ts
function InviteTokenGenerateRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"tokens": value.tokens
};
}
// src/zrok/api/models/PublicFrontend.ts
function PublicFrontendFromJSON(json) {
return PublicFrontendFromJSONTyped(json, false);
}
function PublicFrontendFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"token": !exists(json, "token") ? void 0 : json["token"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"urlTemplate": !exists(json, "urlTemplate") ? void 0 : json["urlTemplate"],
"publicName": !exists(json, "publicName") ? void 0 : json["publicName"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/UpdateFrontendRequest.ts
function UpdateFrontendRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"frontendToken": value.frontendToken,
"publicName": value.publicName,
"urlTemplate": value.urlTemplate
};
}
// src/zrok/api/apis/AdminApi.ts
var AdminApi = class extends BaseAPI {
/**
*/
createFrontendRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/frontend`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: CreateFrontendRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => CreateFrontendResponseFromJSON(jsonValue));
});
}
/**
*/
createFrontend() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.createFrontendRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
createIdentityRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/identity`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: CreateIdentityRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => CreateIdentity201ResponseFromJSON(jsonValue));
});
}
/**
*/
createIdentity() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.createIdentityRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
deleteFrontendRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/frontend`,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
body: DeleteFrontendRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
deleteFrontend() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.deleteFrontendRaw(requestParameters, initOverrides);
});
}
/**
*/
inviteTokenGenerateRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/invite/token/generate`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: InviteTokenGenerateRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
inviteTokenGenerate() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.inviteTokenGenerateRaw(requestParameters, initOverrides);
});
}
/**
*/
listFrontendsRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/frontends`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => jsonValue.map(PublicFrontendFromJSON));
});
}
/**
*/
listFrontends(initOverrides) {
return __async(this, null, function* () {
const response = yield this.listFrontendsRaw(initOverrides);
return yield response.value();
});
}
/**
*/
updateFrontendRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/frontend`,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: UpdateFrontendRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
updateFrontend() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.updateFrontendRaw(requestParameters, initOverrides);
});
}
};
export {
AdminApi
};
//# sourceMappingURL=AdminApi.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,421 @@
"use strict";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
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 __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
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/zrok/api/apis/EnvironmentApi.ts
var EnvironmentApi_exports = {};
__export(EnvironmentApi_exports, {
EnvironmentApi: () => EnvironmentApi
});
module.exports = __toCommonJS(EnvironmentApi_exports);
// src/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var VoidApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return void 0;
});
}
};
// src/zrok/api/models/DisableRequest.ts
function DisableRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"identity": value.identity
};
}
// src/zrok/api/models/EnableRequest.ts
function EnableRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"description": value.description,
"host": value.host
};
}
// src/zrok/api/models/EnableResponse.ts
function EnableResponseFromJSON(json) {
return EnableResponseFromJSONTyped(json, false);
}
function EnableResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"identity": !exists(json, "identity") ? void 0 : json["identity"],
"cfg": !exists(json, "cfg") ? void 0 : json["cfg"]
};
}
// src/zrok/api/apis/EnvironmentApi.ts
var EnvironmentApi = class extends BaseAPI {
/**
*/
disableRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/disable`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DisableRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
disable() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.disableRaw(requestParameters, initOverrides);
});
}
/**
*/
enableRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/enable`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: EnableRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => EnableResponseFromJSON(jsonValue));
});
}
/**
*/
enable() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.enableRaw(requestParameters, initOverrides);
return yield response.value();
});
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
EnvironmentApi
});
//# sourceMappingURL=EnvironmentApi.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,397 @@
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 __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 __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/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var VoidApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return void 0;
});
}
};
// src/zrok/api/models/DisableRequest.ts
function DisableRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"identity": value.identity
};
}
// src/zrok/api/models/EnableRequest.ts
function EnableRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"description": value.description,
"host": value.host
};
}
// src/zrok/api/models/EnableResponse.ts
function EnableResponseFromJSON(json) {
return EnableResponseFromJSONTyped(json, false);
}
function EnableResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"identity": !exists(json, "identity") ? void 0 : json["identity"],
"cfg": !exists(json, "cfg") ? void 0 : json["cfg"]
};
}
// src/zrok/api/apis/EnvironmentApi.ts
var EnvironmentApi = class extends BaseAPI {
/**
*/
disableRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/disable`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: DisableRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
disable() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.disableRaw(requestParameters, initOverrides);
});
}
/**
*/
enableRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/enable`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: EnableRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => EnableResponseFromJSON(jsonValue));
});
}
/**
*/
enable() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.enableRaw(requestParameters, initOverrides);
return yield response.value();
});
}
};
export {
EnvironmentApi
};
//# sourceMappingURL=EnvironmentApi.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,784 @@
"use strict";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
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 __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
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/zrok/api/apis/MetadataApi.ts
var MetadataApi_exports = {};
__export(MetadataApi_exports, {
MetadataApi: () => MetadataApi
});
module.exports = __toCommonJS(MetadataApi_exports);
// src/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
var RequiredError = class extends Error {
constructor(field, msg) {
super(msg);
this.field = field;
this.name = "RequiredError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var TextApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return yield this.raw.text();
});
}
};
// src/zrok/api/models/SparkDataSample.ts
function SparkDataSampleFromJSON(json) {
return SparkDataSampleFromJSONTyped(json, false);
}
function SparkDataSampleFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"rx": !exists(json, "rx") ? void 0 : json["rx"],
"tx": !exists(json, "tx") ? void 0 : json["tx"]
};
}
// src/zrok/api/models/Environment.ts
function EnvironmentFromJSON(json) {
return EnvironmentFromJSONTyped(json, false);
}
function EnvironmentFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"description": !exists(json, "description") ? void 0 : json["description"],
"host": !exists(json, "host") ? void 0 : json["host"],
"address": !exists(json, "address") ? void 0 : json["address"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"activity": !exists(json, "activity") ? void 0 : json["activity"].map(SparkDataSampleFromJSON),
"limited": !exists(json, "limited") ? void 0 : json["limited"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/Frontend.ts
function FrontendFromJSON(json) {
return FrontendFromJSONTyped(json, false);
}
function FrontendFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"id": !exists(json, "id") ? void 0 : json["id"],
"shrToken": !exists(json, "shrToken") ? void 0 : json["shrToken"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/Share.ts
function ShareFromJSON(json) {
return ShareFromJSONTyped(json, false);
}
function ShareFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"token": !exists(json, "token") ? void 0 : json["token"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"shareMode": !exists(json, "shareMode") ? void 0 : json["shareMode"],
"backendMode": !exists(json, "backendMode") ? void 0 : json["backendMode"],
"frontendSelection": !exists(json, "frontendSelection") ? void 0 : json["frontendSelection"],
"frontendEndpoint": !exists(json, "frontendEndpoint") ? void 0 : json["frontendEndpoint"],
"backendProxyEndpoint": !exists(json, "backendProxyEndpoint") ? void 0 : json["backendProxyEndpoint"],
"reserved": !exists(json, "reserved") ? void 0 : json["reserved"],
"activity": !exists(json, "activity") ? void 0 : json["activity"].map(SparkDataSampleFromJSON),
"limited": !exists(json, "limited") ? void 0 : json["limited"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/EnvironmentAndResources.ts
function EnvironmentAndResourcesFromJSON(json) {
return EnvironmentAndResourcesFromJSONTyped(json, false);
}
function EnvironmentAndResourcesFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"environment": !exists(json, "environment") ? void 0 : EnvironmentFromJSON(json["environment"]),
"frontends": !exists(json, "frontends") ? void 0 : json["frontends"].map(FrontendFromJSON),
"shares": !exists(json, "shares") ? void 0 : json["shares"].map(ShareFromJSON)
};
}
// src/zrok/api/models/MetricsSample.ts
function MetricsSampleFromJSON(json) {
return MetricsSampleFromJSONTyped(json, false);
}
function MetricsSampleFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"rx": !exists(json, "rx") ? void 0 : json["rx"],
"tx": !exists(json, "tx") ? void 0 : json["tx"],
"timestamp": !exists(json, "timestamp") ? void 0 : json["timestamp"]
};
}
// src/zrok/api/models/Metrics.ts
function MetricsFromJSON(json) {
return MetricsFromJSONTyped(json, false);
}
function MetricsFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"scope": !exists(json, "scope") ? void 0 : json["scope"],
"id": !exists(json, "id") ? void 0 : json["id"],
"period": !exists(json, "period") ? void 0 : json["period"],
"samples": !exists(json, "samples") ? void 0 : json["samples"].map(MetricsSampleFromJSON)
};
}
// src/zrok/api/models/PasswordRequirements.ts
function PasswordRequirementsFromJSON(json) {
return PasswordRequirementsFromJSONTyped(json, false);
}
function PasswordRequirementsFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"length": !exists(json, "length") ? void 0 : json["length"],
"requireCapital": !exists(json, "requireCapital") ? void 0 : json["requireCapital"],
"requireNumeric": !exists(json, "requireNumeric") ? void 0 : json["requireNumeric"],
"requireSpecial": !exists(json, "requireSpecial") ? void 0 : json["requireSpecial"],
"validSpecialCharacters": !exists(json, "validSpecialCharacters") ? void 0 : json["validSpecialCharacters"]
};
}
// src/zrok/api/models/ModelConfiguration.ts
function ModelConfigurationFromJSON(json) {
return ModelConfigurationFromJSONTyped(json, false);
}
function ModelConfigurationFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"version": !exists(json, "version") ? void 0 : json["version"],
"touLink": !exists(json, "touLink") ? void 0 : json["touLink"],
"invitesOpen": !exists(json, "invitesOpen") ? void 0 : json["invitesOpen"],
"requiresInviteToken": !exists(json, "requiresInviteToken") ? void 0 : json["requiresInviteToken"],
"inviteTokenContact": !exists(json, "inviteTokenContact") ? void 0 : json["inviteTokenContact"],
"passwordRequirements": !exists(json, "passwordRequirements") ? void 0 : PasswordRequirementsFromJSON(json["passwordRequirements"])
};
}
// src/zrok/api/models/Overview.ts
function OverviewFromJSON(json) {
return OverviewFromJSONTyped(json, false);
}
function OverviewFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"accountLimited": !exists(json, "accountLimited") ? void 0 : json["accountLimited"],
"environments": !exists(json, "environments") ? void 0 : json["environments"].map(EnvironmentAndResourcesFromJSON)
};
}
// src/zrok/api/apis/MetadataApi.ts
var MetadataApi = class extends BaseAPI {
/**
*/
_configurationRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
const response = yield this.request({
path: `/configuration`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => ModelConfigurationFromJSON(jsonValue));
});
}
/**
*/
_configuration(initOverrides) {
return __async(this, null, function* () {
const response = yield this._configurationRaw(initOverrides);
return yield response.value();
});
}
/**
*/
getAccountDetailRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/account`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => jsonValue.map(EnvironmentFromJSON));
});
}
/**
*/
getAccountDetail(initOverrides) {
return __async(this, null, function* () {
const response = yield this.getAccountDetailRaw(initOverrides);
return yield response.value();
});
}
/**
*/
getAccountMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/account`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getAccountMetrics() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.getAccountMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getEnvironmentDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.envZId === null || requestParameters.envZId === void 0) {
throw new RequiredError("envZId", "Required parameter requestParameters.envZId was null or undefined when calling getEnvironmentDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/environment/{envZId}`.replace(`{${"envZId"}}`, encodeURIComponent(String(requestParameters.envZId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => EnvironmentAndResourcesFromJSON(jsonValue));
});
}
/**
*/
getEnvironmentDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getEnvironmentDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getEnvironmentMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.envId === null || requestParameters.envId === void 0) {
throw new RequiredError("envId", "Required parameter requestParameters.envId was null or undefined when calling getEnvironmentMetrics.");
}
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/environment/{envId}`.replace(`{${"envId"}}`, encodeURIComponent(String(requestParameters.envId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getEnvironmentMetrics(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getEnvironmentMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getFrontendDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.feId === null || requestParameters.feId === void 0) {
throw new RequiredError("feId", "Required parameter requestParameters.feId was null or undefined when calling getFrontendDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/frontend/{feId}`.replace(`{${"feId"}}`, encodeURIComponent(String(requestParameters.feId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => FrontendFromJSON(jsonValue));
});
}
/**
*/
getFrontendDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getFrontendDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getShareDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.shrToken === null || requestParameters.shrToken === void 0) {
throw new RequiredError("shrToken", "Required parameter requestParameters.shrToken was null or undefined when calling getShareDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/share/{shrToken}`.replace(`{${"shrToken"}}`, encodeURIComponent(String(requestParameters.shrToken))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => ShareFromJSON(jsonValue));
});
}
/**
*/
getShareDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getShareDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getShareMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.shrToken === null || requestParameters.shrToken === void 0) {
throw new RequiredError("shrToken", "Required parameter requestParameters.shrToken was null or undefined when calling getShareMetrics.");
}
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/share/{shrToken}`.replace(`{${"shrToken"}}`, encodeURIComponent(String(requestParameters.shrToken))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getShareMetrics(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getShareMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
overviewRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/overview`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => OverviewFromJSON(jsonValue));
});
}
/**
*/
overview(initOverrides) {
return __async(this, null, function* () {
const response = yield this.overviewRaw(initOverrides);
return yield response.value();
});
}
/**
*/
versionRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
const response = yield this.request({
path: `/version`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new JSONApiResponse(response);
} else {
return new TextApiResponse(response);
}
});
}
/**
*/
version(initOverrides) {
return __async(this, null, function* () {
const response = yield this.versionRaw(initOverrides);
return yield response.value();
});
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
MetadataApi
});
//# sourceMappingURL=MetadataApi.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,760 @@
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 __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 __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/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
var RequiredError = class extends Error {
constructor(field, msg) {
super(msg);
this.field = field;
this.name = "RequiredError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var TextApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return yield this.raw.text();
});
}
};
// src/zrok/api/models/SparkDataSample.ts
function SparkDataSampleFromJSON(json) {
return SparkDataSampleFromJSONTyped(json, false);
}
function SparkDataSampleFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"rx": !exists(json, "rx") ? void 0 : json["rx"],
"tx": !exists(json, "tx") ? void 0 : json["tx"]
};
}
// src/zrok/api/models/Environment.ts
function EnvironmentFromJSON(json) {
return EnvironmentFromJSONTyped(json, false);
}
function EnvironmentFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"description": !exists(json, "description") ? void 0 : json["description"],
"host": !exists(json, "host") ? void 0 : json["host"],
"address": !exists(json, "address") ? void 0 : json["address"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"activity": !exists(json, "activity") ? void 0 : json["activity"].map(SparkDataSampleFromJSON),
"limited": !exists(json, "limited") ? void 0 : json["limited"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/Frontend.ts
function FrontendFromJSON(json) {
return FrontendFromJSONTyped(json, false);
}
function FrontendFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"id": !exists(json, "id") ? void 0 : json["id"],
"shrToken": !exists(json, "shrToken") ? void 0 : json["shrToken"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/Share.ts
function ShareFromJSON(json) {
return ShareFromJSONTyped(json, false);
}
function ShareFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"token": !exists(json, "token") ? void 0 : json["token"],
"zId": !exists(json, "zId") ? void 0 : json["zId"],
"shareMode": !exists(json, "shareMode") ? void 0 : json["shareMode"],
"backendMode": !exists(json, "backendMode") ? void 0 : json["backendMode"],
"frontendSelection": !exists(json, "frontendSelection") ? void 0 : json["frontendSelection"],
"frontendEndpoint": !exists(json, "frontendEndpoint") ? void 0 : json["frontendEndpoint"],
"backendProxyEndpoint": !exists(json, "backendProxyEndpoint") ? void 0 : json["backendProxyEndpoint"],
"reserved": !exists(json, "reserved") ? void 0 : json["reserved"],
"activity": !exists(json, "activity") ? void 0 : json["activity"].map(SparkDataSampleFromJSON),
"limited": !exists(json, "limited") ? void 0 : json["limited"],
"createdAt": !exists(json, "createdAt") ? void 0 : json["createdAt"],
"updatedAt": !exists(json, "updatedAt") ? void 0 : json["updatedAt"]
};
}
// src/zrok/api/models/EnvironmentAndResources.ts
function EnvironmentAndResourcesFromJSON(json) {
return EnvironmentAndResourcesFromJSONTyped(json, false);
}
function EnvironmentAndResourcesFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"environment": !exists(json, "environment") ? void 0 : EnvironmentFromJSON(json["environment"]),
"frontends": !exists(json, "frontends") ? void 0 : json["frontends"].map(FrontendFromJSON),
"shares": !exists(json, "shares") ? void 0 : json["shares"].map(ShareFromJSON)
};
}
// src/zrok/api/models/MetricsSample.ts
function MetricsSampleFromJSON(json) {
return MetricsSampleFromJSONTyped(json, false);
}
function MetricsSampleFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"rx": !exists(json, "rx") ? void 0 : json["rx"],
"tx": !exists(json, "tx") ? void 0 : json["tx"],
"timestamp": !exists(json, "timestamp") ? void 0 : json["timestamp"]
};
}
// src/zrok/api/models/Metrics.ts
function MetricsFromJSON(json) {
return MetricsFromJSONTyped(json, false);
}
function MetricsFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"scope": !exists(json, "scope") ? void 0 : json["scope"],
"id": !exists(json, "id") ? void 0 : json["id"],
"period": !exists(json, "period") ? void 0 : json["period"],
"samples": !exists(json, "samples") ? void 0 : json["samples"].map(MetricsSampleFromJSON)
};
}
// src/zrok/api/models/PasswordRequirements.ts
function PasswordRequirementsFromJSON(json) {
return PasswordRequirementsFromJSONTyped(json, false);
}
function PasswordRequirementsFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"length": !exists(json, "length") ? void 0 : json["length"],
"requireCapital": !exists(json, "requireCapital") ? void 0 : json["requireCapital"],
"requireNumeric": !exists(json, "requireNumeric") ? void 0 : json["requireNumeric"],
"requireSpecial": !exists(json, "requireSpecial") ? void 0 : json["requireSpecial"],
"validSpecialCharacters": !exists(json, "validSpecialCharacters") ? void 0 : json["validSpecialCharacters"]
};
}
// src/zrok/api/models/ModelConfiguration.ts
function ModelConfigurationFromJSON(json) {
return ModelConfigurationFromJSONTyped(json, false);
}
function ModelConfigurationFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"version": !exists(json, "version") ? void 0 : json["version"],
"touLink": !exists(json, "touLink") ? void 0 : json["touLink"],
"invitesOpen": !exists(json, "invitesOpen") ? void 0 : json["invitesOpen"],
"requiresInviteToken": !exists(json, "requiresInviteToken") ? void 0 : json["requiresInviteToken"],
"inviteTokenContact": !exists(json, "inviteTokenContact") ? void 0 : json["inviteTokenContact"],
"passwordRequirements": !exists(json, "passwordRequirements") ? void 0 : PasswordRequirementsFromJSON(json["passwordRequirements"])
};
}
// src/zrok/api/models/Overview.ts
function OverviewFromJSON(json) {
return OverviewFromJSONTyped(json, false);
}
function OverviewFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"accountLimited": !exists(json, "accountLimited") ? void 0 : json["accountLimited"],
"environments": !exists(json, "environments") ? void 0 : json["environments"].map(EnvironmentAndResourcesFromJSON)
};
}
// src/zrok/api/apis/MetadataApi.ts
var MetadataApi = class extends BaseAPI {
/**
*/
_configurationRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
const response = yield this.request({
path: `/configuration`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => ModelConfigurationFromJSON(jsonValue));
});
}
/**
*/
_configuration(initOverrides) {
return __async(this, null, function* () {
const response = yield this._configurationRaw(initOverrides);
return yield response.value();
});
}
/**
*/
getAccountDetailRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/account`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => jsonValue.map(EnvironmentFromJSON));
});
}
/**
*/
getAccountDetail(initOverrides) {
return __async(this, null, function* () {
const response = yield this.getAccountDetailRaw(initOverrides);
return yield response.value();
});
}
/**
*/
getAccountMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/account`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getAccountMetrics() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.getAccountMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getEnvironmentDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.envZId === null || requestParameters.envZId === void 0) {
throw new RequiredError("envZId", "Required parameter requestParameters.envZId was null or undefined when calling getEnvironmentDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/environment/{envZId}`.replace(`{${"envZId"}}`, encodeURIComponent(String(requestParameters.envZId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => EnvironmentAndResourcesFromJSON(jsonValue));
});
}
/**
*/
getEnvironmentDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getEnvironmentDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getEnvironmentMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.envId === null || requestParameters.envId === void 0) {
throw new RequiredError("envId", "Required parameter requestParameters.envId was null or undefined when calling getEnvironmentMetrics.");
}
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/environment/{envId}`.replace(`{${"envId"}}`, encodeURIComponent(String(requestParameters.envId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getEnvironmentMetrics(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getEnvironmentMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getFrontendDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.feId === null || requestParameters.feId === void 0) {
throw new RequiredError("feId", "Required parameter requestParameters.feId was null or undefined when calling getFrontendDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/frontend/{feId}`.replace(`{${"feId"}}`, encodeURIComponent(String(requestParameters.feId))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => FrontendFromJSON(jsonValue));
});
}
/**
*/
getFrontendDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getFrontendDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getShareDetailRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.shrToken === null || requestParameters.shrToken === void 0) {
throw new RequiredError("shrToken", "Required parameter requestParameters.shrToken was null or undefined when calling getShareDetail.");
}
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/detail/share/{shrToken}`.replace(`{${"shrToken"}}`, encodeURIComponent(String(requestParameters.shrToken))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => ShareFromJSON(jsonValue));
});
}
/**
*/
getShareDetail(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getShareDetailRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
getShareMetricsRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
if (requestParameters.shrToken === null || requestParameters.shrToken === void 0) {
throw new RequiredError("shrToken", "Required parameter requestParameters.shrToken was null or undefined when calling getShareMetrics.");
}
const queryParameters = {};
if (requestParameters.duration !== void 0) {
queryParameters["duration"] = requestParameters.duration;
}
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/metrics/share/{shrToken}`.replace(`{${"shrToken"}}`, encodeURIComponent(String(requestParameters.shrToken))),
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => MetricsFromJSON(jsonValue));
});
}
/**
*/
getShareMetrics(requestParameters, initOverrides) {
return __async(this, null, function* () {
const response = yield this.getShareMetricsRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
overviewRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/overview`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => OverviewFromJSON(jsonValue));
});
}
/**
*/
overview(initOverrides) {
return __async(this, null, function* () {
const response = yield this.overviewRaw(initOverrides);
return yield response.value();
});
}
/**
*/
versionRaw(initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
const response = yield this.request({
path: `/version`,
method: "GET",
headers: headerParameters,
query: queryParameters
}, initOverrides);
if (this.isJsonMime(response.headers.get("content-type"))) {
return new JSONApiResponse(response);
} else {
return new TextApiResponse(response);
}
});
}
/**
*/
version(initOverrides) {
return __async(this, null, function* () {
const response = yield this.versionRaw(initOverrides);
return yield response.value();
});
}
};
export {
MetadataApi
};
//# sourceMappingURL=MetadataApi.mjs.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,585 @@
"use strict";
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
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 __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
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/zrok/api/apis/ShareApi.ts
var ShareApi_exports = {};
__export(ShareApi_exports, {
ShareApi: () => ShareApi
});
module.exports = __toCommonJS(ShareApi_exports);
// src/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var VoidApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return void 0;
});
}
};
// src/zrok/api/models/AccessRequest.ts
function AccessRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"envZId": value.envZId,
"shrToken": value.shrToken
};
}
// src/zrok/api/models/AccessResponse.ts
function AccessResponseFromJSON(json) {
return AccessResponseFromJSONTyped(json, false);
}
function AccessResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"frontendToken": !exists(json, "frontendToken") ? void 0 : json["frontendToken"],
"backendMode": !exists(json, "backendMode") ? void 0 : json["backendMode"]
};
}
// src/zrok/api/models/AuthUser.ts
function AuthUserToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"username": value.username,
"password": value.password
};
}
// src/zrok/api/models/ShareRequest.ts
function ShareRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"envZId": value.envZId,
"shareMode": value.shareMode,
"frontendSelection": value.frontendSelection,
"backendMode": value.backendMode,
"backendProxyEndpoint": value.backendProxyEndpoint,
"authScheme": value.authScheme,
"authUsers": value.authUsers === void 0 ? void 0 : value.authUsers.map(AuthUserToJSON),
"oauthProvider": value.oauthProvider,
"oauthEmailDomains": value.oauthEmailDomains,
"oauthAuthorizationCheckInterval": value.oauthAuthorizationCheckInterval,
"reserved": value.reserved
};
}
// src/zrok/api/models/ShareResponse.ts
function ShareResponseFromJSON(json) {
return ShareResponseFromJSONTyped(json, false);
}
function ShareResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"frontendProxyEndpoints": !exists(json, "frontendProxyEndpoints") ? void 0 : json["frontendProxyEndpoints"],
"shrToken": !exists(json, "shrToken") ? void 0 : json["shrToken"]
};
}
// src/zrok/api/models/UnaccessRequest.ts
function UnaccessRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"frontendToken": value.frontendToken,
"envZId": value.envZId,
"shrToken": value.shrToken
};
}
// src/zrok/api/models/UnshareRequest.ts
function UnshareRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"envZId": value.envZId,
"shrToken": value.shrToken,
"reserved": value.reserved
};
}
// src/zrok/api/models/UpdateShareRequest.ts
function UpdateShareRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"shrToken": value.shrToken,
"backendProxyEndpoint": value.backendProxyEndpoint
};
}
// src/zrok/api/apis/ShareApi.ts
var ShareApi = class extends BaseAPI {
/**
*/
accessRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/access`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: AccessRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => AccessResponseFromJSON(jsonValue));
});
}
/**
*/
access() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.accessRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
shareRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/share`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ShareRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => ShareResponseFromJSON(jsonValue));
});
}
/**
*/
share() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.shareRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
unaccessRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/unaccess`,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
body: UnaccessRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
unaccess() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.unaccessRaw(requestParameters, initOverrides);
});
}
/**
*/
unshareRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/unshare`,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
body: UnshareRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
unshare() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.unshareRaw(requestParameters, initOverrides);
});
}
/**
*/
updateShareRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/share`,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: UpdateShareRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
updateShare() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.updateShareRaw(requestParameters, initOverrides);
});
}
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
ShareApi
});
//# sourceMappingURL=ShareApi.js.map

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,561 @@
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 __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 __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/zrok/api/runtime.ts
var BASE_PATH = "/api/v1".replace(/\/+$/, "");
var Configuration = class {
constructor(configuration = {}) {
this.configuration = configuration;
}
set config(configuration) {
this.configuration = configuration;
}
get basePath() {
return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH;
}
get fetchApi() {
return this.configuration.fetchApi;
}
get middleware() {
return this.configuration.middleware || [];
}
get queryParamsStringify() {
return this.configuration.queryParamsStringify || querystring;
}
get username() {
return this.configuration.username;
}
get password() {
return this.configuration.password;
}
get apiKey() {
const apiKey = this.configuration.apiKey;
if (apiKey) {
return typeof apiKey === "function" ? apiKey : () => apiKey;
}
return void 0;
}
get accessToken() {
const accessToken = this.configuration.accessToken;
if (accessToken) {
return typeof accessToken === "function" ? accessToken : () => __async(this, null, function* () {
return accessToken;
});
}
return void 0;
}
get headers() {
return this.configuration.headers;
}
get credentials() {
return this.configuration.credentials;
}
};
var DefaultConfig = new Configuration();
var _BaseAPI = class _BaseAPI {
constructor(configuration = DefaultConfig) {
this.configuration = configuration;
this.fetchApi = (url, init) => __async(this, null, function* () {
let fetchParams = { url, init };
for (const middleware of this.middleware) {
if (middleware.pre) {
fetchParams = (yield middleware.pre(__spreadValues({
fetch: this.fetchApi
}, fetchParams))) || fetchParams;
}
}
let response = void 0;
try {
response = yield (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init);
} catch (e) {
for (const middleware of this.middleware) {
if (middleware.onError) {
response = (yield middleware.onError({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
error: e,
response: response ? response.clone() : void 0
})) || response;
}
}
if (response === void 0) {
if (e instanceof Error) {
throw new FetchError(e, "The request failed and the interceptors did not return an alternative response");
} else {
throw e;
}
}
}
for (const middleware of this.middleware) {
if (middleware.post) {
response = (yield middleware.post({
fetch: this.fetchApi,
url: fetchParams.url,
init: fetchParams.init,
response: response.clone()
})) || response;
}
}
return response;
});
this.middleware = configuration.middleware;
}
withMiddleware(...middlewares) {
const next = this.clone();
next.middleware = next.middleware.concat(...middlewares);
return next;
}
withPreMiddleware(...preMiddlewares) {
const middlewares = preMiddlewares.map((pre) => ({ pre }));
return this.withMiddleware(...middlewares);
}
withPostMiddleware(...postMiddlewares) {
const middlewares = postMiddlewares.map((post) => ({ post }));
return this.withMiddleware(...middlewares);
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
isJsonMime(mime) {
if (!mime) {
return false;
}
return _BaseAPI.jsonRegex.test(mime);
}
request(context, initOverrides) {
return __async(this, null, function* () {
const { url, init } = yield this.createFetchParams(context, initOverrides);
const response = yield this.fetchApi(url, init);
if (response && (response.status >= 200 && response.status < 300)) {
return response;
}
throw new ResponseError(response, "Response returned an error code");
});
}
createFetchParams(context, initOverrides) {
return __async(this, null, function* () {
let url = this.configuration.basePath + context.path;
if (context.query !== void 0 && Object.keys(context.query).length !== 0) {
url += "?" + this.configuration.queryParamsStringify(context.query);
}
const headers = Object.assign({}, this.configuration.headers, context.headers);
Object.keys(headers).forEach((key) => headers[key] === void 0 ? delete headers[key] : {});
const initOverrideFn = typeof initOverrides === "function" ? initOverrides : () => __async(this, null, function* () {
return initOverrides;
});
const initParams = {
method: context.method,
headers,
body: context.body,
credentials: this.configuration.credentials
};
const overriddenInit = __spreadValues(__spreadValues({}, initParams), yield initOverrideFn({
init: initParams,
context
}));
let body;
if (isFormData(overriddenInit.body) || overriddenInit.body instanceof URLSearchParams || isBlob(overriddenInit.body)) {
body = overriddenInit.body;
} else if (this.isJsonMime(headers["Content-Type"])) {
body = JSON.stringify(overriddenInit.body);
} else {
body = overriddenInit.body;
}
const init = __spreadProps(__spreadValues({}, overriddenInit), {
body
});
return { url, init };
});
}
/**
* Create a shallow clone of `this` by constructing a new instance
* and then shallow cloning data members.
*/
clone() {
const constructor = this.constructor;
const next = new constructor(this.configuration);
next.middleware = this.middleware.slice();
return next;
}
};
_BaseAPI.jsonRegex = new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$", "i");
var BaseAPI = _BaseAPI;
function isBlob(value) {
return typeof Blob !== "undefined" && value instanceof Blob;
}
function isFormData(value) {
return typeof FormData !== "undefined" && value instanceof FormData;
}
var ResponseError = class extends Error {
constructor(response, msg) {
super(msg);
this.response = response;
this.name = "ResponseError";
}
};
var FetchError = class extends Error {
constructor(cause, msg) {
super(msg);
this.cause = cause;
this.name = "FetchError";
}
};
function exists(json, key) {
const value = json[key];
return value !== null && value !== void 0;
}
function querystring(params, prefix = "") {
return Object.keys(params).map((key) => querystringSingleKey(key, params[key], prefix)).filter((part) => part.length > 0).join("&");
}
function querystringSingleKey(key, value, keyPrefix = "") {
const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key);
if (value instanceof Array) {
const multiValue = value.map((singleValue) => encodeURIComponent(String(singleValue))).join(`&${encodeURIComponent(fullKey)}=`);
return `${encodeURIComponent(fullKey)}=${multiValue}`;
}
if (value instanceof Set) {
const valueAsArray = Array.from(value);
return querystringSingleKey(key, valueAsArray, keyPrefix);
}
if (value instanceof Date) {
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`;
}
if (value instanceof Object) {
return querystring(value, fullKey);
}
return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`;
}
var JSONApiResponse = class {
constructor(raw, transformer = (jsonValue) => jsonValue) {
this.raw = raw;
this.transformer = transformer;
}
value() {
return __async(this, null, function* () {
return this.transformer(yield this.raw.json());
});
}
};
var VoidApiResponse = class {
constructor(raw) {
this.raw = raw;
}
value() {
return __async(this, null, function* () {
return void 0;
});
}
};
// src/zrok/api/models/AccessRequest.ts
function AccessRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"envZId": value.envZId,
"shrToken": value.shrToken
};
}
// src/zrok/api/models/AccessResponse.ts
function AccessResponseFromJSON(json) {
return AccessResponseFromJSONTyped(json, false);
}
function AccessResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"frontendToken": !exists(json, "frontendToken") ? void 0 : json["frontendToken"],
"backendMode": !exists(json, "backendMode") ? void 0 : json["backendMode"]
};
}
// src/zrok/api/models/AuthUser.ts
function AuthUserToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"username": value.username,
"password": value.password
};
}
// src/zrok/api/models/ShareRequest.ts
function ShareRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"envZId": value.envZId,
"shareMode": value.shareMode,
"frontendSelection": value.frontendSelection,
"backendMode": value.backendMode,
"backendProxyEndpoint": value.backendProxyEndpoint,
"authScheme": value.authScheme,
"authUsers": value.authUsers === void 0 ? void 0 : value.authUsers.map(AuthUserToJSON),
"oauthProvider": value.oauthProvider,
"oauthEmailDomains": value.oauthEmailDomains,
"oauthAuthorizationCheckInterval": value.oauthAuthorizationCheckInterval,
"reserved": value.reserved
};
}
// src/zrok/api/models/ShareResponse.ts
function ShareResponseFromJSON(json) {
return ShareResponseFromJSONTyped(json, false);
}
function ShareResponseFromJSONTyped(json, ignoreDiscriminator) {
if (json === void 0 || json === null) {
return json;
}
return {
"frontendProxyEndpoints": !exists(json, "frontendProxyEndpoints") ? void 0 : json["frontendProxyEndpoints"],
"shrToken": !exists(json, "shrToken") ? void 0 : json["shrToken"]
};
}
// src/zrok/api/models/UnaccessRequest.ts
function UnaccessRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"frontendToken": value.frontendToken,
"envZId": value.envZId,
"shrToken": value.shrToken
};
}
// src/zrok/api/models/UnshareRequest.ts
function UnshareRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"envZId": value.envZId,
"shrToken": value.shrToken,
"reserved": value.reserved
};
}
// src/zrok/api/models/UpdateShareRequest.ts
function UpdateShareRequestToJSON(value) {
if (value === void 0) {
return void 0;
}
if (value === null) {
return null;
}
return {
"shrToken": value.shrToken,
"backendProxyEndpoint": value.backendProxyEndpoint
};
}
// src/zrok/api/apis/ShareApi.ts
var ShareApi = class extends BaseAPI {
/**
*/
accessRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/access`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: AccessRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => AccessResponseFromJSON(jsonValue));
});
}
/**
*/
access() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.accessRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
shareRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/share`,
method: "POST",
headers: headerParameters,
query: queryParameters,
body: ShareRequestToJSON(requestParameters.body)
}, initOverrides);
return new JSONApiResponse(response, (jsonValue) => ShareResponseFromJSON(jsonValue));
});
}
/**
*/
share() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
const response = yield this.shareRaw(requestParameters, initOverrides);
return yield response.value();
});
}
/**
*/
unaccessRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/unaccess`,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
body: UnaccessRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
unaccess() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.unaccessRaw(requestParameters, initOverrides);
});
}
/**
*/
unshareRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/unshare`,
method: "DELETE",
headers: headerParameters,
query: queryParameters,
body: UnshareRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
unshare() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.unshareRaw(requestParameters, initOverrides);
});
}
/**
*/
updateShareRaw(requestParameters, initOverrides) {
return __async(this, null, function* () {
const queryParameters = {};
const headerParameters = {};
headerParameters["Content-Type"] = "application/zrok.v1+json";
if (this.configuration && this.configuration.apiKey) {
headerParameters["x-token"] = this.configuration.apiKey("x-token");
}
const response = yield this.request({
path: `/share`,
method: "PATCH",
headers: headerParameters,
query: queryParameters,
body: UpdateShareRequestToJSON(requestParameters.body)
}, initOverrides);
return new VoidApiResponse(response);
});
}
/**
*/
updateShare() {
return __async(this, arguments, function* (requestParameters = {}, initOverrides) {
yield this.updateShareRaw(requestParameters, initOverrides);
});
}
};
export {
ShareApi
};
//# sourceMappingURL=ShareApi.mjs.map

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

2763
sdk/node/sdk_ts/dist/zrok/api/index.js vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

2564
sdk/node/sdk_ts/dist/zrok/api/index.mjs vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,49 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/zrok/api/model/accessRequest.ts
var accessRequest_exports = {};
__export(accessRequest_exports, {
AccessRequest: () => AccessRequest
});
module.exports = __toCommonJS(accessRequest_exports);
var _AccessRequest = class _AccessRequest {
static getAttributeTypeMap() {
return _AccessRequest.attributeTypeMap;
}
};
_AccessRequest.discriminator = void 0;
_AccessRequest.attributeTypeMap = [
{
"name": "envZId",
"baseName": "envZId",
"type": "string"
},
{
"name": "shrToken",
"baseName": "shrToken",
"type": "string"
}
];
var AccessRequest = _AccessRequest;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
AccessRequest
});
//# sourceMappingURL=accessRequest.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/accessRequest.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class AccessRequest {\n 'envZId'?: string;\n 'shrToken'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"envZId\",\n \"baseName\": \"envZId\",\n \"type\": \"string\"\n },\n {\n \"name\": \"shrToken\",\n \"baseName\": \"shrToken\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return AccessRequest.attributeTypeMap;\n }\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,IAAM,iBAAN,MAAM,eAAc;AAAA,EAkBvB,OAAO,sBAAsB;AACzB,WAAO,eAAc;AAAA,EACzB;AACJ;AArBa,eAIF,gBAAoC;AAJlC,eAMF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAhBN,IAAM,gBAAN;","names":[]}

View File

@ -0,0 +1,24 @@
// src/zrok/api/model/accessRequest.ts
var _AccessRequest = class _AccessRequest {
static getAttributeTypeMap() {
return _AccessRequest.attributeTypeMap;
}
};
_AccessRequest.discriminator = void 0;
_AccessRequest.attributeTypeMap = [
{
"name": "envZId",
"baseName": "envZId",
"type": "string"
},
{
"name": "shrToken",
"baseName": "shrToken",
"type": "string"
}
];
var AccessRequest = _AccessRequest;
export {
AccessRequest
};
//# sourceMappingURL=accessRequest.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/accessRequest.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class AccessRequest {\n 'envZId'?: string;\n 'shrToken'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"envZId\",\n \"baseName\": \"envZId\",\n \"type\": \"string\"\n },\n {\n \"name\": \"shrToken\",\n \"baseName\": \"shrToken\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return AccessRequest.attributeTypeMap;\n }\n}\n\n"],"mappings":";AAcO,IAAM,iBAAN,MAAM,eAAc;AAAA,EAkBvB,OAAO,sBAAsB;AACzB,WAAO,eAAc;AAAA,EACzB;AACJ;AArBa,eAIF,gBAAoC;AAJlC,eAMF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAhBN,IAAM,gBAAN;","names":[]}

View File

@ -0,0 +1,49 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/zrok/api/model/accessResponse.ts
var accessResponse_exports = {};
__export(accessResponse_exports, {
AccessResponse: () => AccessResponse
});
module.exports = __toCommonJS(accessResponse_exports);
var _AccessResponse = class _AccessResponse {
static getAttributeTypeMap() {
return _AccessResponse.attributeTypeMap;
}
};
_AccessResponse.discriminator = void 0;
_AccessResponse.attributeTypeMap = [
{
"name": "frontendToken",
"baseName": "frontendToken",
"type": "string"
},
{
"name": "backendMode",
"baseName": "backendMode",
"type": "string"
}
];
var AccessResponse = _AccessResponse;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
AccessResponse
});
//# sourceMappingURL=accessResponse.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/accessResponse.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class AccessResponse {\n 'frontendToken'?: string;\n 'backendMode'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"frontendToken\",\n \"baseName\": \"frontendToken\",\n \"type\": \"string\"\n },\n {\n \"name\": \"backendMode\",\n \"baseName\": \"backendMode\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return AccessResponse.attributeTypeMap;\n }\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,IAAM,kBAAN,MAAM,gBAAe;AAAA,EAkBxB,OAAO,sBAAsB;AACzB,WAAO,gBAAe;AAAA,EAC1B;AACJ;AArBa,gBAIF,gBAAoC;AAJlC,gBAMF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAhBN,IAAM,iBAAN;","names":[]}

View File

@ -0,0 +1,24 @@
// src/zrok/api/model/accessResponse.ts
var _AccessResponse = class _AccessResponse {
static getAttributeTypeMap() {
return _AccessResponse.attributeTypeMap;
}
};
_AccessResponse.discriminator = void 0;
_AccessResponse.attributeTypeMap = [
{
"name": "frontendToken",
"baseName": "frontendToken",
"type": "string"
},
{
"name": "backendMode",
"baseName": "backendMode",
"type": "string"
}
];
var AccessResponse = _AccessResponse;
export {
AccessResponse
};
//# sourceMappingURL=accessResponse.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/accessResponse.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class AccessResponse {\n 'frontendToken'?: string;\n 'backendMode'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"frontendToken\",\n \"baseName\": \"frontendToken\",\n \"type\": \"string\"\n },\n {\n \"name\": \"backendMode\",\n \"baseName\": \"backendMode\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return AccessResponse.attributeTypeMap;\n }\n}\n\n"],"mappings":";AAcO,IAAM,kBAAN,MAAM,gBAAe;AAAA,EAkBxB,OAAO,sBAAsB;AACzB,WAAO,gBAAe;AAAA,EAC1B;AACJ;AArBa,gBAIF,gBAAoC;AAJlC,gBAMF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAhBN,IAAM,iBAAN;","names":[]}

View File

@ -0,0 +1,49 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/zrok/api/model/authUser.ts
var authUser_exports = {};
__export(authUser_exports, {
AuthUser: () => AuthUser
});
module.exports = __toCommonJS(authUser_exports);
var _AuthUser = class _AuthUser {
static getAttributeTypeMap() {
return _AuthUser.attributeTypeMap;
}
};
_AuthUser.discriminator = void 0;
_AuthUser.attributeTypeMap = [
{
"name": "username",
"baseName": "username",
"type": "string"
},
{
"name": "password",
"baseName": "password",
"type": "string"
}
];
var AuthUser = _AuthUser;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
AuthUser
});
//# sourceMappingURL=authUser.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/authUser.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class AuthUser {\n 'username'?: string;\n 'password'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"username\",\n \"baseName\": \"username\",\n \"type\": \"string\"\n },\n {\n \"name\": \"password\",\n \"baseName\": \"password\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return AuthUser.attributeTypeMap;\n }\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,IAAM,YAAN,MAAM,UAAS;AAAA,EAkBlB,OAAO,sBAAsB;AACzB,WAAO,UAAS;AAAA,EACpB;AACJ;AArBa,UAIF,gBAAoC;AAJlC,UAMF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAhBN,IAAM,WAAN;","names":[]}

View File

@ -0,0 +1,24 @@
// src/zrok/api/model/authUser.ts
var _AuthUser = class _AuthUser {
static getAttributeTypeMap() {
return _AuthUser.attributeTypeMap;
}
};
_AuthUser.discriminator = void 0;
_AuthUser.attributeTypeMap = [
{
"name": "username",
"baseName": "username",
"type": "string"
},
{
"name": "password",
"baseName": "password",
"type": "string"
}
];
var AuthUser = _AuthUser;
export {
AuthUser
};
//# sourceMappingURL=authUser.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/authUser.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class AuthUser {\n 'username'?: string;\n 'password'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"username\",\n \"baseName\": \"username\",\n \"type\": \"string\"\n },\n {\n \"name\": \"password\",\n \"baseName\": \"password\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return AuthUser.attributeTypeMap;\n }\n}\n\n"],"mappings":";AAcO,IAAM,YAAN,MAAM,UAAS;AAAA,EAkBlB,OAAO,sBAAsB;AACzB,WAAO,UAAS;AAAA,EACpB;AACJ;AArBa,UAIF,gBAAoC;AAJlC,UAMF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAhBN,IAAM,WAAN;","names":[]}

View File

@ -0,0 +1,69 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/zrok/api/model/configuration.ts
var configuration_exports = {};
__export(configuration_exports, {
Configuration: () => Configuration
});
module.exports = __toCommonJS(configuration_exports);
var _Configuration = class _Configuration {
static getAttributeTypeMap() {
return _Configuration.attributeTypeMap;
}
};
_Configuration.discriminator = void 0;
_Configuration.attributeTypeMap = [
{
"name": "version",
"baseName": "version",
"type": "string"
},
{
"name": "touLink",
"baseName": "touLink",
"type": "string"
},
{
"name": "invitesOpen",
"baseName": "invitesOpen",
"type": "boolean"
},
{
"name": "requiresInviteToken",
"baseName": "requiresInviteToken",
"type": "boolean"
},
{
"name": "inviteTokenContact",
"baseName": "inviteTokenContact",
"type": "string"
},
{
"name": "passwordRequirements",
"baseName": "passwordRequirements",
"type": "PasswordRequirements"
}
];
var Configuration = _Configuration;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Configuration
});
//# sourceMappingURL=configuration.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/configuration.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\nimport { PasswordRequirements } from './passwordRequirements';\n\nexport class Configuration {\n 'version'?: string;\n 'touLink'?: string;\n 'invitesOpen'?: boolean;\n 'requiresInviteToken'?: boolean;\n 'inviteTokenContact'?: string;\n 'passwordRequirements'?: PasswordRequirements;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n },\n {\n \"name\": \"touLink\",\n \"baseName\": \"touLink\",\n \"type\": \"string\"\n },\n {\n \"name\": \"invitesOpen\",\n \"baseName\": \"invitesOpen\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"requiresInviteToken\",\n \"baseName\": \"requiresInviteToken\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"inviteTokenContact\",\n \"baseName\": \"inviteTokenContact\",\n \"type\": \"string\"\n },\n {\n \"name\": \"passwordRequirements\",\n \"baseName\": \"passwordRequirements\",\n \"type\": \"PasswordRequirements\"\n } ];\n\n static getAttributeTypeMap() {\n return Configuration.attributeTypeMap;\n }\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAeO,IAAM,iBAAN,MAAM,eAAc;AAAA,EA0CvB,OAAO,sBAAsB;AACzB,WAAO,eAAc;AAAA,EACzB;AACJ;AA7Ca,eAQF,gBAAoC;AARlC,eAUF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAxCN,IAAM,gBAAN;","names":[]}

View File

@ -0,0 +1,44 @@
// src/zrok/api/model/configuration.ts
var _Configuration = class _Configuration {
static getAttributeTypeMap() {
return _Configuration.attributeTypeMap;
}
};
_Configuration.discriminator = void 0;
_Configuration.attributeTypeMap = [
{
"name": "version",
"baseName": "version",
"type": "string"
},
{
"name": "touLink",
"baseName": "touLink",
"type": "string"
},
{
"name": "invitesOpen",
"baseName": "invitesOpen",
"type": "boolean"
},
{
"name": "requiresInviteToken",
"baseName": "requiresInviteToken",
"type": "boolean"
},
{
"name": "inviteTokenContact",
"baseName": "inviteTokenContact",
"type": "string"
},
{
"name": "passwordRequirements",
"baseName": "passwordRequirements",
"type": "PasswordRequirements"
}
];
var Configuration = _Configuration;
export {
Configuration
};
//# sourceMappingURL=configuration.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/configuration.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\nimport { PasswordRequirements } from './passwordRequirements';\n\nexport class Configuration {\n 'version'?: string;\n 'touLink'?: string;\n 'invitesOpen'?: boolean;\n 'requiresInviteToken'?: boolean;\n 'inviteTokenContact'?: string;\n 'passwordRequirements'?: PasswordRequirements;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"version\",\n \"baseName\": \"version\",\n \"type\": \"string\"\n },\n {\n \"name\": \"touLink\",\n \"baseName\": \"touLink\",\n \"type\": \"string\"\n },\n {\n \"name\": \"invitesOpen\",\n \"baseName\": \"invitesOpen\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"requiresInviteToken\",\n \"baseName\": \"requiresInviteToken\",\n \"type\": \"boolean\"\n },\n {\n \"name\": \"inviteTokenContact\",\n \"baseName\": \"inviteTokenContact\",\n \"type\": \"string\"\n },\n {\n \"name\": \"passwordRequirements\",\n \"baseName\": \"passwordRequirements\",\n \"type\": \"PasswordRequirements\"\n } ];\n\n static getAttributeTypeMap() {\n return Configuration.attributeTypeMap;\n }\n}\n\n"],"mappings":";AAeO,IAAM,iBAAN,MAAM,eAAc;AAAA,EA0CvB,OAAO,sBAAsB;AACzB,WAAO,eAAc;AAAA,EACzB;AACJ;AA7Ca,eAQF,gBAAoC;AARlC,eAUF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAxCN,IAAM,gBAAN;","names":[]}

View File

@ -0,0 +1,54 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/zrok/api/model/createFrontendRequest.ts
var createFrontendRequest_exports = {};
__export(createFrontendRequest_exports, {
CreateFrontendRequest: () => CreateFrontendRequest
});
module.exports = __toCommonJS(createFrontendRequest_exports);
var _CreateFrontendRequest = class _CreateFrontendRequest {
static getAttributeTypeMap() {
return _CreateFrontendRequest.attributeTypeMap;
}
};
_CreateFrontendRequest.discriminator = void 0;
_CreateFrontendRequest.attributeTypeMap = [
{
"name": "zId",
"baseName": "zId",
"type": "string"
},
{
"name": "urlTemplate",
"baseName": "url_template",
"type": "string"
},
{
"name": "publicName",
"baseName": "public_name",
"type": "string"
}
];
var CreateFrontendRequest = _CreateFrontendRequest;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CreateFrontendRequest
});
//# sourceMappingURL=createFrontendRequest.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/createFrontendRequest.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class CreateFrontendRequest {\n 'zId'?: string;\n 'urlTemplate'?: string;\n 'publicName'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"zId\",\n \"baseName\": \"zId\",\n \"type\": \"string\"\n },\n {\n \"name\": \"urlTemplate\",\n \"baseName\": \"url_template\",\n \"type\": \"string\"\n },\n {\n \"name\": \"publicName\",\n \"baseName\": \"public_name\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return CreateFrontendRequest.attributeTypeMap;\n }\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,IAAM,yBAAN,MAAM,uBAAsB;AAAA,EAwB/B,OAAO,sBAAsB;AACzB,WAAO,uBAAsB;AAAA,EACjC;AACJ;AA3Ba,uBAKF,gBAAoC;AALlC,uBAOF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAtBN,IAAM,wBAAN;","names":[]}

View File

@ -0,0 +1,29 @@
// src/zrok/api/model/createFrontendRequest.ts
var _CreateFrontendRequest = class _CreateFrontendRequest {
static getAttributeTypeMap() {
return _CreateFrontendRequest.attributeTypeMap;
}
};
_CreateFrontendRequest.discriminator = void 0;
_CreateFrontendRequest.attributeTypeMap = [
{
"name": "zId",
"baseName": "zId",
"type": "string"
},
{
"name": "urlTemplate",
"baseName": "url_template",
"type": "string"
},
{
"name": "publicName",
"baseName": "public_name",
"type": "string"
}
];
var CreateFrontendRequest = _CreateFrontendRequest;
export {
CreateFrontendRequest
};
//# sourceMappingURL=createFrontendRequest.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/createFrontendRequest.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class CreateFrontendRequest {\n 'zId'?: string;\n 'urlTemplate'?: string;\n 'publicName'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"zId\",\n \"baseName\": \"zId\",\n \"type\": \"string\"\n },\n {\n \"name\": \"urlTemplate\",\n \"baseName\": \"url_template\",\n \"type\": \"string\"\n },\n {\n \"name\": \"publicName\",\n \"baseName\": \"public_name\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return CreateFrontendRequest.attributeTypeMap;\n }\n}\n\n"],"mappings":";AAcO,IAAM,yBAAN,MAAM,uBAAsB;AAAA,EAwB/B,OAAO,sBAAsB;AACzB,WAAO,uBAAsB;AAAA,EACjC;AACJ;AA3Ba,uBAKF,gBAAoC;AALlC,uBAOF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAtBN,IAAM,wBAAN;","names":[]}

View File

@ -0,0 +1,44 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/zrok/api/model/createFrontendResponse.ts
var createFrontendResponse_exports = {};
__export(createFrontendResponse_exports, {
CreateFrontendResponse: () => CreateFrontendResponse
});
module.exports = __toCommonJS(createFrontendResponse_exports);
var _CreateFrontendResponse = class _CreateFrontendResponse {
static getAttributeTypeMap() {
return _CreateFrontendResponse.attributeTypeMap;
}
};
_CreateFrontendResponse.discriminator = void 0;
_CreateFrontendResponse.attributeTypeMap = [
{
"name": "token",
"baseName": "token",
"type": "string"
}
];
var CreateFrontendResponse = _CreateFrontendResponse;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CreateFrontendResponse
});
//# sourceMappingURL=createFrontendResponse.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/createFrontendResponse.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class CreateFrontendResponse {\n 'token'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"token\",\n \"baseName\": \"token\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return CreateFrontendResponse.attributeTypeMap;\n }\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,IAAM,0BAAN,MAAM,wBAAuB;AAAA,EAYhC,OAAO,sBAAsB;AACzB,WAAO,wBAAuB;AAAA,EAClC;AACJ;AAfa,wBAGF,gBAAoC;AAHlC,wBAKF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAVN,IAAM,yBAAN;","names":[]}

View File

@ -0,0 +1,19 @@
// src/zrok/api/model/createFrontendResponse.ts
var _CreateFrontendResponse = class _CreateFrontendResponse {
static getAttributeTypeMap() {
return _CreateFrontendResponse.attributeTypeMap;
}
};
_CreateFrontendResponse.discriminator = void 0;
_CreateFrontendResponse.attributeTypeMap = [
{
"name": "token",
"baseName": "token",
"type": "string"
}
];
var CreateFrontendResponse = _CreateFrontendResponse;
export {
CreateFrontendResponse
};
//# sourceMappingURL=createFrontendResponse.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/createFrontendResponse.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class CreateFrontendResponse {\n 'token'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"token\",\n \"baseName\": \"token\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return CreateFrontendResponse.attributeTypeMap;\n }\n}\n\n"],"mappings":";AAcO,IAAM,0BAAN,MAAM,wBAAuB;AAAA,EAYhC,OAAO,sBAAsB;AACzB,WAAO,wBAAuB;AAAA,EAClC;AACJ;AAfa,wBAGF,gBAAoC;AAHlC,wBAKF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAVN,IAAM,yBAAN;","names":[]}

View File

@ -0,0 +1,49 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/zrok/api/model/createIdentity201Response.ts
var createIdentity201Response_exports = {};
__export(createIdentity201Response_exports, {
CreateIdentity201Response: () => CreateIdentity201Response
});
module.exports = __toCommonJS(createIdentity201Response_exports);
var _CreateIdentity201Response = class _CreateIdentity201Response {
static getAttributeTypeMap() {
return _CreateIdentity201Response.attributeTypeMap;
}
};
_CreateIdentity201Response.discriminator = void 0;
_CreateIdentity201Response.attributeTypeMap = [
{
"name": "identity",
"baseName": "identity",
"type": "string"
},
{
"name": "cfg",
"baseName": "cfg",
"type": "string"
}
];
var CreateIdentity201Response = _CreateIdentity201Response;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CreateIdentity201Response
});
//# sourceMappingURL=createIdentity201Response.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/createIdentity201Response.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class CreateIdentity201Response {\n 'identity'?: string;\n 'cfg'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"identity\",\n \"baseName\": \"identity\",\n \"type\": \"string\"\n },\n {\n \"name\": \"cfg\",\n \"baseName\": \"cfg\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return CreateIdentity201Response.attributeTypeMap;\n }\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,IAAM,6BAAN,MAAM,2BAA0B;AAAA,EAkBnC,OAAO,sBAAsB;AACzB,WAAO,2BAA0B;AAAA,EACrC;AACJ;AArBa,2BAIF,gBAAoC;AAJlC,2BAMF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAhBN,IAAM,4BAAN;","names":[]}

View File

@ -0,0 +1,24 @@
// src/zrok/api/model/createIdentity201Response.ts
var _CreateIdentity201Response = class _CreateIdentity201Response {
static getAttributeTypeMap() {
return _CreateIdentity201Response.attributeTypeMap;
}
};
_CreateIdentity201Response.discriminator = void 0;
_CreateIdentity201Response.attributeTypeMap = [
{
"name": "identity",
"baseName": "identity",
"type": "string"
},
{
"name": "cfg",
"baseName": "cfg",
"type": "string"
}
];
var CreateIdentity201Response = _CreateIdentity201Response;
export {
CreateIdentity201Response
};
//# sourceMappingURL=createIdentity201Response.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/createIdentity201Response.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class CreateIdentity201Response {\n 'identity'?: string;\n 'cfg'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"identity\",\n \"baseName\": \"identity\",\n \"type\": \"string\"\n },\n {\n \"name\": \"cfg\",\n \"baseName\": \"cfg\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return CreateIdentity201Response.attributeTypeMap;\n }\n}\n\n"],"mappings":";AAcO,IAAM,6BAAN,MAAM,2BAA0B;AAAA,EAkBnC,OAAO,sBAAsB;AACzB,WAAO,2BAA0B;AAAA,EACrC;AACJ;AArBa,2BAIF,gBAAoC;AAJlC,2BAMF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAA,EACA;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAhBN,IAAM,4BAAN;","names":[]}

View File

@ -0,0 +1,44 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/zrok/api/model/createIdentityRequest.ts
var createIdentityRequest_exports = {};
__export(createIdentityRequest_exports, {
CreateIdentityRequest: () => CreateIdentityRequest
});
module.exports = __toCommonJS(createIdentityRequest_exports);
var _CreateIdentityRequest = class _CreateIdentityRequest {
static getAttributeTypeMap() {
return _CreateIdentityRequest.attributeTypeMap;
}
};
_CreateIdentityRequest.discriminator = void 0;
_CreateIdentityRequest.attributeTypeMap = [
{
"name": "name",
"baseName": "name",
"type": "string"
}
];
var CreateIdentityRequest = _CreateIdentityRequest;
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
CreateIdentityRequest
});
//# sourceMappingURL=createIdentityRequest.js.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/createIdentityRequest.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class CreateIdentityRequest {\n 'name'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return CreateIdentityRequest.attributeTypeMap;\n }\n}\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,IAAM,yBAAN,MAAM,uBAAsB;AAAA,EAY/B,OAAO,sBAAsB;AACzB,WAAO,uBAAsB;AAAA,EACjC;AACJ;AAfa,uBAGF,gBAAoC;AAHlC,uBAKF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAVN,IAAM,wBAAN;","names":[]}

View File

@ -0,0 +1,19 @@
// src/zrok/api/model/createIdentityRequest.ts
var _CreateIdentityRequest = class _CreateIdentityRequest {
static getAttributeTypeMap() {
return _CreateIdentityRequest.attributeTypeMap;
}
};
_CreateIdentityRequest.discriminator = void 0;
_CreateIdentityRequest.attributeTypeMap = [
{
"name": "name",
"baseName": "name",
"type": "string"
}
];
var CreateIdentityRequest = _CreateIdentityRequest;
export {
CreateIdentityRequest
};
//# sourceMappingURL=createIdentityRequest.mjs.map

View File

@ -0,0 +1 @@
{"version":3,"sources":["../../../../src/zrok/api/model/createIdentityRequest.ts"],"sourcesContent":["/**\n * zrok\n * zrok client access\n *\n * The version of the OpenAPI document: 0.3.0\n * \n *\n * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\nimport { RequestFile } from './models';\n\nexport class CreateIdentityRequest {\n 'name'?: string;\n\n static discriminator: string | undefined = undefined;\n\n static attributeTypeMap: Array<{name: string, baseName: string, type: string}> = [\n {\n \"name\": \"name\",\n \"baseName\": \"name\",\n \"type\": \"string\"\n } ];\n\n static getAttributeTypeMap() {\n return CreateIdentityRequest.attributeTypeMap;\n }\n}\n\n"],"mappings":";AAcO,IAAM,yBAAN,MAAM,uBAAsB;AAAA,EAY/B,OAAO,sBAAsB;AACzB,WAAO,uBAAsB;AAAA,EACjC;AACJ;AAfa,uBAGF,gBAAoC;AAHlC,uBAKF,mBAA0E;AAAA,EAC7E;AAAA,IACI,QAAQ;AAAA,IACR,YAAY;AAAA,IACZ,QAAQ;AAAA,EACZ;AAAK;AAVN,IAAM,wBAAN;","names":[]}

Some files were not shown because too many files have changed in this diff Show More