@appconda/sdk 1.0.190 → 1.0.192
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +2575 -13567
- package/index.js +117 -625
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -17,740 +17,256 @@
|
|
|
17
17
|
}
|
|
18
18
|
})(self, function() {
|
|
19
19
|
return /******/ (() => { // webpackBootstrap
|
|
20
|
+
/******/ "use strict";
|
|
20
21
|
/******/ var __webpack_modules__ = ({
|
|
21
22
|
|
|
22
|
-
/***/ "./
|
|
23
|
-
|
|
24
|
-
!*** ./
|
|
25
|
-
|
|
26
|
-
/***/ ((
|
|
27
|
-
|
|
28
|
-
eval("// Save global object in a variable\nvar __global__ =\n(typeof globalThis !== 'undefined' && globalThis) ||\n(typeof self !== 'undefined' && self) ||\n(typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g);\n// Create an object that extends from __global__ without the fetch function\nvar __globalThis__ = (function () {\nfunction F() {\nthis.fetch = false;\nthis.DOMException = __global__.DOMException\n}\nF.prototype = __global__; // Needed for feature detection on whatwg-fetch's code\nreturn new F();\n})();\n// Wraps whatwg-fetch with a function scope to hijack the global object\n// \"globalThis\" that's going to be patched\n(function(globalThis) {\n\nvar irrelevant = (function (exports) {\n\n var global =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n (typeof global !== 'undefined' && global);\n\n var support = {\n searchParams: 'URLSearchParams' in global,\n iterable: 'Symbol' in global && 'iterator' in Symbol,\n blob:\n 'FileReader' in global &&\n 'Blob' in global &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in global,\n arrayBuffer: 'ArrayBuffer' in global\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsText(blob);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n this.bodyUsed = this.bodyUsed;\n this._bodyInit = body;\n if (!body) {\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this);\n if (isConsumed) {\n return isConsumed\n }\n if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else {\n return this.blob().then(readBlobAsArrayBuffer)\n }\n };\n }\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal;\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/;\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/;\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();\n }\n }\n }\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n headers.append(key, value);\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText;\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 0, statusText: ''});\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = global.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n status: xhr.status,\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n setTimeout(function() {\n resolve(new Response(body, options));\n }, 0);\n };\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n }, 0);\n };\n\n function fixUrl(url) {\n try {\n return url === '' && global.location.href ? global.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob';\n } else if (\n support.arrayBuffer &&\n request.headers.get('Content-Type') &&\n request.headers.get('Content-Type').indexOf('application/octet-stream') !== -1\n ) {\n xhr.responseType = 'arraybuffer';\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers)) {\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]));\n });\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!global.fetch) {\n global.fetch = fetch;\n global.Headers = Headers;\n global.Request = Request;\n global.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n return exports;\n\n})({});\n})(__globalThis__);\n// This is a ponyfill, so...\n__globalThis__.fetch.ponyfill = true;\ndelete __globalThis__.fetch.polyfill;\n// Choose between native implementation (__global__) or custom implementation (__globalThis__)\nvar ctx = __global__.fetch ? __global__ : __globalThis__;\nexports = ctx.fetch // To enable: import fetch from 'cross-fetch'\nexports.default = ctx.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = ctx.Headers\nexports.Request = ctx.Request\nexports.Response = ctx.Response\nmodule.exports = exports\n\n\n//# sourceURL=webpack://@appconda/sdk/./node_modules/cross-fetch/dist/browser-ponyfill.js?");
|
|
29
|
-
|
|
30
|
-
/***/ }),
|
|
31
|
-
|
|
32
|
-
/***/ "./node_modules/isomorphic-form-data/lib/browser.js":
|
|
33
|
-
/*!**********************************************************!*\
|
|
34
|
-
!*** ./node_modules/isomorphic-form-data/lib/browser.js ***!
|
|
35
|
-
\**********************************************************/
|
|
36
|
-
/***/ ((module) => {
|
|
23
|
+
/***/ "./src/client.ts":
|
|
24
|
+
/*!***********************!*\
|
|
25
|
+
!*** ./src/client.ts ***!
|
|
26
|
+
\***********************/
|
|
27
|
+
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
37
28
|
|
|
38
|
-
eval("module.exports = window.FormData\n\n\n//# sourceURL=webpack://@appconda/sdk/./node_modules/isomorphic-form-data/lib/browser.js?");
|
|
29
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Client\": () => (/* binding */ Client),\n/* harmony export */ \"AppcondaException\": () => (/* binding */ AppcondaException),\n/* harmony export */ \"Query\": () => (/* reexport safe */ _query__WEBPACK_IMPORTED_MODULE_0__.Query)\n/* harmony export */ });\n/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./query */ \"./src/query.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n/**\n * Exception thrown by the package\n */\nclass AppcondaException extends Error {\n /**\n * Initializes a Appconda Exception.\n *\n * @param {string} message - The error message.\n * @param {number} code - The error code. Default is 0.\n * @param {string} type - The error type. Default is an empty string.\n * @param {string} response - The response string. Default is an empty string.\n */\n constructor(message, code = 0, type = '', response = '') {\n super(message);\n this.name = 'AppcondaException';\n this.message = message;\n this.code = code;\n this.type = type;\n this.response = response;\n }\n}\n/**\n * Client that handles requests to Appconda\n */\nclass Client {\n constructor() {\n /**\n * Holds configuration such as project.\n */\n this.config = {\n endpoint: 'https://cloud.appconda.io/v1',\n endpointRealtime: '',\n project: '',\n jwt: '',\n locale: '',\n session: '',\n };\n /**\n * Custom headers for API requests.\n */\n this.headers = {\n 'x-sdk-name': 'Web',\n 'x-sdk-platform': 'client',\n 'x-sdk-language': 'web',\n 'x-sdk-version': '16.0.0',\n 'X-Realmocean-Response-Format': '1.6.0',\n };\n this.realtime = {\n socket: undefined,\n timeout: undefined,\n url: '',\n channels: new Set(),\n subscriptions: new Map(),\n subscriptionsCounter: 0,\n reconnect: true,\n reconnectAttempts: 0,\n lastMessage: undefined,\n connect: () => {\n clearTimeout(this.realtime.timeout);\n this.realtime.timeout = window === null || window === void 0 ? void 0 : window.setTimeout(() => {\n this.realtime.createSocket();\n }, 50);\n },\n getTimeout: () => {\n switch (true) {\n case this.realtime.reconnectAttempts < 5:\n return 1000;\n case this.realtime.reconnectAttempts < 15:\n return 5000;\n case this.realtime.reconnectAttempts < 100:\n return 10000;\n default:\n return 60000;\n }\n },\n createSocket: () => {\n var _a, _b, _c;\n if (this.realtime.channels.size < 1) {\n this.realtime.reconnect = false;\n (_a = this.realtime.socket) === null || _a === void 0 ? void 0 : _a.close();\n return;\n }\n const channels = new URLSearchParams();\n channels.set('project', this.config.project);\n this.realtime.channels.forEach(channel => {\n channels.append('channels[]', channel);\n });\n const url = this.config.endpointRealtime + '/realtime?' + channels.toString();\n if (url !== this.realtime.url || // Check if URL is present\n !this.realtime.socket || // Check if WebSocket has not been created\n ((_b = this.realtime.socket) === null || _b === void 0 ? void 0 : _b.readyState) > WebSocket.OPEN // Check if WebSocket is CLOSING (3) or CLOSED (4)\n ) {\n if (this.realtime.socket &&\n ((_c = this.realtime.socket) === null || _c === void 0 ? void 0 : _c.readyState) < WebSocket.CLOSING // Close WebSocket if it is CONNECTING (0) or OPEN (1)\n ) {\n this.realtime.reconnect = false;\n this.realtime.socket.close();\n }\n this.realtime.url = url;\n this.realtime.socket = new WebSocket(url);\n this.realtime.socket.addEventListener('message', this.realtime.onMessage);\n this.realtime.socket.addEventListener('open', _event => {\n this.realtime.reconnectAttempts = 0;\n });\n this.realtime.socket.addEventListener('close', event => {\n var _a, _b, _c;\n if (!this.realtime.reconnect ||\n (((_b = (_a = this.realtime) === null || _a === void 0 ? void 0 : _a.lastMessage) === null || _b === void 0 ? void 0 : _b.type) === 'error' && // Check if last message was of type error\n ((_c = this.realtime) === null || _c === void 0 ? void 0 : _c.lastMessage.data).code === 1008 // Check for policy violation 1008\n )) {\n this.realtime.reconnect = true;\n return;\n }\n const timeout = this.realtime.getTimeout();\n console.error(`Realtime got disconnected. Reconnect will be attempted in ${timeout / 1000} seconds.`, event.reason);\n setTimeout(() => {\n this.realtime.reconnectAttempts++;\n this.realtime.createSocket();\n }, timeout);\n });\n }\n },\n onMessage: (event) => {\n var _a, _b;\n try {\n const message = JSON.parse(event.data);\n this.realtime.lastMessage = message;\n switch (message.type) {\n case 'connected':\n const cookie = JSON.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');\n const session = cookie === null || cookie === void 0 ? void 0 : cookie[`a_session_${this.config.project}`];\n const messageData = message.data;\n if (session && !messageData.user) {\n (_b = this.realtime.socket) === null || _b === void 0 ? void 0 : _b.send(JSON.stringify({\n type: 'authentication',\n data: {\n session\n }\n }));\n }\n break;\n case 'event':\n let data = message.data;\n if (data === null || data === void 0 ? void 0 : data.channels) {\n const isSubscribed = data.channels.some(channel => this.realtime.channels.has(channel));\n if (!isSubscribed)\n return;\n this.realtime.subscriptions.forEach(subscription => {\n if (data.channels.some(channel => subscription.channels.includes(channel))) {\n setTimeout(() => subscription.callback(data));\n }\n });\n }\n break;\n case 'error':\n throw message.data;\n default:\n break;\n }\n }\n catch (e) {\n console.error(e);\n }\n },\n cleanUp: channels => {\n this.realtime.channels.forEach(channel => {\n if (channels.includes(channel)) {\n let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {\n return subscription.channels.includes(channel);\n });\n if (!found) {\n this.realtime.channels.delete(channel);\n }\n }\n });\n }\n };\n }\n /**\n * Set Endpoint\n *\n * Your project endpoint\n *\n * @param {string} endpoint\n *\n * @returns {this}\n */\n setEndpoint(endpoint) {\n this.config.endpoint = endpoint;\n this.config.endpointRealtime = this.config.endpointRealtime || this.config.endpoint.replace('https://', 'wss://').replace('http://', 'ws://');\n return this;\n }\n /**\n * Set Realtime Endpoint\n *\n * @param {string} endpointRealtime\n *\n * @returns {this}\n */\n setEndpointRealtime(endpointRealtime) {\n this.config.endpointRealtime = endpointRealtime;\n return this;\n }\n /**\n * Set Project\n *\n * Your project ID\n *\n * @param value string\n *\n * @return {this}\n */\n setProject(value) {\n this.headers['X-Realmocean-Project'] = value;\n this.config.project = value;\n return this;\n }\n /**\n * Set JWT\n *\n * Your secret JSON Web Token\n *\n * @param value string\n *\n * @return {this}\n */\n setJWT(value) {\n this.headers['X-Realmocean-JWT'] = value;\n this.config.jwt = value;\n return this;\n }\n /**\n * Set Locale\n *\n * @param value string\n *\n * @return {this}\n */\n setLocale(value) {\n this.headers['X-Realmocean-Locale'] = value;\n this.config.locale = value;\n return this;\n }\n /**\n * Set Session\n *\n * The user session to authenticate with\n *\n * @param value string\n *\n * @return {this}\n */\n setSession(value) {\n this.headers['X-Realmocean-Session'] = value;\n this.config.session = value;\n return this;\n }\n /**\n * Subscribes to Appconda events and passes you the payload in realtime.\n *\n * @param {string|string[]} channels\n * Channel to subscribe - pass a single channel as a string or multiple with an array of strings.\n *\n * Possible channels are:\n * - account\n * - collections\n * - collections.[ID]\n * - collections.[ID].documents\n * - documents\n * - documents.[ID]\n * - files\n * - files.[ID]\n * - executions\n * - executions.[ID]\n * - functions.[ID]\n * - teams\n * - teams.[ID]\n * - memberships\n * - memberships.[ID]\n * @param {(payload: RealtimeMessage) => void} callback Is called on every realtime update.\n * @returns {() => void} Unsubscribes from events.\n */\n subscribe(channels, callback) {\n let channelArray = typeof channels === 'string' ? [channels] : channels;\n channelArray.forEach(channel => this.realtime.channels.add(channel));\n const counter = this.realtime.subscriptionsCounter++;\n this.realtime.subscriptions.set(counter, {\n channels: channelArray,\n callback\n });\n this.realtime.connect();\n return () => {\n this.realtime.subscriptions.delete(counter);\n this.realtime.cleanUp(channelArray);\n this.realtime.connect();\n };\n }\n prepareRequest(method, url, headers = {}, params = {}) {\n method = method.toUpperCase();\n headers = Object.assign({}, this.headers, headers);\n if (typeof window !== 'undefined' && window.localStorage) {\n const cookieFallback = window.localStorage.getItem('cookieFallback');\n if (cookieFallback) {\n headers['X-Fallback-Cookies'] = cookieFallback;\n }\n }\n let options = {\n method,\n headers,\n };\n if (method === 'GET') {\n for (const [key, value] of Object.entries(Client.flatten(params))) {\n url.searchParams.append(key, value);\n }\n }\n else {\n switch (headers['content-type']) {\n case 'application/json':\n options.body = JSON.stringify(params);\n break;\n case 'multipart/form-data':\n const formData = new FormData();\n for (const [key, value] of Object.entries(params)) {\n if (value instanceof File) {\n formData.append(key, value, value.name);\n }\n else if (Array.isArray(value)) {\n for (const nestedValue of value) {\n formData.append(`${key}[]`, nestedValue);\n }\n }\n else {\n formData.append(key, value);\n }\n }\n options.body = formData;\n delete headers['content-type'];\n break;\n }\n }\n return { uri: url.toString(), options };\n }\n chunkedUpload(method_1, url_1) {\n return __awaiter(this, arguments, void 0, function* (method, url, headers = {}, originalPayload = {}, onProgress) {\n const file = Object.values(originalPayload).find((value) => value instanceof File);\n if (file.size <= Client.CHUNK_SIZE) {\n return yield this.call(method, url, headers, originalPayload);\n }\n let start = 0;\n let response = null;\n while (start < file.size) {\n let end = start + Client.CHUNK_SIZE; // Prepare end for the next chunk\n if (end >= file.size) {\n end = file.size; // Adjust for the last chunk to include the last byte\n }\n headers['content-range'] = `bytes ${start}-${end - 1}/${file.size}`;\n const chunk = file.slice(start, end);\n let payload = Object.assign(Object.assign({}, originalPayload), { file: new File([chunk], file.name) });\n response = yield this.call(method, url, headers, payload);\n if (onProgress && typeof onProgress === 'function') {\n onProgress({\n $id: response.$id,\n progress: Math.round((end / file.size) * 100),\n sizeUploaded: end,\n chunksTotal: Math.ceil(file.size / Client.CHUNK_SIZE),\n chunksUploaded: Math.ceil(end / Client.CHUNK_SIZE)\n });\n }\n if (response && response.$id) {\n headers['x-realmocean-id'] = response.$id;\n }\n start = end;\n }\n return response;\n });\n }\n call(method_1, url_1) {\n return __awaiter(this, arguments, void 0, function* (method, url, headers = {}, params = {}, responseType = 'json') {\n var _a;\n const { uri, options } = this.prepareRequest(method, url, headers, params);\n let data = null;\n const response = yield fetch(uri, options);\n const warnings = response.headers.get('x-realmocean-warning');\n if (warnings) {\n warnings.split(';').forEach((warning) => console.warn('Warning: ' + warning));\n }\n if ((_a = response.headers.get('content-type')) === null || _a === void 0 ? void 0 : _a.includes('application/json')) {\n data = yield response.json();\n }\n else if (responseType === 'arrayBuffer') {\n data = yield response.arrayBuffer();\n }\n else {\n data = {\n message: yield response.text()\n };\n }\n if (400 <= response.status) {\n throw new AppcondaException(data === null || data === void 0 ? void 0 : data.message, response.status, data === null || data === void 0 ? void 0 : data.type, data);\n }\n const cookieFallback = response.headers.get('X-Fallback-Cookies');\n if (typeof window !== 'undefined' && window.localStorage && cookieFallback) {\n window.console.warn('Appconda is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');\n window.localStorage.setItem('cookieFallback', cookieFallback);\n }\n return data;\n });\n }\n static flatten(data, prefix = '') {\n let output = {};\n for (const [key, value] of Object.entries(data)) {\n let finalKey = prefix ? prefix + '[' + key + ']' : key;\n if (Array.isArray(value)) {\n output = Object.assign(Object.assign({}, output), Client.flatten(value, finalKey));\n }\n else {\n output[finalKey] = value;\n }\n }\n return output;\n }\n}\nClient.CHUNK_SIZE = 1024 * 1024 * 5;\n\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/client.ts?");
|
|
39
30
|
|
|
40
31
|
/***/ }),
|
|
41
32
|
|
|
42
|
-
/***/ "./src/
|
|
43
|
-
|
|
44
|
-
!*** ./src/
|
|
45
|
-
|
|
33
|
+
/***/ "./src/enums/authentication-factor.ts":
|
|
34
|
+
/*!********************************************!*\
|
|
35
|
+
!*** ./src/enums/authentication-factor.ts ***!
|
|
36
|
+
\********************************************/
|
|
46
37
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
47
38
|
|
|
48
|
-
"
|
|
49
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"client\": () => (/* binding */ client),\n/* harmony export */ \"getClient\": () => (/* binding */ getClient),\n/* harmony export */ \"Services\": () => (/* binding */ Services)\n/* harmony export */ });\n/* harmony import */ var _metrics__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../metrics */ \"./src/metrics/index.ts\");\n/* harmony import */ var _sdk_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../sdk-console */ \"./src/sdk-console/index.ts\");\n/* harmony import */ var _sdk_console_services_qdms__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../sdk-console/services/qdms */ \"./src/sdk-console/services/qdms.ts\");\n\n\n\nvar url = location.port != null ? \"\".concat(location.protocol, \"//\").concat(location.hostname, \":\").concat(location.port, \"/v1\")\n : \"\".concat(location.protocol, \"//\").concat(location.hostname, \"/v1\");\nvar client = new _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Client()\n .setEndpoint(url);\nclient.setEndpointRealtime('ws://localhost:9505/v1');\nvar getClient = function () {\n return client;\n};\nclient.subscribe('console', function (response) {\n // Callback will be executed on all account events.\n console.log(response);\n});\n_metrics__WEBPACK_IMPORTED_MODULE_0__.PerformanceAgent.install({\n token: 'realmocean',\n ingestUrl: url + '/perf'\n});\nvar Services = {\n Client: client,\n Accounts: new _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Account(client),\n Projects: new _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Projects(client),\n Teams: new _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Teams(client),\n Users: new _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Users(client),\n Databases: new _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Databases(client),\n QDMS: new _sdk_console_services_qdms__WEBPACK_IMPORTED_MODULE_2__.QDMS(client),\n Storage: new _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Storage(client)\n};\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/brokers/CelminoProvider.ts?");
|
|
39
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AuthenticationFactor\": () => (/* binding */ AuthenticationFactor)\n/* harmony export */ });\nvar AuthenticationFactor;\n(function (AuthenticationFactor) {\n AuthenticationFactor[\"Email\"] = \"email\";\n AuthenticationFactor[\"Phone\"] = \"phone\";\n AuthenticationFactor[\"Totp\"] = \"totp\";\n AuthenticationFactor[\"Recoverycode\"] = \"recoverycode\";\n})(AuthenticationFactor || (AuthenticationFactor = {}));\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/enums/authentication-factor.ts?");
|
|
50
40
|
|
|
51
41
|
/***/ }),
|
|
52
42
|
|
|
53
|
-
/***/ "./src/
|
|
54
|
-
|
|
55
|
-
!*** ./src/
|
|
56
|
-
|
|
43
|
+
/***/ "./src/enums/authenticator-type.ts":
|
|
44
|
+
/*!*****************************************!*\
|
|
45
|
+
!*** ./src/enums/authenticator-type.ts ***!
|
|
46
|
+
\*****************************************/
|
|
57
47
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
58
48
|
|
|
59
|
-
"
|
|
60
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Services\": () => (/* reexport safe */ _brokers_CelminoProvider__WEBPACK_IMPORTED_MODULE_0__.Services),\n/* harmony export */ \"client\": () => (/* reexport safe */ _brokers_CelminoProvider__WEBPACK_IMPORTED_MODULE_0__.client),\n/* harmony export */ \"getClient\": () => (/* reexport safe */ _brokers_CelminoProvider__WEBPACK_IMPORTED_MODULE_0__.getClient),\n/* harmony export */ \"Account\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Account),\n/* harmony export */ \"AppletBase\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.AppletBase),\n/* harmony export */ \"Assistant\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Assistant),\n/* harmony export */ \"Avatars\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Avatars),\n/* harmony export */ \"Client\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Client),\n/* harmony export */ \"Console\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Console),\n/* harmony export */ \"CspBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.CspBroker),\n/* harmony export */ \"Databases\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Databases),\n/* harmony export */ \"EmailBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.EmailBroker),\n/* harmony export */ \"EncryptionBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.EncryptionBroker),\n/* harmony export */ \"Functions\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Functions),\n/* harmony export */ \"GithubBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.GithubBroker),\n/* harmony export */ \"GooleDriveBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.GooleDriveBroker),\n/* harmony export */ \"Graphql\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Graphql),\n/* harmony export */ \"Health\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Health),\n/* harmony export */ \"ID\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.ID),\n/* harmony export */ \"JiraBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.JiraBroker),\n/* harmony export */ \"Locale\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Locale),\n/* harmony export */ \"LogManagementApplet\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.LogManagementApplet),\n/* harmony export */ \"Migrations\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Migrations),\n/* harmony export */ \"MiningBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.MiningBroker),\n/* harmony export */ \"Permission\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Permission),\n/* harmony export */ \"Project\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Project),\n/* harmony export */ \"Projects\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Projects),\n/* harmony export */ \"ProxyService\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.ProxyService),\n/* harmony export */ \"QdmsBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.QdmsBroker),\n/* harmony export */ \"Query\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Query),\n/* harmony export */ \"RealmoceanException\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException),\n/* harmony export */ \"RegistryBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.RegistryBroker),\n/* harmony export */ \"Role\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Role),\n/* harmony export */ \"SchemaBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.SchemaBroker),\n/* harmony export */ \"ServiceBroker\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.ServiceBroker),\n/* harmony export */ \"ServiceNames\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.ServiceNames),\n/* harmony export */ \"Storage\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Storage),\n/* harmony export */ \"TaskManagement\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.TaskManagement),\n/* harmony export */ \"Teams\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Teams),\n/* harmony export */ \"Users\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Users),\n/* harmony export */ \"Vcs\": () => (/* reexport safe */ _sdk_console__WEBPACK_IMPORTED_MODULE_1__.Vcs),\n/* harmony export */ \"setUpProject\": () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_2__.setUpProject),\n/* harmony export */ \"CONSTANTS\": () => (/* reexport safe */ _metrics__WEBPACK_IMPORTED_MODULE_3__.CONSTANTS),\n/* harmony export */ \"PerformanceAgent\": () => (/* reexport safe */ _metrics__WEBPACK_IMPORTED_MODULE_3__.PerformanceAgent)\n/* harmony export */ });\n/* harmony import */ var _brokers_CelminoProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./brokers/CelminoProvider */ \"./src/brokers/CelminoProvider.ts\");\n/* harmony import */ var _sdk_console__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sdk-console */ \"./src/sdk-console/index.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/utils/index.ts\");\n/* harmony import */ var _metrics__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./metrics */ \"./src/metrics/index.ts\");\n\n\n\n\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/index.ts?");
|
|
49
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AuthenticatorType\": () => (/* binding */ AuthenticatorType)\n/* harmony export */ });\nvar AuthenticatorType;\n(function (AuthenticatorType) {\n AuthenticatorType[\"Totp\"] = \"totp\";\n})(AuthenticatorType || (AuthenticatorType = {}));\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/enums/authenticator-type.ts?");
|
|
61
50
|
|
|
62
51
|
/***/ }),
|
|
63
52
|
|
|
64
|
-
/***/ "./src/
|
|
53
|
+
/***/ "./src/enums/browser.ts":
|
|
65
54
|
/*!******************************!*\
|
|
66
|
-
!*** ./src/
|
|
55
|
+
!*** ./src/enums/browser.ts ***!
|
|
67
56
|
\******************************/
|
|
68
57
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
69
58
|
|
|
70
|
-
"
|
|
71
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Agent\": () => (/* binding */ Agent)\n/* harmony export */ });\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! . */ \"./src/metrics/index.ts\");\n/* harmony import */ var _ApiObserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ApiObserver */ \"./src/metrics/ApiObserver.ts\");\n/* harmony import */ var _ErrorObserver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ErrorObserver */ \"./src/metrics/ErrorObserver.ts\");\n/* harmony import */ var _EventObserver__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./EventObserver */ \"./src/metrics/EventObserver.ts\");\n/* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Logger */ \"./src/metrics/Logger.ts\");\n/* harmony import */ var _PageService__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PageService */ \"./src/metrics/PageService.ts\");\n/* harmony import */ var _ResourceService__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ResourceService */ \"./src/metrics/ResourceService.ts\");\n/* harmony import */ var _Session__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Session */ \"./src/metrics/Session.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ \"./src/metrics/utils.ts\");\n/* harmony import */ var _WebVitalsObserver__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./WebVitalsObserver */ \"./src/metrics/WebVitalsObserver.ts\");\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\n\n\n\n\n\n\n\n\nvar MAX_SENDS = 60; // we send every minute, so this is sending for an hour.\nvar Agent = /** @class */ (function () {\n function Agent(options) {\n var _this = this;\n this.timeOrigin = null;\n this.pageService = new _PageService__WEBPACK_IMPORTED_MODULE_5__.PageService();\n this.resourceService = new _ResourceService__WEBPACK_IMPORTED_MODULE_6__.ResourceService();\n this.shutdownSend = false;\n this.sendCount = 0;\n this.pageViewId = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.newTimeId)();\n this.sessionId = _Session__WEBPACK_IMPORTED_MODULE_7__.Session.getSessionId();\n this.user = null;\n this.metadata = {};\n this.getIngestUrl = function () { return \"\".concat(_this.options.ingestUrl, \"?token=\").concat(_this.options.token, \"&v=\").concat(___WEBPACK_IMPORTED_MODULE_0__.CONSTANTS.VERSION); };\n this.hasSentMeasures = false;\n this.sendBeacon = function () {\n try {\n var payload = _this.getPayload(true);\n payload.source = \"beacon\";\n // On really slow pages sometimes we don't have a duration yet, just drop.\n if (payload.page && payload.page.duration == 0) {\n return;\n }\n if (navigator.sendBeacon && _this.payloadHasData(payload)) {\n _this.clearPayloadAfterSend(payload);\n var url = _this.getIngestUrl();\n var data = JSON.stringify(payload);\n if (data.length > 60000) {\n payload = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.trimPayload)(payload, data.length);\n data = JSON.stringify(payload);\n }\n try {\n navigator.sendBeacon(url, data);\n }\n catch (e) { /* Something broke the browser beacon API */ }\n }\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_4__.Logger.error(e);\n }\n };\n // NOTE Safari <12 has performance but not `getEntriesByType`\n if (!self.performance || !self.performance.getEntriesByType || !(0,_utils__WEBPACK_IMPORTED_MODULE_8__.isURLSupported)()) {\n return;\n }\n // NOTE Mobile Safari <=7 and other old mobile browsers have a performance\n // object but no timings.\n var navEntry = performance.getEntriesByType(\"navigation\") || [];\n if (!(0,_utils__WEBPACK_IMPORTED_MODULE_8__.isWorker)() && !navEntry.length && !performance.timing) {\n return;\n }\n // IE11 doesn't support Object.assign, so here is a naive polyfill for our use-case.\n this.options = Object.keys(Agent.defaults).reduce(function (result, key) {\n result[key] = options[key] || Agent.defaults[key];\n return result;\n }, {});\n // NOTE Safari doesn't support timeOrigin yet. It doesn't have timing in workers.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Performance/timeOrigin\n this.timeOrigin = performance.timeOrigin || (performance.timing || {}).navigationStart || new Date().getTime();\n this.urlGroup = this.options.urlGroup;\n _ApiObserver__WEBPACK_IMPORTED_MODULE_1__.ApiObserver.install(this.options);\n _EventObserver__WEBPACK_IMPORTED_MODULE_3__.EventObserver.install(this.options);\n _ErrorObserver__WEBPACK_IMPORTED_MODULE_2__.ErrorObserver.install(this.options);\n this.manageResourceBuffer();\n (function (ready) {\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_8__.isWorker)() || document.readyState === \"complete\") {\n ready();\n }\n else {\n document.addEventListener('readystatechange', function (event) {\n if (document.readyState === \"complete\") {\n ready();\n }\n });\n }\n })(function () {\n try {\n _this.webVitalsObserver = new _WebVitalsObserver__WEBPACK_IMPORTED_MODULE_9__.WebVitalsObserver();\n _Session__WEBPACK_IMPORTED_MODULE_7__.Session.refreshSession();\n setTimeout(function () { return _this.checkAndSend(); }, 20000);\n setInterval(function () { return _this.checkAndSend(); }, 60 * 1000);\n self.addEventListener(\"pagehide\", function () {\n _EventObserver__WEBPACK_IMPORTED_MODULE_3__.EventObserver.addEvent({\n name: \"page_leave\",\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_8__.roundToDecimal)(performance.now()),\n pageUrl: self.location.toString()\n });\n _this.sendBeacon();\n });\n self.addEventListener(\"visibilitychange\", function () {\n if (!(0,_utils__WEBPACK_IMPORTED_MODULE_8__.isWorker)() && document.visibilityState === 'hidden') {\n _this.sendBeacon();\n }\n else if (!(0,_utils__WEBPACK_IMPORTED_MODULE_8__.isWorker)() && document.visibilityState === 'visible') {\n _this.sessionId = _Session__WEBPACK_IMPORTED_MODULE_7__.Session.getSessionId();\n }\n });\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_4__.Logger.error(e);\n }\n });\n }\n Agent.prototype.identify = function (userId, identifyOptions) {\n userId = userId === null || userId === void 0 ? void 0 : userId.toString();\n identifyOptions = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.trimMetadata)(identifyOptions);\n this.user = __assign({ userId: userId }, identifyOptions);\n };\n Agent.prototype.sendEvent = function (eventName, metadata, time) {\n if (time === void 0) { time = null; }\n var isConversion = undefined;\n var conversionValue = undefined;\n if (metadata === null || metadata === void 0 ? void 0 : metadata.isConversion) {\n isConversion = true;\n delete metadata.isConversion;\n if (metadata === null || metadata === void 0 ? void 0 : metadata.conversionValue) {\n conversionValue = Math.round(metadata.conversionValue);\n if (!(0,_utils__WEBPACK_IMPORTED_MODULE_8__.isNumber)(conversionValue) || isNaN(conversionValue)) {\n conversionValue = undefined;\n }\n delete metadata.conversionValue;\n }\n }\n metadata = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.trimMetadata)(metadata);\n _EventObserver__WEBPACK_IMPORTED_MODULE_3__.EventObserver.addEvent({\n name: \"custom\",\n customName: eventName,\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_8__.roundToDecimal)(time || performance.now()),\n pageUrl: self.location.toString(),\n isConversion: isConversion,\n conversionValue: conversionValue,\n metadata: metadata\n });\n };\n Agent.prototype.setUrlGroup = function (urlGroup) {\n if (!this.urlGroup && this.pageService.hasSentPage) {\n console.warn(\"Request Metrics has already sent performance data for this page load.\");\n }\n urlGroup = '' + urlGroup;\n this.urlGroup = urlGroup;\n };\n Agent.prototype.track = function (error, metadata, time) {\n if (time === void 0) { time = null; }\n metadata = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.trimMetadata)(metadata);\n _ErrorObserver__WEBPACK_IMPORTED_MODULE_2__.ErrorObserver.addError({\n name: error.name,\n message: error.message,\n stack: error.stack,\n cause: error[\"cause\"] ? (0,_utils__WEBPACK_IMPORTED_MODULE_8__.serialize)(error[\"cause\"]) : undefined,\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_8__.roundToDecimal)(time || performance.now()),\n entry: \"direct\",\n pageUrl: self.location.toString(),\n metadata: metadata\n });\n };\n Agent.prototype.addMetadata = function (metadata) {\n this.metadata = Object.assign(this.metadata, metadata);\n this.metadata = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.trimMetadata)(this.metadata);\n };\n Agent.prototype.getDevice = function () {\n try {\n if (/Mobi|Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {\n return \"mobile\";\n }\n }\n catch (e) { /* don't care */ }\n return \"desktop\";\n };\n Agent.prototype.getNetworkType = function () {\n try {\n var connection = navigator === null || navigator === void 0 ? void 0 : navigator.connection;\n if (!connection) {\n return null;\n }\n return \"\".concat(connection.effectiveType, \":\").concat(connection.downlink, \":\").concat(connection.rtt);\n }\n catch (e) {\n return null;\n }\n };\n Agent.prototype.getMeasures = function () {\n // NOTE: This is limited to only the first X seconds of measures, which\n // might not be good enough. Break this out and handle overflows and such\n // later.\n if (this.hasSentMeasures) {\n return [];\n }\n this.hasSentMeasures = true;\n try {\n return performance.getEntriesByType(\"measure\").map(function (pe) {\n return {\n name: pe.name,\n startTime: (0,_utils__WEBPACK_IMPORTED_MODULE_8__.roundToDecimal)(pe.startTime),\n duration: (0,_utils__WEBPACK_IMPORTED_MODULE_8__.roundToDecimal)(pe.duration)\n };\n });\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_4__.Logger.error(e, \"Failed to get measures\");\n return [];\n }\n };\n Agent.prototype.getPayload = function (lastChance) {\n var _a;\n if (lastChance === void 0) { lastChance = false; }\n var payload = {\n token: this.options.token,\n timeOrigin: new Date(this.timeOrigin).toISOString(),\n timeSent: new Date().toISOString(),\n device: this.getDevice(),\n pageViewId: this.pageViewId,\n sessionId: this.sessionId,\n isFirstVisit: _Session__WEBPACK_IMPORTED_MODULE_7__.Session.isFirstVisit,\n page: this.pageService.getPageEntry(),\n pageResources: this.resourceService.getPageResources(),\n vitals: (_a = this.webVitalsObserver) === null || _a === void 0 ? void 0 : _a.getVitals(),\n measures: this.getMeasures(),\n metadata: this.metadata,\n networkType: this.getNetworkType(),\n api: _ApiObserver__WEBPACK_IMPORTED_MODULE_1__.ApiObserver.getApis(lastChance),\n events: _EventObserver__WEBPACK_IMPORTED_MODULE_3__.EventObserver.getEvents(lastChance),\n errors: _ErrorObserver__WEBPACK_IMPORTED_MODULE_2__.ErrorObserver.getErrors(lastChance),\n env: {\n lang: navigator.language,\n width: (0,_utils__WEBPACK_IMPORTED_MODULE_8__.isWorker)() ? null : screen === null || screen === void 0 ? void 0 : screen.width,\n height: (0,_utils__WEBPACK_IMPORTED_MODULE_8__.isWorker)() ? null : screen === null || screen === void 0 ? void 0 : screen.height,\n dpr: (0,_utils__WEBPACK_IMPORTED_MODULE_8__.isWorker)() ? null : window === null || window === void 0 ? void 0 : window.devicePixelRatio,\n memory: navigator[\"deviceMemory\"]\n },\n urlGroup: this.urlGroup,\n user: this.user\n };\n return payload;\n };\n Agent.prototype.payloadHasData = function (payload) {\n if (this.shutdownSend) {\n return false;\n }\n if (this.sendCount >= MAX_SENDS) {\n return false;\n }\n if (!payload) {\n return false;\n }\n if (payload.page || payload.pageResources.length || payload.vitals || payload.api.length || payload.events.length || payload.errors.length) {\n return true;\n }\n return false;\n };\n Agent.prototype.shouldSendInterval = function (payload) {\n if (!this.payloadHasData(payload)) {\n return false;\n }\n if (payload.page || payload.pageResources.length || payload.vitals || (0,_utils__WEBPACK_IMPORTED_MODULE_8__.isWorker)() || payload.api.length > 0 || payload.events.length > 0 || payload.errors.length > 0) {\n return true;\n }\n return false;\n };\n Agent.prototype.checkAndSend = function () {\n var _this = this;\n try {\n var payload = this.getPayload();\n payload.source = \"polling\";\n if (!this.shouldSendInterval(payload)) {\n return;\n }\n this.clearPayloadAfterSend(payload);\n // NOTE [Todd] We used to use Fetch here, but it had a high failure rate of\n // aborted attempts that resulted in \"Failed to fetch\" warnings in TrackJS.\n // We're not entirely sure why this happens, but there are no errors with XHR.\n // This might be silently failing as well, but we don't want users seeing it\n // regardless, so sticking with XHR. FTW.\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", this.getIngestUrl());\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.addEventListener(\"load\", function () {\n if (xhr.status >= 400) {\n _this.shutdownSend = true;\n }\n });\n xhr.send(JSON.stringify(payload));\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_4__.Logger.error(e);\n }\n };\n Agent.prototype.clearPayloadAfterSend = function (payload) {\n var _a;\n this.sendCount++;\n if (payload.page) {\n this.pageService.sentPage();\n }\n if (payload.vitals) {\n (_a = this.webVitalsObserver) === null || _a === void 0 ? void 0 : _a.sentVitals();\n }\n if (payload.pageResources.length > 0) {\n this.resourceService.sentPageResources();\n }\n };\n Agent.prototype.manageResourceBuffer = function () {\n var _this = this;\n if (performance.setResourceTimingBufferSize) {\n performance.setResourceTimingBufferSize(1000);\n }\n var handleResourceTimingBufferFullEvt = function (evt) {\n _this.resourceService.cacheResources();\n performance.clearResourceTimings();\n };\n if (performance.addEventListener) {\n try {\n performance.addEventListener(\"resourcetimingbufferfull\", handleResourceTimingBufferFullEvt);\n }\n catch (e) {\n // Firefox 82 blows up when calling performance.addEventListener in a web worker.\n // For now, we're just ignoring the error and not cleaning up the buffer.\n // @see https://bugzilla.mozilla.org/show_bug.cgi?id=1674254\n }\n }\n else {\n // TODO later, pass through to other listeners?\n performance.onresourcetimingbufferfull = handleResourceTimingBufferFullEvt;\n }\n // NOTE: Maybe in the future we should clear the entry hash/lookup if we\n // are in a situation where there are lots of resources doing lots of things. AKA a shitty site.\n };\n Agent.defaults = {\n token: null,\n ingestUrl: \"https://in.realmocean.com/v1\",\n monitorSelfCalls: false,\n urlGroup: undefined\n };\n return Agent;\n}());\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/Agent.ts?");
|
|
59
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Browser\": () => (/* binding */ Browser)\n/* harmony export */ });\nvar Browser;\n(function (Browser) {\n Browser[\"AvantBrowser\"] = \"aa\";\n Browser[\"AndroidWebViewBeta\"] = \"an\";\n Browser[\"GoogleChrome\"] = \"ch\";\n Browser[\"GoogleChromeIOS\"] = \"ci\";\n Browser[\"GoogleChromeMobile\"] = \"cm\";\n Browser[\"Chromium\"] = \"cr\";\n Browser[\"MozillaFirefox\"] = \"ff\";\n Browser[\"Safari\"] = \"sf\";\n Browser[\"MobileSafari\"] = \"mf\";\n Browser[\"MicrosoftEdge\"] = \"ps\";\n Browser[\"MicrosoftEdgeIOS\"] = \"oi\";\n Browser[\"OperaMini\"] = \"om\";\n Browser[\"Opera\"] = \"op\";\n Browser[\"OperaNext\"] = \"on\";\n})(Browser || (Browser = {}));\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/enums/browser.ts?");
|
|
72
60
|
|
|
73
61
|
/***/ }),
|
|
74
62
|
|
|
75
|
-
/***/ "./src/
|
|
76
|
-
|
|
77
|
-
!*** ./src/
|
|
78
|
-
|
|
63
|
+
/***/ "./src/enums/credit-card.ts":
|
|
64
|
+
/*!**********************************!*\
|
|
65
|
+
!*** ./src/enums/credit-card.ts ***!
|
|
66
|
+
\**********************************/
|
|
79
67
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
80
68
|
|
|
81
|
-
"
|
|
82
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ApiObserver\": () => (/* binding */ ApiObserver)\n/* harmony export */ });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./src/metrics/utils.ts\");\n\nvar RM_STATE_NAME = '__rm_state__';\nvar MIN_ENTRIES_FOR_SEND = 10;\nvar _ApiObserver = /** @class */ (function () {\n function _ApiObserver() {\n var _this_1 = this;\n this.apiEntries = [];\n this.addEntry = function (entry) {\n if (!entry.url || entry.url.indexOf(\"http\") !== 0) {\n return;\n }\n if (!_this_1.options.monitorSelfCalls && entry.url.indexOf(_this_1.options.ingestUrl) === 0) {\n // We don't want to include our own ingest API in the reports.\n return;\n }\n _this_1.apiEntries.push(entry);\n };\n }\n _ApiObserver.prototype.install = function (options) {\n this.options = options;\n try {\n this.wrapFetch();\n this.wrapXhr();\n }\n catch (e) {\n /* Sometimes customers prevent us from wrapping networks (Adevinta). If that\n happens, don't blow up, just no-op. */\n }\n };\n _ApiObserver.prototype.getApis = function (lastChance) {\n if (lastChance === void 0) { lastChance = false; }\n if (lastChance || this.apiEntries.length >= MIN_ENTRIES_FOR_SEND) {\n var result = this.apiEntries;\n this.apiEntries = [];\n return result;\n }\n return [];\n };\n _ApiObserver.prototype.wrapFetch = function () {\n var _this = this;\n (0,_utils__WEBPACK_IMPORTED_MODULE_0__.patch)(__webpack_require__.g, 'fetch', function (previous) {\n return function (url, options) {\n // NOTE [Todd Gardner] the fetch method can take lots of different shapes:\n // - (string, [object])\n // - (url, [object])\n // - (Request)\n // We need to figure out what the URL and method are in the various shapes.\n var reqUrl = (url instanceof Request) ? url['url'] : url;\n var reqMethod = (url instanceof Request) ? url['method'] : (options || {})['method'] || 'GET';\n var fetching = previous.apply(__webpack_require__.g, arguments);\n fetching[RM_STATE_NAME] = {\n 'source': (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isWorker)() ? 'worker' : 'fetch',\n 'startedOn': (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(performance.now()),\n 'method': reqMethod,\n 'requestUrl': (0,_utils__WEBPACK_IMPORTED_MODULE_0__.ensureUrlIsAbsolute)(reqUrl),\n 'pageUrl': (0,_utils__WEBPACK_IMPORTED_MODULE_0__.truncateUrl)(self.location.toString())\n };\n return fetching.then(function (response) {\n var startInfo = fetching[RM_STATE_NAME];\n if (startInfo) {\n var completedOn = performance.now();\n var apiEntry = {\n 'source': startInfo.source,\n 'method': startInfo.method,\n 'startedOn': startInfo.startedOn,\n 'pageUrl': startInfo.pageUrl,\n 'duration': (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(completedOn) - startInfo.startedOn,\n 'statusCode': response.status,\n 'contentLength': response.headers.get('content-length'),\n 'contentType': response.headers.get('content-type'),\n 'url': response.url || startInfo.requestUrl\n };\n _this.addEntry(apiEntry);\n }\n return response;\n }).catch(function (err) {\n var startInfo = fetching[RM_STATE_NAME];\n if (startInfo) {\n var completedOn = performance.now();\n var apiEntry = {\n 'source': startInfo.source,\n 'method': startInfo.method,\n 'startedOn': startInfo.startedOn,\n 'pageUrl': startInfo.pageUrl,\n 'duration': (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(completedOn) - startInfo.startedOn,\n 'statusCode': 0,\n 'contentLength': null,\n 'contentType': null,\n 'url': startInfo.requestUrl\n };\n _this.addEntry(apiEntry);\n }\n throw err;\n });\n };\n });\n };\n _ApiObserver.prototype.wrapXhr = function () {\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_0__.isWorker)()) {\n return;\n }\n var _this = this;\n (0,_utils__WEBPACK_IMPORTED_MODULE_0__.patch)(XMLHttpRequest.prototype, 'open', function (previous) {\n return function (method, url) {\n var xhr = this;\n xhr[RM_STATE_NAME] = {\n 'source': 'xhr',\n 'method': method,\n 'requestUrl': (0,_utils__WEBPACK_IMPORTED_MODULE_0__.ensureUrlIsAbsolute)((url || \"\").toString())\n };\n return previous.apply(xhr, arguments);\n };\n });\n (0,_utils__WEBPACK_IMPORTED_MODULE_0__.patch)(XMLHttpRequest.prototype, 'send', function (previous) {\n return function () {\n var xhr = this;\n var startInfo = xhr[RM_STATE_NAME];\n if (!startInfo) {\n return previous.apply(xhr, arguments);\n }\n xhr[RM_STATE_NAME] = Object.assign(startInfo, {\n 'startedOn': (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(performance.now()),\n 'pageUrl': (0,_utils__WEBPACK_IMPORTED_MODULE_0__.truncateUrl)(self.location.toString())\n });\n xhr.addEventListener(\"readystatechange\", function () {\n if (xhr.readyState === 4) {\n var startInfo = xhr[RM_STATE_NAME];\n var completedOn = performance.now();\n var apiEntry = {\n 'source': startInfo.source,\n 'method': startInfo.method,\n 'startedOn': startInfo.startedOn,\n 'pageUrl': startInfo.pageUrl,\n 'duration': (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(completedOn) - startInfo.startedOn,\n 'statusCode': xhr.status,\n 'url': xhr.responseURL || startInfo.requestUrl,\n 'contentLength': xhr.getResponseHeader('content-length'),\n 'contentType': xhr.getResponseHeader('content-type')\n };\n _this.addEntry(apiEntry);\n }\n }, true);\n return previous.apply(xhr, arguments);\n };\n });\n };\n return _ApiObserver;\n}());\nvar ApiObserver = new _ApiObserver();\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/ApiObserver.ts?");
|
|
69
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CreditCard\": () => (/* binding */ CreditCard)\n/* harmony export */ });\nvar CreditCard;\n(function (CreditCard) {\n CreditCard[\"AmericanExpress\"] = \"amex\";\n CreditCard[\"Argencard\"] = \"argencard\";\n CreditCard[\"Cabal\"] = \"cabal\";\n CreditCard[\"Cencosud\"] = \"cencosud\";\n CreditCard[\"DinersClub\"] = \"diners\";\n CreditCard[\"Discover\"] = \"discover\";\n CreditCard[\"Elo\"] = \"elo\";\n CreditCard[\"Hipercard\"] = \"hipercard\";\n CreditCard[\"JCB\"] = \"jcb\";\n CreditCard[\"Mastercard\"] = \"mastercard\";\n CreditCard[\"Naranja\"] = \"naranja\";\n CreditCard[\"TarjetaShopping\"] = \"targeta-shopping\";\n CreditCard[\"UnionChinaPay\"] = \"union-china-pay\";\n CreditCard[\"Visa\"] = \"visa\";\n CreditCard[\"MIR\"] = \"mir\";\n CreditCard[\"Maestro\"] = \"maestro\";\n})(CreditCard || (CreditCard = {}));\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/enums/credit-card.ts?");
|
|
83
70
|
|
|
84
71
|
/***/ }),
|
|
85
72
|
|
|
86
|
-
/***/ "./src/
|
|
87
|
-
|
|
88
|
-
!*** ./src/
|
|
89
|
-
|
|
73
|
+
/***/ "./src/enums/execution-method.ts":
|
|
74
|
+
/*!***************************************!*\
|
|
75
|
+
!*** ./src/enums/execution-method.ts ***!
|
|
76
|
+
\***************************************/
|
|
90
77
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
91
78
|
|
|
92
|
-
"
|
|
93
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ErrorObserver\": () => (/* binding */ ErrorObserver)\n/* harmony export */ });\n/* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Logger */ \"./src/metrics/Logger.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./src/metrics/utils.ts\");\n\n\nvar MIN_ENTRIES_FOR_SEND = 1;\nvar _ErrorObserver = /** @class */ (function () {\n function _ErrorObserver() {\n this.errorEntries = [];\n }\n _ErrorObserver.prototype.install = function (options) {\n this.options = options;\n this.watchGlobal();\n this.watchPromise();\n this.wrapConsole();\n };\n _ErrorObserver.prototype.getErrors = function (lastChance) {\n if (lastChance === void 0) { lastChance = false; }\n if (lastChance || this.errorEntries.length >= MIN_ENTRIES_FOR_SEND) {\n var result = this.errorEntries;\n this.errorEntries = [];\n return result;\n }\n return [];\n };\n _ErrorObserver.prototype.addError = function (error) {\n if (error.message == null || error.message.toString().indexOf(\"Script error\") === 0) {\n return;\n }\n this.errorEntries.push(error);\n };\n _ErrorObserver.prototype.watchGlobal = function () {\n self.addEventListener(\"error\", function (errorEvent) {\n try {\n if (!errorEvent || !errorEvent.error) {\n return;\n }\n ErrorObserver.addError({\n name: errorEvent.error.name,\n message: errorEvent.error.message,\n stack: errorEvent.error.stack,\n cause: errorEvent.error.cause ? (0,_utils__WEBPACK_IMPORTED_MODULE_1__.serialize)(errorEvent.error.cause) : undefined,\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.roundToDecimal)(performance.now()),\n entry: \"global\",\n pageUrl: self.location.toString()\n });\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_0__.Logger.error(e, \"global error handler\");\n }\n });\n };\n _ErrorObserver.prototype.watchPromise = function () {\n self.addEventListener('unhandledrejection', function (evt) {\n try {\n if (!evt) {\n return;\n }\n var reason = evt.reason;\n if (reason === undefined || reason === null) {\n return;\n }\n if (!(0,_utils__WEBPACK_IMPORTED_MODULE_1__.isError)(reason)) {\n reason = new Error((0,_utils__WEBPACK_IMPORTED_MODULE_1__.serialize)(reason));\n }\n ErrorObserver.addError({\n name: reason.name,\n message: reason.message,\n stack: reason.stack,\n cause: reason.cause ? (0,_utils__WEBPACK_IMPORTED_MODULE_1__.serialize)(reason.cause) : undefined,\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.roundToDecimal)(performance.now()),\n entry: \"promise\",\n pageUrl: self.location.toString()\n });\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_0__.Logger.error(e, \"promise error handler\");\n }\n });\n };\n _ErrorObserver.prototype.wrapConsole = function () {\n (0,_utils__WEBPACK_IMPORTED_MODULE_1__.patch)(self.console, 'error', function (original) {\n return function ( /* ...args */) {\n try {\n var args = Array.prototype.slice.call(arguments);\n var error;\n if (args.length === 1 && (0,_utils__WEBPACK_IMPORTED_MODULE_1__.isError)(args[0])) {\n error = args[0];\n }\n else {\n error = new Error((args.length === 1) ? (0,_utils__WEBPACK_IMPORTED_MODULE_1__.serialize)(args[0]) : (0,_utils__WEBPACK_IMPORTED_MODULE_1__.serialize)(args));\n }\n ErrorObserver.addError({\n name: error.name,\n message: error.message,\n stack: error.stack,\n cause: error.cause ? (0,_utils__WEBPACK_IMPORTED_MODULE_1__.serialize)(error.cause) : undefined,\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.roundToDecimal)(performance.now()),\n entry: \"console\",\n pageUrl: self.location.toString()\n });\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_0__.Logger.error(e, \"console error handler\");\n }\n return original.apply(this, arguments);\n };\n });\n };\n return _ErrorObserver;\n}());\nvar ErrorObserver = new _ErrorObserver();\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/ErrorObserver.ts?");
|
|
79
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ExecutionMethod\": () => (/* binding */ ExecutionMethod)\n/* harmony export */ });\nvar ExecutionMethod;\n(function (ExecutionMethod) {\n ExecutionMethod[\"GET\"] = \"GET\";\n ExecutionMethod[\"POST\"] = \"POST\";\n ExecutionMethod[\"PUT\"] = \"PUT\";\n ExecutionMethod[\"PATCH\"] = \"PATCH\";\n ExecutionMethod[\"DELETE\"] = \"DELETE\";\n ExecutionMethod[\"OPTIONS\"] = \"OPTIONS\";\n})(ExecutionMethod || (ExecutionMethod = {}));\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/enums/execution-method.ts?");
|
|
94
80
|
|
|
95
81
|
/***/ }),
|
|
96
82
|
|
|
97
|
-
/***/ "./src/
|
|
98
|
-
|
|
99
|
-
!*** ./src/
|
|
100
|
-
|
|
83
|
+
/***/ "./src/enums/flag.ts":
|
|
84
|
+
/*!***************************!*\
|
|
85
|
+
!*** ./src/enums/flag.ts ***!
|
|
86
|
+
\***************************/
|
|
101
87
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
102
88
|
|
|
103
|
-
"
|
|
104
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"EventObserver\": () => (/* binding */ EventObserver)\n/* harmony export */ });\n/* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Logger */ \"./src/metrics/Logger.ts\");\n/* harmony import */ var _Session__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Session */ \"./src/metrics/Session.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/metrics/utils.ts\");\n\n\n\nvar MIN_ENTRIES_FOR_SEND = 1;\nvar _EventObserver = /** @class */ (function () {\n function _EventObserver() {\n var _this_1 = this;\n this.eventEntries = [];\n /**\n * Processes a click event for a valid user action and writes event to log.\n *\n * @method onDocumentClicked\n * @param {Object} evt The click event.\n */\n this.onDocumentClicked = function (evt) {\n try {\n var element = _this_1.getElementFromEvent(evt);\n if (!element || !element.tagName) {\n return;\n }\n var clickedElement = _this_1.getDescribedElement(element, \"a\") || _this_1.getDescribedElement(element, \"button\") || _this_1.getDescribedElement(element, \"input\", [\"button\", \"submit\"]);\n var inputElement = _this_1.getDescribedElement(element, \"input\", [\"checkbox\", \"radio\"]);\n if (clickedElement) {\n _this_1.writeActivityEvent(clickedElement, \"click\");\n }\n else if (inputElement) {\n _this_1.writeActivityEvent(inputElement, \"input\", inputElement.value, inputElement.checked);\n }\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_0__.Logger.error(e, \"On Document Clicked Error\");\n }\n };\n /**\n * Processes a blur event for a valid user action and writes event to log.\n *\n * @method onInputChanged\n * @param {Object} evt The click event.\n */\n this.onInputChanged = function (evt) {\n try {\n var element = _this_1.getElementFromEvent(evt);\n if (!element || !element.tagName) {\n return;\n }\n var textAreaElement = _this_1.getDescribedElement(element, \"textarea\");\n var selectElement = _this_1.getDescribedElement(element, \"select\");\n var inputElement = _this_1.getDescribedElement(element, \"input\");\n var elementToIgnore = _this_1.getDescribedElement(element, \"input\", [\"button\", \"submit\", \"hidden\", \"checkbox\", \"radio\"]);\n if (textAreaElement) {\n _this_1.writeActivityEvent(textAreaElement, \"input\", textAreaElement.value);\n }\n else if (selectElement && selectElement.options && selectElement.options.length) {\n _this_1.onSelectInputChanged(selectElement);\n }\n else if (inputElement && !elementToIgnore) {\n _this_1.writeActivityEvent(inputElement, \"input\", inputElement.value);\n }\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_0__.Logger.error(e, \"On Input Changed Error\");\n }\n };\n this.onFirstScroll = function () {\n document.removeEventListener(\"scroll\", _this_1.onFirstScroll);\n _this_1.addEvent({\n name: \"first_scroll\",\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.roundToDecimal)(performance.now()),\n pageUrl: self.location.toString()\n });\n };\n }\n _EventObserver.prototype.install = function (options) {\n this.options = options;\n this.wrapHistory();\n this.wrapActivity();\n this.addEvent({\n name: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.isWorker)() ? \"worker_init\" : \"page_view\",\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.roundToDecimal)(performance.now()),\n pageUrl: self.location.toString()\n });\n };\n _EventObserver.prototype.getEvents = function (lastChance) {\n if (lastChance === void 0) { lastChance = false; }\n if (lastChance || this.eventEntries.length >= MIN_ENTRIES_FOR_SEND) {\n var result = this.eventEntries;\n this.eventEntries = [];\n return result;\n }\n return [];\n };\n _EventObserver.prototype.addEvent = function (event) {\n _Session__WEBPACK_IMPORTED_MODULE_1__.Session.refreshSession();\n this.eventEntries.push(event);\n };\n _EventObserver.prototype.wrapActivity = function () {\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_2__.isWorker)()) {\n return;\n }\n document.addEventListener(\"click\", this.onDocumentClicked, true);\n document.addEventListener(\"blur\", this.onInputChanged, true);\n document.addEventListener(\"scroll\", this.onFirstScroll, {\n once: true,\n capture: true,\n passive: true\n });\n };\n _EventObserver.prototype.wrapHistory = function () {\n var _this_1 = this;\n if (!this.isCompatible()) {\n return;\n }\n var _this = this;\n // Popstate event will be triggered from visitor-originated actions, like\n // clicking on a hash link or using the browser forward/back buttons.\n // https://developer.mozilla.org/en-US/docs/Web/Events/popstate\n self.addEventListener('popstate', function () {\n _this_1.addEvent({\n name: \"popstate\",\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.roundToDecimal)(performance.now()),\n pageUrl: self.location.toString()\n });\n }, true);\n // pushState is the programmatic action that can be taken,\n // but will not generate a `popstate` event. We monkeypatch them to grab\n // location values immediately before and after the change.\n (0,_utils__WEBPACK_IMPORTED_MODULE_2__.patch)(history, 'pushState', function (original) {\n return function ( /* state, title, url */) {\n var result = original.apply(this, arguments);\n _this.addEvent({\n name: 'pushState',\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.roundToDecimal)(performance.now()),\n pageUrl: self.location.toString()\n });\n return result;\n };\n });\n };\n _EventObserver.prototype.isCompatible = function () {\n return !(0,_utils__WEBPACK_IMPORTED_MODULE_2__.isWorker)() &&\n !(0,_utils__WEBPACK_IMPORTED_MODULE_2__.has)(self, 'chrome.app.runtime') &&\n (0,_utils__WEBPACK_IMPORTED_MODULE_2__.has)(self, 'addEventListener') &&\n (0,_utils__WEBPACK_IMPORTED_MODULE_2__.has)(self, 'history.pushState');\n };\n /**\n * Processes a change to a select element and writes to the log.\n *\n * @method onSelectInputChanged\n * @param {Object} element The element raising the event.\n */\n _EventObserver.prototype.onSelectInputChanged = function (element) {\n if (element.multiple) {\n // NOTE: Preferred to enumerate element.selectIptions, but this property was\n // not available before IE10.\n for (var i = 0; i < element.options.length; i++) {\n if (element.options[i].selected) {\n this.writeActivityEvent(element, \"input\", element.options[i].value);\n }\n }\n }\n else if (element.selectedIndex >= 0 && element.options[element.selectedIndex]) {\n this.writeActivityEvent(element, \"input\", element.options[element.selectedIndex].value);\n }\n };\n /**\n * Writes a formatted visitor event to the log for the element.\n *\n * @method writeVisitorEvent\n * @param {Element} element The event.\n * @param {String} action The action taken on the element ('click'|'input').\n * @param {String} value The current value of the element.\n * @param {Boolean} isChecked Whether the element is currently checked.\n */\n _EventObserver.prototype.writeActivityEvent = function (element, action, value, isChecked) {\n if (this.getElementType(element) === \"password\") {\n value = undefined;\n }\n this.addEvent({\n name: action,\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_2__.roundToDecimal)(performance.now()),\n pageUrl: self.location.toString(),\n element: {\n tag: element.tagName.toLowerCase(),\n attributes: this.getElementAttributes(element),\n value: this.getMetaValue(value, isChecked),\n text: element.innerText ? (0,_utils__WEBPACK_IMPORTED_MODULE_2__.truncate)(element.innerText, 100) : ''\n }\n });\n };\n /**\n * Get the element that raised an event.\n *\n * @method getElementFromEvent\n * @param {Event} evt The event.\n */\n _EventObserver.prototype.getElementFromEvent = function (evt) {\n return evt.target || document.elementFromPoint(evt.clientX, evt.clientY);\n };\n _EventObserver.prototype.getDescribedElement = function (element, tagName, types) {\n if (element.closest) {\n element = element.closest(tagName);\n if (!element) {\n return null;\n }\n }\n else if (element.tagName.toLowerCase() !== tagName.toLowerCase()) {\n return null;\n }\n if (!types) {\n return element;\n }\n var elementType = this.getElementType(element);\n for (var i = 0; i < types.length; i++) {\n if (types[i] === elementType) {\n return element;\n }\n }\n return null;\n };\n /**\n * Get the normalized type attribute of an element.\n *\n * @method getElementType\n * @param {Element} element The element to check.\n * @returns {String} The element type.\n */\n _EventObserver.prototype.getElementType = function (element) {\n return (element.getAttribute(\"type\") || \"\").toLowerCase();\n };\n /**\n * Get the normalized map of attributes of an element.\n *\n * @method getElementAttributes\n * @param {Element} element The element to check.\n * @return {Object} Key-Value map of attributes on the element.\n */\n _EventObserver.prototype.getElementAttributes = function (element) {\n var attributes = {};\n var maxAttributes = Math.min(element.attributes.length, 10);\n for (var i = 0; i < maxAttributes; i++) {\n var attr = element['attributes'][i];\n var attrName = attr['name'];\n if (attrName.toLowerCase() != 'data-value' && attrName.toLowerCase() != 'value') {\n attributes[attr['name']] = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.truncate)(attr['value'], 50);\n }\n }\n return attributes;\n };\n /**\n * Get the metadata information about the element value (for obfuscation).\n *\n * @method getMetaValue\n * @param {String} value The actual value of the element.\n * @param {Boolean} isChecked Whether the element was checked (for radio/checkbox).\n * @returns {Object} Metadata description of the value.\n */\n _EventObserver.prototype.getMetaValue = function (value, isChecked) {\n return (value === undefined) ? undefined : {\n length: value.length,\n pattern: this.matchInputPattern(value),\n checked: isChecked\n };\n };\n /**\n * Matches a string against known character patterns.\n *\n * @method matchInputPattern\n * @param {String} value The string to match.\n * @returns {String} The name of the matched pattern.\n */\n _EventObserver.prototype.matchInputPattern = function (value) {\n if (value === \"\") {\n return \"empty\";\n }\n else if ((/^[a-z0-9!#$%&'*+=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/).test(value)) {\n return \"email\";\n }\n else if ((/^(0?[1-9]|[12][0-9]|3[01])[\\/\\-](0?[1-9]|1[012])[\\/\\-]\\d{4}$/).test(value) ||\n (/^(\\d{4}[\\/\\-](0?[1-9]|1[012])[\\/\\-]0?[1-9]|[12][0-9]|3[01])$/).test(value)) {\n return \"date\";\n }\n else if ((/^(?:(?:\\+?1\\s*(?:[.-]\\s*)?)?(?:\\(\\s*([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9])\\s*\\)|([2-9]1[02-9]|[2-9][02-8]1|[2-9][02-8][02-9]))\\s*(?:[.-]\\s*)?)?([2-9]1[02-9]|[2-9][02-9]1|[2-9][02-9]{2})\\s*(?:[.-]\\s*)?([0-9]{4})(?:\\s*(?:#|x\\.?|ext\\.?|extension)\\s*(\\d+))?$/.test(value))) {\n return \"usphone\";\n }\n else if ((/^\\s*$/).test(value)) {\n return \"whitespace\";\n }\n else if ((/^\\d*$/).test(value)) {\n return \"numeric\";\n }\n else if ((/^[a-zA-Z]*$/).test(value)) {\n return \"alpha\";\n }\n else if ((/^[a-zA-Z0-9]*$/).test(value)) {\n return \"alphanumeric\";\n }\n else {\n return \"characters\";\n }\n };\n return _EventObserver;\n}());\nvar EventObserver = new _EventObserver();\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/EventObserver.ts?");
|
|
89
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Flag\": () => (/* binding */ Flag)\n/* harmony export */ });\nvar Flag;\n(function (Flag) {\n Flag[\"Afghanistan\"] = \"af\";\n Flag[\"Angola\"] = \"ao\";\n Flag[\"Albania\"] = \"al\";\n Flag[\"Andorra\"] = \"ad\";\n Flag[\"UnitedArabEmirates\"] = \"ae\";\n Flag[\"Argentina\"] = \"ar\";\n Flag[\"Armenia\"] = \"am\";\n Flag[\"AntiguaAndBarbuda\"] = \"ag\";\n Flag[\"Australia\"] = \"au\";\n Flag[\"Austria\"] = \"at\";\n Flag[\"Azerbaijan\"] = \"az\";\n Flag[\"Burundi\"] = \"bi\";\n Flag[\"Belgium\"] = \"be\";\n Flag[\"Benin\"] = \"bj\";\n Flag[\"BurkinaFaso\"] = \"bf\";\n Flag[\"Bangladesh\"] = \"bd\";\n Flag[\"Bulgaria\"] = \"bg\";\n Flag[\"Bahrain\"] = \"bh\";\n Flag[\"Bahamas\"] = \"bs\";\n Flag[\"BosniaAndHerzegovina\"] = \"ba\";\n Flag[\"Belarus\"] = \"by\";\n Flag[\"Belize\"] = \"bz\";\n Flag[\"Bolivia\"] = \"bo\";\n Flag[\"Brazil\"] = \"br\";\n Flag[\"Barbados\"] = \"bb\";\n Flag[\"BruneiDarussalam\"] = \"bn\";\n Flag[\"Bhutan\"] = \"bt\";\n Flag[\"Botswana\"] = \"bw\";\n Flag[\"CentralAfricanRepublic\"] = \"cf\";\n Flag[\"Canada\"] = \"ca\";\n Flag[\"Switzerland\"] = \"ch\";\n Flag[\"Chile\"] = \"cl\";\n Flag[\"China\"] = \"cn\";\n Flag[\"CoteDIvoire\"] = \"ci\";\n Flag[\"Cameroon\"] = \"cm\";\n Flag[\"DemocraticRepublicOfTheCongo\"] = \"cd\";\n Flag[\"RepublicOfTheCongo\"] = \"cg\";\n Flag[\"Colombia\"] = \"co\";\n Flag[\"Comoros\"] = \"km\";\n Flag[\"CapeVerde\"] = \"cv\";\n Flag[\"CostaRica\"] = \"cr\";\n Flag[\"Cuba\"] = \"cu\";\n Flag[\"Cyprus\"] = \"cy\";\n Flag[\"CzechRepublic\"] = \"cz\";\n Flag[\"Germany\"] = \"de\";\n Flag[\"Djibouti\"] = \"dj\";\n Flag[\"Dominica\"] = \"dm\";\n Flag[\"Denmark\"] = \"dk\";\n Flag[\"DominicanRepublic\"] = \"do\";\n Flag[\"Algeria\"] = \"dz\";\n Flag[\"Ecuador\"] = \"ec\";\n Flag[\"Egypt\"] = \"eg\";\n Flag[\"Eritrea\"] = \"er\";\n Flag[\"Spain\"] = \"es\";\n Flag[\"Estonia\"] = \"ee\";\n Flag[\"Ethiopia\"] = \"et\";\n Flag[\"Finland\"] = \"fi\";\n Flag[\"Fiji\"] = \"fj\";\n Flag[\"France\"] = \"fr\";\n Flag[\"MicronesiaFederatedStatesOf\"] = \"fm\";\n Flag[\"Gabon\"] = \"ga\";\n Flag[\"UnitedKingdom\"] = \"gb\";\n Flag[\"Georgia\"] = \"ge\";\n Flag[\"Ghana\"] = \"gh\";\n Flag[\"Guinea\"] = \"gn\";\n Flag[\"Gambia\"] = \"gm\";\n Flag[\"GuineaBissau\"] = \"gw\";\n Flag[\"EquatorialGuinea\"] = \"gq\";\n Flag[\"Greece\"] = \"gr\";\n Flag[\"Grenada\"] = \"gd\";\n Flag[\"Guatemala\"] = \"gt\";\n Flag[\"Guyana\"] = \"gy\";\n Flag[\"Honduras\"] = \"hn\";\n Flag[\"Croatia\"] = \"hr\";\n Flag[\"Haiti\"] = \"ht\";\n Flag[\"Hungary\"] = \"hu\";\n Flag[\"Indonesia\"] = \"id\";\n Flag[\"India\"] = \"in\";\n Flag[\"Ireland\"] = \"ie\";\n Flag[\"IranIslamicRepublicOf\"] = \"ir\";\n Flag[\"Iraq\"] = \"iq\";\n Flag[\"Iceland\"] = \"is\";\n Flag[\"Israel\"] = \"il\";\n Flag[\"Italy\"] = \"it\";\n Flag[\"Jamaica\"] = \"jm\";\n Flag[\"Jordan\"] = \"jo\";\n Flag[\"Japan\"] = \"jp\";\n Flag[\"Kazakhstan\"] = \"kz\";\n Flag[\"Kenya\"] = \"ke\";\n Flag[\"Kyrgyzstan\"] = \"kg\";\n Flag[\"Cambodia\"] = \"kh\";\n Flag[\"Kiribati\"] = \"ki\";\n Flag[\"SaintKittsAndNevis\"] = \"kn\";\n Flag[\"SouthKorea\"] = \"kr\";\n Flag[\"Kuwait\"] = \"kw\";\n Flag[\"LaoPeopleSDemocraticRepublic\"] = \"la\";\n Flag[\"Lebanon\"] = \"lb\";\n Flag[\"Liberia\"] = \"lr\";\n Flag[\"Libya\"] = \"ly\";\n Flag[\"SaintLucia\"] = \"lc\";\n Flag[\"Liechtenstein\"] = \"li\";\n Flag[\"SriLanka\"] = \"lk\";\n Flag[\"Lesotho\"] = \"ls\";\n Flag[\"Lithuania\"] = \"lt\";\n Flag[\"Luxembourg\"] = \"lu\";\n Flag[\"Latvia\"] = \"lv\";\n Flag[\"Morocco\"] = \"ma\";\n Flag[\"Monaco\"] = \"mc\";\n Flag[\"Moldova\"] = \"md\";\n Flag[\"Madagascar\"] = \"mg\";\n Flag[\"Maldives\"] = \"mv\";\n Flag[\"Mexico\"] = \"mx\";\n Flag[\"MarshallIslands\"] = \"mh\";\n Flag[\"NorthMacedonia\"] = \"mk\";\n Flag[\"Mali\"] = \"ml\";\n Flag[\"Malta\"] = \"mt\";\n Flag[\"Myanmar\"] = \"mm\";\n Flag[\"Montenegro\"] = \"me\";\n Flag[\"Mongolia\"] = \"mn\";\n Flag[\"Mozambique\"] = \"mz\";\n Flag[\"Mauritania\"] = \"mr\";\n Flag[\"Mauritius\"] = \"mu\";\n Flag[\"Malawi\"] = \"mw\";\n Flag[\"Malaysia\"] = \"my\";\n Flag[\"Namibia\"] = \"na\";\n Flag[\"Niger\"] = \"ne\";\n Flag[\"Nigeria\"] = \"ng\";\n Flag[\"Nicaragua\"] = \"ni\";\n Flag[\"Netherlands\"] = \"nl\";\n Flag[\"Norway\"] = \"no\";\n Flag[\"Nepal\"] = \"np\";\n Flag[\"Nauru\"] = \"nr\";\n Flag[\"NewZealand\"] = \"nz\";\n Flag[\"Oman\"] = \"om\";\n Flag[\"Pakistan\"] = \"pk\";\n Flag[\"Panama\"] = \"pa\";\n Flag[\"Peru\"] = \"pe\";\n Flag[\"Philippines\"] = \"ph\";\n Flag[\"Palau\"] = \"pw\";\n Flag[\"PapuaNewGuinea\"] = \"pg\";\n Flag[\"Poland\"] = \"pl\";\n Flag[\"FrenchPolynesia\"] = \"pf\";\n Flag[\"NorthKorea\"] = \"kp\";\n Flag[\"Portugal\"] = \"pt\";\n Flag[\"Paraguay\"] = \"py\";\n Flag[\"Qatar\"] = \"qa\";\n Flag[\"Romania\"] = \"ro\";\n Flag[\"Russia\"] = \"ru\";\n Flag[\"Rwanda\"] = \"rw\";\n Flag[\"SaudiArabia\"] = \"sa\";\n Flag[\"Sudan\"] = \"sd\";\n Flag[\"Senegal\"] = \"sn\";\n Flag[\"Singapore\"] = \"sg\";\n Flag[\"SolomonIslands\"] = \"sb\";\n Flag[\"SierraLeone\"] = \"sl\";\n Flag[\"ElSalvador\"] = \"sv\";\n Flag[\"SanMarino\"] = \"sm\";\n Flag[\"Somalia\"] = \"so\";\n Flag[\"Serbia\"] = \"rs\";\n Flag[\"SouthSudan\"] = \"ss\";\n Flag[\"SaoTomeAndPrincipe\"] = \"st\";\n Flag[\"Suriname\"] = \"sr\";\n Flag[\"Slovakia\"] = \"sk\";\n Flag[\"Slovenia\"] = \"si\";\n Flag[\"Sweden\"] = \"se\";\n Flag[\"Eswatini\"] = \"sz\";\n Flag[\"Seychelles\"] = \"sc\";\n Flag[\"Syria\"] = \"sy\";\n Flag[\"Chad\"] = \"td\";\n Flag[\"Togo\"] = \"tg\";\n Flag[\"Thailand\"] = \"th\";\n Flag[\"Tajikistan\"] = \"tj\";\n Flag[\"Turkmenistan\"] = \"tm\";\n Flag[\"TimorLeste\"] = \"tl\";\n Flag[\"Tonga\"] = \"to\";\n Flag[\"TrinidadAndTobago\"] = \"tt\";\n Flag[\"Tunisia\"] = \"tn\";\n Flag[\"Turkey\"] = \"tr\";\n Flag[\"Tuvalu\"] = \"tv\";\n Flag[\"Tanzania\"] = \"tz\";\n Flag[\"Uganda\"] = \"ug\";\n Flag[\"Ukraine\"] = \"ua\";\n Flag[\"Uruguay\"] = \"uy\";\n Flag[\"UnitedStates\"] = \"us\";\n Flag[\"Uzbekistan\"] = \"uz\";\n Flag[\"VaticanCity\"] = \"va\";\n Flag[\"SaintVincentAndTheGrenadines\"] = \"vc\";\n Flag[\"Venezuela\"] = \"ve\";\n Flag[\"Vietnam\"] = \"vn\";\n Flag[\"Vanuatu\"] = \"vu\";\n Flag[\"Samoa\"] = \"ws\";\n Flag[\"Yemen\"] = \"ye\";\n Flag[\"SouthAfrica\"] = \"za\";\n Flag[\"Zambia\"] = \"zm\";\n Flag[\"Zimbabwe\"] = \"zw\";\n})(Flag || (Flag = {}));\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/enums/flag.ts?");
|
|
105
90
|
|
|
106
91
|
/***/ }),
|
|
107
92
|
|
|
108
|
-
/***/ "./src/
|
|
109
|
-
|
|
110
|
-
!*** ./src/
|
|
111
|
-
|
|
93
|
+
/***/ "./src/enums/image-format.ts":
|
|
94
|
+
/*!***********************************!*\
|
|
95
|
+
!*** ./src/enums/image-format.ts ***!
|
|
96
|
+
\***********************************/
|
|
112
97
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
113
98
|
|
|
114
|
-
"
|
|
115
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Logger\": () => (/* binding */ Logger)\n/* harmony export */ });\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! . */ \"./src/metrics/index.ts\");\n\nvar MAX_LOGGER_SENDS = 2;\nvar loggerSends = 0;\nvar Logger = {\n token: \"empty token\",\n errorCount: 0,\n tjsToken: \"8de4c78a3ec64020ab2ad15dea1ae9ff\",\n tjsApp: \"rmagent\",\n tjsVersion: \"3.6.0\",\n getErrorUrl: function () { return \"https://capture.trackjs.com/capture?token=\" + Logger.tjsToken + \"&v=\" + Logger.tjsVersion + \"&source=rm\"; },\n error: function (error, additionalInfo) {\n if (additionalInfo === void 0) { additionalInfo = null; }\n if (!___WEBPACK_IMPORTED_MODULE_0__.CONSTANTS.IS_PROD) {\n throw error;\n }\n if (loggerSends >= MAX_LOGGER_SENDS) {\n return;\n }\n var safeError = error || {};\n var message = safeError.message || \"empty\";\n var stack = safeError.stack || new Error().stack;\n Logger.errorCount++;\n var url = (self.location || \"\").toString();\n var payload = {\n \"agentPlatform\": \"browser\",\n \"console\": [{\n \"message\": JSON.stringify(error),\n \"severity\": \"log\",\n \"timestamp\": new Date().toISOString()\n }],\n \"customer\": {\n \"token\": Logger.tjsToken,\n \"application\": Logger.tjsApp,\n \"userId\": Logger.token,\n \"version\": ___WEBPACK_IMPORTED_MODULE_0__.CONSTANTS.VERSION\n },\n \"entry\": \"catch\",\n \"environment\": {\n \"originalUrl\": url,\n \"userAgent\": navigator.userAgent,\n },\n \"message\": message,\n \"url\": url,\n \"stack\": stack,\n \"timestamp\": new Date().toISOString(),\n \"version\": Logger.tjsVersion\n };\n if (additionalInfo != null) {\n payload.console.push({\n \"message\": additionalInfo,\n \"severity\": \"log\",\n \"timestamp\": new Date().toISOString()\n });\n }\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", Logger.getErrorUrl());\n xhr.send(JSON.stringify(payload));\n loggerSends++;\n }\n};\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/Logger.ts?");
|
|
99
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ImageFormat\": () => (/* binding */ ImageFormat)\n/* harmony export */ });\nvar ImageFormat;\n(function (ImageFormat) {\n ImageFormat[\"Jpg\"] = \"jpg\";\n ImageFormat[\"Jpeg\"] = \"jpeg\";\n ImageFormat[\"Gif\"] = \"gif\";\n ImageFormat[\"Png\"] = \"png\";\n ImageFormat[\"Webp\"] = \"webp\";\n})(ImageFormat || (ImageFormat = {}));\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/enums/image-format.ts?");
|
|
116
100
|
|
|
117
101
|
/***/ }),
|
|
118
102
|
|
|
119
|
-
/***/ "./src/
|
|
103
|
+
/***/ "./src/enums/image-gravity.ts":
|
|
120
104
|
/*!************************************!*\
|
|
121
|
-
!*** ./src/
|
|
105
|
+
!*** ./src/enums/image-gravity.ts ***!
|
|
122
106
|
\************************************/
|
|
123
107
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
124
108
|
|
|
125
|
-
"
|
|
126
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PageService\": () => (/* binding */ PageService)\n/* harmony export */ });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./src/metrics/utils.ts\");\n\nvar PageService = /** @class */ (function () {\n function PageService() {\n this.hasSentPage = false;\n }\n PageService.prototype.getPageEntry = function () {\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_0__.isWorker)()) {\n return null;\n }\n if (this.hasSentPage) {\n return null;\n }\n var entry = performance.getEntriesByType(\"navigation\")[0];\n var result = null;\n // NOTE Safari doesn't have a navigation entry, so we need to crawl the old Timings API\n if (!entry) {\n var timings = performance.timing;\n result = {\n url: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.truncateUrl)(self.location.toString()),\n tempFullUrl: self.location.toString(),\n referrer: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isWorker)() ? \"\" : document.referrer,\n start: 0,\n unloadTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(timings.unloadEventEnd - timings.unloadEventStart),\n redirectTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(timings.redirectEnd - timings.redirectStart),\n workerTime: 0,\n dnsTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(timings.domainLookupEnd - timings.domainLookupStart),\n // For now, sslTime includes full TCP connection time. JUST sslTime looks like this:\n //sslTime: timings.secureConnectionStart ? timings.connectEnd - timings.secureConnectionStart : 0,\n sslTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(timings.connectEnd - timings.connectStart),\n serverTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(timings.responseEnd - timings.requestStart),\n firstByteTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(timings.responseStart - timings.navigationStart),\n blockingAssetLoadTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(timings.domInteractive - timings.responseEnd),\n domInteractive: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(timings.domInteractive - timings.navigationStart),\n duration: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(timings.domComplete - timings.navigationStart),\n };\n }\n else {\n result = {\n // Sometimes entry.name contains \"document\" because of a misunderstanding in the w3 spec,\n // but we want to use it if it's a URL, since the self location might have been pushState'd.\n url: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.truncateUrl)((entry.name && entry.name.indexOf(\"http\") === 0) ? entry.name : self.location.toString()),\n tempFullUrl: entry.name.indexOf(\"http\") === 0 ? entry.name : self.location.toString(),\n referrer: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isWorker)() ? \"\" : document.referrer,\n start: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.startTime),\n unloadTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.unloadEventEnd - entry.unloadEventStart),\n redirectTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.redirectEnd - entry.redirectStart),\n workerTime: (entry.workerStart === 0) ? 0 : (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.domainLookupStart - entry.workerStart),\n dnsTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.domainLookupEnd - entry.domainLookupStart),\n // For now, sslTime includes full TCP connection time. JUST sslTime looks like this:\n //sslTime: entry.secureConnectionStart ? entry.connectEnd - entry.secureConnectionStart : 0,\n sslTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.connectEnd - entry.connectStart),\n serverTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.responseEnd - entry.requestStart),\n firstByteTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.responseStart),\n blockingAssetLoadTime: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(entry.domInteractive) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.domInteractive - entry.responseEnd) : 0,\n domInteractive: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(entry.domInteractive) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.domInteractive) : 0,\n duration: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(entry.duration),\n pageSize: entry.transferSize,\n // Status isn't in the spec, but we see it in Chrome browsers.\n statusCode: entry[\"responseStatus\"],\n proto: entry.nextHopProtocol,\n type: entry.type,\n decodedBodySize: entry.decodedBodySize,\n encodedBodySize: entry.encodedBodySize,\n deliveryType: entry[\"deliveryType\"]\n };\n }\n return result;\n };\n PageService.prototype.sentPage = function () {\n this.hasSentPage = true;\n };\n return PageService;\n}());\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/PageService.ts?");
|
|
127
|
-
|
|
128
|
-
/***/ }),
|
|
129
|
-
|
|
130
|
-
/***/ "./src/metrics/ResourceService.ts":
|
|
131
|
-
/*!****************************************!*\
|
|
132
|
-
!*** ./src/metrics/ResourceService.ts ***!
|
|
133
|
-
\****************************************/
|
|
134
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
135
|
-
|
|
136
|
-
"use strict";
|
|
137
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ResourceService\": () => (/* binding */ ResourceService)\n/* harmony export */ });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./src/metrics/utils.ts\");\n\nvar ignoredOrigins = [\n \"safeframe.googlesyndication.com\",\n \"chrome-extension:\",\n \"moz-extension:\"\n];\n// how long to watch after pageLoad for resources.\nvar RESOURCE_CAPTURE_THRESHOLD = 5000;\nvar ResourceService = /** @class */ (function () {\n function ResourceService() {\n this.hasSent = false;\n }\n ResourceService.prototype.cacheResources = function () {\n if (this.hasSent) {\n return;\n }\n ResourceService.cachedResourceTimings = ResourceService.getAllResources();\n };\n ResourceService.getAllResources = function () {\n var allResources = (ResourceService.cachedResourceTimings || []).concat(performance.getEntriesByType(\"resource\"));\n var resourceHash = {};\n allResources = allResources.filter(function (resource) {\n if (!resource || ResourceService.shouldIgnore(resource)) {\n return false;\n }\n var resourceKey = resource.name + resource.startTime;\n if (resourceHash[resourceKey]) {\n return false;\n }\n resourceHash[resourceKey] = true;\n return true;\n });\n return allResources;\n };\n ResourceService.prototype.getPageResources = function () {\n var _this = this;\n if (this.hasSent) {\n return [];\n }\n var navEntry = performance.getEntriesByType(\"navigation\")[0];\n if (!navEntry) {\n return [];\n }\n var blockingEndTime = navEntry.domInteractive;\n var clientEndTime = navEntry.duration;\n var allResources = ResourceService.getAllResources();\n var pageResourceEntries = allResources\n .map(function (pageResource) {\n var resourceType = _this.getResourceType(pageResource);\n if (resourceType === \"xhr\") {\n return null;\n }\n if (pageResource.startTime >= clientEndTime + RESOURCE_CAPTURE_THRESHOLD) {\n return null;\n }\n if (!pageResource.name || pageResource.name.startsWith(\"data:\")) {\n return null;\n }\n var stage = \"postload\";\n if (pageResource.startTime <= blockingEndTime) {\n stage = \"blocking\";\n }\n else if (pageResource.startTime <= clientEndTime) {\n stage = \"client\";\n }\n return {\n url: pageResource.name,\n type: resourceType,\n stage: stage,\n renderBlockingStatus: pageResource[\"renderBlockingStatus\"],\n proto: pageResource.nextHopProtocol,\n start: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(pageResource.startTime) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(pageResource.startTime) : null,\n duration: (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(pageResource.duration) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(pageResource.duration) : null,\n responseStatus: pageResource[\"responseStatus\"],\n transferSize: pageResource.transferSize,\n decodedBodySize: pageResource.decodedBodySize,\n encodedBodySize: pageResource.encodedBodySize,\n deliveryType: pageResource[\"deliveryType\"]\n };\n })\n .filter(function (resource) {\n return resource !== null;\n });\n return pageResourceEntries;\n };\n ResourceService.shouldIgnore = function (resource) {\n return ignoredOrigins.some(function (io) { return resource.name.toLowerCase().indexOf(io) >= 0; });\n };\n ResourceService.prototype.getResourceType = function (resource) {\n if (this.isCss(resource)) {\n return \"css\";\n }\n if (this.isImage(resource)) {\n return \"img\";\n }\n if (this.isFont(resource)) {\n return \"font\";\n }\n if (this.isScript(resource)) {\n return \"script\";\n }\n if (this.isVideo(resource)) {\n return \"video\";\n }\n if (this.isXhr(resource)) {\n return \"xhr\";\n }\n if (this.isIFrame(resource)) {\n return \"iframe\";\n }\n return \"other\";\n };\n ResourceService.prototype.isImage = function (timing) {\n if (timing.initiatorType === \"img\") {\n return true;\n }\n try {\n if (timing.initiatorType === \"css\" || timing.initiatorType === \"link\") {\n var imgExtensions = [\".jpg\", \".jpeg\", \".png\", \".gif\", \".svg\", \".raw\", \".webp\", \".heif\", \".avif\"];\n var pathname = new URL(timing.name).pathname.toLowerCase();\n return imgExtensions.some(function (imgExt) { return pathname.endsWith(imgExt); });\n }\n }\n catch (_a) { }\n return false;\n };\n ResourceService.prototype.isScript = function (timing) {\n if (timing.initiatorType === \"script\") {\n return true;\n }\n try {\n if (timing.initiatorType === \"link\" || timing.initiatorType === \"other\") {\n var pathname = new URL(timing.name).pathname.toLowerCase();\n return pathname.endsWith(\".js\");\n }\n }\n catch (_a) { }\n return false;\n };\n ResourceService.prototype.isVideo = function (timing) {\n return timing.initiatorType === \"video\";\n };\n ResourceService.prototype.isXhr = function (timing) {\n return timing.initiatorType === \"fetch\" || timing.initiatorType === \"xmlhttprequest\";\n };\n ResourceService.prototype.isIFrame = function (timing) {\n return timing.initiatorType === \"iframe\";\n };\n ResourceService.prototype.isCss = function (timing) {\n if (timing.initiatorType !== \"link\" && timing.initiatorType !== \"css\") {\n return false;\n }\n try {\n var pathname = new URL(timing.name).pathname;\n return (pathname.toLowerCase().indexOf(\"css\") >= 0);\n }\n catch (_a) { }\n return false;\n };\n ResourceService.prototype.isFont = function (timing) {\n if (timing.initiatorType !== \"link\" && timing.initiatorType !== \"css\" && timing.initiatorType !== \"other\") {\n return false;\n }\n try {\n var fontExtensions = [\".woff\", \".woff2\", \".ttf\", \".eot\", \".otf\"];\n var pathname = new URL(timing.name).pathname.toLowerCase();\n return fontExtensions.some(function (fontExt) { return pathname.endsWith(fontExt); });\n }\n catch (_a) { }\n return false;\n };\n ResourceService.prototype.isThirdParty = function (urlString) {\n try {\n var url = new URL(urlString);\n return url.origin !== self.location.origin;\n }\n catch (_a) { }\n return false;\n };\n ResourceService.prototype.sentPageResources = function () {\n this.hasSent = true;\n ResourceService.cachedResourceTimings = null;\n };\n ResourceService.cachedResourceTimings = null;\n return ResourceService;\n}());\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/ResourceService.ts?");
|
|
138
|
-
|
|
139
|
-
/***/ }),
|
|
140
|
-
|
|
141
|
-
/***/ "./src/metrics/Session.ts":
|
|
142
|
-
/*!********************************!*\
|
|
143
|
-
!*** ./src/metrics/Session.ts ***!
|
|
144
|
-
\********************************/
|
|
145
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
146
|
-
|
|
147
|
-
"use strict";
|
|
148
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Session\": () => (/* binding */ Session)\n/* harmony export */ });\n/* harmony import */ var _EventObserver__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EventObserver */ \"./src/metrics/EventObserver.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./src/metrics/utils.ts\");\n\n\nvar SESSION_KEY = '__rm_sid__';\nvar SESSION_TIMESTAMP = '__rm_sid_ts__';\nvar isFirstVisit = true;\ntry {\n isFirstVisit = !localStorage.getItem(SESSION_KEY);\n}\ncatch (e) { /* do nothing */ }\nvar Session = {\n _sessionId: 0,\n _storageDisabled: false,\n isFirstVisit: isFirstVisit,\n getSessionId: function () {\n // getSessionId is called before other browser compatibility checks, so we\n // need to short-circuit here too.\n if (!self.performance) {\n return 0;\n }\n var now = Date.now();\n var sessionTimestamp = 0;\n // storage blew up for some reason, so to prevent sending tons of session_start\n // events, let's save it off for at least the duration of this page view.\n if (this._storageDisabled && this._sessionId) {\n return this._sessionId;\n }\n try {\n this._sessionId = parseInt(localStorage.getItem(SESSION_KEY), 10);\n sessionTimestamp = parseInt(localStorage.getItem(SESSION_TIMESTAMP), 10);\n }\n catch (e) {\n this._storageDisabled = true;\n }\n if (!this._sessionId || this.isSessionExpired(now, sessionTimestamp)) {\n this._sessionId = (0,_utils__WEBPACK_IMPORTED_MODULE_1__.newTimeId)();\n // We're intentionally ignoring the case where the user leaves within the\n // session time, but comes in again with a new source. Google would create\n // a new session, we don't care (for now).\n _EventObserver__WEBPACK_IMPORTED_MODULE_0__.EventObserver.addEvent({\n name: \"session_start\",\n time: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.roundToDecimal)(performance.now()),\n pageUrl: self.location.toString(),\n referrer: (0,_utils__WEBPACK_IMPORTED_MODULE_1__.isWorker)() ? \"\" : document.referrer\n });\n try {\n localStorage.setItem(SESSION_KEY, this._sessionId.toString());\n this.refreshSession();\n }\n catch (e) {\n this._storageDisabled = true;\n }\n }\n return this._sessionId;\n },\n refreshSession: function () {\n try {\n localStorage.setItem(SESSION_TIMESTAMP, Date.now().toString());\n }\n catch (e) { /* localStorage is broken */ }\n },\n isSessionExpired: function (now, timestamp) {\n var thirtyMinutes = 1000 * 60 * 30;\n if (!timestamp) {\n return true;\n }\n return ((timestamp + thirtyMinutes) < now);\n }\n};\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/Session.ts?");
|
|
149
|
-
|
|
150
|
-
/***/ }),
|
|
151
|
-
|
|
152
|
-
/***/ "./src/metrics/WebVitalsObserver.ts":
|
|
153
|
-
/*!******************************************!*\
|
|
154
|
-
!*** ./src/metrics/WebVitalsObserver.ts ***!
|
|
155
|
-
\******************************************/
|
|
156
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
157
|
-
|
|
158
|
-
"use strict";
|
|
159
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"WebVitalsObserver\": () => (/* binding */ WebVitalsObserver)\n/* harmony export */ });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./src/metrics/utils.ts\");\n/* harmony import */ var web_vitals_attribution__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! web-vitals/attribution */ \"./node_modules/web-vitals/dist/web-vitals.attribution.js\");\n\n\nvar WebVitalsObserver = /** @class */ (function () {\n function WebVitalsObserver() {\n var _this = this;\n this.vitalsSent = false;\n this.metricQueue = {};\n this.addToQueue = function (metric) {\n _this.metricQueue[metric.name] = metric;\n };\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_0__.isWorker)()) {\n return;\n }\n try {\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_1__.onCLS)(this.addToQueue, { reportAllChanges: true });\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_1__.onFID)(this.addToQueue, { reportAllChanges: true });\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_1__.onFCP)(this.addToQueue, { reportAllChanges: true });\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_1__.onLCP)(this.addToQueue, { reportAllChanges: true });\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_1__.onINP)(this.addToQueue, { reportAllChanges: true });\n (0,web_vitals_attribution__WEBPACK_IMPORTED_MODULE_1__.onTTFB)(this.addToQueue, { reportAllChanges: true });\n }\n catch (e) {\n /* Google's library is blowing up */\n }\n }\n WebVitalsObserver.prototype.getVitals = function () {\n var _a;\n if (this.vitalsSent) {\n return null;\n }\n if (Object.keys(this.metricQueue).length === 0) {\n return null;\n }\n var resultVitals /* VitalsEntry */ = {};\n if (this.metricQueue[\"FCP\"]) {\n var fcp = this.metricQueue[\"FCP\"];\n resultVitals.fcp = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(fcp.value);\n resultVitals.fcpLoadState = (_a = fcp.attribution) === null || _a === void 0 ? void 0 : _a.loadState;\n }\n if (this.metricQueue[\"LCP\"]) {\n var lcp = this.metricQueue[\"LCP\"];\n resultVitals.lcp = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(lcp.value);\n if (lcp.attribution) {\n resultVitals.lcpElement = lcp.attribution.element;\n resultVitals.lcpUrl = lcp.attribution.url;\n resultVitals.lcpElementRenderDelay = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(lcp.attribution.elementRenderDelay) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(lcp.attribution.elementRenderDelay) : null;\n resultVitals.lcpResourceLoadDelay = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(lcp.attribution.resourceLoadDelay) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(lcp.attribution.resourceLoadDelay) : null;\n resultVitals.lcpResourceLoadTime = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(lcp.attribution.resourceLoadTime) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(lcp.attribution.resourceLoadTime) : null;\n }\n }\n if (this.metricQueue[\"CLS\"]) {\n var cls = this.metricQueue[\"CLS\"];\n resultVitals.cls = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(cls.value, 5);\n if (cls.attribution) {\n resultVitals.clsLargestShiftTarget = cls.attribution.largestShiftTarget;\n resultVitals.clsLargestShiftTime = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(cls.attribution.largestShiftTime) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(cls.attribution.largestShiftTime) : null;\n resultVitals.clsLargestShiftValue = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(cls.attribution.largestShiftValue) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(cls.attribution.largestShiftValue, 5) : null;\n resultVitals.clsLargestShiftLoadState = cls.attribution.loadState;\n }\n }\n if (this.metricQueue[\"FID\"]) {\n var fid = this.metricQueue[\"FID\"];\n resultVitals.fid = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(fid.value);\n if (fid.attribution) {\n resultVitals.fidEventTarget = fid.attribution.eventTarget;\n resultVitals.fidEventTime = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(fid.attribution.eventTime) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(fid.attribution.eventTime) : null;\n resultVitals.fidEventType = fid.attribution.eventType;\n resultVitals.fidLoadState = fid.attribution.loadState;\n }\n }\n if (this.metricQueue[\"INP\"]) {\n var inp = this.metricQueue[\"INP\"];\n resultVitals.inp = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(inp.value);\n if (inp.attribution) {\n resultVitals.inpEventTarget = inp.attribution.eventTarget;\n resultVitals.inpEventTime = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.isNumber)(inp.attribution.eventTime) ? (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(inp.attribution.eventTime) : null;\n resultVitals.inpEventType = inp.attribution.eventType;\n resultVitals.inpLoadState = inp.attribution.loadState;\n }\n }\n if (this.metricQueue[\"TTFB\"]) {\n resultVitals.ttfb = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.roundToDecimal)(this.metricQueue[\"TTFB\"].value);\n }\n // The Web-Vital lib doesn't return a CLS if it is 0, but we know we are in\n // Chrome-land because we have an LCP.\n if (resultVitals.lcp && !resultVitals.cls) {\n resultVitals.cls = 0;\n }\n return resultVitals;\n };\n WebVitalsObserver.prototype.sentVitals = function () {\n this.vitalsSent = true;\n };\n return WebVitalsObserver;\n}());\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/WebVitalsObserver.ts?");
|
|
160
|
-
|
|
161
|
-
/***/ }),
|
|
162
|
-
|
|
163
|
-
/***/ "./src/metrics/index.ts":
|
|
164
|
-
/*!******************************!*\
|
|
165
|
-
!*** ./src/metrics/index.ts ***!
|
|
166
|
-
\******************************/
|
|
167
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
168
|
-
|
|
169
|
-
"use strict";
|
|
170
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CONSTANTS\": () => (/* binding */ CONSTANTS),\n/* harmony export */ \"PerformanceAgent\": () => (/* binding */ PerformanceAgent)\n/* harmony export */ });\n/* harmony import */ var _Agent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Agent */ \"./src/metrics/Agent.ts\");\n/* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Logger */ \"./src/metrics/Logger.ts\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/metrics/utils.ts\");\n\n\n\nvar CONSTANTS = {\n IS_PROD: false,\n VERSION: '1.0'\n};\nvar PerformanceAgent = {\n __agent: null,\n version: CONSTANTS.VERSION,\n install: function (options) {\n try {\n if (PerformanceAgent.__agent) {\n console.warn(\"Request Metrics is already installed.\");\n return;\n }\n // If we are loaded in Node, or in Server-Side Rendering like NextJS\n if (typeof self === \"undefined\") {\n console.warn(\"Request Metrics does not operate in this environment.\");\n return;\n }\n if (!options || !options.token) {\n console.error(\"You must provide a token to install Request Metrics.\");\n return;\n }\n _Logger__WEBPACK_IMPORTED_MODULE_1__.Logger.token = options.token;\n PerformanceAgent.__agent = new _Agent__WEBPACK_IMPORTED_MODULE_0__.Agent(options);\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_1__.Logger.error(e);\n }\n },\n identify: function (userId, identifyOptions) {\n try {\n if (!PerformanceAgent.__agent) {\n console.warn(\"Request Metrics isn't installed.\");\n return;\n }\n if (!userId) {\n console.warn(\"You must provide a userId.\");\n return;\n }\n return PerformanceAgent.__agent.identify(userId, identifyOptions);\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_1__.Logger.error(e);\n }\n },\n sendEvent: function (eventName, metadata, time) {\n if (time === void 0) { time = null; }\n try {\n if (!PerformanceAgent.__agent) {\n console.warn(\"Request Metrics isn't installed.\");\n return;\n }\n if (!eventName) {\n console.warn(\"You must provide an event name.\");\n return;\n }\n if (metadata && (!(0,_utils__WEBPACK_IMPORTED_MODULE_2__.isObject)(metadata) || (0,_utils__WEBPACK_IMPORTED_MODULE_2__.isArray)(metadata))) {\n console.warn(\"Metadata must be an object\");\n metadata = null;\n }\n return PerformanceAgent.__agent.sendEvent(eventName, metadata, time);\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_1__.Logger.error(e);\n }\n },\n setUrlGroup: function (urlGroup) {\n try {\n if (!PerformanceAgent.__agent) {\n console.warn(\"Request Metrics isn't installed.\");\n return;\n }\n if (!urlGroup) {\n console.warn(\"You must provide a url group.\");\n return;\n }\n return PerformanceAgent.__agent.setUrlGroup(urlGroup);\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_1__.Logger.error(e);\n }\n },\n track: function (error, metadata, time) {\n if (time === void 0) { time = null; }\n try {\n if (!PerformanceAgent.__agent) {\n console.warn(\"Request Metrics isn't installed.\");\n return;\n }\n if (!(0,_utils__WEBPACK_IMPORTED_MODULE_2__.isError)(error)) {\n console.warn(\"You must provide an instance of Error\");\n return;\n }\n return PerformanceAgent.__agent.track(error, metadata, time);\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_1__.Logger.error(e);\n }\n },\n addMetadata: function (metadata) {\n try {\n if (!PerformanceAgent.__agent) {\n console.warn(\"Request Metrics isn't installed.\");\n return;\n }\n if (!metadata) {\n return;\n }\n return PerformanceAgent.__agent.addMetadata(metadata);\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_1__.Logger.error(e);\n }\n }\n};\n/*\nexport const RM = sdk;\n\n(function () {\n try {\n if (isWorker()) { return; }\n if (!document.querySelector) { return; }\n\n // Detect if we are loading from the async snippet\n if (self[\"RM\"] && self[\"RM\"]._options) {\n sdk.install(self[\"RM\"]._options);\n\n if (self[\"RM\"]._userId) {\n sdk.identify(self[\"RM\"]._userId, self[\"RM\"]._identifyOptions);\n }\n\n if (self[\"RM\"]._events) {\n self[\"RM\"]._events.forEach(eventEntry => {\n sdk.sendEvent(eventEntry.eventName, eventEntry.metadata, eventEntry.time);\n });\n }\n\n if (self[\"RM\"]._urlGroup) {\n sdk.setUrlGroup(self[\"RM\"]._urlGroup);\n }\n\n if (self[\"RM\"]._errors) {\n self[\"RM\"]._errors.forEach(errorEntry => {\n sdk.track(errorEntry.error, errorEntry.metadata, errorEntry.time);\n });\n }\n\n if (self[\"RM\"]._metadata) {\n sdk.addMetadata(self[\"RM\"]._metadata);\n }\n\n return;\n }\n\n var scriptEl = document.querySelector(\"[data-rm-token]\");\n if (!scriptEl) { return; }\n\n var token = scriptEl.getAttribute(\"data-rm-token\");\n if (!token) { return; }\n\n Logger.token = token;\n\n sdk.install({\n token: token,\n ingestUrl: scriptEl.getAttribute(\"data-rm-ingest\"),\n monitorSelfCalls: !!scriptEl.getAttribute(\"data-rm-monitor-self\"),\n urlGroup: scriptEl.getAttribute(\"data-rm-url-group\")\n });\n\n var userId = scriptEl.getAttribute(\"data-rm-userId\");\n if (userId) {\n sdk.identify(userId);\n }\n }\n catch (e: any) {\n Logger.error(e);\n }\n\n})(); */ \n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/index.ts?");
|
|
171
|
-
|
|
172
|
-
/***/ }),
|
|
173
|
-
|
|
174
|
-
/***/ "./src/metrics/utils.ts":
|
|
175
|
-
/*!******************************!*\
|
|
176
|
-
!*** ./src/metrics/utils.ts ***!
|
|
177
|
-
\******************************/
|
|
178
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
179
|
-
|
|
180
|
-
"use strict";
|
|
181
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"isWorker\": () => (/* binding */ isWorker),\n/* harmony export */ \"isURLSupported\": () => (/* binding */ isURLSupported),\n/* harmony export */ \"truncateUrl\": () => (/* binding */ truncateUrl),\n/* harmony export */ \"truncate\": () => (/* binding */ truncate),\n/* harmony export */ \"roundToDecimal\": () => (/* binding */ roundToDecimal),\n/* harmony export */ \"isFirstPartyUrl\": () => (/* binding */ isFirstPartyUrl),\n/* harmony export */ \"getTopLevelSegment\": () => (/* binding */ getTopLevelSegment),\n/* harmony export */ \"describeElement\": () => (/* binding */ describeElement),\n/* harmony export */ \"patch\": () => (/* binding */ patch),\n/* harmony export */ \"noop\": () => (/* binding */ noop),\n/* harmony export */ \"newTimeId\": () => (/* binding */ newTimeId),\n/* harmony export */ \"has\": () => (/* binding */ has),\n/* harmony export */ \"trimMetadata\": () => (/* binding */ trimMetadata),\n/* harmony export */ \"getTag\": () => (/* binding */ getTag),\n/* harmony export */ \"isElement\": () => (/* binding */ isElement),\n/* harmony export */ \"isFunction\": () => (/* binding */ isFunction),\n/* harmony export */ \"isNumber\": () => (/* binding */ isNumber),\n/* harmony export */ \"isObject\": () => (/* binding */ isObject),\n/* harmony export */ \"isString\": () => (/* binding */ isString),\n/* harmony export */ \"isArray\": () => (/* binding */ isArray),\n/* harmony export */ \"isBoolean\": () => (/* binding */ isBoolean),\n/* harmony export */ \"isError\": () => (/* binding */ isError),\n/* harmony export */ \"serialize\": () => (/* binding */ serialize),\n/* harmony export */ \"ensureUrlIsAbsolute\": () => (/* binding */ ensureUrlIsAbsolute),\n/* harmony export */ \"trimPayload\": () => (/* binding */ trimPayload)\n/* harmony export */ });\n/* harmony import */ var _Logger__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Logger */ \"./src/metrics/Logger.ts\");\n\nfunction isWorker() {\n return (typeof document === \"undefined\");\n}\nfunction isURLSupported() {\n return !!(self.URL && self.URL.prototype && ('hostname' in self.URL.prototype));\n}\nfunction truncateUrl(url) {\n url = url || \"\";\n if (url.indexOf(\"?\") >= 0) {\n url = url.split(\"?\")[0];\n }\n if (url.length >= 1000) {\n url = url.substr(0, 1000);\n }\n return url;\n}\nfunction truncate(str, length) {\n str = '' + str; // Handle cases where we might get a stringable object rather than a string.\n if (str.length <= length) {\n return str;\n }\n var truncatedLength = str.length - length;\n return str.substr(0, length) + '...{' + truncatedLength + '}';\n}\nfunction roundToDecimal(num, places) {\n if (places === void 0) { places = 0; }\n return parseFloat(num.toFixed(places));\n}\nfunction isFirstPartyUrl(url, pageUrl) {\n var tls = getTopLevelSegment(pageUrl);\n if (!tls) {\n return false;\n }\n try {\n var hostname = new URL(url).hostname;\n if (!hostname) {\n return false;\n }\n return hostname.indexOf(tls) >= 0;\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_0__.Logger.error(e, \"Problem parsing first party url: \".concat(url));\n return false;\n }\n}\nvar reservedTLDs = [\"com\", \"net\", \"gov\", \"edu\", \"org\"];\nfunction getTopLevelSegment(pageUrl) {\n try {\n if (!pageUrl || pageUrl.indexOf(\"http\") !== 0) {\n return null;\n }\n var url = new URL(pageUrl);\n var hostname = url.hostname;\n if (!hostname) {\n return null;\n }\n var segments = hostname.split(\".\");\n // ignore last segment, should be .com or whatever cute tld they use\n var firstSegment = segments.pop();\n if (firstSegment === \"localhost\") {\n return firstSegment;\n }\n if (hostname === \"127.0.0.1\") {\n return hostname;\n }\n var lastSegment = segments.pop();\n // If it's something like co.uk or mn.us\n if (lastSegment.length === 2) {\n lastSegment = segments.pop();\n }\n // Something like com.au\n if (reservedTLDs.indexOf(lastSegment) >= 0) {\n lastSegment = segments.pop();\n }\n return \"\".concat(lastSegment, \".\");\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_0__.Logger.error(e, \"Page Url: \".concat(pageUrl));\n return null;\n }\n}\nfunction describeElement(el) {\n if (!el) {\n return null;\n }\n try {\n var outerHtml = el.outerHTML;\n return outerHtml.substring(0, outerHtml.indexOf(\">\") + 1);\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_0__.Logger.error(e, \"failed to describe element\");\n return null;\n }\n}\n/**\n * patch\n * Monkeypatch a method\n *\n * @param {Object} obj The object containing the method.\n * @param {String} name The name of the method\n * @param {Function} func A function to monkeypatch into the method. Will\n * be called with the original function as the parameter.\n */\nfunction patch(obj, name, func) {\n var original = obj[name] || noop;\n obj[name] = func(original);\n}\nfunction noop() { }\nfunction newTimeId() {\n return Math.floor((Date.now() + Math.random()) * 1000);\n}\n/**\n * has\n * Examines an object if it contains a nested addressable property. for\n * example, if you want to check if window.chrome.app exists, you can\n * check with has(window, \"chrome.app\");\n */\nfunction has(obj, path) {\n try {\n var segments = path.split('.');\n var root = obj;\n for (var idx = 0; idx < segments.length; idx++) {\n if (root[segments[idx]]) {\n root = root[segments[idx]];\n }\n else {\n return false;\n }\n }\n return true;\n }\n catch (e) {\n return false;\n }\n}\nfunction trimMetadata(obj) {\n obj = obj || {};\n Object.keys(obj).forEach(function (key, i) {\n if (i > 25) {\n delete obj[key];\n }\n else {\n obj[key] = truncate(obj[key], 100);\n }\n });\n return obj;\n}\nfunction getTag(thing) {\n return Object.prototype.toString.call(thing);\n}\nfunction isElement(thing) {\n return isObject(thing) && thing['nodeType'] === 1;\n}\nfunction isFunction(thing) {\n return !!(thing && typeof thing === 'function');\n}\nfunction isNumber(thing) {\n return typeof thing === 'number' ||\n (isObject(thing) && getTag(thing) === '[object Number]');\n}\nfunction isObject(thing) {\n return !!(thing && typeof thing === 'object');\n}\nfunction isString(thing) {\n return typeof thing === 'string' ||\n (!isArray(thing) && isObject(thing) && getTag(thing) === '[object String]');\n}\nfunction isArray(thing) {\n return getTag(thing) === '[object Array]';\n}\nfunction isBoolean(thing) {\n return typeof thing === 'boolean' ||\n (isObject(thing) && getTag(thing) === '[object Boolean]');\n}\nfunction isError(thing) {\n if (!isObject(thing)) {\n return false;\n }\n var tag = getTag(thing);\n return tag === '[object Error]' ||\n tag === '[object DOMException]' ||\n (isString(thing['name']) && isString(thing['message']));\n}\nfunction serialize(thing) {\n function serializeElement(el) {\n var htmlTagResult = '<' + el.tagName.toLowerCase();\n var attributes = el['attributes'] || [];\n for (var idx = 0; idx < attributes.length; idx++) {\n htmlTagResult += ' ' + attributes[idx].name + '=\"' + attributes[idx].value + '\"';\n }\n return htmlTagResult + '>';\n }\n var STR_UNDEFINED = 'undefined';\n var STR_NAN = 'NaN';\n if (thing === '') {\n return 'Empty String';\n }\n if (thing === undefined) {\n return STR_UNDEFINED;\n }\n if (isString(thing) || isNumber(thing) || isBoolean(thing) || isFunction(thing)) {\n return '' + thing;\n }\n if (isElement(thing)) {\n return serializeElement(thing);\n }\n if (typeof thing === 'symbol') {\n return Symbol.prototype.toString.call(thing);\n }\n var result;\n try {\n result = JSON.stringify(thing, function (key, value) {\n if (value === undefined) {\n return STR_UNDEFINED;\n }\n if (isNumber(value) && isNaN(value)) {\n return STR_NAN;\n }\n // NOTE [Todd Gardner] Errors do not serialize automatically do to some\n // trickery on where the normal properties reside. So let's convert\n // it into an object that can be serialized.\n if (isError(value)) {\n return {\n 'name': value['name'],\n 'message': value['message'],\n 'stack': value['stack']\n };\n }\n if (isElement(value)) {\n return serializeElement(value);\n }\n return value;\n });\n }\n catch (e) {\n // NOTE [Todd Gardner] There were circular references inside of the thing\n // so let's fallback to a simpler serialization, just the top-level\n // keys on the thing, using only string coercion.\n var unserializableResult = '';\n for (var key in thing) {\n if (!thing.hasOwnProperty(key)) {\n continue;\n }\n try {\n unserializableResult += ',\"' + key + '\":\"' + thing[key] + '\"';\n }\n catch (e) { /* don't care */ }\n }\n result = unserializableResult ?\n '{' + unserializableResult.replace(',', '') + '}' :\n 'Unserializable Object';\n }\n // NOTE [Todd Gardner] in order to correctly capture undefined and NaN,\n // we wrote them out as strings. But they are not strings, so let's\n // remove the quotes.\n return result\n .replace(/\"undefined\"/g, STR_UNDEFINED)\n .replace(/\"NaN\"/g, STR_NAN);\n}\nfunction ensureUrlIsAbsolute(url) {\n if (!url) {\n return \"\";\n }\n url = url.toString();\n if (url.startsWith(\"http\") || isWorker()) {\n return url;\n }\n try {\n var absoluteUrl = new URL(url, document.baseURI).toString();\n return absoluteUrl;\n }\n catch (err) {\n return url;\n }\n}\nfunction trimPayload(payload, payloadLength) {\n var goalPayloadSize = 60000;\n var resourceBaseSize = 220;\n var amountToShrink = payloadLength - goalPayloadSize;\n if (payloadLength <= goalPayloadSize) {\n return payload;\n }\n try {\n var shrunkSoFar = 0;\n for (var i = payload.pageResources.length - 1; i > 0; i--) {\n if (shrunkSoFar >= amountToShrink) {\n break;\n }\n shrunkSoFar += payload.pageResources[i].url.length + resourceBaseSize;\n }\n payload.pageResources = payload.pageResources.slice(0, i);\n return payload;\n }\n catch (e) {\n _Logger__WEBPACK_IMPORTED_MODULE_0__.Logger.error(e, \"trimPayload failed\");\n return payload;\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/metrics/utils.ts?");
|
|
182
|
-
|
|
183
|
-
/***/ }),
|
|
184
|
-
|
|
185
|
-
/***/ "./src/sdk-console/applets/AppletBase.ts":
|
|
186
|
-
/*!***********************************************!*\
|
|
187
|
-
!*** ./src/sdk-console/applets/AppletBase.ts ***!
|
|
188
|
-
\***********************************************/
|
|
189
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
190
|
-
|
|
191
|
-
"use strict";
|
|
192
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AppletBase\": () => (/* binding */ AppletBase)\n/* harmony export */ });\n/* harmony import */ var _brokers_CelminoProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../brokers/CelminoProvider */ \"./src/brokers/CelminoProvider.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar AppletBase = /** @class */ (function (_super) {\n __extends(AppletBase, _super);\n function AppletBase(appId, appletId) {\n var _this = _super.call(this) || this;\n _this.setEndpoint(_this.ServiceUrl);\n _this.setHeader('x-app-id', appId);\n _this.setHeader('x-applet-id', appletId);\n return _this;\n }\n Object.defineProperty(AppletBase.prototype, \"ServiceUrl\", {\n get: function () {\n /* const url = window.location.port != null ?\n `${window.location.protocol}//${window.location.hostname}:${window.location.port}/v1/service/${this.AppletId}`\n : `${window.location.protocol}//${window.location.hostname}/v1/service/${this.AppletId}`; */\n var client = (0,_brokers_CelminoProvider__WEBPACK_IMPORTED_MODULE_0__.getClient)();\n var url = client.config.endpoint + \"/service/\".concat(this.AppletId);\n return url;\n },\n enumerable: false,\n configurable: true\n });\n AppletBase.prototype.setHeader = function (key, value) {\n this.headers[key] = value;\n };\n return AppletBase;\n}(_client__WEBPACK_IMPORTED_MODULE_1__.Client));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/applets/AppletBase.ts?");
|
|
193
|
-
|
|
194
|
-
/***/ }),
|
|
195
|
-
|
|
196
|
-
/***/ "./src/sdk-console/applets/LogManagement/LogApplet.ts":
|
|
197
|
-
/*!************************************************************!*\
|
|
198
|
-
!*** ./src/sdk-console/applets/LogManagement/LogApplet.ts ***!
|
|
199
|
-
\************************************************************/
|
|
200
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
201
|
-
|
|
202
|
-
"use strict";
|
|
203
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"LogManagementApplet\": () => (/* binding */ LogManagementApplet)\n/* harmony export */ });\n/* harmony import */ var _AppletBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../AppletBase */ \"./src/sdk-console/applets/AppletBase.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar LogManagementApplet = /** @class */ (function (_super) {\n __extends(LogManagementApplet, _super);\n function LogManagementApplet() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(LogManagementApplet.prototype, \"AppletId\", {\n get: function () {\n return 'com.appconda.service.log';\n },\n enumerable: false,\n configurable: true\n });\n LogManagementApplet.prototype.info = function (logInfo) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/info';\n payload = logInfo;\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return LogManagementApplet;\n}(_AppletBase__WEBPACK_IMPORTED_MODULE_0__.AppletBase));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/applets/LogManagement/LogApplet.ts?");
|
|
204
|
-
|
|
205
|
-
/***/ }),
|
|
206
|
-
|
|
207
|
-
/***/ "./src/sdk-console/applets/LogManagement/index.ts":
|
|
208
|
-
/*!********************************************************!*\
|
|
209
|
-
!*** ./src/sdk-console/applets/LogManagement/index.ts ***!
|
|
210
|
-
\********************************************************/
|
|
211
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
212
|
-
|
|
213
|
-
"use strict";
|
|
214
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"LogManagementApplet\": () => (/* reexport safe */ _LogApplet__WEBPACK_IMPORTED_MODULE_0__.LogManagementApplet)\n/* harmony export */ });\n/* harmony import */ var _LogApplet__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./LogApplet */ \"./src/sdk-console/applets/LogManagement/LogApplet.ts\");\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/applets/LogManagement/index.ts?");
|
|
215
|
-
|
|
216
|
-
/***/ }),
|
|
217
|
-
|
|
218
|
-
/***/ "./src/sdk-console/applets/TaskManagement/TaskManagement.ts":
|
|
219
|
-
/*!******************************************************************!*\
|
|
220
|
-
!*** ./src/sdk-console/applets/TaskManagement/TaskManagement.ts ***!
|
|
221
|
-
\******************************************************************/
|
|
222
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
223
|
-
|
|
224
|
-
"use strict";
|
|
225
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TaskManagement\": () => (/* binding */ TaskManagement)\n/* harmony export */ });\n/* harmony import */ var _AppletBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../AppletBase */ \"./src/sdk-console/applets/AppletBase.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar TaskManagement = /** @class */ (function (_super) {\n __extends(TaskManagement, _super);\n function TaskManagement() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(TaskManagement.prototype, \"AppletId\", {\n get: function () {\n return 'com.appconda.service.task';\n },\n enumerable: false,\n configurable: true\n });\n TaskManagement.prototype.create = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/setup';\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n TaskManagement.prototype.addTask = function (task) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/addTask';\n payload = task;\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return TaskManagement;\n}(_AppletBase__WEBPACK_IMPORTED_MODULE_0__.AppletBase));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/applets/TaskManagement/TaskManagement.ts?");
|
|
226
|
-
|
|
227
|
-
/***/ }),
|
|
228
|
-
|
|
229
|
-
/***/ "./src/sdk-console/applets/TaskManagement/index.ts":
|
|
230
|
-
/*!*********************************************************!*\
|
|
231
|
-
!*** ./src/sdk-console/applets/TaskManagement/index.ts ***!
|
|
232
|
-
\*********************************************************/
|
|
233
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
234
|
-
|
|
235
|
-
"use strict";
|
|
236
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TaskManagement\": () => (/* reexport safe */ _TaskManagement__WEBPACK_IMPORTED_MODULE_1__.TaskManagement)\n/* harmony export */ });\n/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./models */ \"./src/sdk-console/applets/TaskManagement/models/index.ts\");\n/* harmony import */ var _TaskManagement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TaskManagement */ \"./src/sdk-console/applets/TaskManagement/TaskManagement.ts\");\n\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/applets/TaskManagement/index.ts?");
|
|
237
|
-
|
|
238
|
-
/***/ }),
|
|
239
|
-
|
|
240
|
-
/***/ "./src/sdk-console/applets/TaskManagement/models/Task.ts":
|
|
241
|
-
/*!***************************************************************!*\
|
|
242
|
-
!*** ./src/sdk-console/applets/TaskManagement/models/Task.ts ***!
|
|
243
|
-
\***************************************************************/
|
|
244
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
245
|
-
|
|
246
|
-
"use strict";
|
|
247
|
-
eval("__webpack_require__.r(__webpack_exports__);\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/applets/TaskManagement/models/Task.ts?");
|
|
248
|
-
|
|
249
|
-
/***/ }),
|
|
250
|
-
|
|
251
|
-
/***/ "./src/sdk-console/applets/TaskManagement/models/index.ts":
|
|
252
|
-
/*!****************************************************************!*\
|
|
253
|
-
!*** ./src/sdk-console/applets/TaskManagement/models/index.ts ***!
|
|
254
|
-
\****************************************************************/
|
|
255
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
256
|
-
|
|
257
|
-
"use strict";
|
|
258
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Task__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Task */ \"./src/sdk-console/applets/TaskManagement/models/Task.ts\");\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/applets/TaskManagement/models/index.ts?");
|
|
259
|
-
|
|
260
|
-
/***/ }),
|
|
261
|
-
|
|
262
|
-
/***/ "./src/sdk-console/applets/index.ts":
|
|
263
|
-
/*!******************************************!*\
|
|
264
|
-
!*** ./src/sdk-console/applets/index.ts ***!
|
|
265
|
-
\******************************************/
|
|
266
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
267
|
-
|
|
268
|
-
"use strict";
|
|
269
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AppletBase\": () => (/* reexport safe */ _AppletBase__WEBPACK_IMPORTED_MODULE_0__.AppletBase),\n/* harmony export */ \"TaskManagement\": () => (/* reexport safe */ _TaskManagement__WEBPACK_IMPORTED_MODULE_1__.TaskManagement),\n/* harmony export */ \"LogManagementApplet\": () => (/* reexport safe */ _LogManagement__WEBPACK_IMPORTED_MODULE_2__.LogManagementApplet)\n/* harmony export */ });\n/* harmony import */ var _AppletBase__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AppletBase */ \"./src/sdk-console/applets/AppletBase.ts\");\n/* harmony import */ var _TaskManagement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TaskManagement */ \"./src/sdk-console/applets/TaskManagement/index.ts\");\n/* harmony import */ var _LogManagement__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LogManagement */ \"./src/sdk-console/applets/LogManagement/index.ts\");\n\n\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/applets/index.ts?");
|
|
109
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ImageGravity\": () => (/* binding */ ImageGravity)\n/* harmony export */ });\nvar ImageGravity;\n(function (ImageGravity) {\n ImageGravity[\"Center\"] = \"center\";\n ImageGravity[\"Topleft\"] = \"top-left\";\n ImageGravity[\"Top\"] = \"top\";\n ImageGravity[\"Topright\"] = \"top-right\";\n ImageGravity[\"Left\"] = \"left\";\n ImageGravity[\"Right\"] = \"right\";\n ImageGravity[\"Bottomleft\"] = \"bottom-left\";\n ImageGravity[\"Bottom\"] = \"bottom\";\n ImageGravity[\"Bottomright\"] = \"bottom-right\";\n})(ImageGravity || (ImageGravity = {}));\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/enums/image-gravity.ts?");
|
|
270
110
|
|
|
271
111
|
/***/ }),
|
|
272
112
|
|
|
273
|
-
/***/ "./src/
|
|
274
|
-
|
|
275
|
-
!*** ./src/
|
|
276
|
-
|
|
277
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
278
|
-
|
|
279
|
-
"use strict";
|
|
280
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"EmailBroker\": () => (/* binding */ EmailBroker)\n/* harmony export */ });\n/* harmony import */ var _ServiceBroker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ServiceBroker */ \"./src/sdk-console/brokers/ServiceBroker.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar EmailBroker = /** @class */ (function (_super) {\n __extends(EmailBroker, _super);\n function EmailBroker() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(EmailBroker.prototype, \"ServiceName\", {\n get: function () {\n return 'email';\n },\n enumerable: false,\n configurable: true\n });\n /* public setSmtpServer(host: string) {\n this.setHeader('x-smtp-server', host);\n return this;\n }\n \n public setSmtpPort(port: string) {\n this.setHeader('x-smtp-port', port);\n return this;\n }\n \n public setSmtpUserName(username: string) {\n this.setHeader('x-smtp-username', username);\n return this;\n }\n \n public setSmtpPassword(password: string) {\n this.setHeader('x-smtp-password', password);\n return this;\n } */\n EmailBroker.prototype.sendEmail = function (from_email, to_email, subject, htmlTemplate, values) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/send';\n payload = {};\n payload['form_email'] = from_email;\n payload['to_email'] = to_email;\n payload['subject'] = subject;\n payload['htmlTemplate'] = encodeURIComponent(htmlTemplate);\n payload['values'] = values;\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n EmailBroker.Default = new EmailBroker();\n return EmailBroker;\n}(_ServiceBroker__WEBPACK_IMPORTED_MODULE_0__.ServiceBroker));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/EmailBroker.ts?");
|
|
281
|
-
|
|
282
|
-
/***/ }),
|
|
283
|
-
|
|
284
|
-
/***/ "./src/sdk-console/brokers/GithubBroker.ts":
|
|
285
|
-
/*!*************************************************!*\
|
|
286
|
-
!*** ./src/sdk-console/brokers/GithubBroker.ts ***!
|
|
287
|
-
\*************************************************/
|
|
288
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
289
|
-
|
|
290
|
-
"use strict";
|
|
291
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"GithubBroker\": () => (/* binding */ GithubBroker)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar url = window.location.port != null ?\n \"\".concat(window.location.protocol, \"//\").concat(window.location.hostname, \":\").concat(window.location.port, \"/v1/service/github\")\n : \"\".concat(window.location.protocol, \"//\").concat(window.location.hostname, \"/v1/service/github\");\nvar GithubBroker = /** @class */ (function (_super) {\n __extends(GithubBroker, _super);\n function GithubBroker() {\n var _this = _super.call(this) || this;\n _this.headers = {\n 'x-github-username': 'Console',\n 'x-github-repo': 'console',\n 'x-github-token': 'web'\n };\n _this.setEndpoint(url);\n return _this;\n }\n Object.defineProperty(GithubBroker, \"Default\", {\n get: function () {\n return new GithubBroker();\n },\n enumerable: false,\n configurable: true\n });\n GithubBroker.prototype.setUserName = function (value) {\n this.headers['x-github-username'] = value;\n return this;\n };\n GithubBroker.prototype.setRepo = function (value) {\n this.headers['x-github-repo'] = value;\n return this;\n };\n GithubBroker.prototype.setToken = function (value) {\n this.headers['x-github-token'] = value;\n return this;\n };\n GithubBroker.prototype.createIssue = function (issue) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof issue === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.RealmoceanException('Missing required parameter: \"issue\"');\n }\n path = '/issue/create';\n payload = {};\n payload['issue'] = issue;\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('post', uri, {\n 'content-type': 'application/x-www-form-urlencoded'\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return GithubBroker;\n}(_client__WEBPACK_IMPORTED_MODULE_0__.Client));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/GithubBroker.ts?");
|
|
292
|
-
|
|
293
|
-
/***/ }),
|
|
294
|
-
|
|
295
|
-
/***/ "./src/sdk-console/brokers/GoogleDriveBroker.ts":
|
|
296
|
-
/*!******************************************************!*\
|
|
297
|
-
!*** ./src/sdk-console/brokers/GoogleDriveBroker.ts ***!
|
|
298
|
-
\******************************************************/
|
|
299
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
300
|
-
|
|
301
|
-
"use strict";
|
|
302
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"GooleDriveBroker\": () => (/* binding */ GooleDriveBroker)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nfunction receiveMessage(event) {\n console.log(event);\n}\nfunction windowPopup(width, height, url, title, win) {\n if (typeof width !== 'number' || typeof height !== 'number') {\n throw new TypeError('Width and height must be numbers');\n }\n if (typeof url !== 'string') {\n throw new TypeError('Url must be string');\n }\n if ((typeof title !== 'string') && (typeof title !== 'undefined')) {\n throw new TypeError('Title must be string');\n }\n win = win || window;\n title = title || '';\n var left = (win.outerWidth / 2) + (win.screenX || win.screenLeft || 0) - (width / 2);\n var top = (win.outerHeight / 2) + (win.screenY || win.screenTop || 0) - (height / 2);\n return win.open(url, title, 'toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=' + width + ', height=' + height + ', top=' + top + ', left=' + left);\n}\nvar url = window.location.port != null ?\n \"\".concat(window.location.protocol, \"//\").concat(window.location.hostname, \":\").concat(window.location.port, \"/v1/service/google\")\n : \"\".concat(window.location.protocol, \"//\").concat(window.location.hostname, \"/v1/service/google\");\nvar GooleDriveBroker = /** @class */ (function (_super) {\n __extends(GooleDriveBroker, _super);\n function GooleDriveBroker() {\n var _this = _super.call(this) || this;\n _this.headers = {\n 'x-google-drive-token': null\n };\n _this.setEndpoint(url);\n return _this;\n }\n GooleDriveBroker.prototype.setToken = function (value) {\n this.headers['x-google-drive-token'] = value;\n return this;\n };\n GooleDriveBroker.prototype.listFiles = function () {\n return __awaiter(this, arguments, void 0, function (parentId, token) {\n var token_1, path, payload, uri;\n if (parentId === void 0) { parentId = 'root'; }\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (token != null) {\n this.setToken(token);\n }\n if (!(this.headers['x-google-drive-token'] == null)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.getUserToken()];\n case 1:\n token_1 = _a.sent();\n this.setToken(token_1);\n _a.label = 2;\n case 2:\n path = '/files/' + parentId;\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 3: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n GooleDriveBroker.prototype.listFolders = function () {\n return __awaiter(this, arguments, void 0, function (parentId, token) {\n var token_2, path, payload, uri;\n if (parentId === void 0) { parentId = 'root'; }\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (token != null) {\n this.setToken(token);\n }\n if (!(this.headers['x-google-drive-token'] == null)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.getUserToken()];\n case 1:\n token_2 = _a.sent();\n this.setToken(token_2);\n _a.label = 2;\n case 2:\n path = '/folders/' + parentId;\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 3: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n GooleDriveBroker.prototype.listChild = function (parentId) {\n return __awaiter(this, void 0, void 0, function () {\n var token, path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(this.headers['x-google-drive-token'] == null)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.getUserToken()];\n case 1:\n token = _a.sent();\n this.setToken(token);\n _a.label = 2;\n case 2:\n path = '/folder/' + parentId;\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 3: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n GooleDriveBroker.prototype.getUserToken = function () {\n return new Promise(function (resolve, reject) {\n var access_token = '';\n // window.removeEventListener('message', receiveMessage);\n var popup = windowPopup(800, 600, url, \"Google Drive Authenticate\");\n function receiveMessage(event) {\n if (event.data.message === 'google-drive') {\n window.removeEventListener('message', receiveMessage);\n resolve(event.data.token);\n }\n }\n window.addEventListener('message', receiveMessage, false);\n /* const checkPopup = setInterval(() => {\n if (popup.window.location.href.includes(\"CLOSE\")) {\n const searchParams = new URLSearchParams(decodeURI(popup.window.location.search));\n if (searchParams.get('CLOSE') === 'true') {\n access_token = searchParams.get('access_token');\n resolve(access_token);\n popup.close();\n }\n }\n if (!popup || !popup.closed) return;\n clearInterval(checkPopup);\n \n }, 10); */\n });\n };\n GooleDriveBroker.Default = new GooleDriveBroker();\n return GooleDriveBroker;\n}(_client__WEBPACK_IMPORTED_MODULE_0__.Client));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/GoogleDriveBroker.ts?");
|
|
303
|
-
|
|
304
|
-
/***/ }),
|
|
305
|
-
|
|
306
|
-
/***/ "./src/sdk-console/brokers/QdmsBroker.ts":
|
|
307
|
-
/*!***********************************************!*\
|
|
308
|
-
!*** ./src/sdk-console/brokers/QdmsBroker.ts ***!
|
|
309
|
-
\***********************************************/
|
|
310
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
311
|
-
|
|
312
|
-
"use strict";
|
|
313
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"QdmsBroker\": () => (/* binding */ QdmsBroker)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar url = window.location.port != null ?\n \"\".concat(window.location.protocol, \"//\").concat(window.location.hostname, \":\").concat(window.location.port, \"/v1/service/qdms\")\n : \"\".concat(window.location.protocol, \"//\").concat(window.location.hostname, \"/v1/service/qdms\");\nvar QdmsBroker = /** @class */ (function (_super) {\n __extends(QdmsBroker, _super);\n function QdmsBroker() {\n var _this = _super.call(this) || this;\n _this.headers = {\n 'x-qdms-url': null,\n 'x-qdms-token': null\n };\n _this.setEndpoint(url);\n return _this;\n }\n QdmsBroker.GetToken = function (url, user, password) {\n return __awaiter(this, void 0, void 0, function () {\n var _;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _ = new QdmsBroker();\n return [4 /*yield*/, _.getToken(url, user, password)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Object.defineProperty(QdmsBroker, \"Default\", {\n get: function () {\n return new QdmsBroker();\n },\n enumerable: false,\n configurable: true\n });\n QdmsBroker.prototype.setUrl = function (value) {\n this.headers['x-qdms-url'] = value;\n return this;\n };\n QdmsBroker.prototype.setToken = function (value) {\n this.headers['x-qdms-token'] = value;\n return this;\n };\n QdmsBroker.prototype.getToken = function (url, user, password) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.RealmoceanException('Missing required parameter: \"url\"');\n }\n if (typeof user === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.RealmoceanException('Missing required parameter: \"user\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/token';\n payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof user !== 'undefined') {\n payload['user'] = user;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n QdmsBroker.prototype.listUsers = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/users';\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return QdmsBroker;\n}(_client__WEBPACK_IMPORTED_MODULE_0__.Client));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/QdmsBroker.ts?");
|
|
314
|
-
|
|
315
|
-
/***/ }),
|
|
316
|
-
|
|
317
|
-
/***/ "./src/sdk-console/brokers/ServiceBroker.ts":
|
|
318
|
-
/*!**************************************************!*\
|
|
319
|
-
!*** ./src/sdk-console/brokers/ServiceBroker.ts ***!
|
|
320
|
-
\**************************************************/
|
|
321
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
322
|
-
|
|
323
|
-
"use strict";
|
|
324
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ServiceBroker\": () => (/* binding */ ServiceBroker)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar ServiceBroker = /** @class */ (function (_super) {\n __extends(ServiceBroker, _super);\n function ServiceBroker() {\n var _this = _super.call(this) || this;\n _this.setEndpoint(_this.ServiceUrl);\n return _this;\n }\n Object.defineProperty(ServiceBroker.prototype, \"ServiceUrl\", {\n get: function () {\n var url = window.location.port != null ?\n \"\".concat(window.location.protocol, \"//\").concat(window.location.hostname, \":\").concat(window.location.port, \"/v1/service/\").concat(this.ServiceName)\n : \"\".concat(window.location.protocol, \"//\").concat(window.location.hostname, \"/v1/service/\").concat(this.ServiceName);\n return url;\n },\n enumerable: false,\n configurable: true\n });\n ServiceBroker.prototype.setHeader = function (key, value) {\n this.headers[key] = value;\n };\n ServiceBroker.prototype.setKey = function (accessKey) {\n this.setHeader('x-access-key', accessKey);\n return this;\n };\n ServiceBroker.prototype.createKey = function (params) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/createKey';\n payload = params;\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1:\n response = _a.sent();\n return [2 /*return*/, response.accessKey];\n }\n });\n });\n };\n return ServiceBroker;\n}(_client__WEBPACK_IMPORTED_MODULE_0__.Client));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/ServiceBroker.ts?");
|
|
325
|
-
|
|
326
|
-
/***/ }),
|
|
327
|
-
|
|
328
|
-
/***/ "./src/sdk-console/brokers/ServiceNames.ts":
|
|
329
|
-
/*!*************************************************!*\
|
|
330
|
-
!*** ./src/sdk-console/brokers/ServiceNames.ts ***!
|
|
331
|
-
\*************************************************/
|
|
332
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
333
|
-
|
|
334
|
-
"use strict";
|
|
335
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ServiceNames\": () => (/* binding */ ServiceNames)\n/* harmony export */ });\nvar ServiceNames = {\n Email: 'com.realmocean.service.email',\n Qdms: 'com.realmocean.service.qdms',\n Mining: 'com.realmocean.service.mining',\n Registry: 'com.realmocean.service.registry'\n};\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/ServiceNames.ts?");
|
|
336
|
-
|
|
337
|
-
/***/ }),
|
|
338
|
-
|
|
339
|
-
/***/ "./src/sdk-console/brokers/csp/CspBroker.ts":
|
|
340
|
-
/*!**************************************************!*\
|
|
341
|
-
!*** ./src/sdk-console/brokers/csp/CspBroker.ts ***!
|
|
342
|
-
\**************************************************/
|
|
113
|
+
/***/ "./src/enums/o-auth-provider.ts":
|
|
114
|
+
/*!**************************************!*\
|
|
115
|
+
!*** ./src/enums/o-auth-provider.ts ***!
|
|
116
|
+
\**************************************/
|
|
343
117
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
344
118
|
|
|
345
|
-
"
|
|
346
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CspBroker\": () => (/* binding */ CspBroker)\n/* harmony export */ });\n/* harmony import */ var _ServiceBroker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServiceBroker */ \"./src/sdk-console/brokers/ServiceBroker.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar CspBroker = /** @class */ (function (_super) {\n __extends(CspBroker, _super);\n function CspBroker() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(CspBroker.prototype, \"ServiceName\", {\n get: function () {\n return 'csp';\n },\n enumerable: false,\n configurable: true\n });\n CspBroker.prototype.getProjects = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/projects';\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n CspBroker.prototype.getFlows = function (projectSecretKey, projectId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = \"/\".concat(projectId, \"/flows\");\n payload = {\n projectSecretKey: projectSecretKey\n };\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n CspBroker.prototype.getProcesses = function (projectId, flowId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = \"/\".concat(projectId, \"/\").concat(flowId, \"/processes\");\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n CspBroker.Default = new CspBroker();\n return CspBroker;\n}(_ServiceBroker__WEBPACK_IMPORTED_MODULE_0__.ServiceBroker));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/csp/CspBroker.ts?");
|
|
119
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"OAuthProvider\": () => (/* binding */ OAuthProvider)\n/* harmony export */ });\nvar OAuthProvider;\n(function (OAuthProvider) {\n OAuthProvider[\"Amazon\"] = \"amazon\";\n OAuthProvider[\"Apple\"] = \"apple\";\n OAuthProvider[\"Auth0\"] = \"auth0\";\n OAuthProvider[\"Authentik\"] = \"authentik\";\n OAuthProvider[\"Autodesk\"] = \"autodesk\";\n OAuthProvider[\"Bitbucket\"] = \"bitbucket\";\n OAuthProvider[\"Bitly\"] = \"bitly\";\n OAuthProvider[\"Box\"] = \"box\";\n OAuthProvider[\"Dailymotion\"] = \"dailymotion\";\n OAuthProvider[\"Discord\"] = \"discord\";\n OAuthProvider[\"Disqus\"] = \"disqus\";\n OAuthProvider[\"Dropbox\"] = \"dropbox\";\n OAuthProvider[\"Etsy\"] = \"etsy\";\n OAuthProvider[\"Facebook\"] = \"facebook\";\n OAuthProvider[\"Github\"] = \"github\";\n OAuthProvider[\"Gitlab\"] = \"gitlab\";\n OAuthProvider[\"Google\"] = \"google\";\n OAuthProvider[\"Linkedin\"] = \"linkedin\";\n OAuthProvider[\"Microsoft\"] = \"microsoft\";\n OAuthProvider[\"Notion\"] = \"notion\";\n OAuthProvider[\"Oidc\"] = \"oidc\";\n OAuthProvider[\"Okta\"] = \"okta\";\n OAuthProvider[\"Paypal\"] = \"paypal\";\n OAuthProvider[\"PaypalSandbox\"] = \"paypalSandbox\";\n OAuthProvider[\"Podio\"] = \"podio\";\n OAuthProvider[\"Salesforce\"] = \"salesforce\";\n OAuthProvider[\"Slack\"] = \"slack\";\n OAuthProvider[\"Spotify\"] = \"spotify\";\n OAuthProvider[\"Stripe\"] = \"stripe\";\n OAuthProvider[\"Tradeshift\"] = \"tradeshift\";\n OAuthProvider[\"TradeshiftBox\"] = \"tradeshiftBox\";\n OAuthProvider[\"Twitch\"] = \"twitch\";\n OAuthProvider[\"Wordpress\"] = \"wordpress\";\n OAuthProvider[\"Yahoo\"] = \"yahoo\";\n OAuthProvider[\"Yammer\"] = \"yammer\";\n OAuthProvider[\"Yandex\"] = \"yandex\";\n OAuthProvider[\"Zoho\"] = \"zoho\";\n OAuthProvider[\"Zoom\"] = \"zoom\";\n OAuthProvider[\"Mock\"] = \"mock\";\n})(OAuthProvider || (OAuthProvider = {}));\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/enums/o-auth-provider.ts?");
|
|
347
120
|
|
|
348
121
|
/***/ }),
|
|
349
122
|
|
|
350
|
-
/***/ "./src/
|
|
351
|
-
|
|
352
|
-
!*** ./src/
|
|
353
|
-
|
|
123
|
+
/***/ "./src/id.ts":
|
|
124
|
+
/*!*******************!*\
|
|
125
|
+
!*** ./src/id.ts ***!
|
|
126
|
+
\*******************/
|
|
354
127
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
355
128
|
|
|
356
|
-
"
|
|
357
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"EncryptionBroker\": () => (/* binding */ EncryptionBroker)\n/* harmony export */ });\n/* harmony import */ var _ServiceBroker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServiceBroker */ \"./src/sdk-console/brokers/ServiceBroker.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nvar EncryptionBroker = /** @class */ (function (_super) {\n __extends(EncryptionBroker, _super);\n function EncryptionBroker() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(EncryptionBroker.prototype, \"ServiceName\", {\n get: function () {\n return 'encryption';\n },\n enumerable: false,\n configurable: true\n });\n EncryptionBroker.Default = new EncryptionBroker();\n return EncryptionBroker;\n}(_ServiceBroker__WEBPACK_IMPORTED_MODULE_0__.ServiceBroker));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/encryption/EncryptionBroker.ts?");
|
|
129
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ID\": () => (/* binding */ ID)\n/* harmony export */ });\nvar __classPrivateFieldGet = (undefined && undefined.__classPrivateFieldGet) || function (receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n};\nvar _a, _ID_hexTimestamp;\n/**\n * Helper class to generate ID strings for resources.\n */\nclass ID {\n /**\n * Uses the provided ID as the ID for the resource.\n *\n * @param {string} id\n * @returns {string}\n */\n static custom(id) {\n return id;\n }\n /**\n * Have Appconda generate a unique ID for you.\n *\n * @param {number} padding. Default is 7.\n * @returns {string}\n */\n static unique(padding = 7) {\n // Generate a unique ID with padding to have a longer ID\n const baseId = __classPrivateFieldGet(_a, _a, \"m\", _ID_hexTimestamp).call(_a);\n let randomPadding = '';\n for (let i = 0; i < padding; i++) {\n const randomHexDigit = Math.floor(Math.random() * 16).toString(16);\n randomPadding += randomHexDigit;\n }\n return baseId + randomPadding;\n }\n}\n_a = ID, _ID_hexTimestamp = function _ID_hexTimestamp() {\n const now = new Date();\n const sec = Math.floor(now.getTime() / 1000);\n const msec = now.getMilliseconds();\n // Convert to hexadecimal\n const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, '0');\n return hexTimestamp;\n};\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/id.ts?");
|
|
358
130
|
|
|
359
131
|
/***/ }),
|
|
360
132
|
|
|
361
|
-
/***/ "./src/
|
|
362
|
-
|
|
363
|
-
!*** ./src/
|
|
364
|
-
|
|
133
|
+
/***/ "./src/index.ts":
|
|
134
|
+
/*!**********************!*\
|
|
135
|
+
!*** ./src/index.ts ***!
|
|
136
|
+
\**********************/
|
|
365
137
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
366
138
|
|
|
367
|
-
"
|
|
368
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"GithubBroker\": () => (/* reexport safe */ _GithubBroker__WEBPACK_IMPORTED_MODULE_0__.GithubBroker),\n/* harmony export */ \"QdmsBroker\": () => (/* reexport safe */ _QdmsBroker__WEBPACK_IMPORTED_MODULE_1__.QdmsBroker),\n/* harmony export */ \"GooleDriveBroker\": () => (/* reexport safe */ _GoogleDriveBroker__WEBPACK_IMPORTED_MODULE_2__.GooleDriveBroker),\n/* harmony export */ \"JiraBroker\": () => (/* reexport safe */ _jira_JiraBroker__WEBPACK_IMPORTED_MODULE_3__.JiraBroker),\n/* harmony export */ \"MiningBroker\": () => (/* reexport safe */ _mining_MiningBroker__WEBPACK_IMPORTED_MODULE_4__.MiningBroker),\n/* harmony export */ \"EmailBroker\": () => (/* reexport safe */ _EmailBroker__WEBPACK_IMPORTED_MODULE_5__.EmailBroker),\n/* harmony export */ \"CspBroker\": () => (/* reexport safe */ _csp_CspBroker__WEBPACK_IMPORTED_MODULE_6__.CspBroker),\n/* harmony export */ \"EncryptionBroker\": () => (/* reexport safe */ _encryption_EncryptionBroker__WEBPACK_IMPORTED_MODULE_7__.EncryptionBroker),\n/* harmony export */ \"ServiceBroker\": () => (/* reexport safe */ _ServiceBroker__WEBPACK_IMPORTED_MODULE_8__.ServiceBroker),\n/* harmony export */ \"RegistryBroker\": () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_9__.RegistryBroker),\n/* harmony export */ \"ServiceNames\": () => (/* reexport safe */ _ServiceNames__WEBPACK_IMPORTED_MODULE_10__.ServiceNames),\n/* harmony export */ \"SchemaBroker\": () => (/* reexport safe */ _schema_SchemaBroker__WEBPACK_IMPORTED_MODULE_11__.SchemaBroker)\n/* harmony export */ });\n/* harmony import */ var _GithubBroker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GithubBroker */ \"./src/sdk-console/brokers/GithubBroker.ts\");\n/* harmony import */ var _QdmsBroker__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./QdmsBroker */ \"./src/sdk-console/brokers/QdmsBroker.ts\");\n/* harmony import */ var _GoogleDriveBroker__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./GoogleDriveBroker */ \"./src/sdk-console/brokers/GoogleDriveBroker.ts\");\n/* harmony import */ var _jira_JiraBroker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./jira/JiraBroker */ \"./src/sdk-console/brokers/jira/JiraBroker.ts\");\n/* harmony import */ var _mining_MiningBroker__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mining/MiningBroker */ \"./src/sdk-console/brokers/mining/MiningBroker.ts\");\n/* harmony import */ var _EmailBroker__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./EmailBroker */ \"./src/sdk-console/brokers/EmailBroker.ts\");\n/* harmony import */ var _csp_CspBroker__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./csp/CspBroker */ \"./src/sdk-console/brokers/csp/CspBroker.ts\");\n/* harmony import */ var _encryption_EncryptionBroker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./encryption/EncryptionBroker */ \"./src/sdk-console/brokers/encryption/EncryptionBroker.ts\");\n/* harmony import */ var _ServiceBroker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ServiceBroker */ \"./src/sdk-console/brokers/ServiceBroker.ts\");\n/* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./registry */ \"./src/sdk-console/brokers/registry/index.ts\");\n/* harmony import */ var _ServiceNames__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ServiceNames */ \"./src/sdk-console/brokers/ServiceNames.ts\");\n/* harmony import */ var _schema_SchemaBroker__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./schema/SchemaBroker */ \"./src/sdk-console/brokers/schema/SchemaBroker.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/index.ts?");
|
|
139
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Client\": () => (/* reexport safe */ _client__WEBPACK_IMPORTED_MODULE_0__.Client),\n/* harmony export */ \"Query\": () => (/* reexport safe */ _client__WEBPACK_IMPORTED_MODULE_0__.Query),\n/* harmony export */ \"AppcondaException\": () => (/* reexport safe */ _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException),\n/* harmony export */ \"Account\": () => (/* reexport safe */ _services_account__WEBPACK_IMPORTED_MODULE_1__.Account),\n/* harmony export */ \"Avatars\": () => (/* reexport safe */ _services_avatars__WEBPACK_IMPORTED_MODULE_2__.Avatars),\n/* harmony export */ \"Databases\": () => (/* reexport safe */ _services_databases__WEBPACK_IMPORTED_MODULE_3__.Databases),\n/* harmony export */ \"Functions\": () => (/* reexport safe */ _services_functions__WEBPACK_IMPORTED_MODULE_4__.Functions),\n/* harmony export */ \"Graphql\": () => (/* reexport safe */ _services_graphql__WEBPACK_IMPORTED_MODULE_5__.Graphql),\n/* harmony export */ \"Locale\": () => (/* reexport safe */ _services_locale__WEBPACK_IMPORTED_MODULE_6__.Locale),\n/* harmony export */ \"Messaging\": () => (/* reexport safe */ _services_messaging__WEBPACK_IMPORTED_MODULE_7__.Messaging),\n/* harmony export */ \"Storage\": () => (/* reexport safe */ _services_storage__WEBPACK_IMPORTED_MODULE_8__.Storage),\n/* harmony export */ \"Teams\": () => (/* reexport safe */ _services_teams__WEBPACK_IMPORTED_MODULE_9__.Teams),\n/* harmony export */ \"Permission\": () => (/* reexport safe */ _permission__WEBPACK_IMPORTED_MODULE_10__.Permission),\n/* harmony export */ \"Role\": () => (/* reexport safe */ _role__WEBPACK_IMPORTED_MODULE_11__.Role),\n/* harmony export */ \"ID\": () => (/* reexport safe */ _id__WEBPACK_IMPORTED_MODULE_12__.ID),\n/* harmony export */ \"AuthenticatorType\": () => (/* reexport safe */ _enums_authenticator_type__WEBPACK_IMPORTED_MODULE_13__.AuthenticatorType),\n/* harmony export */ \"AuthenticationFactor\": () => (/* reexport safe */ _enums_authentication_factor__WEBPACK_IMPORTED_MODULE_14__.AuthenticationFactor),\n/* harmony export */ \"OAuthProvider\": () => (/* reexport safe */ _enums_o_auth_provider__WEBPACK_IMPORTED_MODULE_15__.OAuthProvider),\n/* harmony export */ \"Browser\": () => (/* reexport safe */ _enums_browser__WEBPACK_IMPORTED_MODULE_16__.Browser),\n/* harmony export */ \"CreditCard\": () => (/* reexport safe */ _enums_credit_card__WEBPACK_IMPORTED_MODULE_17__.CreditCard),\n/* harmony export */ \"Flag\": () => (/* reexport safe */ _enums_flag__WEBPACK_IMPORTED_MODULE_18__.Flag),\n/* harmony export */ \"ExecutionMethod\": () => (/* reexport safe */ _enums_execution_method__WEBPACK_IMPORTED_MODULE_19__.ExecutionMethod),\n/* harmony export */ \"ImageGravity\": () => (/* reexport safe */ _enums_image_gravity__WEBPACK_IMPORTED_MODULE_20__.ImageGravity),\n/* harmony export */ \"ImageFormat\": () => (/* reexport safe */ _enums_image_format__WEBPACK_IMPORTED_MODULE_21__.ImageFormat)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./client */ \"./src/client.ts\");\n/* harmony import */ var _services_account__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services/account */ \"./src/services/account.ts\");\n/* harmony import */ var _services_avatars__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/avatars */ \"./src/services/avatars.ts\");\n/* harmony import */ var _services_databases__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/databases */ \"./src/services/databases.ts\");\n/* harmony import */ var _services_functions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/functions */ \"./src/services/functions.ts\");\n/* harmony import */ var _services_graphql__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./services/graphql */ \"./src/services/graphql.ts\");\n/* harmony import */ var _services_locale__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./services/locale */ \"./src/services/locale.ts\");\n/* harmony import */ var _services_messaging__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./services/messaging */ \"./src/services/messaging.ts\");\n/* harmony import */ var _services_storage__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./services/storage */ \"./src/services/storage.ts\");\n/* harmony import */ var _services_teams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./services/teams */ \"./src/services/teams.ts\");\n/* harmony import */ var _permission__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./permission */ \"./src/permission.ts\");\n/* harmony import */ var _role__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./role */ \"./src/role.ts\");\n/* harmony import */ var _id__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./id */ \"./src/id.ts\");\n/* harmony import */ var _enums_authenticator_type__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./enums/authenticator-type */ \"./src/enums/authenticator-type.ts\");\n/* harmony import */ var _enums_authentication_factor__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./enums/authentication-factor */ \"./src/enums/authentication-factor.ts\");\n/* harmony import */ var _enums_o_auth_provider__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./enums/o-auth-provider */ \"./src/enums/o-auth-provider.ts\");\n/* harmony import */ var _enums_browser__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./enums/browser */ \"./src/enums/browser.ts\");\n/* harmony import */ var _enums_credit_card__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./enums/credit-card */ \"./src/enums/credit-card.ts\");\n/* harmony import */ var _enums_flag__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./enums/flag */ \"./src/enums/flag.ts\");\n/* harmony import */ var _enums_execution_method__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./enums/execution-method */ \"./src/enums/execution-method.ts\");\n/* harmony import */ var _enums_image_gravity__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./enums/image-gravity */ \"./src/enums/image-gravity.ts\");\n/* harmony import */ var _enums_image_format__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./enums/image-format */ \"./src/enums/image-format.ts\");\n/**\n * Appconda Web SDK\n *\n * This SDK is compatible with Appconda server version 1.6.x.\n * For older versions, please check\n * [previous releases](https://github.com/appconda/sdk-for-web/releases).\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/index.ts?");
|
|
369
140
|
|
|
370
141
|
/***/ }),
|
|
371
142
|
|
|
372
|
-
/***/ "./src/
|
|
373
|
-
|
|
374
|
-
!*** ./src/
|
|
375
|
-
|
|
143
|
+
/***/ "./src/permission.ts":
|
|
144
|
+
/*!***************************!*\
|
|
145
|
+
!*** ./src/permission.ts ***!
|
|
146
|
+
\***************************/
|
|
376
147
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
377
148
|
|
|
378
|
-
"use
|
|
379
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"JiraBroker\": () => (/* binding */ JiraBroker)\n/* harmony export */ });\n/* harmony import */ var _ServiceBroker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServiceBroker */ \"./src/sdk-console/brokers/ServiceBroker.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar JiraBroker = /** @class */ (function (_super) {\n __extends(JiraBroker, _super);\n function JiraBroker() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(JiraBroker.prototype, \"ServiceName\", {\n get: function () {\n return 'jira';\n },\n enumerable: false,\n configurable: true\n });\n JiraBroker.prototype.getProjects = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/projects';\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n JiraBroker.prototype.getIssues = function (projectKey) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = \"/project/\".concat(projectKey, \"/issues\");\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n JiraBroker.Default = new JiraBroker();\n return JiraBroker;\n}(_ServiceBroker__WEBPACK_IMPORTED_MODULE_0__.ServiceBroker));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/jira/JiraBroker.ts?");
|
|
149
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Permission\": () => (/* binding */ Permission)\n/* harmony export */ });\n/**\n * Helper class to generate permission strings for resources.\n */\nclass Permission {\n}\n/**\n * Generate read permission string for the provided role.\n *\n * @param {string} role\n * @returns {string}\n */\nPermission.read = (role) => {\n return `read(\"${role}\")`;\n};\n/**\n * Generate write permission string for the provided role.\n *\n * This is an alias of update, delete, and possibly create.\n * Don't use write in combination with update, delete, or create.\n *\n * @param {string} role\n * @returns {string}\n */\nPermission.write = (role) => {\n return `write(\"${role}\")`;\n};\n/**\n * Generate create permission string for the provided role.\n *\n * @param {string} role\n * @returns {string}\n */\nPermission.create = (role) => {\n return `create(\"${role}\")`;\n};\n/**\n * Generate update permission string for the provided role.\n *\n * @param {string} role\n * @returns {string}\n */\nPermission.update = (role) => {\n return `update(\"${role}\")`;\n};\n/**\n * Generate delete permission string for the provided role.\n *\n * @param {string} role\n * @returns {string}\n */\nPermission.delete = (role) => {\n return `delete(\"${role}\")`;\n};\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/permission.ts?");
|
|
380
150
|
|
|
381
151
|
/***/ }),
|
|
382
152
|
|
|
383
|
-
/***/ "./src/
|
|
384
|
-
|
|
385
|
-
!*** ./src/
|
|
386
|
-
|
|
153
|
+
/***/ "./src/query.ts":
|
|
154
|
+
/*!**********************!*\
|
|
155
|
+
!*** ./src/query.ts ***!
|
|
156
|
+
\**********************/
|
|
387
157
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
388
158
|
|
|
389
|
-
"
|
|
390
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"MiningBroker\": () => (/* binding */ MiningBroker)\n/* harmony export */ });\n/* harmony import */ var _ServiceBroker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServiceBroker */ \"./src/sdk-console/brokers/ServiceBroker.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar MiningBroker = /** @class */ (function (_super) {\n __extends(MiningBroker, _super);\n function MiningBroker() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(MiningBroker.prototype, \"ServiceName\", {\n get: function () {\n return 'mining';\n },\n enumerable: false,\n configurable: true\n });\n MiningBroker.prototype.loadCsv = function (csv) {\n return __awaiter(this, void 0, void 0, function () {\n var file, path, payload, uri, size;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n file = new File([new Blob([csv], { type: 'text/plain' })], 'file.csv');\n path = '/load/csv';\n payload = {};\n payload['files'] = file;\n uri = new URL(this.config.endpoint + path);\n size = file.size;\n return [4 /*yield*/, this.call('post', uri, {\n 'content-type': 'multipart/form-data',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MiningBroker.prototype.getVariantInfo = function (logId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = \"/\".concat(logId, \"/variantInfo\");\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n MiningBroker.Default = new MiningBroker();\n return MiningBroker;\n}(_ServiceBroker__WEBPACK_IMPORTED_MODULE_0__.ServiceBroker));\n\n/*\nasync loadCsv(csv: string): Promise<any> {\n\n \n let path = '/load/csv';\n\n const uri = new URL(this.config.endpoint + path);\n \n\n\n \n const data = new FormData();\n\n\n var parts = [\n new Blob([csv], { type: 'text/plain' })\n ];\n var file = new File(parts, 'csv.txt')\n\n data.append('files', file, 'test.csv');\n\n return await HttpClient.Post(uri.toString(), data, {\n headers: {\n \"Content-Type\": \"multipart/form-data\"\n }\n })\n\n} */ \n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/mining/MiningBroker.ts?");
|
|
159
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Query\": () => (/* binding */ Query)\n/* harmony export */ });\n/**\n * Helper class to generate query strings.\n */\nclass Query {\n /**\n * Constructor for Query class.\n *\n * @param {string} method\n * @param {AttributesTypes} attribute\n * @param {QueryTypes} values\n */\n constructor(method, attribute, values) {\n this.method = method;\n this.attribute = attribute;\n if (values !== undefined) {\n if (Array.isArray(values)) {\n this.values = values;\n }\n else {\n this.values = [values];\n }\n }\n }\n /**\n * Convert the query object to a JSON string.\n *\n * @returns {string}\n */\n toString() {\n return JSON.stringify({\n method: this.method,\n attribute: this.attribute,\n values: this.values,\n });\n }\n}\n/**\n * Filter resources where attribute is equal to value.\n *\n * @param {string} attribute\n * @param {QueryTypes} value\n * @returns {string}\n */\nQuery.equal = (attribute, value) => new Query(\"equal\", attribute, value).toString();\n/**\n * Filter resources where attribute is not equal to value.\n *\n * @param {string} attribute\n * @param {QueryTypes} value\n * @returns {string}\n */\nQuery.notEqual = (attribute, value) => new Query(\"notEqual\", attribute, value).toString();\n/**\n * Filter resources where attribute is less than value.\n *\n * @param {string} attribute\n * @param {QueryTypes} value\n * @returns {string}\n */\nQuery.lessThan = (attribute, value) => new Query(\"lessThan\", attribute, value).toString();\n/**\n * Filter resources where attribute is less than or equal to value.\n *\n * @param {string} attribute\n * @param {QueryTypes} value\n * @returns {string}\n */\nQuery.lessThanEqual = (attribute, value) => new Query(\"lessThanEqual\", attribute, value).toString();\n/**\n * Filter resources where attribute is greater than value.\n *\n * @param {string} attribute\n * @param {QueryTypes} value\n * @returns {string}\n */\nQuery.greaterThan = (attribute, value) => new Query(\"greaterThan\", attribute, value).toString();\n/**\n * Filter resources where attribute is greater than or equal to value.\n *\n * @param {string} attribute\n * @param {QueryTypes} value\n * @returns {string}\n */\nQuery.greaterThanEqual = (attribute, value) => new Query(\"greaterThanEqual\", attribute, value).toString();\n/**\n * Filter resources where attribute is null.\n *\n * @param {string} attribute\n * @returns {string}\n */\nQuery.isNull = (attribute) => new Query(\"isNull\", attribute).toString();\n/**\n * Filter resources where attribute is not null.\n *\n * @param {string} attribute\n * @returns {string}\n */\nQuery.isNotNull = (attribute) => new Query(\"isNotNull\", attribute).toString();\n/**\n * Filter resources where attribute is between start and end (inclusive).\n *\n * @param {string} attribute\n * @param {string | number} start\n * @param {string | number} end\n * @returns {string}\n */\nQuery.between = (attribute, start, end) => new Query(\"between\", attribute, [start, end]).toString();\n/**\n * Filter resources where attribute starts with value.\n *\n * @param {string} attribute\n * @param {string} value\n * @returns {string}\n */\nQuery.startsWith = (attribute, value) => new Query(\"startsWith\", attribute, value).toString();\n/**\n * Filter resources where attribute ends with value.\n *\n * @param {string} attribute\n * @param {string} value\n * @returns {string}\n */\nQuery.endsWith = (attribute, value) => new Query(\"endsWith\", attribute, value).toString();\n/**\n * Specify which attributes should be returned by the API call.\n *\n * @param {string[]} attributes\n * @returns {string}\n */\nQuery.select = (attributes) => new Query(\"select\", undefined, attributes).toString();\n/**\n * Filter resources by searching attribute for value.\n * A fulltext index on attribute is required for this query to work.\n *\n * @param {string} attribute\n * @param {string} value\n * @returns {string}\n */\nQuery.search = (attribute, value) => new Query(\"search\", attribute, value).toString();\n/**\n * Sort results by attribute descending.\n *\n * @param {string} attribute\n * @returns {string}\n */\nQuery.orderDesc = (attribute) => new Query(\"orderDesc\", attribute).toString();\n/**\n * Sort results by attribute ascending.\n *\n * @param {string} attribute\n * @returns {string}\n */\nQuery.orderAsc = (attribute) => new Query(\"orderAsc\", attribute).toString();\n/**\n * Return results after documentId.\n *\n * @param {string} documentId\n * @returns {string}\n */\nQuery.cursorAfter = (documentId) => new Query(\"cursorAfter\", undefined, documentId).toString();\n/**\n * Return results before documentId.\n *\n * @param {string} documentId\n * @returns {string}\n */\nQuery.cursorBefore = (documentId) => new Query(\"cursorBefore\", undefined, documentId).toString();\n/**\n * Return only limit results.\n *\n * @param {number} limit\n * @returns {string}\n */\nQuery.limit = (limit) => new Query(\"limit\", undefined, limit).toString();\n/**\n * Filter resources by skipping the first offset results.\n *\n * @param {number} offset\n * @returns {string}\n */\nQuery.offset = (offset) => new Query(\"offset\", undefined, offset).toString();\n/**\n * Filter resources where attribute contains the specified value.\n *\n * @param {string} attribute\n * @param {string | string[]} value\n * @returns {string}\n */\nQuery.contains = (attribute, value) => new Query(\"contains\", attribute, value).toString();\n/**\n * Combine multiple queries using logical OR operator.\n *\n * @param {string[]} queries\n * @returns {string}\n */\nQuery.or = (queries) => new Query(\"or\", undefined, queries.map((query) => JSON.parse(query))).toString();\n/**\n * Combine multiple queries using logical AND operator.\n *\n * @param {string[]} queries\n * @returns {string}\n */\nQuery.and = (queries) => new Query(\"and\", undefined, queries.map((query) => JSON.parse(query))).toString();\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/query.ts?");
|
|
391
160
|
|
|
392
161
|
/***/ }),
|
|
393
162
|
|
|
394
|
-
/***/ "./src/
|
|
395
|
-
|
|
396
|
-
!*** ./src/
|
|
397
|
-
|
|
163
|
+
/***/ "./src/role.ts":
|
|
164
|
+
/*!*********************!*\
|
|
165
|
+
!*** ./src/role.ts ***!
|
|
166
|
+
\*********************/
|
|
398
167
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
399
168
|
|
|
400
|
-
"
|
|
401
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RegistryBroker\": () => (/* binding */ RegistryBroker)\n/* harmony export */ });\n/* harmony import */ var _ServiceBroker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServiceBroker */ \"./src/sdk-console/brokers/ServiceBroker.ts\");\n/* harmony import */ var _ServiceNames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../ServiceNames */ \"./src/sdk-console/brokers/ServiceNames.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar RegistryBroker = /** @class */ (function (_super) {\n __extends(RegistryBroker, _super);\n function RegistryBroker() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(RegistryBroker.prototype, \"ServiceName\", {\n get: function () {\n return _ServiceNames__WEBPACK_IMPORTED_MODULE_1__.ServiceNames.Registry;\n },\n enumerable: false,\n configurable: true\n });\n RegistryBroker.prototype.listServices = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/services';\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'multipart/form-data',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n RegistryBroker.prototype.listConnectors = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/connectors';\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'multipart/form-data',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n RegistryBroker.prototype.listComponents = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/components';\n payload = {};\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('get', uri, {\n 'content-type': 'multipart/form-data',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n RegistryBroker.Default = new RegistryBroker();\n return RegistryBroker;\n}(_ServiceBroker__WEBPACK_IMPORTED_MODULE_0__.ServiceBroker));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/registry/RegistryBroker.ts?");
|
|
169
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Role\": () => (/* binding */ Role)\n/* harmony export */ });\n/**\n * Helper class to generate role strings for `Permission`.\n */\nclass Role {\n /**\n * Grants access to anyone.\n *\n * This includes authenticated and unauthenticated users.\n *\n * @returns {string}\n */\n static any() {\n return 'any';\n }\n /**\n * Grants access to a specific user by user ID.\n *\n * You can optionally pass verified or unverified for\n * `status` to target specific types of users.\n *\n * @param {string} id\n * @param {string} status\n * @returns {string}\n */\n static user(id, status = '') {\n if (status === '') {\n return `user:${id}`;\n }\n return `user:${id}/${status}`;\n }\n /**\n * Grants access to any authenticated or anonymous user.\n *\n * You can optionally pass verified or unverified for\n * `status` to target specific types of users.\n *\n * @param {string} status\n * @returns {string}\n */\n static users(status = '') {\n if (status === '') {\n return 'users';\n }\n return `users/${status}`;\n }\n /**\n * Grants access to any guest user without a session.\n *\n * Authenticated users don't have access to this role.\n *\n * @returns {string}\n */\n static guests() {\n return 'guests';\n }\n /**\n * Grants access to a team by team ID.\n *\n * You can optionally pass a role for `role` to target\n * team members with the specified role.\n *\n * @param {string} id\n * @param {string} role\n * @returns {string}\n */\n static team(id, role = '') {\n if (role === '') {\n return `team:${id}`;\n }\n return `team:${id}/${role}`;\n }\n /**\n * Grants access to a specific member of a team.\n *\n * When the member is removed from the team, they will\n * no longer have access.\n *\n * @param {string} id\n * @returns {string}\n */\n static member(id) {\n return `member:${id}`;\n }\n /**\n * Grants access to a user with the specified label.\n *\n * @param {string} name\n * @returns {string}\n */\n static label(name) {\n return `label:${name}`;\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/role.ts?");
|
|
402
170
|
|
|
403
171
|
/***/ }),
|
|
404
172
|
|
|
405
|
-
/***/ "./src/
|
|
406
|
-
|
|
407
|
-
!*** ./src/
|
|
408
|
-
|
|
173
|
+
/***/ "./src/service.ts":
|
|
174
|
+
/*!************************!*\
|
|
175
|
+
!*** ./src/service.ts ***!
|
|
176
|
+
\************************/
|
|
409
177
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
410
178
|
|
|
411
|
-
"
|
|
412
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RegistryBroker\": () => (/* reexport safe */ _RegistryBroker__WEBPACK_IMPORTED_MODULE_0__.RegistryBroker)\n/* harmony export */ });\n/* harmony import */ var _RegistryBroker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./RegistryBroker */ \"./src/sdk-console/brokers/registry/RegistryBroker.ts\");\n/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./models */ \"./src/sdk-console/brokers/registry/models/index.ts\");\n\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/registry/index.ts?");
|
|
179
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Service\": () => (/* binding */ Service)\n/* harmony export */ });\nclass Service {\n constructor(client) {\n this.client = client;\n }\n static flatten(data, prefix = '') {\n let output = {};\n for (const [key, value] of Object.entries(data)) {\n let finalKey = prefix ? prefix + '[' + key + ']' : key;\n if (Array.isArray(value)) {\n output = Object.assign(Object.assign({}, output), Service.flatten(value, finalKey));\n }\n else {\n output[finalKey] = value;\n }\n }\n return output;\n }\n}\n/**\n * The size for chunked uploads in bytes.\n */\nService.CHUNK_SIZE = 5 * 1024 * 1024; // 5MB\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/service.ts?");
|
|
413
180
|
|
|
414
181
|
/***/ }),
|
|
415
182
|
|
|
416
|
-
/***/ "./src/
|
|
417
|
-
|
|
418
|
-
!*** ./src/
|
|
419
|
-
|
|
183
|
+
/***/ "./src/services/account.ts":
|
|
184
|
+
/*!*********************************!*\
|
|
185
|
+
!*** ./src/services/account.ts ***!
|
|
186
|
+
\*********************************/
|
|
420
187
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
421
188
|
|
|
422
|
-
"use strict";
|
|
423
|
-
eval("__webpack_require__.r(__webpack_exports__);\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/registry/models/index.ts?");
|
|
189
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Account\": () => (/* binding */ Account)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/client.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nclass Account {\n constructor(client) {\n this.client = client;\n }\n /**\n * Get account\n *\n * Get the currently logged in user.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.User<Preferences>>}\n */\n get() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Create account\n *\n * Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](https://appconda.io/docs/references/cloud/client-web/account#createVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](https://appconda.io/docs/references/cloud/client-web/account#createEmailSession).\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} password\n * @param {string} name\n * @throws {AppcondaException}\n * @returns {Promise<Models.User<Preferences>>}\n */\n create(userId, email, password, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"password\"');\n }\n const apiPath = '/account';\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Update email\n *\n * Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.\nThis endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n\n *\n * @param {string} email\n * @param {string} password\n * @throws {AppcondaException}\n * @returns {Promise<Models.User<Preferences>>}\n */\n updateEmail(email, password) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"password\"');\n }\n const apiPath = '/account/email';\n const payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * List Identities\n *\n * Get the list of identities for the currently logged in user.\n *\n * @param {string[]} queries\n * @throws {AppcondaException}\n * @returns {Promise<Models.IdentityList>}\n */\n listIdentities(queries) {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/identities';\n const payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Delete identity\n *\n * Delete an identity by its unique ID.\n *\n * @param {string} identityId\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n deleteIdentity(identityId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof identityId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"identityId\"');\n }\n const apiPath = '/account/identities/{identityId}'.replace('{identityId}', identityId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('delete', uri, apiHeaders, payload);\n });\n }\n /**\n * Create JWT\n *\n * Use this endpoint to create a JSON Web Token. You can use the resulting JWT to authenticate on behalf of the current user when working with the Appconda server-side API and SDKs. The JWT secret is valid for 15 minutes from its creation and will be invalid if the user will logout in that time frame.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.Jwt>}\n */\n createJWT() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/jwts';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * List logs\n *\n * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log.\n *\n * @param {string[]} queries\n * @throws {AppcondaException}\n * @returns {Promise<Models.LogList>}\n */\n listLogs(queries) {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/logs';\n const payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Update MFA\n *\n * Enable or disable MFA on an account.\n *\n * @param {boolean} mfa\n * @throws {AppcondaException}\n * @returns {Promise<Models.User<Preferences>>}\n */\n updateMFA(mfa) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof mfa === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"mfa\"');\n }\n const apiPath = '/account/mfa';\n const payload = {};\n if (typeof mfa !== 'undefined') {\n payload['mfa'] = mfa;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Create Authenticator\n *\n * Add an authenticator app to be used as an MFA factor. Verify the authenticator using the [verify authenticator](/docs/references/cloud/client-web/account#updateMfaAuthenticator) method.\n *\n * @param {AuthenticatorType} type\n * @throws {AppcondaException}\n * @returns {Promise<Models.MfaType>}\n */\n createMfaAuthenticator(type) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"type\"');\n }\n const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Verify Authenticator\n *\n * Verify an authenticator app after adding it using the [add authenticator](/docs/references/cloud/client-web/account#createMfaAuthenticator) method.\n *\n * @param {AuthenticatorType} type\n * @param {string} otp\n * @throws {AppcondaException}\n * @returns {Promise<Models.User<Preferences>>}\n */\n updateMfaAuthenticator(type, otp) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"type\"');\n }\n if (typeof otp === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"otp\"');\n }\n const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);\n const payload = {};\n if (typeof otp !== 'undefined') {\n payload['otp'] = otp;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n /**\n * Delete Authenticator\n *\n * Delete an authenticator for a user by ID.\n *\n * @param {AuthenticatorType} type\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n deleteMfaAuthenticator(type) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"type\"');\n }\n const apiPath = '/account/mfa/authenticators/{type}'.replace('{type}', type);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('delete', uri, apiHeaders, payload);\n });\n }\n /**\n * Create MFA Challenge\n *\n * Begin the process of MFA verification after sign-in. Finish the flow with [updateMfaChallenge](/docs/references/cloud/client-web/account#updateMfaChallenge) method.\n *\n * @param {AuthenticationFactor} factor\n * @throws {AppcondaException}\n * @returns {Promise<Models.MfaChallenge>}\n */\n createMfaChallenge(factor) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof factor === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"factor\"');\n }\n const apiPath = '/account/mfa/challenge';\n const payload = {};\n if (typeof factor !== 'undefined') {\n payload['factor'] = factor;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Create MFA Challenge (confirmation)\n *\n * Complete the MFA challenge by providing the one-time password. Finish the process of MFA verification by providing the one-time password. To begin the flow, use [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.\n *\n * @param {string} challengeId\n * @param {string} otp\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n updateMfaChallenge(challengeId, otp) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof challengeId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"challengeId\"');\n }\n if (typeof otp === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"otp\"');\n }\n const apiPath = '/account/mfa/challenge';\n const payload = {};\n if (typeof challengeId !== 'undefined') {\n payload['challengeId'] = challengeId;\n }\n if (typeof otp !== 'undefined') {\n payload['otp'] = otp;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n /**\n * List Factors\n *\n * List the factors available on the account to be used as a MFA challange.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.MfaFactors>}\n */\n listMfaFactors() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/mfa/factors';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Get MFA Recovery Codes\n *\n * Get recovery codes that can be used as backup for MFA flow. Before getting codes, they must be generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to read recovery codes.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.MfaRecoveryCodes>}\n */\n getMfaRecoveryCodes() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/mfa/recovery-codes';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Create MFA Recovery Codes\n *\n * Generate recovery codes as backup for MFA flow. It's recommended to generate and show then immediately after user successfully adds their authehticator. Recovery codes can be used as a MFA verification type in [createMfaChallenge](/docs/references/cloud/client-web/account#createMfaChallenge) method.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.MfaRecoveryCodes>}\n */\n createMfaRecoveryCodes() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/mfa/recovery-codes';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Regenerate MFA Recovery Codes\n *\n * Regenerate recovery codes that can be used as backup for MFA flow. Before regenerating codes, they must be first generated using [createMfaRecoveryCodes](/docs/references/cloud/client-web/account#createMfaRecoveryCodes) method. An OTP challenge is required to regenreate recovery codes.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.MfaRecoveryCodes>}\n */\n updateMfaRecoveryCodes() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/mfa/recovery-codes';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Update name\n *\n * Update currently logged in user account name.\n *\n * @param {string} name\n * @throws {AppcondaException}\n * @returns {Promise<Models.User<Preferences>>}\n */\n updateName(name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"name\"');\n }\n const apiPath = '/account/name';\n const payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Update password\n *\n * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional.\n *\n * @param {string} password\n * @param {string} oldPassword\n * @throws {AppcondaException}\n * @returns {Promise<Models.User<Preferences>>}\n */\n updatePassword(password, oldPassword) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"password\"');\n }\n const apiPath = '/account/password';\n const payload = {};\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof oldPassword !== 'undefined') {\n payload['oldPassword'] = oldPassword;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Update phone\n *\n * Update the currently logged in user's phone number. After updating the phone number, the phone verification status will be reset. A confirmation SMS is not sent automatically, however you can use the [POST /account/verification/phone](https://appconda.io/docs/references/cloud/client-web/account#createPhoneVerification) endpoint to send a confirmation SMS.\n *\n * @param {string} phone\n * @param {string} password\n * @throws {AppcondaException}\n * @returns {Promise<Models.User<Preferences>>}\n */\n updatePhone(phone, password) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof phone === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"phone\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"password\"');\n }\n const apiPath = '/account/phone';\n const payload = {};\n if (typeof phone !== 'undefined') {\n payload['phone'] = phone;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Get account preferences\n *\n * Get the preferences as a key-value object for the currently logged in user.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Preferences>}\n */\n getPrefs() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/prefs';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Update preferences\n *\n * Update currently logged in user account preferences. The object you pass is stored as is, and replaces any previous value. The maximum allowed prefs size is 64kB and throws error if exceeded.\n *\n * @param {Partial<Preferences>} prefs\n * @throws {AppcondaException}\n * @returns {Promise<Models.User<Preferences>>}\n */\n updatePrefs(prefs) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof prefs === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"prefs\"');\n }\n const apiPath = '/account/prefs';\n const payload = {};\n if (typeof prefs !== 'undefined') {\n payload['prefs'] = prefs;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Create password recovery\n *\n * Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the [PUT /account/recovery](https://appconda.io/docs/references/cloud/client-web/account#updateRecovery) endpoint to complete the process. The verification link sent to the user's email address is valid for 1 hour.\n *\n * @param {string} email\n * @param {string} url\n * @throws {AppcondaException}\n * @returns {Promise<Models.Token>}\n */\n createRecovery(email, url) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"email\"');\n }\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"url\"');\n }\n const apiPath = '/account/recovery';\n const payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Create password recovery (confirmation)\n *\n * Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](https://appconda.io/docs/references/cloud/client-web/account#createRecovery) endpoint.\n\nPlease note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n *\n * @param {string} userId\n * @param {string} secret\n * @param {string} password\n * @throws {AppcondaException}\n * @returns {Promise<Models.Token>}\n */\n updateRecovery(userId, secret, password) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"secret\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"password\"');\n }\n const apiPath = '/account/recovery';\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n /**\n * List sessions\n *\n * Get the list of active sessions across different devices for the currently logged in user.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.SessionList>}\n */\n listSessions() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/sessions';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Delete sessions\n *\n * Delete all sessions from the user account and remove any sessions cookies from the end client.\n *\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n deleteSessions() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/sessions';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('delete', uri, apiHeaders, payload);\n });\n }\n /**\n * Create anonymous session\n *\n * Use this endpoint to allow a new user to register an anonymous account in your project. This route will also create a new session for the user. To allow the new user to convert an anonymous account to a normal account, you need to update its [email and password](https://appconda.io/docs/references/cloud/client-web/account#updateEmail) or create an [OAuth2 session](https://appconda.io/docs/references/cloud/client-web/account#CreateOAuth2Session).\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.Session>}\n */\n createAnonymousSession() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/sessions/anonymous';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Create email password session\n *\n * Allow the user to login into their account by providing a valid email and password combination. This route will create a new session for the user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appconda.io/docs/authentication-security#limits).\n *\n * @param {string} email\n * @param {string} password\n * @throws {AppcondaException}\n * @returns {Promise<Models.Session>}\n */\n createEmailPasswordSession(email, password) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"password\"');\n }\n const apiPath = '/account/sessions/email';\n const payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Update magic URL session\n *\n * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.\n *\n * @param {string} userId\n * @param {string} secret\n * @throws {AppcondaException}\n * @returns {Promise<Models.Session>}\n */\n updateMagicURLSession(userId, secret) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"secret\"');\n }\n const apiPath = '/account/sessions/magic-url';\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n /**\n * Create OAuth2 session\n *\n * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appconda console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf there is already an active session, the new session will be attached to the logged-in account. If there are no active sessions, the server will attempt to look for a user with the same email address as the email received from the OAuth2 provider and attach the new session to the existing user. If no matching user is found - the server will create a new user.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appconda.io/docs/authentication-security#limits).\n\n *\n * @param {OAuthProvider} provider\n * @param {string} success\n * @param {string} failure\n * @param {string[]} scopes\n * @throws {AppcondaException}\n * @returns {Promise<void | string>}\n */\n createOAuth2Session(provider, success, failure, scopes) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof provider === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"provider\"');\n }\n const apiPath = '/account/sessions/oauth2/{provider}'.replace('{provider}', provider);\n const payload = {};\n if (typeof success !== 'undefined') {\n payload['success'] = success;\n }\n if (typeof failure !== 'undefined') {\n payload['failure'] = failure;\n }\n if (typeof scopes !== 'undefined') {\n payload['scopes'] = scopes;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {\n window.location.href = uri.toString();\n return;\n }\n else {\n return uri.toString();\n }\n });\n }\n /**\n * Update phone session\n *\n * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.\n *\n * @param {string} userId\n * @param {string} secret\n * @throws {AppcondaException}\n * @returns {Promise<Models.Session>}\n */\n updatePhoneSession(userId, secret) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"secret\"');\n }\n const apiPath = '/account/sessions/phone';\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n /**\n * Create session\n *\n * Use this endpoint to create a session from token. Provide the **userId** and **secret** parameters from the successful response of authentication flows initiated by token creation. For example, magic URL and phone login.\n *\n * @param {string} userId\n * @param {string} secret\n * @throws {AppcondaException}\n * @returns {Promise<Models.Session>}\n */\n createSession(userId, secret) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"secret\"');\n }\n const apiPath = '/account/sessions/token';\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Get session\n *\n * Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.\n *\n * @param {string} sessionId\n * @throws {AppcondaException}\n * @returns {Promise<Models.Session>}\n */\n getSession(sessionId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof sessionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"sessionId\"');\n }\n const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Update session\n *\n * Use this endpoint to extend a session's length. Extending a session is useful when session expiry is short. If the session was created using an OAuth provider, this endpoint refreshes the access token from the provider.\n *\n * @param {string} sessionId\n * @throws {AppcondaException}\n * @returns {Promise<Models.Session>}\n */\n updateSession(sessionId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof sessionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"sessionId\"');\n }\n const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Delete session\n *\n * Logout the user. Use 'current' as the session ID to logout on this device, use a session ID to logout on another device. If you're looking to logout the user on all devices, use [Delete Sessions](https://appconda.io/docs/references/cloud/client-web/account#deleteSessions) instead.\n *\n * @param {string} sessionId\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n deleteSession(sessionId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof sessionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"sessionId\"');\n }\n const apiPath = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('delete', uri, apiHeaders, payload);\n });\n }\n /**\n * Update status\n *\n * Block the currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. To completely delete a user, use the Users API instead.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.User<Preferences>>}\n */\n updateStatus() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/status';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Create push target\n *\n *\n * @param {string} targetId\n * @param {string} identifier\n * @param {string} providerId\n * @throws {AppcondaException}\n * @returns {Promise<Models.Target>}\n */\n createPushTarget(targetId, identifier, providerId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof targetId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"targetId\"');\n }\n if (typeof identifier === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"identifier\"');\n }\n const apiPath = '/account/targets/push';\n const payload = {};\n if (typeof targetId !== 'undefined') {\n payload['targetId'] = targetId;\n }\n if (typeof identifier !== 'undefined') {\n payload['identifier'] = identifier;\n }\n if (typeof providerId !== 'undefined') {\n payload['providerId'] = providerId;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Update push target\n *\n *\n * @param {string} targetId\n * @param {string} identifier\n * @throws {AppcondaException}\n * @returns {Promise<Models.Target>}\n */\n updatePushTarget(targetId, identifier) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof targetId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"targetId\"');\n }\n if (typeof identifier === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"identifier\"');\n }\n const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId);\n const payload = {};\n if (typeof identifier !== 'undefined') {\n payload['identifier'] = identifier;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n /**\n * Delete push target\n *\n *\n * @param {string} targetId\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n deletePushTarget(targetId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof targetId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"targetId\"');\n }\n const apiPath = '/account/targets/{targetId}/push'.replace('{targetId}', targetId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('delete', uri, apiHeaders, payload);\n });\n }\n /**\n * Create email token (OTP)\n *\n * Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appconda.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's email is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appconda.io/docs/authentication-security#limits).\n *\n * @param {string} userId\n * @param {string} email\n * @param {boolean} phrase\n * @throws {AppcondaException}\n * @returns {Promise<Models.Token>}\n */\n createEmailToken(userId, email, phrase) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"email\"');\n }\n const apiPath = '/account/tokens/email';\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof phrase !== 'undefined') {\n payload['phrase'] = phrase;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Create magic URL token\n *\n * Sends the user an email with a secret key for creating a session. If the provided user ID has not been registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [POST /v1/account/sessions/token](https://appconda.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The link sent to the user's email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appconda instance by default.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appconda.io/docs/authentication-security#limits).\n\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} url\n * @param {boolean} phrase\n * @throws {AppcondaException}\n * @returns {Promise<Models.Token>}\n */\n createMagicURLToken(userId, email, url, phrase) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"email\"');\n }\n const apiPath = '/account/tokens/magic-url';\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof phrase !== 'undefined') {\n payload['phrase'] = phrase;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Create OAuth2 token\n *\n * Allow the user to login to their account using the OAuth2 provider of their choice. Each OAuth2 provider should be enabled from the Appconda console first. Use the success and failure arguments to provide a redirect URL's back to your app when login is completed.\n\nIf authentication succeeds, `userId` and `secret` of a token will be appended to the success URL as query parameters. These can be used to create a new session using the [Create session](https://appconda.io/docs/references/cloud/client-web/account#createSession) endpoint.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appconda.io/docs/authentication-security#limits).\n *\n * @param {OAuthProvider} provider\n * @param {string} success\n * @param {string} failure\n * @param {string[]} scopes\n * @throws {AppcondaException}\n * @returns {Promise<void | string>}\n */\n createOAuth2Token(provider, success, failure, scopes) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof provider === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"provider\"');\n }\n const apiPath = '/account/tokens/oauth2/{provider}'.replace('{provider}', provider);\n const payload = {};\n if (typeof success !== 'undefined') {\n payload['success'] = success;\n }\n if (typeof failure !== 'undefined') {\n payload['failure'] = failure;\n }\n if (typeof scopes !== 'undefined') {\n payload['scopes'] = scopes;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {\n window.location.href = uri.toString();\n return;\n }\n else {\n return uri.toString();\n }\n });\n }\n /**\n * Create phone token\n *\n * Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [POST /v1/account/sessions/token](https://appconda.io/docs/references/cloud/client-web/account#createSession) endpoint to complete the login process. The secret sent to the user's phone is valid for 15 minutes.\n\nA user is limited to 10 active sessions at a time by default. [Learn more about session limits](https://appconda.io/docs/authentication-security#limits).\n *\n * @param {string} userId\n * @param {string} phone\n * @throws {AppcondaException}\n * @returns {Promise<Models.Token>}\n */\n createPhoneToken(userId, phone) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof phone === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"phone\"');\n }\n const apiPath = '/account/tokens/phone';\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof phone !== 'undefined') {\n payload['phone'] = phone;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Create email verification\n *\n * Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provided to be attached to the verification email. The provided URL should redirect the user back to your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](https://appconda.io/docs/references/cloud/client-web/account#updateVerification). The verification link sent to the user's email address is valid for 7 days.\n\nPlease note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md), the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n\n *\n * @param {string} url\n * @throws {AppcondaException}\n * @returns {Promise<Models.Token>}\n */\n createVerification(url) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"url\"');\n }\n const apiPath = '/account/verification';\n const payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Create email verification (confirmation)\n *\n * Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.\n *\n * @param {string} userId\n * @param {string} secret\n * @throws {AppcondaException}\n * @returns {Promise<Models.Token>}\n */\n updateVerification(userId, secret) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"secret\"');\n }\n const apiPath = '/account/verification';\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n /**\n * Create phone verification\n *\n * Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appconda.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appconda.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.Token>}\n */\n createPhoneVerification() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/account/verification/phone';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Update phone verification (confirmation)\n *\n * Use this endpoint to complete the user phone verification process. Use the **userId** and **secret** that were sent to your user's phone number to verify the user email ownership. If confirmed this route will return a 200 status code.\n *\n * @param {string} userId\n * @param {string} secret\n * @throws {AppcondaException}\n * @returns {Promise<Models.Token>}\n */\n updatePhoneVerification(userId, secret) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"secret\"');\n }\n const apiPath = '/account/verification/phone';\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/services/account.ts?");
|
|
424
190
|
|
|
425
191
|
/***/ }),
|
|
426
192
|
|
|
427
|
-
/***/ "./src/
|
|
428
|
-
|
|
429
|
-
!*** ./src/
|
|
430
|
-
|
|
193
|
+
/***/ "./src/services/avatars.ts":
|
|
194
|
+
/*!*********************************!*\
|
|
195
|
+
!*** ./src/services/avatars.ts ***!
|
|
196
|
+
\*********************************/
|
|
431
197
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
432
198
|
|
|
433
|
-
"use strict";
|
|
434
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"SchemaBroker\": () => (/* binding */ SchemaBroker)\n/* harmony export */ });\n/* harmony import */ var _ServiceBroker__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../ServiceBroker */ \"./src/sdk-console/brokers/ServiceBroker.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n/* export interface JiraAccessKeyParams {\n host: string;\n username: string;\n token: string;\n} */\nvar SchemaBroker = /** @class */ (function (_super) {\n __extends(SchemaBroker, _super);\n function SchemaBroker() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Object.defineProperty(SchemaBroker.prototype, \"ServiceName\", {\n get: function () {\n return 'schema';\n },\n enumerable: false,\n configurable: true\n });\n SchemaBroker.prototype.setRealm = function (realmId) {\n this.headers['x-realm-id'] = realmId;\n };\n SchemaBroker.prototype.create = function (databaseId, schema) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/create';\n payload = {};\n payload['databaseId'] = databaseId;\n payload['schema'] = schema;\n uri = new URL(this.config.endpoint + path);\n return [4 /*yield*/, this.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n SchemaBroker.Default = new SchemaBroker();\n return SchemaBroker;\n}(_ServiceBroker__WEBPACK_IMPORTED_MODULE_0__.ServiceBroker));\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/brokers/schema/SchemaBroker.ts?");
|
|
199
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Avatars\": () => (/* binding */ Avatars)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/client.ts\");\n\n\nclass Avatars {\n constructor(client) {\n this.client = client;\n }\n /**\n * Get browser icon\n *\n * You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appconda.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n *\n * @param {Browser} code\n * @param {number} width\n * @param {number} height\n * @param {number} quality\n * @throws {AppcondaException}\n * @returns {string}\n */\n getBrowser(code, width, height, quality) {\n if (typeof code === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"code\"');\n }\n const apiPath = '/avatars/browsers/{code}'.replace('{code}', code);\n const payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_client__WEBPACK_IMPORTED_MODULE_1__.Client.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n return uri.toString();\n }\n /**\n * Get credit card icon\n *\n * The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n\n *\n * @param {CreditCard} code\n * @param {number} width\n * @param {number} height\n * @param {number} quality\n * @throws {AppcondaException}\n * @returns {string}\n */\n getCreditCard(code, width, height, quality) {\n if (typeof code === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"code\"');\n }\n const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);\n const payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_client__WEBPACK_IMPORTED_MODULE_1__.Client.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n return uri.toString();\n }\n /**\n * Get favicon\n *\n * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.\n\nThis endpoint does not follow HTTP redirects.\n *\n * @param {string} url\n * @throws {AppcondaException}\n * @returns {string}\n */\n getFavicon(url) {\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"url\"');\n }\n const apiPath = '/avatars/favicon';\n const payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_client__WEBPACK_IMPORTED_MODULE_1__.Client.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n return uri.toString();\n }\n /**\n * Get country flag\n *\n * You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n\n *\n * @param {Flag} code\n * @param {number} width\n * @param {number} height\n * @param {number} quality\n * @throws {AppcondaException}\n * @returns {string}\n */\n getFlag(code, width, height, quality) {\n if (typeof code === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"code\"');\n }\n const apiPath = '/avatars/flags/{code}'.replace('{code}', code);\n const payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_client__WEBPACK_IMPORTED_MODULE_1__.Client.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n return uri.toString();\n }\n /**\n * Get image from URL\n *\n * Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.\n\nThis endpoint does not follow HTTP redirects.\n *\n * @param {string} url\n * @param {number} width\n * @param {number} height\n * @throws {AppcondaException}\n * @returns {string}\n */\n getImage(url, width, height) {\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"url\"');\n }\n const apiPath = '/avatars/image';\n const payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_client__WEBPACK_IMPORTED_MODULE_1__.Client.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n return uri.toString();\n }\n /**\n * Get user initials\n *\n * Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.\n\nYou can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.\n\nWhen one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.\n\n *\n * @param {string} name\n * @param {number} width\n * @param {number} height\n * @param {string} background\n * @throws {AppcondaException}\n * @returns {string}\n */\n getInitials(name, width, height, background) {\n const apiPath = '/avatars/initials';\n const payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof background !== 'undefined') {\n payload['background'] = background;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_client__WEBPACK_IMPORTED_MODULE_1__.Client.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n return uri.toString();\n }\n /**\n * Get QR code\n *\n * Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.\n\n *\n * @param {string} text\n * @param {number} size\n * @param {number} margin\n * @param {boolean} download\n * @throws {AppcondaException}\n * @returns {string}\n */\n getQR(text, size, margin, download) {\n if (typeof text === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"text\"');\n }\n const apiPath = '/avatars/qr';\n const payload = {};\n if (typeof text !== 'undefined') {\n payload['text'] = text;\n }\n if (typeof size !== 'undefined') {\n payload['size'] = size;\n }\n if (typeof margin !== 'undefined') {\n payload['margin'] = margin;\n }\n if (typeof download !== 'undefined') {\n payload['download'] = download;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_client__WEBPACK_IMPORTED_MODULE_1__.Client.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n return uri.toString();\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/services/avatars.ts?");
|
|
435
200
|
|
|
436
201
|
/***/ }),
|
|
437
202
|
|
|
438
|
-
/***/ "./src/
|
|
203
|
+
/***/ "./src/services/databases.ts":
|
|
439
204
|
/*!***********************************!*\
|
|
440
|
-
!*** ./src/
|
|
205
|
+
!*** ./src/services/databases.ts ***!
|
|
441
206
|
\***********************************/
|
|
442
207
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
443
208
|
|
|
444
|
-
"use strict";
|
|
445
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Client\": () => (/* binding */ Client),\n/* harmony export */ \"RealmoceanException\": () => (/* binding */ RealmoceanException),\n/* harmony export */ \"Query\": () => (/* reexport safe */ _query__WEBPACK_IMPORTED_MODULE_3__.Query)\n/* harmony export */ });\n/* harmony import */ var isomorphic_form_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! isomorphic-form-data */ \"./node_modules/isomorphic-form-data/lib/browser.js\");\n/* harmony import */ var isomorphic_form_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(isomorphic_form_data__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var cross_fetch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! cross-fetch */ \"./node_modules/cross-fetch/dist/browser-ponyfill.js\");\n/* harmony import */ var cross_fetch__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(cross_fetch__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./query */ \"./src/sdk-console/query.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\n\nfunction jsonToUrlEncoded(obj) {\n var formBody = [];\n for (var property in obj) {\n var encodedKey = encodeURIComponent(property);\n var encodedValue = void 0;\n if (typeof obj[property] === 'object') {\n encodedValue = encodeURIComponent(JSON.stringify(obj[property]));\n }\n else {\n encodedValue = encodeURIComponent(obj[property]);\n }\n formBody.push(encodedKey + \"=\" + encodedValue);\n }\n return formBody.join(\"&\");\n}\nvar RealmoceanException = /** @class */ (function (_super) {\n __extends(RealmoceanException, _super);\n function RealmoceanException(message, code, type, response) {\n if (code === void 0) { code = 0; }\n if (type === void 0) { type = ''; }\n if (response === void 0) { response = ''; }\n var _this = _super.call(this, message) || this;\n _this.name = 'RealmoceanException';\n _this.message = message;\n _this.code = code;\n _this.type = type;\n _this.response = response;\n return _this;\n }\n return RealmoceanException;\n}(Error));\nvar Client = /** @class */ (function () {\n function Client() {\n var _this = this;\n this.config = {\n endpoint: 'https://HOSTNAME/v1',\n endpointRealtime: '',\n project: '',\n key: '',\n jwt: '',\n locale: '',\n mode: '',\n };\n this.headers = {\n 'x-sdk-name': 'Console',\n 'x-sdk-platform': 'console',\n 'x-sdk-language': 'web',\n 'x-sdk-version': '0.1.0',\n 'X-Realmocean-Response-Format': '1.4.0',\n };\n this.realtime = {\n socket: undefined,\n timeout: undefined,\n url: '',\n channels: new Set(),\n subscriptions: new Map(),\n subscriptionsCounter: 0,\n reconnect: true,\n reconnectAttempts: 0,\n lastMessage: undefined,\n connect: function () {\n clearTimeout(_this.realtime.timeout);\n _this.realtime.timeout = window === null || window === void 0 ? void 0 : window.setTimeout(function () {\n _this.realtime.createSocket();\n }, 50);\n },\n getTimeout: function () {\n switch (true) {\n case _this.realtime.reconnectAttempts < 5:\n return 1000;\n case _this.realtime.reconnectAttempts < 15:\n return 5000;\n case _this.realtime.reconnectAttempts < 100:\n return 10000;\n default:\n return 60000;\n }\n },\n createSocket: function () {\n var _a, _b;\n if (_this.realtime.channels.size < 1)\n return;\n var channels = new URLSearchParams();\n channels.set('project', _this.config.project);\n _this.realtime.channels.forEach(function (channel) {\n channels.append('channels[]', channel);\n });\n var url = _this.config.endpointRealtime + '/realtime?' + channels.toString();\n if (url !== _this.realtime.url || // Check if URL is present\n !_this.realtime.socket || // Check if WebSocket has not been created\n ((_a = _this.realtime.socket) === null || _a === void 0 ? void 0 : _a.readyState) > WebSocket.OPEN // Check if WebSocket is CLOSING (3) or CLOSED (4)\n ) {\n if (_this.realtime.socket &&\n ((_b = _this.realtime.socket) === null || _b === void 0 ? void 0 : _b.readyState) < WebSocket.CLOSING // Close WebSocket if it is CONNECTING (0) or OPEN (1)\n ) {\n _this.realtime.reconnect = false;\n _this.realtime.socket.close();\n }\n _this.realtime.url = url;\n _this.realtime.socket = new WebSocket(url);\n _this.realtime.socket.addEventListener('message', _this.realtime.onMessage);\n _this.realtime.socket.addEventListener('open', function (_event) {\n _this.realtime.reconnectAttempts = 0;\n });\n _this.realtime.socket.addEventListener('close', function (event) {\n var _a, _b, _c;\n if (!_this.realtime.reconnect ||\n (((_b = (_a = _this.realtime) === null || _a === void 0 ? void 0 : _a.lastMessage) === null || _b === void 0 ? void 0 : _b.type) === 'error' && // Check if last message was of type error\n ((_c = _this.realtime) === null || _c === void 0 ? void 0 : _c.lastMessage.data).code === 1008 // Check for policy violation 1008\n )) {\n _this.realtime.reconnect = true;\n return;\n }\n var timeout = _this.realtime.getTimeout();\n console.error(\"Realtime got disconnected. Reconnect will be attempted in \".concat(timeout / 1000, \" seconds.\"), event.reason);\n setTimeout(function () {\n _this.realtime.reconnectAttempts++;\n _this.realtime.createSocket();\n }, timeout);\n });\n }\n },\n onMessage: function (event) {\n var _a, _b;\n try {\n var message = JSON.parse(event.data);\n _this.realtime.lastMessage = message;\n switch (message.type) {\n case 'connected':\n var cookie = JSON.parse((_a = window.localStorage.getItem('cookieFallback')) !== null && _a !== void 0 ? _a : '{}');\n var session = cookie === null || cookie === void 0 ? void 0 : cookie[\"a_session_\".concat(_this.config.project)];\n var messageData = message.data;\n if (session && !messageData.user) {\n (_b = _this.realtime.socket) === null || _b === void 0 ? void 0 : _b.send(JSON.stringify({\n type: 'authentication',\n data: {\n session: session\n }\n }));\n }\n break;\n case 'event':\n var data_1 = message.data;\n if (data_1 === null || data_1 === void 0 ? void 0 : data_1.channels) {\n var isSubscribed = data_1.channels.some(function (channel) { return _this.realtime.channels.has(channel); });\n if (!isSubscribed)\n return;\n _this.realtime.subscriptions.forEach(function (subscription) {\n if (data_1.channels.some(function (channel) { return subscription.channels.includes(channel); })) {\n setTimeout(function () { return subscription.callback(data_1); });\n }\n });\n }\n break;\n case 'error':\n throw message.data;\n default:\n break;\n }\n }\n catch (e) {\n console.error(e);\n }\n },\n cleanUp: function (channels) {\n _this.realtime.channels.forEach(function (channel) {\n if (channels.includes(channel)) {\n var found = Array.from(_this.realtime.subscriptions).some(function (_a) {\n var _key = _a[0], subscription = _a[1];\n return subscription.channels.includes(channel);\n });\n if (!found) {\n _this.realtime.channels.delete(channel);\n }\n }\n });\n }\n };\n }\n /**\n * Set Endpoint\n *\n * Your project endpoint\n *\n * @param {string} endpoint\n *\n * @returns {this}\n */\n Client.prototype.setEndpoint = function (endpoint) {\n this.config.endpoint = endpoint;\n this.config.endpointRealtime = this.config.endpointRealtime || this.config.endpoint.replace('https://', 'wss://').replace('http://', 'ws://');\n return this;\n };\n /**\n * Set Realtime Endpoint\n *\n * @param {string} endpointRealtime\n *\n * @returns {this}\n */\n Client.prototype.setEndpointRealtime = function (endpointRealtime) {\n this.config.endpointRealtime = endpointRealtime;\n return this;\n };\n /**\n * Set Project\n *\n * Your project ID\n *\n * @param value string\n *\n * @return {this}\n */\n Client.prototype.setProject = function (value) {\n this.headers['X-Realmocean-Realm'] = value;\n this.config.project = value;\n return this;\n };\n /**\n * Set Key\n *\n * Your secret API key\n *\n * @param value string\n *\n * @return {this}\n */\n Client.prototype.setKey = function (value) {\n this.headers['X-Realmocean-Key'] = value;\n this.config.key = value;\n return this;\n };\n /**\n * Set JWT\n *\n * Your secret JSON Web Token\n *\n * @param value string\n *\n * @return {this}\n */\n Client.prototype.setJWT = function (value) {\n this.headers['X-Realmocean-JWT'] = value;\n this.config.jwt = value;\n return this;\n };\n /**\n * Set Locale\n *\n * @param value string\n *\n * @return {this}\n */\n Client.prototype.setLocale = function (value) {\n this.headers['X-Realmocean-Locale'] = value;\n this.config.locale = value;\n return this;\n };\n /**\n * Set Mode\n *\n * @param value string\n *\n * @return {this}\n */\n Client.prototype.setMode = function (value) {\n if (value === undefined) {\n delete this.headers['X-Realmocean-Mode'];\n this.config.mode = undefined;\n }\n else {\n this.headers['X-Realmocean-Mode'] = value;\n this.config.mode = value;\n }\n return this;\n };\n /**\n * Subscribes to Realmocean events and passes you the payload in realtime.\n *\n * @param {string|string[]} channels\n * Channel to subscribe - pass a single channel as a string or multiple with an array of strings.\n *\n * Possible channels are:\n * - account\n * - collections\n * - collections.[ID]\n * - collections.[ID].documents\n * - documents\n * - documents.[ID]\n * - files\n * - files.[ID]\n * - executions\n * - executions.[ID]\n * - functions.[ID]\n * - teams\n * - teams.[ID]\n * - memberships\n * - memberships.[ID]\n * @param {(payload: RealtimeMessage) => void} callback Is called on every realtime update.\n * @returns {() => void} Unsubscribes from events.\n */\n Client.prototype.subscribe = function (channels, callback) {\n var _this = this;\n var channelArray = typeof channels === 'string' ? [channels] : channels;\n channelArray.forEach(function (channel) { return _this.realtime.channels.add(channel); });\n var counter = this.realtime.subscriptionsCounter++;\n this.realtime.subscriptions.set(counter, {\n channels: channelArray,\n callback: callback\n });\n this.realtime.connect();\n return function () {\n _this.realtime.subscriptions.delete(counter);\n _this.realtime.cleanUp(channelArray);\n _this.realtime.connect();\n };\n };\n Client.prototype.call = function (method_1, url_1) {\n return __awaiter(this, arguments, void 0, function (method, url, headers, params) {\n var options, _i, _a, _b, key, value, formData_1, _loop_1, key, data, response, cookieFallback, e_1;\n var _c;\n var _d, _e;\n if (headers === void 0) { headers = {}; }\n if (params === void 0) { params = {}; }\n return __generator(this, function (_f) {\n switch (_f.label) {\n case 0:\n method = method.toUpperCase();\n headers = Object.assign({}, this.headers, headers);\n options = {\n method: method,\n headers: headers,\n credentials: 'include'\n };\n if (typeof window !== 'undefined' && window.localStorage) {\n headers['X-Fallback-Cookies'] = (_d = window.localStorage.getItem('cookieFallback')) !== null && _d !== void 0 ? _d : '';\n }\n if (method === 'GET') {\n for (_i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_2__.Service.flatten(params)); _i < _a.length; _i++) {\n _b = _a[_i], key = _b[0], value = _b[1];\n url.searchParams.append(key, value);\n }\n }\n else {\n switch (headers['content-type']) {\n case 'application/json':\n options.body = JSON.stringify(params);\n break;\n case 'multipart/form-data':\n formData_1 = new FormData();\n _loop_1 = function (key) {\n if (Array.isArray(params[key])) {\n params[key].forEach(function (value) {\n formData_1.append(key + '[]', value);\n });\n }\n else {\n formData_1.append(key, params[key]);\n }\n };\n for (key in params) {\n _loop_1(key);\n }\n options.body = formData_1;\n delete headers['content-type'];\n break;\n case 'application/x-www-form-urlencoded':\n options.body = jsonToUrlEncoded(params);\n delete headers['content-type'];\n break;\n }\n }\n _f.label = 1;\n case 1:\n _f.trys.push([1, 7, , 8]);\n data = null;\n return [4 /*yield*/, (0,cross_fetch__WEBPACK_IMPORTED_MODULE_1__.fetch)(url.toString(), options)];\n case 2:\n response = _f.sent();\n if (!((_e = response.headers.get('content-type')) === null || _e === void 0 ? void 0 : _e.includes('application/json'))) return [3 /*break*/, 4];\n return [4 /*yield*/, response.json()];\n case 3:\n data = _f.sent();\n return [3 /*break*/, 6];\n case 4:\n _c = {};\n return [4 /*yield*/, response.text()];\n case 5:\n data = (_c.message = _f.sent(),\n _c);\n _f.label = 6;\n case 6:\n if (400 <= response.status) {\n throw new RealmoceanException(data === null || data === void 0 ? void 0 : data.message, response.status, data === null || data === void 0 ? void 0 : data.type, data);\n }\n cookieFallback = response.headers.get('X-Fallback-Cookies');\n if (typeof window !== 'undefined' && window.localStorage && cookieFallback) {\n window.console.warn('Realmocean is using localStorage for session management. Increase your security by adding a custom domain as your API endpoint.');\n window.localStorage.setItem('cookieFallback', cookieFallback);\n }\n return [2 /*return*/, data];\n case 7:\n e_1 = _f.sent();\n if (e_1 instanceof RealmoceanException) {\n throw e_1;\n }\n throw new RealmoceanException(e_1.message, e_1.code, e_1.type, e_1.response);\n case 8: return [2 /*return*/];\n }\n });\n });\n };\n return Client;\n}());\n\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/client.ts?");
|
|
209
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Databases\": () => (/* binding */ Databases)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../client */ \"./src/client.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nclass Databases {\n constructor(client) {\n this.client = client;\n }\n /**\n * List documents\n *\n * Get a list of all the user's documents in a given collection. You can use the query params to filter your results.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string[]} queries\n * @throws {AppcondaException}\n * @returns {Promise<Models.DocumentList<Document>>}\n */\n listDocuments(databaseId, collectionId, queries) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"collectionId\"');\n }\n const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n const payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Create document\n *\n * Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appconda.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} documentId\n * @param {Omit<Document, keyof Models.Document>} data\n * @param {string[]} permissions\n * @throws {AppcondaException}\n * @returns {Promise<Document>}\n */\n createDocument(databaseId, collectionId, documentId, data, permissions) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"collectionId\"');\n }\n if (typeof documentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"documentId\"');\n }\n if (typeof data === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"data\"');\n }\n const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n const payload = {};\n if (typeof documentId !== 'undefined') {\n payload['documentId'] = documentId;\n }\n if (typeof data !== 'undefined') {\n payload['data'] = data;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Get document\n *\n * Get a document by its unique ID. This endpoint response returns a JSON object with the document data.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} documentId\n * @param {string[]} queries\n * @throws {AppcondaException}\n * @returns {Promise<Document>}\n */\n getDocument(databaseId, collectionId, documentId, queries) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"collectionId\"');\n }\n if (typeof documentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"documentId\"');\n }\n const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);\n const payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Update document\n *\n * Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} documentId\n * @param {Partial<Omit<Document, keyof Models.Document>>} data\n * @param {string[]} permissions\n * @throws {AppcondaException}\n * @returns {Promise<Document>}\n */\n updateDocument(databaseId, collectionId, documentId, data, permissions) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"collectionId\"');\n }\n if (typeof documentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"documentId\"');\n }\n const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);\n const payload = {};\n if (typeof data !== 'undefined') {\n payload['data'] = data;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Delete document\n *\n * Delete a document by its unique ID.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} documentId\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n deleteDocument(databaseId, collectionId, documentId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"collectionId\"');\n }\n if (typeof documentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"documentId\"');\n }\n const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('delete', uri, apiHeaders, payload);\n });\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/services/databases.ts?");
|
|
446
210
|
|
|
447
211
|
/***/ }),
|
|
448
212
|
|
|
449
|
-
/***/ "./src/
|
|
450
|
-
/*!*******************************!*\
|
|
451
|
-
!*** ./src/sdk-console/id.ts ***!
|
|
452
|
-
\*******************************/
|
|
453
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
454
|
-
|
|
455
|
-
"use strict";
|
|
456
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ID\": () => (/* binding */ ID)\n/* harmony export */ });\nvar ID = /** @class */ (function () {\n function ID() {\n }\n ID.custom = function (id) {\n return id;\n };\n ID.unique = function () {\n return 'unique()';\n };\n return ID;\n}());\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/id.ts?");
|
|
457
|
-
|
|
458
|
-
/***/ }),
|
|
459
|
-
|
|
460
|
-
/***/ "./src/sdk-console/index.ts":
|
|
461
|
-
/*!**********************************!*\
|
|
462
|
-
!*** ./src/sdk-console/index.ts ***!
|
|
463
|
-
\**********************************/
|
|
464
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
465
|
-
|
|
466
|
-
"use strict";
|
|
467
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Client\": () => (/* reexport safe */ _client__WEBPACK_IMPORTED_MODULE_0__.Client),\n/* harmony export */ \"Query\": () => (/* reexport safe */ _client__WEBPACK_IMPORTED_MODULE_0__.Query),\n/* harmony export */ \"RealmoceanException\": () => (/* reexport safe */ _client__WEBPACK_IMPORTED_MODULE_0__.RealmoceanException),\n/* harmony export */ \"Account\": () => (/* reexport safe */ _services_account__WEBPACK_IMPORTED_MODULE_1__.Account),\n/* harmony export */ \"Avatars\": () => (/* reexport safe */ _services_avatars__WEBPACK_IMPORTED_MODULE_2__.Avatars),\n/* harmony export */ \"Assistant\": () => (/* reexport safe */ _services_assistant__WEBPACK_IMPORTED_MODULE_3__.Assistant),\n/* harmony export */ \"Console\": () => (/* reexport safe */ _services_console__WEBPACK_IMPORTED_MODULE_4__.Console),\n/* harmony export */ \"Databases\": () => (/* reexport safe */ _services_databases__WEBPACK_IMPORTED_MODULE_5__.Databases),\n/* harmony export */ \"Functions\": () => (/* reexport safe */ _services_functions__WEBPACK_IMPORTED_MODULE_6__.Functions),\n/* harmony export */ \"Graphql\": () => (/* reexport safe */ _services_graphql__WEBPACK_IMPORTED_MODULE_7__.Graphql),\n/* harmony export */ \"Health\": () => (/* reexport safe */ _services_health__WEBPACK_IMPORTED_MODULE_8__.Health),\n/* harmony export */ \"Locale\": () => (/* reexport safe */ _services_locale__WEBPACK_IMPORTED_MODULE_9__.Locale),\n/* harmony export */ \"Migrations\": () => (/* reexport safe */ _services_migrations__WEBPACK_IMPORTED_MODULE_10__.Migrations),\n/* harmony export */ \"Project\": () => (/* reexport safe */ _services_project__WEBPACK_IMPORTED_MODULE_11__.Project),\n/* harmony export */ \"Projects\": () => (/* reexport safe */ _services_projects__WEBPACK_IMPORTED_MODULE_12__.Projects),\n/* harmony export */ \"ProxyService\": () => (/* reexport safe */ _services_proxy__WEBPACK_IMPORTED_MODULE_13__.ProxyService),\n/* harmony export */ \"Storage\": () => (/* reexport safe */ _services_storage__WEBPACK_IMPORTED_MODULE_14__.Storage),\n/* harmony export */ \"Teams\": () => (/* reexport safe */ _services_teams__WEBPACK_IMPORTED_MODULE_15__.Teams),\n/* harmony export */ \"Users\": () => (/* reexport safe */ _services_users__WEBPACK_IMPORTED_MODULE_16__.Users),\n/* harmony export */ \"Vcs\": () => (/* reexport safe */ _services_vcs__WEBPACK_IMPORTED_MODULE_17__.Vcs),\n/* harmony export */ \"Permission\": () => (/* reexport safe */ _permission__WEBPACK_IMPORTED_MODULE_18__.Permission),\n/* harmony export */ \"Role\": () => (/* reexport safe */ _role__WEBPACK_IMPORTED_MODULE_19__.Role),\n/* harmony export */ \"ID\": () => (/* reexport safe */ _id__WEBPACK_IMPORTED_MODULE_20__.ID),\n/* harmony export */ \"CspBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.CspBroker),\n/* harmony export */ \"EmailBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.EmailBroker),\n/* harmony export */ \"EncryptionBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.EncryptionBroker),\n/* harmony export */ \"GithubBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.GithubBroker),\n/* harmony export */ \"GooleDriveBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.GooleDriveBroker),\n/* harmony export */ \"JiraBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.JiraBroker),\n/* harmony export */ \"MiningBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.MiningBroker),\n/* harmony export */ \"QdmsBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.QdmsBroker),\n/* harmony export */ \"RegistryBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.RegistryBroker),\n/* harmony export */ \"SchemaBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.SchemaBroker),\n/* harmony export */ \"ServiceBroker\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.ServiceBroker),\n/* harmony export */ \"ServiceNames\": () => (/* reexport safe */ _brokers__WEBPACK_IMPORTED_MODULE_22__.ServiceNames),\n/* harmony export */ \"AppletBase\": () => (/* reexport safe */ _applets__WEBPACK_IMPORTED_MODULE_23__.AppletBase),\n/* harmony export */ \"LogManagementApplet\": () => (/* reexport safe */ _applets__WEBPACK_IMPORTED_MODULE_23__.LogManagementApplet),\n/* harmony export */ \"TaskManagement\": () => (/* reexport safe */ _applets__WEBPACK_IMPORTED_MODULE_23__.TaskManagement)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./client */ \"./src/sdk-console/client.ts\");\n/* harmony import */ var _services_account__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./services/account */ \"./src/sdk-console/services/account.ts\");\n/* harmony import */ var _services_avatars__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./services/avatars */ \"./src/sdk-console/services/avatars.ts\");\n/* harmony import */ var _services_assistant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/assistant */ \"./src/sdk-console/services/assistant.ts\");\n/* harmony import */ var _services_console__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./services/console */ \"./src/sdk-console/services/console.ts\");\n/* harmony import */ var _services_databases__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./services/databases */ \"./src/sdk-console/services/databases.ts\");\n/* harmony import */ var _services_functions__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./services/functions */ \"./src/sdk-console/services/functions.ts\");\n/* harmony import */ var _services_graphql__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./services/graphql */ \"./src/sdk-console/services/graphql.ts\");\n/* harmony import */ var _services_health__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./services/health */ \"./src/sdk-console/services/health.ts\");\n/* harmony import */ var _services_locale__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./services/locale */ \"./src/sdk-console/services/locale.ts\");\n/* harmony import */ var _services_migrations__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./services/migrations */ \"./src/sdk-console/services/migrations.ts\");\n/* harmony import */ var _services_project__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./services/project */ \"./src/sdk-console/services/project.ts\");\n/* harmony import */ var _services_projects__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./services/projects */ \"./src/sdk-console/services/projects.ts\");\n/* harmony import */ var _services_proxy__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./services/proxy */ \"./src/sdk-console/services/proxy.ts\");\n/* harmony import */ var _services_storage__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./services/storage */ \"./src/sdk-console/services/storage.ts\");\n/* harmony import */ var _services_teams__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./services/teams */ \"./src/sdk-console/services/teams.ts\");\n/* harmony import */ var _services_users__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./services/users */ \"./src/sdk-console/services/users.ts\");\n/* harmony import */ var _services_vcs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./services/vcs */ \"./src/sdk-console/services/vcs.ts\");\n/* harmony import */ var _permission__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./permission */ \"./src/sdk-console/permission.ts\");\n/* harmony import */ var _role__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./role */ \"./src/sdk-console/role.ts\");\n/* harmony import */ var _id__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./id */ \"./src/sdk-console/id.ts\");\n/* harmony import */ var _models__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./models */ \"./src/sdk-console/models.ts\");\n/* harmony import */ var _brokers__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./brokers */ \"./src/sdk-console/brokers/index.ts\");\n/* harmony import */ var _applets__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./applets */ \"./src/sdk-console/applets/index.ts\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/index.ts?");
|
|
468
|
-
|
|
469
|
-
/***/ }),
|
|
470
|
-
|
|
471
|
-
/***/ "./src/sdk-console/models.ts":
|
|
213
|
+
/***/ "./src/services/functions.ts":
|
|
472
214
|
/*!***********************************!*\
|
|
473
|
-
!*** ./src/
|
|
215
|
+
!*** ./src/services/functions.ts ***!
|
|
474
216
|
\***********************************/
|
|
475
217
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
476
218
|
|
|
477
|
-
"use
|
|
478
|
-
eval("__webpack_require__.r(__webpack_exports__);\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/models.ts?");
|
|
479
|
-
|
|
480
|
-
/***/ }),
|
|
481
|
-
|
|
482
|
-
/***/ "./src/sdk-console/permission.ts":
|
|
483
|
-
/*!***************************************!*\
|
|
484
|
-
!*** ./src/sdk-console/permission.ts ***!
|
|
485
|
-
\***************************************/
|
|
486
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
487
|
-
|
|
488
|
-
"use strict";
|
|
489
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Permission\": () => (/* binding */ Permission)\n/* harmony export */ });\nvar Permission = /** @class */ (function () {\n function Permission() {\n }\n Permission.read = function (role) {\n return \"read(\\\"\".concat(role, \"\\\")\");\n };\n Permission.write = function (role) {\n return \"write(\\\"\".concat(role, \"\\\")\");\n };\n Permission.create = function (role) {\n return \"create(\\\"\".concat(role, \"\\\")\");\n };\n Permission.update = function (role) {\n return \"update(\\\"\".concat(role, \"\\\")\");\n };\n Permission.delete = function (role) {\n return \"delete(\\\"\".concat(role, \"\\\")\");\n };\n return Permission;\n}());\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/permission.ts?");
|
|
219
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Functions\": () => (/* binding */ Functions)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../client */ \"./src/client.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nclass Functions {\n constructor(client) {\n this.client = client;\n }\n /**\n * List executions\n *\n * Get a list of all the current user function execution logs. You can use the query params to filter your results.\n *\n * @param {string} functionId\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppcondaException}\n * @returns {Promise<Models.ExecutionList>}\n */\n listExecutions(functionId, queries, search) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"functionId\"');\n }\n const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);\n const payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Create execution\n *\n * Trigger a function execution. The returned object will return you the current execution status. You can ping the `Get Execution` endpoint to get updates on the current execution status. Once this endpoint is called, your function execution process will start asynchronously.\n *\n * @param {string} functionId\n * @param {string} body\n * @param {boolean} async\n * @param {string} xpath\n * @param {ExecutionMethod} method\n * @param {object} headers\n * @param {string} scheduledAt\n * @throws {AppcondaException}\n * @returns {Promise<Models.Execution>}\n */\n createExecution(functionId, body, async, xpath, method, headers, scheduledAt) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"functionId\"');\n }\n const apiPath = '/functions/{functionId}/executions'.replace('{functionId}', functionId);\n const payload = {};\n if (typeof body !== 'undefined') {\n payload['body'] = body;\n }\n if (typeof async !== 'undefined') {\n payload['async'] = async;\n }\n if (typeof xpath !== 'undefined') {\n payload['path'] = xpath;\n }\n if (typeof method !== 'undefined') {\n payload['method'] = method;\n }\n if (typeof headers !== 'undefined') {\n payload['headers'] = headers;\n }\n if (typeof scheduledAt !== 'undefined') {\n payload['scheduledAt'] = scheduledAt;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Get execution\n *\n * Get a function execution log by its unique ID.\n *\n * @param {string} functionId\n * @param {string} executionId\n * @throws {AppcondaException}\n * @returns {Promise<Models.Execution>}\n */\n getExecution(functionId, executionId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"functionId\"');\n }\n if (typeof executionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"executionId\"');\n }\n const apiPath = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/services/functions.ts?");
|
|
490
220
|
|
|
491
221
|
/***/ }),
|
|
492
222
|
|
|
493
|
-
/***/ "./src/
|
|
494
|
-
/*!**********************************!*\
|
|
495
|
-
!*** ./src/sdk-console/query.ts ***!
|
|
496
|
-
\**********************************/
|
|
497
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
498
|
-
|
|
499
|
-
"use strict";
|
|
500
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Query\": () => (/* binding */ Query)\n/* harmony export */ });\nvar Query = /** @class */ (function () {\n function Query() {\n }\n Query.equal = function (attribute, value) {\n return Query.addQuery(attribute, \"equal\", value);\n };\n Query.notEqual = function (attribute, value) {\n return Query.addQuery(attribute, \"notEqual\", value);\n };\n Query.lessThan = function (attribute, value) {\n return Query.addQuery(attribute, \"lessThan\", value);\n };\n Query.lessThanEqual = function (attribute, value) {\n return Query.addQuery(attribute, \"lessThanEqual\", value);\n };\n Query.greaterThan = function (attribute, value) {\n return Query.addQuery(attribute, \"greaterThan\", value);\n };\n Query.greaterThanEqual = function (attribute, value) {\n return Query.addQuery(attribute, \"greaterThanEqual\", value);\n };\n Query.isNull = function (attribute) {\n return \"isNull(\\\"\".concat(attribute, \"\\\")\");\n };\n Query.isNotNull = function (attribute) {\n return \"isNotNull(\\\"\".concat(attribute, \"\\\")\");\n };\n Query.between = function (attribute, start, end) {\n return \"between(\\\"\".concat(attribute, \"\\\", [\").concat(Query.parseValues(start), \",\").concat(Query.parseValues(end), \"])\");\n };\n Query.startsWith = function (attribute, value) {\n return Query.addQuery(attribute, \"startsWith\", value);\n };\n Query.endsWith = function (attribute, value) {\n return Query.addQuery(attribute, \"endsWith\", value);\n };\n Query.select = function (attributes) {\n return \"select([\".concat(attributes.map(function (attr) { return \"\\\"\".concat(attr, \"\\\"\"); }).join(\",\"), \"])\");\n };\n Query.search = function (attribute, value) {\n return Query.addQuery(attribute, \"search\", value);\n };\n Query.orderDesc = function (attribute) {\n return \"orderDesc(\\\"\".concat(attribute, \"\\\")\");\n };\n Query.orderAsc = function (attribute) {\n return \"orderAsc(\\\"\".concat(attribute, \"\\\")\");\n };\n Query.cursorAfter = function (documentId) {\n return \"cursorAfter(\\\"\".concat(documentId, \"\\\")\");\n };\n Query.cursorBefore = function (documentId) {\n return \"cursorBefore(\\\"\".concat(documentId, \"\\\")\");\n };\n Query.limit = function (limit) {\n return \"limit(\".concat(limit, \")\");\n };\n Query.offset = function (offset) {\n return \"offset(\".concat(offset, \")\");\n };\n Query.addQuery = function (attribute, method, value) {\n return value instanceof Array\n ? \"\".concat(method, \"(\\\"\").concat(attribute, \"\\\", [\").concat(value\n .map(function (v) { return Query.parseValues(v); })\n .join(\",\"), \"])\")\n : \"\".concat(method, \"(\\\"\").concat(attribute, \"\\\", [\").concat(Query.parseValues(value), \"])\");\n };\n Query.parseValues = function (value) {\n return typeof value === \"string\" || value instanceof String\n ? \"\\\"\".concat(value, \"\\\"\")\n : \"\".concat(value);\n };\n return Query;\n}());\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/query.ts?");
|
|
501
|
-
|
|
502
|
-
/***/ }),
|
|
503
|
-
|
|
504
|
-
/***/ "./src/sdk-console/role.ts":
|
|
223
|
+
/***/ "./src/services/graphql.ts":
|
|
505
224
|
/*!*********************************!*\
|
|
506
|
-
!*** ./src/
|
|
225
|
+
!*** ./src/services/graphql.ts ***!
|
|
507
226
|
\*********************************/
|
|
508
227
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
509
228
|
|
|
510
|
-
"
|
|
511
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Role\": () => (/* binding */ Role)\n/* harmony export */ });\nvar Role = /** @class */ (function () {\n function Role() {\n }\n Role.any = function () {\n return 'any';\n };\n Role.user = function (id, status) {\n if (status === void 0) { status = ''; }\n if (status === '') {\n return \"user:\".concat(id);\n }\n return \"user:\".concat(id, \"/\").concat(status);\n };\n Role.users = function (status) {\n if (status === void 0) { status = ''; }\n if (status === '') {\n return 'users';\n }\n return \"users/\".concat(status);\n };\n Role.guests = function () {\n return 'guests';\n };\n Role.team = function (id, role) {\n if (role === void 0) { role = ''; }\n if (role === '') {\n return \"team:\".concat(id);\n }\n return \"team:\".concat(id, \"/\").concat(role);\n };\n Role.member = function (id) {\n return \"member:\".concat(id);\n };\n return Role;\n}());\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/role.ts?");
|
|
512
|
-
|
|
513
|
-
/***/ }),
|
|
514
|
-
|
|
515
|
-
/***/ "./src/sdk-console/service.ts":
|
|
516
|
-
/*!************************************!*\
|
|
517
|
-
!*** ./src/sdk-console/service.ts ***!
|
|
518
|
-
\************************************/
|
|
519
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
520
|
-
|
|
521
|
-
"use strict";
|
|
522
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Service\": () => (/* binding */ Service)\n/* harmony export */ });\nvar Service = /** @class */ (function () {\n function Service(client) {\n this.client = client;\n }\n Service.flatten = function (data, prefix) {\n if (prefix === void 0) { prefix = ''; }\n var output = {};\n for (var key in data) {\n var value = data[key];\n var finalKey = prefix ? \"\".concat(prefix, \"[\").concat(key, \"]\") : key;\n if (Array.isArray(value)) {\n output = Object.assign(output, this.flatten(value, finalKey));\n }\n else {\n output[finalKey] = value;\n }\n }\n return output;\n };\n Service.CHUNK_SIZE = 5 * 1024 * 1024; // 5MB\n return Service;\n}());\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/service.ts?");
|
|
229
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Graphql\": () => (/* binding */ Graphql)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../client */ \"./src/client.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nclass Graphql {\n constructor(client) {\n this.client = client;\n }\n /**\n * GraphQL endpoint\n *\n * Execute a GraphQL mutation.\n *\n * @param {object} query\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n query(query) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof query === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"query\"');\n }\n const apiPath = '/graphql';\n const payload = {};\n if (typeof query !== 'undefined') {\n payload['query'] = query;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'x-sdk-graphql': 'true',\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * GraphQL endpoint\n *\n * Execute a GraphQL mutation.\n *\n * @param {object} query\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n mutation(query) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof query === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"query\"');\n }\n const apiPath = '/graphql/mutation';\n const payload = {};\n if (typeof query !== 'undefined') {\n payload['query'] = query;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'x-sdk-graphql': 'true',\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/services/graphql.ts?");
|
|
523
230
|
|
|
524
231
|
/***/ }),
|
|
525
232
|
|
|
526
|
-
/***/ "./src/
|
|
527
|
-
|
|
528
|
-
!*** ./src/
|
|
529
|
-
|
|
530
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
531
|
-
|
|
532
|
-
"use strict";
|
|
533
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Account\": () => (/* binding */ Account)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar Account = /** @class */ (function (_super) {\n __extends(Account, _super);\n function Account(client) {\n return _super.call(this, client) || this;\n }\n /**\n * Get Account\n *\n * Get the currently logged in user.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.get = function () {\n console.log('account get');\n var path = '/account';\n var payload = {};\n var uri = new URL(this.client.config.endpoint + path);\n return this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload);\n };\n /**\n * Create Account\n *\n * Use this endpoint to allow a new user to register a new account in your\n * project. After the user registration completes successfully, you can use\n * the [/account/verfication](/docs/client/account#accountCreateVerification)\n * route to start verifying the user email address. To allow the new user to\n * login to their new account, you need to create a new [account\n * session](/docs/client/account#accountCreateSession).\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} password\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.create = function (userId, email, password, name, organizationId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/account';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof organizationId !== 'undefined') {\n payload['organizationId'] = organizationId;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Users\n *\n * Get a list of all the project's users. You can use the query params to\n * filter your results.\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.list = function (queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/list';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Account.prototype.listMemberships = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/memberships';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Email\n *\n * Update currently logged in user account email address. After changing user\n * address, the user confirmation status will get reset. A new confirmation\n * email is not sent automatically however you can use the send confirmation\n * email endpoint again to send the confirmation email. For security measures,\n * user password is required to complete this request.\n * This endpoint can also be used to convert an anonymous account to a normal\n * one, by passing an email address and a new password.\n *\n *\n * @param {string} email\n * @param {string} password\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updateEmail = function (email, password) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/account/email';\n payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Identities\n *\n * Get the list of identities for the currently logged in user.\n *\n * @param {string} queries\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.listIdentities = function (queries) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/identities';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Identity\n *\n * Delete an identity by its unique ID.\n *\n * @param {string} identityId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.deleteIdentity = function (identityId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof identityId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"identityId\"');\n }\n path = '/account/identities/{identityId}'.replace('{identityId}', identityId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create account using an invite code\n *\n * Use this endpoint to allow a new user to register a new account in your\n * project. After the user registration completes successfully, you can use\n * the [/account/verfication](/docs/client/account#accountCreateVerification)\n * route to start verifying the user email address. To allow the new user to\n * login to their new account, you need to create a new [account\n * session](/docs/client/account#accountCreateSession).\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} password\n * @param {string} name\n * @param {string} code\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.createWithInviteCode = function (userId, email, password, name, code) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/account/invite';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof code !== 'undefined') {\n payload['code'] = code;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create JWT\n *\n * Use this endpoint to create a JSON Web Token. You can use the resulting JWT\n * to authenticate on behalf of the current user when working with the\n * realmocean server-side API and SDKs. The JWT secret is valid for 15 minutes\n * from its creation and will be invalid if the user will logout in that time\n * frame.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.createJWT = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/jwt';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Logs\n *\n * Get the list of latest security activity logs for the currently logged in\n * user. Each log returns user IP address, location and date and time of log.\n *\n * @param {string[]} queries\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.listLogs = function (queries) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/logs';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Name\n *\n * Update currently logged in user account name.\n *\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updateName = function (name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/account/name';\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Password\n *\n * Update currently logged in user password. For validation, user is required\n * to pass in the new password, and the old password. For users created with\n * OAuth, Team Invites and Magic URL, oldPassword is optional.\n *\n * @param {string} password\n * @param {string} oldPassword\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updatePassword = function (password, oldPassword) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/account/password';\n payload = {};\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof oldPassword !== 'undefined') {\n payload['oldPassword'] = oldPassword;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Phone\n *\n * Update the currently logged in user's phone number. After updating the\n * phone number, the phone verification status will be reset. A confirmation\n * SMS is not sent automatically, however you can use the [POST\n * /account/verification/phone](/docs/client/account#accountCreatePhoneVerification)\n * endpoint to send a confirmation SMS.\n *\n * @param {string} phone\n * @param {string} password\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updatePhone = function (phone, password) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof phone === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"phone\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/account/phone';\n payload = {};\n if (typeof phone !== 'undefined') {\n payload['phone'] = phone;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Account Preferences\n *\n * Get the preferences as a key-value object for the currently logged in user.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.getPrefs = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/prefs';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Preferences\n *\n * Update currently logged in user account preferences. The object you pass is\n * stored as is, and replaces any previous value. The maximum allowed prefs\n * size is 64kB and throws error if exceeded.\n *\n * @param {Partial<Preferences>} prefs\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updatePrefs = function (prefs) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof prefs === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"prefs\"');\n }\n path = '/account/prefs';\n payload = {};\n if (typeof prefs !== 'undefined') {\n payload['prefs'] = prefs;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Password Recovery\n *\n * Sends the user an email with a temporary secret key for password reset.\n * When the user clicks the confirmation link he is redirected back to your\n * app password reset URL with the secret key and email address values\n * attached to the URL query string. Use the query string params to submit a\n * request to the [PUT\n * /account/recovery](/docs/client/account#accountUpdateRecovery) endpoint to\n * complete the process. The verification link sent to the user's email\n * address is valid for 1 hour.\n *\n * @param {string} email\n * @param {string} url\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.createRecovery = function (email, url) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"url\"');\n }\n path = '/account/recovery';\n payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Password Recovery (confirmation)\n *\n * Use this endpoint to complete the user account password reset. Both the\n * **userId** and **secret** arguments will be passed as query parameters to\n * the redirect URL you have provided when sending your request to the [POST\n * /account/recovery](/docs/client/account#accountCreateRecovery) endpoint.\n *\n * Please note that in order to avoid a [Redirect\n * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)\n * the only valid redirect URLs are the ones from domains you have set when\n * adding your platforms in the console interface.\n *\n * @param {string} userId\n * @param {string} secret\n * @param {string} password\n * @param {string} passwordAgain\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updateRecovery = function (userId, secret, password, passwordAgain) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"secret\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n if (typeof passwordAgain === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"passwordAgain\"');\n }\n path = '/account/recovery';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof passwordAgain !== 'undefined') {\n payload['passwordAgain'] = passwordAgain;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Sessions\n *\n * Get the list of active sessions across different devices for the currently\n * logged in user.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.listSessions = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/sessions';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Sessions\n *\n * Delete all sessions from the user account and remove any sessions cookies\n * from the end client.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.deleteSessions = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/sessions';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Anonymous Session\n *\n * Use this endpoint to allow a new user to register an anonymous account in\n * your project. This route will also create a new session for the user. To\n * allow the new user to convert an anonymous account to a normal account, you\n * need to update its [email and\n * password](/docs/client/account#accountUpdateEmail) or create an [OAuth2\n * session](/docs/client/account#accountCreateOAuth2Session).\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.createAnonymousSession = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/sessions/anonymous';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Email Session\n *\n * Allow the user to login into their account by providing a valid email and\n * password combination. This route will create a new session for the user.\n *\n * A user is limited to 10 active sessions at a time by default. [Learn more\n * about session limits](/docs/authentication-security#limits).\n *\n * @param {string} email\n * @param {string} password\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.createEmailSession = function (email, password) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/account/sessions/email';\n payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Magic URL session\n *\n * Sends the user an email with a secret key for creating a session. If the\n * provided user ID has not been registered, a new user will be created. When\n * the user clicks the link in the email, the user is redirected back to the\n * URL you provided with the secret key and userId values attached to the URL\n * query string. Use the query string parameters to submit a request to the\n * [PUT\n * /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession)\n * endpoint to complete the login process. The link sent to the user's email\n * address is valid for 1 hour. If you are on a mobile device you can leave\n * the URL parameter empty, so that the login completion will be handled by\n * your realmocean instance by default.\n *\n * A user is limited to 10 active sessions at a time by default. [Learn more\n * about session limits](/docs/authentication-security#limits).\n *\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} url\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.createMagicURLSession = function (userId, email, url) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n path = '/account/sessions/magic-url';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Account.prototype.createMagicURL = function (userId, email, url) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n path = '/account/sessions/magic-url/create';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Magic URL session (confirmation)\n *\n * Use this endpoint to complete creating the session with the Magic URL. Both\n * the **userId** and **secret** arguments will be passed as query parameters\n * to the redirect URL you have provided when sending your request to the\n * [POST\n * /account/sessions/magic-url](/docs/client/account#accountCreateMagicURLSession)\n * endpoint.\n *\n * Please note that in order to avoid a [Redirect\n * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)\n * the only valid redirect URLs are the ones from domains you have set when\n * adding your platforms in the console interface.\n *\n * @param {string} userId\n * @param {string} secret\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updateMagicURLSession = function (userId, secret) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"secret\"');\n }\n path = '/account/sessions/magic-url';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create OAuth2 Session\n *\n * Allow the user to login to their account using the OAuth2 provider of their\n * choice. Each OAuth2 provider should be enabled from the realmocean console\n * first. Use the success and failure arguments to provide a redirect URL's\n * back to your app when login is completed.\n *\n * If there is already an active session, the new session will be attached to\n * the logged-in account. If there are no active sessions, the server will\n * attempt to look for a user with the same email address as the email\n * received from the OAuth2 provider and attach the new session to the\n * existing user. If no matching user is found - the server will create a new\n * user.\n *\n * A user is limited to 10 active sessions at a time by default. [Learn more\n * about session limits](/docs/authentication-security#limits).\n *\n *\n * @param {string} provider\n * @param {string} success\n * @param {string} failure\n * @param {string[]} scopes\n * @throws {RealmoceanException}\n * @returns {void|string}\n */\n Account.prototype.createOAuth2Session = function (provider, success, failure, scopes) {\n if (typeof provider === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"provider\"');\n }\n var path = '/account/sessions/oauth2/{provider}'.replace('{provider}', provider);\n var payload = {};\n if (typeof success !== 'undefined') {\n payload['success'] = success;\n }\n if (typeof failure !== 'undefined') {\n payload['failure'] = failure;\n }\n if (typeof scopes !== 'undefined') {\n payload['scopes'] = scopes;\n }\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {\n window.location.href = uri.toString();\n }\n else {\n return uri;\n }\n };\n /**\n * Create Phone session\n *\n * Sends the user an SMS with a secret key for creating a session. If the\n * provided user ID has not be registered, a new user will be created. Use the\n * returned user ID and secret and submit a request to the [PUT\n * /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession)\n * endpoint to complete the login process. The secret sent to the user's phone\n * is valid for 15 minutes.\n *\n * A user is limited to 10 active sessions at a time by default. [Learn more\n * about session limits](/docs/authentication-security#limits).\n *\n * @param {string} userId\n * @param {string} phone\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.createPhoneSession = function (userId, phone) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof phone === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"phone\"');\n }\n path = '/account/sessions/phone';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof phone !== 'undefined') {\n payload['phone'] = phone;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Phone Session (confirmation)\n *\n * Use this endpoint to complete creating a session with SMS. Use the\n * **userId** from the\n * [createPhoneSession](/docs/client/account#accountCreatePhoneSession)\n * endpoint and the **secret** received via SMS to successfully update and\n * confirm the phone session.\n *\n * @param {string} userId\n * @param {string} secret\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updatePhoneSession = function (userId, secret) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"secret\"');\n }\n path = '/account/sessions/phone';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Session\n *\n * Use this endpoint to get a logged in user's session using a Session ID.\n * Inputting 'current' will return the current session being used.\n *\n * @param {string} sessionId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.getSession = function (sessionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof sessionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"sessionId\"');\n }\n path = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update OAuth Session (Refresh Tokens)\n *\n * Access tokens have limited lifespan and expire to mitigate security risks.\n * If session was created using an OAuth provider, this route can be used to\n * \"refresh\" the access token.\n *\n * @param {string} sessionId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updateSession = function (sessionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof sessionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"sessionId\"');\n }\n path = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Session\n *\n * Logout the user. Use 'current' as the session ID to logout on this device,\n * use a session ID to logout on another device. If you're looking to logout\n * the user on all devices, use [Delete\n * Sessions](/docs/client/account#accountDeleteSessions) instead.\n *\n * @param {string} sessionId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.deleteSession = function (sessionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof sessionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"sessionId\"');\n }\n path = '/account/sessions/{sessionId}'.replace('{sessionId}', sessionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Status\n *\n * Block the currently logged in user account. Behind the scene, the user\n * record is not deleted but permanently blocked from any access. To\n * completely delete a user, use the Users API instead.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updateStatus = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/status';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Email Verification\n *\n * Use this endpoint to send a verification message to your user email address\n * to confirm they are the valid owners of that address. Both the **userId**\n * and **secret** arguments will be passed as query parameters to the URL you\n * have provided to be attached to the verification email. The provided URL\n * should redirect the user back to your app and allow you to complete the\n * verification process by verifying both the **userId** and **secret**\n * parameters. Learn more about how to [complete the verification\n * process](/docs/client/account#accountUpdateEmailVerification). The\n * verification link sent to the user's email address is valid for 7 days.\n *\n * Please note that in order to avoid a [Redirect\n * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md),\n * the only valid redirect URLs are the ones from domains you have set when\n * adding your platforms in the console interface.\n *\n *\n * @param {string} url\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.createVerification = function (url) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"url\"');\n }\n path = '/account/verification';\n payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Email Verification (confirmation)\n *\n * Use this endpoint to complete the user email verification process. Use both\n * the **userId** and **secret** parameters that were attached to your app URL\n * to verify the user email ownership. If confirmed this route will return a\n * 200 status code.\n *\n * @param {string} userId\n * @param {string} secret\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updateVerification = function (userId, secret) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"secret\"');\n }\n path = '/account/verification';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Phone Verification\n *\n * Use this endpoint to send a verification SMS to the currently logged in\n * user. This endpoint is meant for use after updating a user's phone number\n * using the [accountUpdatePhone](/docs/client/account#accountUpdatePhone)\n * endpoint. Learn more about how to [complete the verification\n * process](/docs/client/account#accountUpdatePhoneVerification). The\n * verification code sent to the user's phone number is valid for 15 minutes.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.createPhoneVerification = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/account/verification/phone';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Phone Verification (confirmation)\n *\n * Use this endpoint to complete the user phone verification process. Use the\n * **userId** and **secret** that were sent to your user's phone number to\n * verify the user email ownership. If confirmed this route will return a 200\n * status code.\n *\n * @param {string} userId\n * @param {string} secret\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Account.prototype.updatePhoneVerification = function (userId, secret) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"secret\"');\n }\n path = '/account/verification/phone';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Account;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/account.ts?");
|
|
534
|
-
|
|
535
|
-
/***/ }),
|
|
536
|
-
|
|
537
|
-
/***/ "./src/sdk-console/services/assistant.ts":
|
|
538
|
-
/*!***********************************************!*\
|
|
539
|
-
!*** ./src/sdk-console/services/assistant.ts ***!
|
|
540
|
-
\***********************************************/
|
|
541
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
542
|
-
|
|
543
|
-
"use strict";
|
|
544
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Assistant\": () => (/* binding */ Assistant)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar Assistant = /** @class */ (function (_super) {\n __extends(Assistant, _super);\n function Assistant(client) {\n return _super.call(this, client) || this;\n }\n /**\n * Ask Query\n *\n *\n * @param {string} prompt\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Assistant.prototype.chat = function (prompt) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof prompt === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"prompt\"');\n }\n path = '/console/assistant';\n payload = {};\n if (typeof prompt !== 'undefined') {\n payload['prompt'] = prompt;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Assistant;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/assistant.ts?");
|
|
545
|
-
|
|
546
|
-
/***/ }),
|
|
547
|
-
|
|
548
|
-
/***/ "./src/sdk-console/services/avatars.ts":
|
|
549
|
-
/*!*********************************************!*\
|
|
550
|
-
!*** ./src/sdk-console/services/avatars.ts ***!
|
|
551
|
-
\*********************************************/
|
|
552
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
553
|
-
|
|
554
|
-
"use strict";
|
|
555
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Avatars\": () => (/* binding */ Avatars)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\n\nvar Avatars = /** @class */ (function (_super) {\n __extends(Avatars, _super);\n function Avatars(client) {\n return _super.call(this, client) || this;\n }\n /**\n * Get Browser Icon\n *\n * You can use this endpoint to show different browser icons to your users.\n * The code argument receives the browser code as it appears in your user [GET\n * /account/sessions](/docs/client/account#accountGetSessions) endpoint. Use\n * width, height and quality arguments to change the output settings.\n *\n * When one dimension is specified and the other is 0, the image is scaled\n * with preserved aspect ratio. If both dimensions are 0, the API provides an\n * image at source quality. If dimensions are not specified, the default size\n * of image returned is 100x100px.\n *\n * @param {string} code\n * @param {number} width\n * @param {number} height\n * @param {number} quality\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Avatars.prototype.getBrowser = function (code, width, height, quality) {\n if (typeof code === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"code\"');\n }\n var path = '/avatars/browsers/{code}'.replace('{code}', code);\n var payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n /**\n * Get Credit Card Icon\n *\n * The credit card endpoint will return you the icon of the credit card\n * provider you need. Use width, height and quality arguments to change the\n * output settings.\n *\n * When one dimension is specified and the other is 0, the image is scaled\n * with preserved aspect ratio. If both dimensions are 0, the API provides an\n * image at source quality. If dimensions are not specified, the default size\n * of image returned is 100x100px.\n *\n *\n * @param {string} code\n * @param {number} width\n * @param {number} height\n * @param {number} quality\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Avatars.prototype.getCreditCard = function (code, width, height, quality) {\n if (typeof code === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"code\"');\n }\n var path = '/avatars/credit-cards/{code}'.replace('{code}', code);\n var payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n /**\n * Get Favicon\n *\n * Use this endpoint to fetch the favorite icon (AKA favicon) of any remote\n * website URL.\n *\n *\n * @param {string} url\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Avatars.prototype.getFavicon = function (url) {\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"url\"');\n }\n var path = '/avatars/favicon';\n var payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n /**\n * Get Country Flag\n *\n * You can use this endpoint to show different country flags icons to your\n * users. The code argument receives the 2 letter country code. Use width,\n * height and quality arguments to change the output settings. Country codes\n * follow the [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) standard.\n *\n * When one dimension is specified and the other is 0, the image is scaled\n * with preserved aspect ratio. If both dimensions are 0, the API provides an\n * image at source quality. If dimensions are not specified, the default size\n * of image returned is 100x100px.\n *\n *\n * @param {string} code\n * @param {number} width\n * @param {number} height\n * @param {number} quality\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Avatars.prototype.getFlag = function (code, width, height, quality) {\n if (typeof code === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"code\"');\n }\n var path = '/avatars/flags/{code}'.replace('{code}', code);\n var payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n /**\n * Get Image from URL\n *\n * Use this endpoint to fetch a remote image URL and crop it to any image size\n * you want. This endpoint is very useful if you need to crop and display\n * remote images in your app or in case you want to make sure a 3rd party\n * image is properly served using a TLS protocol.\n *\n * When one dimension is specified and the other is 0, the image is scaled\n * with preserved aspect ratio. If both dimensions are 0, the API provides an\n * image at source quality. If dimensions are not specified, the default size\n * of image returned is 400x400px.\n *\n *\n * @param {string} url\n * @param {number} width\n * @param {number} height\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Avatars.prototype.getImage = function (url, width, height) {\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"url\"');\n }\n var path = '/avatars/image';\n var payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n /**\n * Get User Initials\n *\n * Use this endpoint to show your user initials avatar icon on your website or\n * app. By default, this route will try to print your logged-in user name or\n * email initials. You can also overwrite the user name if you pass the 'name'\n * parameter. If no name is given and no user is logged, an empty avatar will\n * be returned.\n *\n * You can use the color and background params to change the avatar colors. By\n * default, a random theme will be selected. The random theme will persist for\n * the user's initials when reloading the same theme will always return for\n * the same initials.\n *\n * When one dimension is specified and the other is 0, the image is scaled\n * with preserved aspect ratio. If both dimensions are 0, the API provides an\n * image at source quality. If dimensions are not specified, the default size\n * of image returned is 100x100px.\n *\n *\n * @param {string} name\n * @param {number} width\n * @param {number} height\n * @param {string} background\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Avatars.prototype.getInitials = function (name, width, height, background) {\n var path = '/avatars/initials';\n var payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof background !== 'undefined') {\n payload['background'] = background;\n }\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n /**\n * Get QR Code\n *\n * Converts a given plain text to a QR code image. You can use the query\n * parameters to change the size and style of the resulting image.\n *\n *\n * @param {string} text\n * @param {number} size\n * @param {number} margin\n * @param {boolean} download\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Avatars.prototype.getQR = function (text, size, margin, download) {\n if (typeof text === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"text\"');\n }\n var path = '/avatars/qr';\n var payload = {};\n if (typeof text !== 'undefined') {\n payload['text'] = text;\n }\n if (typeof size !== 'undefined') {\n payload['size'] = size;\n }\n if (typeof margin !== 'undefined') {\n payload['margin'] = margin;\n }\n if (typeof download !== 'undefined') {\n payload['download'] = download;\n }\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n return Avatars;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/avatars.ts?");
|
|
556
|
-
|
|
557
|
-
/***/ }),
|
|
558
|
-
|
|
559
|
-
/***/ "./src/sdk-console/services/console.ts":
|
|
560
|
-
/*!*********************************************!*\
|
|
561
|
-
!*** ./src/sdk-console/services/console.ts ***!
|
|
562
|
-
\*********************************************/
|
|
563
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
564
|
-
|
|
565
|
-
"use strict";
|
|
566
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Console\": () => (/* binding */ Console)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar Console = /** @class */ (function (_super) {\n __extends(Console, _super);\n function Console(client) {\n return _super.call(this, client) || this;\n }\n /**\n * Get Variables\n *\n * Get all Environment Variables that are relevant for the console.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Console.prototype.variables = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/console/variables';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Console;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/console.ts?");
|
|
567
|
-
|
|
568
|
-
/***/ }),
|
|
569
|
-
|
|
570
|
-
/***/ "./src/sdk-console/services/databases.ts":
|
|
571
|
-
/*!***********************************************!*\
|
|
572
|
-
!*** ./src/sdk-console/services/databases.ts ***!
|
|
573
|
-
\***********************************************/
|
|
574
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
575
|
-
|
|
576
|
-
"use strict";
|
|
577
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Databases\": () => (/* binding */ Databases)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\n/* harmony import */ var _utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/setUpProject */ \"./src/utils/setUpProject.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\n\nvar Databases = /** @class */ (function (_super) {\n __extends(Databases, _super);\n function Databases(client) {\n return _super.call(this, client) || this;\n }\n /**\n * List Databases\n *\n * Get a list of all databases from the current realmocean project. You can use\n * the search parameter to filter your results.\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.list = function (projectId, queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n path = '/databases';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Database\n *\n * Create a new Database.\n *\n *\n * @param {string} databaseId\n * @param {string} name\n * @param {boolean} enabled\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.create = function (projectId, databaseId, name, category, enabled) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/databases';\n payload = {};\n if (typeof databaseId !== 'undefined') {\n payload['databaseId'] = databaseId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof category !== 'undefined') {\n payload['category'] = category;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get usage stats for the database\n *\n *\n * @param {string} range\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.getUsage = function (projectId, range) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n path = '/databases/usage';\n payload = {};\n if (typeof range !== 'undefined') {\n payload['range'] = range;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Database\n *\n * Get a database by its unique ID. This endpoint response returns a JSON\n * object with the database metadata.\n *\n * @param {string} databaseId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.get = function (projectId, databaseId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n path = '/databases/{databaseId}'.replace('{databaseId}', databaseId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Database\n *\n * Update a database by its unique ID.\n *\n * @param {string} databaseId\n * @param {string} name\n * @param {boolean} enabled\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.update = function (projectId, databaseId, name, enabled) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/databases/{databaseId}'.replace('{databaseId}', databaseId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Database\n *\n * Delete a database by its unique ID. Only API keys with with databases.write\n * scope can delete a database.\n *\n * @param {string} databaseId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.delete = function (projectId, databaseId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n path = '/databases/{databaseId}'.replace('{databaseId}', databaseId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Collections\n *\n * Get a list of all collections that belong to the provided databaseId. You\n * can use the search parameter to filter your results.\n *\n * @param {string} databaseId\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.listCollections = function (projectId, databaseId, queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n path = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Collection\n *\n * Create a new Collection. Before using this route, you should create a new\n * database resource using either a [server\n * integration](/docs/server/databases#databasesCreateCollection) API or\n * directly from your database console.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} documentSecurity\n * @param {boolean} enabled\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createCollection = function (projectId, databaseId, collectionId, name, permissions, documentSecurity, enabled) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/databases/{databaseId}/collections'.replace('{databaseId}', databaseId);\n payload = {};\n if (typeof collectionId !== 'undefined') {\n payload['collectionId'] = collectionId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n if (typeof documentSecurity !== 'undefined') {\n payload['documentSecurity'] = documentSecurity;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Collection\n *\n * Get a collection by its unique ID. This endpoint response returns a JSON\n * object with the collection metadata.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.getCollection = function (projectId, databaseId, collectionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Collection\n *\n * Update a collection by its unique ID.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} documentSecurity\n * @param {boolean} enabled\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateCollection = function (projectId, databaseId, collectionId, name, permissions, documentSecurity, enabled) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n if (typeof documentSecurity !== 'undefined') {\n payload['documentSecurity'] = documentSecurity;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Collection\n *\n * Delete a collection by its unique ID. Only users with write permissions\n * have access to delete this resource.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.deleteCollection = function (projectId, databaseId, collectionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Attributes\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string[]} queries\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.listAttributes = function (projectId, databaseId, collectionId, queries) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Boolean Attribute\n *\n * Create a boolean attribute.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {boolean} xdefault\n * @param {boolean} array\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createBooleanAttribute = function (projectId, databaseId, collectionId, key, required, xdefault, array) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n if (typeof array !== 'undefined') {\n payload['array'] = array;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Boolean Attribute\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {boolean} xdefault\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateBooleanAttribute = function (projectId, databaseId, collectionId, key, required, xdefault) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n if (typeof xdefault === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"xdefault\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/boolean/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create DateTime Attribute\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {string} xdefault\n * @param {boolean} array\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createDatetimeAttribute = function (projectId, databaseId, collectionId, key, required, xdefault, array) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n if (typeof array !== 'undefined') {\n payload['array'] = array;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update DateTime Attribute\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {string} xdefault\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateDatetimeAttribute = function (projectId, databaseId, collectionId, key, required, xdefault) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n if (typeof xdefault === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"xdefault\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/datetime/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Email Attribute\n *\n * Create an email attribute.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {string} xdefault\n * @param {boolean} array\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createEmailAttribute = function (projectId, databaseId, collectionId, key, required, xdefault, array) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/email'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n if (typeof array !== 'undefined') {\n payload['array'] = array;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Email Attribute\n *\n * Update an email attribute. Changing the `default` value will not update\n * already existing documents.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {string} xdefault\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateEmailAttribute = function (projectId, databaseId, collectionId, key, required, xdefault) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n if (typeof xdefault === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"xdefault\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/email/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Enum Attribute\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {string[]} elements\n * @param {boolean} required\n * @param {string} xdefault\n * @param {boolean} array\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createEnumAttribute = function (projectId, databaseId, collectionId, key, elements, required, xdefault, array) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof elements === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"elements\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof elements !== 'undefined') {\n payload['elements'] = elements;\n }\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n if (typeof array !== 'undefined') {\n payload['array'] = array;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Enum Attribute\n *\n * Update an enum attribute. Changing the `default` value will not update\n * already existing documents.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {string[]} elements\n * @param {boolean} required\n * @param {string} xdefault\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateEnumAttribute = function (projectId, databaseId, collectionId, key, elements, required, xdefault) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof elements === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"elements\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n if (typeof xdefault === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"xdefault\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/enum/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n if (typeof elements !== 'undefined') {\n payload['elements'] = elements;\n }\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Float Attribute\n *\n * Create a float attribute. Optionally, minimum and maximum values can be\n * provided.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {number} min\n * @param {number} max\n * @param {number} xdefault\n * @param {boolean} array\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createFloatAttribute = function (projectId, databaseId, collectionId, key, required, min, max, xdefault, array) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/float'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof min !== 'undefined') {\n payload['min'] = min;\n }\n if (typeof max !== 'undefined') {\n payload['max'] = max;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n if (typeof array !== 'undefined') {\n payload['array'] = array;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Float Attribute\n *\n * Update a float attribute. Changing the `default` value will not update\n * already existing documents.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {number} min\n * @param {number} max\n * @param {number} xdefault\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateFloatAttribute = function (projectId, databaseId, collectionId, key, required, min, max, xdefault) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n if (typeof min === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"min\"');\n }\n if (typeof max === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"max\"');\n }\n if (typeof xdefault === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"xdefault\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/float/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof min !== 'undefined') {\n payload['min'] = min;\n }\n if (typeof max !== 'undefined') {\n payload['max'] = max;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Integer Attribute\n *\n * Create an integer attribute. Optionally, minimum and maximum values can be\n * provided.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {number} min\n * @param {number} max\n * @param {number} xdefault\n * @param {boolean} array\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createIntegerAttribute = function (projectId, databaseId, collectionId, key, required, min, max, xdefault, array) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof min !== 'undefined') {\n payload['min'] = min;\n }\n if (typeof max !== 'undefined') {\n payload['max'] = max;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n if (typeof array !== 'undefined') {\n payload['array'] = array;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Integer Attribute\n *\n * Update an integer attribute. Changing the `default` value will not update\n * already existing documents.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {number} min\n * @param {number} max\n * @param {number} xdefault\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateIntegerAttribute = function (projectId, databaseId, collectionId, key, required, min, max, xdefault) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n if (typeof min === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"min\"');\n }\n if (typeof max === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"max\"');\n }\n if (typeof xdefault === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"xdefault\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/integer/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof min !== 'undefined') {\n payload['min'] = min;\n }\n if (typeof max !== 'undefined') {\n payload['max'] = max;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create IP Address Attribute\n *\n * Create IP address attribute.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {string} xdefault\n * @param {boolean} array\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createIpAttribute = function (projectId, databaseId, collectionId, key, required, xdefault, array) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n if (typeof array !== 'undefined') {\n payload['array'] = array;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update IP Address Attribute\n *\n * Update an ip attribute. Changing the `default` value will not update\n * already existing documents.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {string} xdefault\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateIpAttribute = function (projectId, databaseId, collectionId, key, required, xdefault) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n if (typeof xdefault === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"xdefault\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/ip/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Relationship Attribute\n *\n * Create relationship attribute. [Learn more about relationship\n * attributes](/docs/databases-relationships#relationship-attributes).\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} relatedCollectionId\n * @param {string} type\n * @param {boolean} twoWay\n * @param {string} key\n * @param {string} twoWayKey\n * @param {string} onDelete\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createRelationshipAttribute = function (projectId, databaseId, collectionId, relatedDatabaseId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof relatedDatabaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"relatedDatabaseId\"');\n }\n if (typeof relatedCollectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"relatedCollectionId\"');\n }\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"type\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof relatedDatabaseId !== 'undefined') {\n payload['relatedDatabaseId'] = relatedDatabaseId;\n }\n if (typeof relatedCollectionId !== 'undefined') {\n payload['relatedCollectionId'] = relatedCollectionId;\n }\n if (typeof type !== 'undefined') {\n payload['type'] = type;\n }\n if (typeof twoWay !== 'undefined') {\n payload['twoWay'] = twoWay;\n }\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof twoWayKey !== 'undefined') {\n payload['twoWayKey'] = twoWayKey;\n }\n if (typeof onDelete !== 'undefined') {\n payload['onDelete'] = onDelete;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create String Attribute\n *\n * Create a string attribute.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {number} size\n * @param {boolean} required\n * @param {string} xdefault\n * @param {boolean} array\n * @param {boolean} encrypt\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createStringAttribute = function (projectId, databaseId, collectionId, key, size, required, xdefault, array, encrypt) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof size === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"size\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/string'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof size !== 'undefined') {\n payload['size'] = size;\n }\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n if (typeof array !== 'undefined') {\n payload['array'] = array;\n }\n if (typeof encrypt !== 'undefined') {\n payload['encrypt'] = encrypt;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update String Attribute\n *\n * Update a string attribute. Changing the `default` value will not update\n * already existing documents.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {string} xdefault\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateStringAttribute = function (projectId, databaseId, collectionId, key, required, xdefault) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n if (typeof xdefault === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"xdefault\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/string/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create URL Attribute\n *\n * Create a URL attribute.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {string} xdefault\n * @param {boolean} array\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createUrlAttribute = function (projectId, databaseId, collectionId, key, required, xdefault, array) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/url'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n if (typeof array !== 'undefined') {\n payload['array'] = array;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update URL Attribute\n *\n * Update an url attribute. Changing the `default` value will not update\n * already existing documents.\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {boolean} required\n * @param {string} xdefault\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateUrlAttribute = function (projectId, databaseId, collectionId, key, required, xdefault) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof required === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"required\"');\n }\n if (typeof xdefault === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"xdefault\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/url/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n if (typeof required !== 'undefined') {\n payload['required'] = required;\n }\n if (typeof xdefault !== 'undefined') {\n payload['default'] = xdefault;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Attribute\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.getAttribute = function (projectId, databaseId, collectionId, key) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Attribute\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.deleteAttribute = function (projectId, databaseId, collectionId, key) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Relationship Attribute\n *\n * Update relationship attribute. [Learn more about relationship\n * attributes](/docs/databases-relationships#relationship-attributes).\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {string} onDelete\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateRelationshipAttribute = function (projectId, databaseId, collectionId, key, onDelete) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n if (typeof onDelete !== 'undefined') {\n payload['onDelete'] = onDelete;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Databases.prototype.listDocuments = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return __awaiter(this, void 0, void 0, function () {\n var databaseId, collectionId, queries, path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n databaseId = null;\n collectionId = null;\n queries = [];\n if (args.length === 4) {\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(args[0], 'admin');\n databaseId = args[1];\n collectionId = args[2];\n queries = args[3];\n }\n else {\n databaseId = args[0];\n collectionId = args[1];\n queries = args[2];\n }\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Document\n *\n * Create a new Document. Before using this route, you should create a new\n * collection resource using either a [server\n * integration](/docs/server/databases#databasesCreateCollection) API or\n * directly from your database console.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} documentId\n * @param {Omit<Document, keyof Models.Document>} data\n * @param {string[]} permissions\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createDocument = function (projectId, databaseId, collectionId, documentId, data, permissions) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof documentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"documentId\"');\n }\n if (typeof data === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"data\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof documentId !== 'undefined') {\n payload['documentId'] = documentId;\n }\n if (typeof data !== 'undefined') {\n payload['data'] = data;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Document\n *\n * Get a document by its unique ID. This endpoint response returns a JSON\n * object with the document data.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} documentId\n * @param {string[]} queries\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.getDocument = function (projectId, databaseId, collectionId, documentId, queries) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof documentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException(\"Missing required parameter: \\\"documentId\\\", projectId:\".concat(projectId, \", collectionId: \").concat(collectionId));\n }\n path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Document\n *\n * Update a document by its unique ID. Using the patch method you can pass\n * only specific fields that will get updated.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} documentId\n * @param {Partial<Omit<Document, keyof Models.Document>>} data\n * @param {string[]} permissions\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.updateDocument = function (projectId, databaseId, collectionId, documentId, data, permissions) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof documentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"documentId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);\n payload = {};\n if (typeof data !== 'undefined') {\n payload['data'] = data;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Document\n *\n * Delete a document by its unique ID.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} documentId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.deleteDocument = function (projectId, databaseId, collectionId, documentId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof documentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"documentId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Document\n *\n * Delete a document by its unique ID.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} documentId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.deleteAllDocument = function (projectId, databaseId, collectionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/documents'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Document Logs\n *\n * Get the document activity logs list by its unique ID.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} documentId\n * @param {string[]} queries\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.listDocumentLogs = function (projectId, databaseId, collectionId, documentId, queries) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof documentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"documentId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Indexes\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string[]} queries\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.listIndexes = function (projectId, databaseId, collectionId, queries) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Index\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @param {string} type\n * @param {string[]} attributes\n * @param {string[]} orders\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.createIndex = function (projectId, databaseId, collectionId, key, type, attributes, orders) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"type\"');\n }\n if (typeof attributes === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"attributes\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/indexes'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof type !== 'undefined') {\n payload['type'] = type;\n }\n if (typeof attributes !== 'undefined') {\n payload['attributes'] = attributes;\n }\n if (typeof orders !== 'undefined') {\n payload['orders'] = orders;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Index\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.getIndex = function (projectId, databaseId, collectionId, key) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Index\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} key\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.deleteIndex = function (projectId, databaseId, collectionId, key) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/indexes/{key}'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{key}', key);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Collection Logs\n *\n * Get the collection activity logs list by its unique ID.\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string[]} queries\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.listCollectionLogs = function (projectId, databaseId, collectionId, queries) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/logs'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get usage stats for a collection\n *\n *\n * @param {string} databaseId\n * @param {string} collectionId\n * @param {string} range\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.getCollectionUsage = function (projectId, databaseId, collectionId, range) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n if (typeof collectionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"collectionId\"');\n }\n path = '/databases/{databaseId}/collections/{collectionId}/usage'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId);\n payload = {};\n if (typeof range !== 'undefined') {\n payload['range'] = range;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Database Logs\n *\n * Get the database activity logs list by its unique ID.\n *\n * @param {string} databaseId\n * @param {string[]} queries\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.listLogs = function (projectId, databaseId, queries) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n path = '/databases/{databaseId}/logs'.replace('{databaseId}', databaseId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get usage stats for the database\n *\n *\n * @param {string} databaseId\n * @param {string} range\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Databases.prototype.getDatabaseUsage = function (projectId, databaseId, range) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)(projectId, 'admin');\n if (typeof databaseId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseId\"');\n }\n path = '/databases/{databaseId}/usage'.replace('{databaseId}', databaseId);\n payload = {};\n if (typeof range !== 'undefined') {\n payload['range'] = range;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Databases;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/databases.ts?");
|
|
578
|
-
|
|
579
|
-
/***/ }),
|
|
580
|
-
|
|
581
|
-
/***/ "./src/sdk-console/services/functions.ts":
|
|
582
|
-
/*!***********************************************!*\
|
|
583
|
-
!*** ./src/sdk-console/services/functions.ts ***!
|
|
584
|
-
\***********************************************/
|
|
585
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
586
|
-
|
|
587
|
-
"use strict";
|
|
588
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Functions\": () => (/* binding */ Functions)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar Functions = /** @class */ (function (_super) {\n __extends(Functions, _super);\n function Functions(client) {\n return _super.call(this, client) || this;\n }\n /**\n * List Functions\n *\n * Get a list of all the project's functions. You can use the query params to\n * filter your results.\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.list = function (queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/functions';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Function\n *\n * Create a new function. You can pass a list of\n * [permissions](/docs/permissions) to allow different project users or team\n * with access to execute the function using the client API.\n *\n * @param {string} functionId\n * @param {string} name\n * @param {string} runtime\n * @param {string[]} execute\n * @param {string[]} events\n * @param {string} schedule\n * @param {number} timeout\n * @param {boolean} enabled\n * @param {boolean} logging\n * @param {string} entrypoint\n * @param {string} commands\n * @param {string} installationId\n * @param {string} providerRepositoryId\n * @param {string} providerBranch\n * @param {boolean} providerSilentMode\n * @param {string} providerRootDirectory\n * @param {string} templateRepository\n * @param {string} templateOwner\n * @param {string} templateRootDirectory\n * @param {string} templateBranch\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.create = function (functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory, templateRepository, templateOwner, templateRootDirectory, templateBranch) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n if (typeof runtime === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"runtime\"');\n }\n path = '/functions';\n payload = {};\n if (typeof functionId !== 'undefined') {\n payload['functionId'] = functionId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof runtime !== 'undefined') {\n payload['runtime'] = runtime;\n }\n if (typeof execute !== 'undefined') {\n payload['execute'] = execute;\n }\n if (typeof events !== 'undefined') {\n payload['events'] = events;\n }\n if (typeof schedule !== 'undefined') {\n payload['schedule'] = schedule;\n }\n if (typeof timeout !== 'undefined') {\n payload['timeout'] = timeout;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof logging !== 'undefined') {\n payload['logging'] = logging;\n }\n if (typeof entrypoint !== 'undefined') {\n payload['entrypoint'] = entrypoint;\n }\n if (typeof commands !== 'undefined') {\n payload['commands'] = commands;\n }\n if (typeof installationId !== 'undefined') {\n payload['installationId'] = installationId;\n }\n if (typeof providerRepositoryId !== 'undefined') {\n payload['providerRepositoryId'] = providerRepositoryId;\n }\n if (typeof providerBranch !== 'undefined') {\n payload['providerBranch'] = providerBranch;\n }\n if (typeof providerSilentMode !== 'undefined') {\n payload['providerSilentMode'] = providerSilentMode;\n }\n if (typeof providerRootDirectory !== 'undefined') {\n payload['providerRootDirectory'] = providerRootDirectory;\n }\n if (typeof templateRepository !== 'undefined') {\n payload['templateRepository'] = templateRepository;\n }\n if (typeof templateOwner !== 'undefined') {\n payload['templateOwner'] = templateOwner;\n }\n if (typeof templateRootDirectory !== 'undefined') {\n payload['templateRootDirectory'] = templateRootDirectory;\n }\n if (typeof templateBranch !== 'undefined') {\n payload['templateBranch'] = templateBranch;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List runtimes\n *\n * Get a list of all runtimes that are currently active on your instance.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.listRuntimes = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/functions/runtimes';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Functions Usage\n *\n *\n * @param {string} range\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.getUsage = function (range) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/functions/usage';\n payload = {};\n if (typeof range !== 'undefined') {\n payload['range'] = range;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Function\n *\n * Get a function by its unique ID.\n *\n * @param {string} functionId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.get = function (functionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n path = '/functions/{functionId}'.replace('{functionId}', functionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Function\n *\n * Update function by its unique ID.\n *\n * @param {string} functionId\n * @param {string} name\n * @param {string} runtime\n * @param {string[]} execute\n * @param {string[]} events\n * @param {string} schedule\n * @param {number} timeout\n * @param {boolean} enabled\n * @param {boolean} logging\n * @param {string} entrypoint\n * @param {string} commands\n * @param {string} installationId\n * @param {string} providerRepositoryId\n * @param {string} providerBranch\n * @param {boolean} providerSilentMode\n * @param {string} providerRootDirectory\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.update = function (functionId, name, runtime, execute, events, schedule, timeout, enabled, logging, entrypoint, commands, installationId, providerRepositoryId, providerBranch, providerSilentMode, providerRootDirectory) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n if (typeof runtime === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"runtime\"');\n }\n path = '/functions/{functionId}'.replace('{functionId}', functionId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof runtime !== 'undefined') {\n payload['runtime'] = runtime;\n }\n if (typeof execute !== 'undefined') {\n payload['execute'] = execute;\n }\n if (typeof events !== 'undefined') {\n payload['events'] = events;\n }\n if (typeof schedule !== 'undefined') {\n payload['schedule'] = schedule;\n }\n if (typeof timeout !== 'undefined') {\n payload['timeout'] = timeout;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof logging !== 'undefined') {\n payload['logging'] = logging;\n }\n if (typeof entrypoint !== 'undefined') {\n payload['entrypoint'] = entrypoint;\n }\n if (typeof commands !== 'undefined') {\n payload['commands'] = commands;\n }\n if (typeof installationId !== 'undefined') {\n payload['installationId'] = installationId;\n }\n if (typeof providerRepositoryId !== 'undefined') {\n payload['providerRepositoryId'] = providerRepositoryId;\n }\n if (typeof providerBranch !== 'undefined') {\n payload['providerBranch'] = providerBranch;\n }\n if (typeof providerSilentMode !== 'undefined') {\n payload['providerSilentMode'] = providerSilentMode;\n }\n if (typeof providerRootDirectory !== 'undefined') {\n payload['providerRootDirectory'] = providerRootDirectory;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Function\n *\n * Delete a function by its unique ID.\n *\n * @param {string} functionId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.delete = function (functionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n path = '/functions/{functionId}'.replace('{functionId}', functionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Deployments\n *\n * Get a list of all the project's code deployments. You can use the query\n * params to filter your results.\n *\n * @param {string} functionId\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.listDeployments = function (functionId, queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n path = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Deployment\n *\n * Create a new function code deployment. Use this endpoint to upload a new\n * version of your code function. To execute your newly uploaded code, you'll\n * need to update the function's deployment to use your new deployment UID.\n *\n * This endpoint accepts a tar.gz file compressed with your code. Make sure to\n * include any dependencies your code has within the compressed file. You can\n * learn more about code packaging in the [realmocean Cloud Functions\n * tutorial](/docs/functions).\n *\n * Use the \"command\" param to set the entrypoint used to execute your code.\n *\n * @param {string} functionId\n * @param {File} code\n * @param {boolean} activate\n * @param {string} entrypoint\n * @param {string} commands\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.createDeployment = function (functionId_1, code_1, activate_1, entrypoint_1, commands_1) {\n return __awaiter(this, arguments, void 0, function (functionId, code, activate, entrypoint, commands, onProgress) {\n var path, payload, uri, size, id, response, headers, counter, totalCounters, start, end, stream;\n if (onProgress === void 0) { onProgress = function (progress) { }; }\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof code === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"code\"');\n }\n if (typeof activate === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"activate\"');\n }\n path = '/functions/{functionId}/deployments'.replace('{functionId}', functionId);\n payload = {};\n if (typeof entrypoint !== 'undefined') {\n payload['entrypoint'] = entrypoint;\n }\n if (typeof commands !== 'undefined') {\n payload['commands'] = commands;\n }\n if (typeof code !== 'undefined') {\n payload['code'] = code;\n }\n if (typeof activate !== 'undefined') {\n payload['activate'] = activate;\n }\n uri = new URL(this.client.config.endpoint + path);\n if (!(code instanceof File)) {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Parameter \"code\" has to be a File.');\n }\n size = code.size;\n if (!(size <= _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'multipart/form-data',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n case 2:\n id = undefined;\n response = undefined;\n headers = {\n 'content-type': 'multipart/form-data',\n };\n counter = 0;\n totalCounters = Math.ceil(size / _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE);\n counter;\n _a.label = 3;\n case 3:\n if (!(counter < totalCounters)) return [3 /*break*/, 6];\n start = (counter * _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE);\n end = Math.min((((counter * _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE) + _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE) - 1), size);\n headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size;\n if (id) {\n headers['x-realmocean-id'] = id;\n }\n stream = code.slice(start, end + 1);\n payload['code'] = new File([stream], code.name);\n return [4 /*yield*/, this.client.call('post', uri, headers, payload)];\n case 4:\n response = _a.sent();\n if (!id) {\n id = response['$id'];\n }\n if (onProgress) {\n onProgress({\n $id: response.$id,\n progress: Math.min((counter + 1) * _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE - 1, size) / size * 100,\n sizeUploaded: end,\n chunksTotal: response.chunksTotal,\n chunksUploaded: response.chunksUploaded\n });\n }\n _a.label = 5;\n case 5:\n counter++;\n return [3 /*break*/, 3];\n case 6: return [2 /*return*/, response];\n }\n });\n });\n };\n /**\n * Get Deployment\n *\n * Get a code deployment by its unique ID.\n *\n * @param {string} functionId\n * @param {string} deploymentId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.getDeployment = function (functionId, deploymentId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof deploymentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"deploymentId\"');\n }\n path = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Function Deployment\n *\n * Update the function code deployment ID using the unique function ID. Use\n * this endpoint to switch the code deployment that should be executed by the\n * execution endpoint.\n *\n * @param {string} functionId\n * @param {string} deploymentId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.updateDeployment = function (functionId, deploymentId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof deploymentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"deploymentId\"');\n }\n path = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Deployment\n *\n * Delete a code deployment by its unique ID.\n *\n * @param {string} functionId\n * @param {string} deploymentId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.deleteDeployment = function (functionId, deploymentId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof deploymentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"deploymentId\"');\n }\n path = '/functions/{functionId}/deployments/{deploymentId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Build\n *\n *\n * @param {string} functionId\n * @param {string} deploymentId\n * @param {string} buildId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.createBuild = function (functionId, deploymentId, buildId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof deploymentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"deploymentId\"');\n }\n if (typeof buildId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"buildId\"');\n }\n path = '/functions/{functionId}/deployments/{deploymentId}/builds/{buildId}'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId).replace('{buildId}', buildId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Download Deployment\n *\n *\n * @param {string} functionId\n * @param {string} deploymentId\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Functions.prototype.downloadDeployment = function (functionId, deploymentId) {\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof deploymentId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"deploymentId\"');\n }\n var path = '/functions/{functionId}/deployments/{deploymentId}/download'.replace('{functionId}', functionId).replace('{deploymentId}', deploymentId);\n var payload = {};\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n /**\n * List Executions\n *\n * Get a list of all the current user function execution logs. You can use the\n * query params to filter your results.\n *\n * @param {string} functionId\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.listExecutions = function (functionId, queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n path = '/functions/{functionId}/executions'.replace('{functionId}', functionId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Execution\n *\n * Trigger a function execution. The returned object will return you the\n * current execution status. You can ping the `Get Execution` endpoint to get\n * updates on the current execution status. Once this endpoint is called, your\n * function execution process will start asynchronously.\n *\n * @param {string} functionId\n * @param {string} body\n * @param {boolean} async\n * @param {string} path\n * @param {string} method\n * @param {object} headers\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.createExecution = function (functionId, body, async, path, method, headers) {\n return __awaiter(this, void 0, void 0, function () {\n var _path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n _path = '/functions/{functionId}/executions'.replace('{functionId}', functionId);\n payload = {};\n if (typeof body !== 'undefined') {\n payload['body'] = body;\n }\n if (typeof async !== 'undefined') {\n payload['async'] = async;\n }\n if (typeof path !== 'undefined') {\n payload['path'] = path;\n }\n if (typeof method !== 'undefined') {\n payload['method'] = method;\n }\n if (typeof headers !== 'undefined') {\n payload['headers'] = headers;\n }\n uri = new URL(this.client.config.endpoint + _path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Execution\n *\n * Get a function execution log by its unique ID.\n *\n * @param {string} functionId\n * @param {string} executionId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.getExecution = function (functionId, executionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof executionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"executionId\"');\n }\n path = '/functions/{functionId}/executions/{executionId}'.replace('{functionId}', functionId).replace('{executionId}', executionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Function Usage\n *\n *\n * @param {string} functionId\n * @param {string} range\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.getFunctionUsage = function (functionId, range) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n path = '/functions/{functionId}/usage'.replace('{functionId}', functionId);\n payload = {};\n if (typeof range !== 'undefined') {\n payload['range'] = range;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Variables\n *\n * Get a list of all variables of a specific function.\n *\n * @param {string} functionId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.listVariables = function (functionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n path = '/functions/{functionId}/variables'.replace('{functionId}', functionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Variable\n *\n * Create a new function environment variable. These variables can be accessed\n * in the function at runtime as environment variables.\n *\n * @param {string} functionId\n * @param {string} key\n * @param {string} value\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.createVariable = function (functionId, key, value) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof value === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"value\"');\n }\n path = '/functions/{functionId}/variables'.replace('{functionId}', functionId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof value !== 'undefined') {\n payload['value'] = value;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Variable\n *\n * Get a variable by its unique ID.\n *\n * @param {string} functionId\n * @param {string} variableId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.getVariable = function (functionId, variableId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof variableId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"variableId\"');\n }\n path = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Variable\n *\n * Update variable by its unique ID.\n *\n * @param {string} functionId\n * @param {string} variableId\n * @param {string} key\n * @param {string} value\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.updateVariable = function (functionId, variableId, key, value) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof variableId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"variableId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n path = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof value !== 'undefined') {\n payload['value'] = value;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Variable\n *\n * Delete a variable by its unique ID.\n *\n * @param {string} functionId\n * @param {string} variableId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Functions.prototype.deleteVariable = function (functionId, variableId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof functionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"functionId\"');\n }\n if (typeof variableId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"variableId\"');\n }\n path = '/functions/{functionId}/variables/{variableId}'.replace('{functionId}', functionId).replace('{variableId}', variableId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Functions;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/functions.ts?");
|
|
589
|
-
|
|
590
|
-
/***/ }),
|
|
591
|
-
|
|
592
|
-
/***/ "./src/sdk-console/services/graphql.ts":
|
|
593
|
-
/*!*********************************************!*\
|
|
594
|
-
!*** ./src/sdk-console/services/graphql.ts ***!
|
|
595
|
-
\*********************************************/
|
|
596
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
597
|
-
|
|
598
|
-
"use strict";
|
|
599
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Graphql\": () => (/* binding */ Graphql)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar Graphql = /** @class */ (function (_super) {\n __extends(Graphql, _super);\n function Graphql(client) {\n return _super.call(this, client) || this;\n }\n /**\n * GraphQL Endpoint\n *\n * Execute a GraphQL mutation.\n *\n * @param {object} query\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Graphql.prototype.query = function (query) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof query === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"query\"');\n }\n path = '/graphql';\n payload = {};\n if (typeof query !== 'undefined') {\n payload['query'] = query;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'x-sdk-graphql': 'true',\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * GraphQL Endpoint\n *\n * Execute a GraphQL mutation.\n *\n * @param {object} query\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Graphql.prototype.mutation = function (query) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof query === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"query\"');\n }\n path = '/graphql/mutation';\n payload = {};\n if (typeof query !== 'undefined') {\n payload['query'] = query;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'x-sdk-graphql': 'true',\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Graphql;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/graphql.ts?");
|
|
600
|
-
|
|
601
|
-
/***/ }),
|
|
602
|
-
|
|
603
|
-
/***/ "./src/sdk-console/services/health.ts":
|
|
604
|
-
/*!********************************************!*\
|
|
605
|
-
!*** ./src/sdk-console/services/health.ts ***!
|
|
606
|
-
\********************************************/
|
|
607
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
608
|
-
|
|
609
|
-
"use strict";
|
|
610
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Health\": () => (/* binding */ Health)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar Health = /** @class */ (function (_super) {\n __extends(Health, _super);\n function Health(client) {\n return _super.call(this, client) || this;\n }\n /**\n * Get HTTP\n *\n * Check the realmocean HTTP server is up and responsive.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.get = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Antivirus\n *\n * Check the realmocean Antivirus server is up and connection is successful.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getAntivirus = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/anti-virus';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Cache\n *\n * Check the realmocean in-memory cache servers are up and connection is\n * successful.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getCache = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/cache';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get DB\n *\n * Check the realmocean database servers are up and connection is successful.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getDB = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/db';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get PubSub\n *\n * Check the realmocean pub-sub servers are up and connection is successful.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getPubSub = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/pubsub';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Queue\n *\n * Check the realmocean queue messaging servers are up and connection is\n * successful.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getQueue = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/queue';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Certificates Queue\n *\n * Get the number of certificates that are waiting to be issued against\n * [Letsencrypt](https://letsencrypt.org/) in the realmocean internal queue\n * server.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getQueueCertificates = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/queue/certificates';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Functions Queue\n *\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getQueueFunctions = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/queue/functions';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Logs Queue\n *\n * Get the number of logs that are waiting to be processed in the realmocean\n * internal queue server.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getQueueLogs = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/queue/logs';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Webhooks Queue\n *\n * Get the number of webhooks that are waiting to be processed in the realmocean\n * internal queue server.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getQueueWebhooks = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/queue/webhooks';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Local Storage\n *\n * Check the realmocean local storage device is up and connection is successful.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getStorageLocal = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/storage/local';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Time\n *\n * Check the realmocean server time is synced with Google remote NTP server. We\n * use this technology to smoothly handle leap seconds with no disruptive\n * events. The [Network Time\n * Protocol](https://en.wikipedia.org/wiki/Network_Time_Protocol) (NTP) is\n * used by hundreds of millions of computers and devices to synchronize their\n * clocks over the Internet. If your computer sets its own clock, it likely\n * uses NTP.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Health.prototype.getTime = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/health/time';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Health;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/health.ts?");
|
|
611
|
-
|
|
612
|
-
/***/ }),
|
|
613
|
-
|
|
614
|
-
/***/ "./src/sdk-console/services/locale.ts":
|
|
615
|
-
/*!********************************************!*\
|
|
616
|
-
!*** ./src/sdk-console/services/locale.ts ***!
|
|
617
|
-
\********************************************/
|
|
618
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
619
|
-
|
|
620
|
-
"use strict";
|
|
621
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Locale\": () => (/* binding */ Locale)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\nvar Locale = /** @class */ (function (_super) {\n __extends(Locale, _super);\n function Locale(client) {\n return _super.call(this, client) || this;\n }\n /**\n * Get User Locale\n *\n * Get the current user location based on IP. Returns an object with user\n * country code, country name, continent name, continent code, ip address and\n * suggested currency. You can use the locale header to get the data in a\n * supported language.\n *\n * ([IP Geolocation by DB-IP](https://db-ip.com))\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Locale.prototype.get = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/locale';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Locale Codes\n *\n * List of all locale codes in [ISO\n * 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Locale.prototype.listCodes = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/locale/codes';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Continents\n *\n * List of all continents. You can use the locale header to get the data in a\n * supported language.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Locale.prototype.listContinents = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/locale/continents';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Countries\n *\n * List of all countries. You can use the locale header to get the data in a\n * supported language.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Locale.prototype.listCountries = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/locale/countries';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List EU Countries\n *\n * List of all countries that are currently members of the EU. You can use the\n * locale header to get the data in a supported language.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Locale.prototype.listCountriesEU = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/locale/countries/eu';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Countries Phone Codes\n *\n * List of all countries phone codes. You can use the locale header to get the\n * data in a supported language.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Locale.prototype.listCountriesPhones = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/locale/countries/phones';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Currencies\n *\n * List of all currencies, including currency symbol, name, plural, and\n * decimal digits for all major and minor currencies. You can use the locale\n * header to get the data in a supported language.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Locale.prototype.listCurrencies = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/locale/currencies';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Languages\n *\n * List of all languages classified by ISO 639-1 including 2-letter code, name\n * in English, and name in the respective language.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Locale.prototype.listLanguages = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/locale/languages';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Locale;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/locale.ts?");
|
|
622
|
-
|
|
623
|
-
/***/ }),
|
|
624
|
-
|
|
625
|
-
/***/ "./src/sdk-console/services/migrations.ts":
|
|
626
|
-
/*!************************************************!*\
|
|
627
|
-
!*** ./src/sdk-console/services/migrations.ts ***!
|
|
628
|
-
\************************************************/
|
|
629
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
630
|
-
|
|
631
|
-
"use strict";
|
|
632
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Migrations\": () => (/* binding */ Migrations)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar Migrations = /** @class */ (function (_super) {\n __extends(Migrations, _super);\n function Migrations(client) {\n return _super.call(this, client) || this;\n }\n /**\n * List Migrations\n *\n *\n * @param {string} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.list = function (queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/migrations';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Migrate realmocean Data\n *\n *\n * @param {string[]} resources\n * @param {string} endpoint\n * @param {string} projectId\n * @param {string} apiKey\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.createRealmoceanMigration = function (resources, endpoint, projectId, apiKey) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof resources === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resources\"');\n }\n if (typeof endpoint === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"endpoint\"');\n }\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof apiKey === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"apiKey\"');\n }\n path = '/migrations/realmocean';\n payload = {};\n if (typeof resources !== 'undefined') {\n payload['resources'] = resources;\n }\n if (typeof endpoint !== 'undefined') {\n payload['endpoint'] = endpoint;\n }\n if (typeof projectId !== 'undefined') {\n payload['projectId'] = projectId;\n }\n if (typeof apiKey !== 'undefined') {\n payload['apiKey'] = apiKey;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Generate a report on realmocean Data\n *\n *\n * @param {string[]} resources\n * @param {string} endpoint\n * @param {string} projectID\n * @param {string} key\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.getRealmoceanReport = function (resources, endpoint, projectID, key) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof resources === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resources\"');\n }\n if (typeof endpoint === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"endpoint\"');\n }\n if (typeof projectID === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectID\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n path = '/migrations/realmocean/report';\n payload = {};\n if (typeof resources !== 'undefined') {\n payload['resources'] = resources;\n }\n if (typeof endpoint !== 'undefined') {\n payload['endpoint'] = endpoint;\n }\n if (typeof projectID !== 'undefined') {\n payload['projectID'] = projectID;\n }\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Migrate Firebase Data (Service Account)\n *\n *\n * @param {string[]} resources\n * @param {string} serviceAccount\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.createFirebaseMigration = function (resources, serviceAccount) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof resources === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resources\"');\n }\n if (typeof serviceAccount === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"serviceAccount\"');\n }\n path = '/migrations/firebase';\n payload = {};\n if (typeof resources !== 'undefined') {\n payload['resources'] = resources;\n }\n if (typeof serviceAccount !== 'undefined') {\n payload['serviceAccount'] = serviceAccount;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Revoke realmocean's authorization to access Firebase Projects\n *\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.deleteFirebaseAuth = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/migrations/firebase/deauthorize';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Migrate Firebase Data (OAuth)\n *\n *\n * @param {string[]} resources\n * @param {string} projectId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.createFirebaseOAuthMigration = function (resources, projectId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof resources === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resources\"');\n }\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n path = '/migrations/firebase/oauth';\n payload = {};\n if (typeof resources !== 'undefined') {\n payload['resources'] = resources;\n }\n if (typeof projectId !== 'undefined') {\n payload['projectId'] = projectId;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Firebase Projects\n *\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.listFirebaseProjects = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/migrations/firebase/projects';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Generate a report on Firebase Data\n *\n *\n * @param {string[]} resources\n * @param {string} serviceAccount\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.getFirebaseReport = function (resources, serviceAccount) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof resources === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resources\"');\n }\n if (typeof serviceAccount === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"serviceAccount\"');\n }\n path = '/migrations/firebase/report';\n payload = {};\n if (typeof resources !== 'undefined') {\n payload['resources'] = resources;\n }\n if (typeof serviceAccount !== 'undefined') {\n payload['serviceAccount'] = serviceAccount;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Generate a report on Firebase Data using OAuth\n *\n *\n * @param {string[]} resources\n * @param {string} projectId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.getFirebaseReportOAuth = function (resources, projectId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof resources === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resources\"');\n }\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n path = '/migrations/firebase/report/oauth';\n payload = {};\n if (typeof resources !== 'undefined') {\n payload['resources'] = resources;\n }\n if (typeof projectId !== 'undefined') {\n payload['projectId'] = projectId;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Migrate NHost Data\n *\n *\n * @param {string[]} resources\n * @param {string} subdomain\n * @param {string} region\n * @param {string} adminSecret\n * @param {string} database\n * @param {string} username\n * @param {string} password\n * @param {number} port\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.createNHostMigration = function (resources, subdomain, region, adminSecret, database, username, password, port) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof resources === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resources\"');\n }\n if (typeof subdomain === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"subdomain\"');\n }\n if (typeof region === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"region\"');\n }\n if (typeof adminSecret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"adminSecret\"');\n }\n if (typeof database === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"database\"');\n }\n if (typeof username === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"username\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/migrations/nhost';\n payload = {};\n if (typeof resources !== 'undefined') {\n payload['resources'] = resources;\n }\n if (typeof subdomain !== 'undefined') {\n payload['subdomain'] = subdomain;\n }\n if (typeof region !== 'undefined') {\n payload['region'] = region;\n }\n if (typeof adminSecret !== 'undefined') {\n payload['adminSecret'] = adminSecret;\n }\n if (typeof database !== 'undefined') {\n payload['database'] = database;\n }\n if (typeof username !== 'undefined') {\n payload['username'] = username;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof port !== 'undefined') {\n payload['port'] = port;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Generate a report on NHost Data\n *\n *\n * @param {string[]} resources\n * @param {string} subdomain\n * @param {string} region\n * @param {string} adminSecret\n * @param {string} database\n * @param {string} username\n * @param {string} password\n * @param {number} port\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.getNHostReport = function (resources, subdomain, region, adminSecret, database, username, password, port) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof resources === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resources\"');\n }\n if (typeof subdomain === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"subdomain\"');\n }\n if (typeof region === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"region\"');\n }\n if (typeof adminSecret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"adminSecret\"');\n }\n if (typeof database === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"database\"');\n }\n if (typeof username === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"username\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/migrations/nhost/report';\n payload = {};\n if (typeof resources !== 'undefined') {\n payload['resources'] = resources;\n }\n if (typeof subdomain !== 'undefined') {\n payload['subdomain'] = subdomain;\n }\n if (typeof region !== 'undefined') {\n payload['region'] = region;\n }\n if (typeof adminSecret !== 'undefined') {\n payload['adminSecret'] = adminSecret;\n }\n if (typeof database !== 'undefined') {\n payload['database'] = database;\n }\n if (typeof username !== 'undefined') {\n payload['username'] = username;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof port !== 'undefined') {\n payload['port'] = port;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Migrate Supabase Data\n *\n *\n * @param {string[]} resources\n * @param {string} endpoint\n * @param {string} apiKey\n * @param {string} databaseHost\n * @param {string} username\n * @param {string} password\n * @param {number} port\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.createSupabaseMigration = function (resources, endpoint, apiKey, databaseHost, username, password, port) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof resources === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resources\"');\n }\n if (typeof endpoint === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"endpoint\"');\n }\n if (typeof apiKey === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"apiKey\"');\n }\n if (typeof databaseHost === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseHost\"');\n }\n if (typeof username === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"username\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/migrations/supabase';\n payload = {};\n if (typeof resources !== 'undefined') {\n payload['resources'] = resources;\n }\n if (typeof endpoint !== 'undefined') {\n payload['endpoint'] = endpoint;\n }\n if (typeof apiKey !== 'undefined') {\n payload['apiKey'] = apiKey;\n }\n if (typeof databaseHost !== 'undefined') {\n payload['databaseHost'] = databaseHost;\n }\n if (typeof username !== 'undefined') {\n payload['username'] = username;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof port !== 'undefined') {\n payload['port'] = port;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Generate a report on Supabase Data\n *\n *\n * @param {string[]} resources\n * @param {string} endpoint\n * @param {string} apiKey\n * @param {string} databaseHost\n * @param {string} username\n * @param {string} password\n * @param {number} port\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.getSupabaseReport = function (resources, endpoint, apiKey, databaseHost, username, password, port) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof resources === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resources\"');\n }\n if (typeof endpoint === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"endpoint\"');\n }\n if (typeof apiKey === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"apiKey\"');\n }\n if (typeof databaseHost === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"databaseHost\"');\n }\n if (typeof username === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"username\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/migrations/supabase/report';\n payload = {};\n if (typeof resources !== 'undefined') {\n payload['resources'] = resources;\n }\n if (typeof endpoint !== 'undefined') {\n payload['endpoint'] = endpoint;\n }\n if (typeof apiKey !== 'undefined') {\n payload['apiKey'] = apiKey;\n }\n if (typeof databaseHost !== 'undefined') {\n payload['databaseHost'] = databaseHost;\n }\n if (typeof username !== 'undefined') {\n payload['username'] = username;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof port !== 'undefined') {\n payload['port'] = port;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Migration\n *\n *\n * @param {string} migrationId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.get = function (migrationId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof migrationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"migrationId\"');\n }\n path = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Retry Migration\n *\n *\n * @param {string} migrationId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.retry = function (migrationId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof migrationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"migrationId\"');\n }\n path = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Migration\n *\n *\n * @param {string} migrationId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Migrations.prototype.delete = function (migrationId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof migrationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"migrationId\"');\n }\n path = '/migrations/{migrationId}'.replace('{migrationId}', migrationId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Migrations;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/migrations.ts?");
|
|
633
|
-
|
|
634
|
-
/***/ }),
|
|
635
|
-
|
|
636
|
-
/***/ "./src/sdk-console/services/project.ts":
|
|
637
|
-
/*!*********************************************!*\
|
|
638
|
-
!*** ./src/sdk-console/services/project.ts ***!
|
|
639
|
-
\*********************************************/
|
|
640
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
641
|
-
|
|
642
|
-
"use strict";
|
|
643
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Project\": () => (/* binding */ Project)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar Project = /** @class */ (function (_super) {\n __extends(Project, _super);\n function Project(client) {\n return _super.call(this, client) || this;\n }\n /**\n * Get usage stats for a project\n *\n *\n * @param {string} range\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Project.prototype.getUsage = function (range) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/project/usage';\n payload = {};\n if (typeof range !== 'undefined') {\n payload['range'] = range;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Variables\n *\n * Get a list of all project variables. These variables will be accessible in\n * all realmocean Functions at runtime.\n *\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Project.prototype.listVariables = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/project/variables';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Variable\n *\n * Create a new project variable. This variable will be accessible in all\n * realmocean Functions at runtime.\n *\n * @param {string} key\n * @param {string} value\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Project.prototype.createVariable = function (key, value) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n if (typeof value === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"value\"');\n }\n path = '/project/variables';\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof value !== 'undefined') {\n payload['value'] = value;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Variable\n *\n * Get a project variable by its unique ID.\n *\n * @param {string} variableId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Project.prototype.getVariable = function (variableId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof variableId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"variableId\"');\n }\n path = '/project/variables/{variableId}'.replace('{variableId}', variableId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Variable\n *\n * Update project variable by its unique ID. This variable will be accessible\n * in all realmocean Functions at runtime.\n *\n * @param {string} variableId\n * @param {string} key\n * @param {string} value\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Project.prototype.updateVariable = function (variableId, key, value) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof variableId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"variableId\"');\n }\n if (typeof key === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"key\"');\n }\n path = '/project/variables/{variableId}'.replace('{variableId}', variableId);\n payload = {};\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof value !== 'undefined') {\n payload['value'] = value;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Variable\n *\n * Delete a project variable by its unique ID.\n *\n * @param {string} variableId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Project.prototype.deleteVariable = function (variableId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof variableId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"variableId\"');\n }\n path = '/project/variables/{variableId}'.replace('{variableId}', variableId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Project;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/project.ts?");
|
|
644
|
-
|
|
645
|
-
/***/ }),
|
|
646
|
-
|
|
647
|
-
/***/ "./src/sdk-console/services/projects.ts":
|
|
648
|
-
/*!**********************************************!*\
|
|
649
|
-
!*** ./src/sdk-console/services/projects.ts ***!
|
|
650
|
-
\**********************************************/
|
|
651
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
652
|
-
|
|
653
|
-
"use strict";
|
|
654
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Projects\": () => (/* binding */ Projects)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\n/* harmony import */ var _utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../utils/setUpProject */ \"./src/utils/setUpProject.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\n\nvar Projects = /** @class */ (function (_super) {\n __extends(Projects, _super);\n function Projects(client) {\n return _super.call(this, client) || this;\n }\n /**\n * List Projects\n *\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.list = function (queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/projects';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Project\n *\n *\n * @param {string} projectId\n * @param {string} name\n * @param {string} teamId\n * @param {string} region\n * @param {string} description\n * @param {string} logo\n * @param {string} url\n * @param {string} legalName\n * @param {string} legalCountry\n * @param {string} legalState\n * @param {string} legalCity\n * @param {string} legalAddress\n * @param {string} legalTaxId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.create = function (projectId, name, teamId, region, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n path = '/projects';\n payload = {};\n if (typeof projectId !== 'undefined') {\n payload['projectId'] = projectId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof teamId !== 'undefined') {\n payload['teamId'] = teamId;\n }\n if (typeof region !== 'undefined') {\n payload['region'] = region;\n }\n if (typeof description !== 'undefined') {\n payload['description'] = description;\n }\n if (typeof logo !== 'undefined') {\n payload['logo'] = logo;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof legalName !== 'undefined') {\n payload['legalName'] = legalName;\n }\n if (typeof legalCountry !== 'undefined') {\n payload['legalCountry'] = legalCountry;\n }\n if (typeof legalState !== 'undefined') {\n payload['legalState'] = legalState;\n }\n if (typeof legalCity !== 'undefined') {\n payload['legalCity'] = legalCity;\n }\n if (typeof legalAddress !== 'undefined') {\n payload['legalAddress'] = legalAddress;\n }\n if (typeof legalTaxId !== 'undefined') {\n payload['legalTaxId'] = legalTaxId;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Project\n *\n *\n * @param {string} projectId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.get = function (projectId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n (0,_utils_setUpProject__WEBPACK_IMPORTED_MODULE_2__.setUpProject)('console', undefined);\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n path = '/projects/{projectId}'.replace('{projectId}', projectId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Project\n *\n *\n * @param {string} projectId\n * @param {string} name\n * @param {string} description\n * @param {string} logo\n * @param {string} url\n * @param {string} legalName\n * @param {string} legalCountry\n * @param {string} legalState\n * @param {string} legalCity\n * @param {string} legalAddress\n * @param {string} legalTaxId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.update = function (projectId, name, description, logo, url, legalName, legalCountry, legalState, legalCity, legalAddress, legalTaxId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/projects/{projectId}'.replace('{projectId}', projectId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof description !== 'undefined') {\n payload['description'] = description;\n }\n if (typeof logo !== 'undefined') {\n payload['logo'] = logo;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof legalName !== 'undefined') {\n payload['legalName'] = legalName;\n }\n if (typeof legalCountry !== 'undefined') {\n payload['legalCountry'] = legalCountry;\n }\n if (typeof legalState !== 'undefined') {\n payload['legalState'] = legalState;\n }\n if (typeof legalCity !== 'undefined') {\n payload['legalCity'] = legalCity;\n }\n if (typeof legalAddress !== 'undefined') {\n payload['legalAddress'] = legalAddress;\n }\n if (typeof legalTaxId !== 'undefined') {\n payload['legalTaxId'] = legalTaxId;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Project\n *\n *\n * @param {string} projectId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.delete = function (projectId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n path = '/projects/{projectId}'.replace('{projectId}', projectId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Project Authentication Duration\n *\n *\n * @param {string} projectId\n * @param {number} duration\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateAuthDuration = function (projectId, duration) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof duration === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"duration\"');\n }\n path = '/projects/{projectId}/auth/duration'.replace('{projectId}', projectId);\n payload = {};\n if (typeof duration !== 'undefined') {\n payload['duration'] = duration;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Project users limit\n *\n *\n * @param {string} projectId\n * @param {number} limit\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateAuthLimit = function (projectId, limit) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof limit === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"limit\"');\n }\n path = '/projects/{projectId}/auth/limit'.replace('{projectId}', projectId);\n payload = {};\n if (typeof limit !== 'undefined') {\n payload['limit'] = limit;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Project user sessions limit\n *\n *\n * @param {string} projectId\n * @param {number} limit\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateAuthSessionsLimit = function (projectId, limit) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof limit === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"limit\"');\n }\n path = '/projects/{projectId}/auth/max-sessions'.replace('{projectId}', projectId);\n payload = {};\n if (typeof limit !== 'undefined') {\n payload['limit'] = limit;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update authentication password dictionary status. Use this endpoint to enable or disable the dicitonary check for user password\n *\n *\n * @param {string} projectId\n * @param {boolean} enabled\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateAuthPasswordDictionary = function (projectId, enabled) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof enabled === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"enabled\"');\n }\n path = '/projects/{projectId}/auth/password-dictionary'.replace('{projectId}', projectId);\n payload = {};\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update authentication password history. Use this endpoint to set the number of password history to save and 0 to disable password history.\n *\n *\n * @param {string} projectId\n * @param {number} limit\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateAuthPasswordHistory = function (projectId, limit) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof limit === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"limit\"');\n }\n path = '/projects/{projectId}/auth/password-history'.replace('{projectId}', projectId);\n payload = {};\n if (typeof limit !== 'undefined') {\n payload['limit'] = limit;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Enable or disable checking user passwords for similarity with their personal data.\n *\n *\n * @param {string} projectId\n * @param {boolean} enabled\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updatePersonalDataCheck = function (projectId, enabled) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof enabled === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"enabled\"');\n }\n path = '/projects/{projectId}/auth/personal-data'.replace('{projectId}', projectId);\n payload = {};\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Project auth method status. Use this endpoint to enable or disable a given auth method for this project.\n *\n *\n * @param {string} projectId\n * @param {string} method\n * @param {boolean} status\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateAuthStatus = function (projectId, method, status) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof method === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"method\"');\n }\n if (typeof status === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"status\"');\n }\n path = '/projects/{projectId}/auth/{method}'.replace('{projectId}', projectId).replace('{method}', method);\n payload = {};\n if (typeof status !== 'undefined') {\n payload['status'] = status;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Keys\n *\n *\n * @param {string} projectId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.listKeys = function (projectId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n path = '/projects/{projectId}/keys'.replace('{projectId}', projectId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Key\n *\n *\n * @param {string} projectId\n * @param {string} name\n * @param {string[]} scopes\n * @param {string} expire\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.createKey = function (projectId, name, scopes, expire) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n if (typeof scopes === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"scopes\"');\n }\n path = '/projects/{projectId}/keys'.replace('{projectId}', projectId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof scopes !== 'undefined') {\n payload['scopes'] = scopes;\n }\n if (typeof expire !== 'undefined') {\n payload['expire'] = expire;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Key\n *\n *\n * @param {string} projectId\n * @param {string} keyId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.getKey = function (projectId, keyId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof keyId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"keyId\"');\n }\n path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Key\n *\n *\n * @param {string} projectId\n * @param {string} keyId\n * @param {string} name\n * @param {string[]} scopes\n * @param {string} expire\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateKey = function (projectId, keyId, name, scopes, expire) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof keyId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"keyId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n if (typeof scopes === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"scopes\"');\n }\n path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof scopes !== 'undefined') {\n payload['scopes'] = scopes;\n }\n if (typeof expire !== 'undefined') {\n payload['expire'] = expire;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Key\n *\n *\n * @param {string} projectId\n * @param {string} keyId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.deleteKey = function (projectId, keyId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof keyId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"keyId\"');\n }\n path = '/projects/{projectId}/keys/{keyId}'.replace('{projectId}', projectId).replace('{keyId}', keyId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Project OAuth2\n *\n *\n * @param {string} projectId\n * @param {string} provider\n * @param {string} appId\n * @param {string} secret\n * @param {boolean} enabled\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateOAuth2 = function (projectId, provider, appId, secret, enabled) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof provider === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"provider\"');\n }\n path = '/projects/{projectId}/oauth2'.replace('{projectId}', projectId);\n payload = {};\n if (typeof provider !== 'undefined') {\n payload['provider'] = provider;\n }\n if (typeof appId !== 'undefined') {\n payload['appId'] = appId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Platforms\n *\n *\n * @param {string} projectId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.listPlatforms = function (projectId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n path = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Platform\n *\n *\n * @param {string} projectId\n * @param {string} type\n * @param {string} name\n * @param {string} key\n * @param {string} store\n * @param {string} hostname\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.createPlatform = function (projectId, type, name, key, store, hostname) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"type\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/projects/{projectId}/platforms'.replace('{projectId}', projectId);\n payload = {};\n if (typeof type !== 'undefined') {\n payload['type'] = type;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof store !== 'undefined') {\n payload['store'] = store;\n }\n if (typeof hostname !== 'undefined') {\n payload['hostname'] = hostname;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Platform\n *\n *\n * @param {string} projectId\n * @param {string} platformId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.getPlatform = function (projectId, platformId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof platformId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"platformId\"');\n }\n path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Platform\n *\n *\n * @param {string} projectId\n * @param {string} platformId\n * @param {string} name\n * @param {string} key\n * @param {string} store\n * @param {string} hostname\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updatePlatform = function (projectId, platformId, name, key, store, hostname) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof platformId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"platformId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof key !== 'undefined') {\n payload['key'] = key;\n }\n if (typeof store !== 'undefined') {\n payload['store'] = store;\n }\n if (typeof hostname !== 'undefined') {\n payload['hostname'] = hostname;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Platform\n *\n *\n * @param {string} projectId\n * @param {string} platformId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.deletePlatform = function (projectId, platformId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof platformId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"platformId\"');\n }\n path = '/projects/{projectId}/platforms/{platformId}'.replace('{projectId}', projectId).replace('{platformId}', platformId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update service status\n *\n *\n * @param {string} projectId\n * @param {string} service\n * @param {boolean} status\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateServiceStatus = function (projectId, service, status) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof service === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"service\"');\n }\n if (typeof status === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"status\"');\n }\n path = '/projects/{projectId}/service'.replace('{projectId}', projectId);\n payload = {};\n if (typeof service !== 'undefined') {\n payload['service'] = service;\n }\n if (typeof status !== 'undefined') {\n payload['status'] = status;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update all service status\n *\n *\n * @param {string} projectId\n * @param {boolean} status\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateServiceStatusAll = function (projectId, status) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof status === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"status\"');\n }\n path = '/projects/{projectId}/service/all'.replace('{projectId}', projectId);\n payload = {};\n if (typeof status !== 'undefined') {\n payload['status'] = status;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update SMTP configuration\n *\n *\n * @param {string} projectId\n * @param {boolean} enabled\n * @param {string} senderName\n * @param {string} senderEmail\n * @param {string} replyTo\n * @param {string} host\n * @param {number} port\n * @param {string} username\n * @param {string} password\n * @param {string} secure\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateSmtpConfiguration = function (projectId, enabled, senderName, senderEmail, replyTo, host, port, username, password, secure) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof enabled === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"enabled\"');\n }\n path = '/projects/{projectId}/smtp'.replace('{projectId}', projectId);\n payload = {};\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof senderName !== 'undefined') {\n payload['senderName'] = senderName;\n }\n if (typeof senderEmail !== 'undefined') {\n payload['senderEmail'] = senderEmail;\n }\n if (typeof replyTo !== 'undefined') {\n payload['replyTo'] = replyTo;\n }\n if (typeof host !== 'undefined') {\n payload['host'] = host;\n }\n if (typeof port !== 'undefined') {\n payload['port'] = port;\n }\n if (typeof username !== 'undefined') {\n payload['username'] = username;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof secure !== 'undefined') {\n payload['secure'] = secure;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Project Team\n *\n *\n * @param {string} projectId\n * @param {string} teamId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateTeam = function (projectId, teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n path = '/projects/{projectId}/team'.replace('{projectId}', projectId);\n payload = {};\n if (typeof teamId !== 'undefined') {\n payload['teamId'] = teamId;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get custom email template\n *\n *\n * @param {string} projectId\n * @param {string} type\n * @param {string} locale\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.getEmailTemplate = function (projectId, type, locale) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"type\"');\n }\n if (typeof locale === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"locale\"');\n }\n path = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update custom email templates\n *\n *\n * @param {string} projectId\n * @param {string} type\n * @param {string} locale\n * @param {string} subject\n * @param {string} message\n * @param {string} senderName\n * @param {string} senderEmail\n * @param {string} replyTo\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateEmailTemplate = function (projectId, type, locale, subject, message, senderName, senderEmail, replyTo) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"type\"');\n }\n if (typeof locale === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"locale\"');\n }\n if (typeof subject === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"subject\"');\n }\n if (typeof message === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"message\"');\n }\n path = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);\n payload = {};\n if (typeof subject !== 'undefined') {\n payload['subject'] = subject;\n }\n if (typeof message !== 'undefined') {\n payload['message'] = message;\n }\n if (typeof senderName !== 'undefined') {\n payload['senderName'] = senderName;\n }\n if (typeof senderEmail !== 'undefined') {\n payload['senderEmail'] = senderEmail;\n }\n if (typeof replyTo !== 'undefined') {\n payload['replyTo'] = replyTo;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Reset custom email template\n *\n *\n * @param {string} projectId\n * @param {string} type\n * @param {string} locale\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.deleteEmailTemplate = function (projectId, type, locale) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"type\"');\n }\n if (typeof locale === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"locale\"');\n }\n path = '/projects/{projectId}/templates/email/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get custom SMS template\n *\n *\n * @param {string} projectId\n * @param {string} type\n * @param {string} locale\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.getSmsTemplate = function (projectId, type, locale) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"type\"');\n }\n if (typeof locale === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"locale\"');\n }\n path = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update custom SMS template\n *\n *\n * @param {string} projectId\n * @param {string} type\n * @param {string} locale\n * @param {string} message\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateSmsTemplate = function (projectId, type, locale, message) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"type\"');\n }\n if (typeof locale === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"locale\"');\n }\n if (typeof message === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"message\"');\n }\n path = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);\n payload = {};\n if (typeof message !== 'undefined') {\n payload['message'] = message;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Reset custom SMS template\n *\n *\n * @param {string} projectId\n * @param {string} type\n * @param {string} locale\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.deleteSmsTemplate = function (projectId, type, locale) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof type === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"type\"');\n }\n if (typeof locale === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"locale\"');\n }\n path = '/projects/{projectId}/templates/sms/{type}/{locale}'.replace('{projectId}', projectId).replace('{type}', type).replace('{locale}', locale);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get usage stats for a project\n *\n *\n * @param {string} projectId\n * @param {string} range\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.getUsage = function (projectId, range) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n path = '/projects/{projectId}/usage'.replace('{projectId}', projectId);\n payload = {};\n if (typeof range !== 'undefined') {\n payload['range'] = range;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Webhooks\n *\n *\n * @param {string} projectId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.listWebhooks = function (projectId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n path = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Webhook\n *\n *\n * @param {string} projectId\n * @param {string} name\n * @param {string[]} events\n * @param {string} url\n * @param {boolean} security\n * @param {string} httpUser\n * @param {string} httpPass\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.createWebhook = function (projectId, name, events, url, security, httpUser, httpPass) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n if (typeof events === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"events\"');\n }\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"url\"');\n }\n if (typeof security === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"security\"');\n }\n path = '/projects/{projectId}/webhooks'.replace('{projectId}', projectId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof events !== 'undefined') {\n payload['events'] = events;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof security !== 'undefined') {\n payload['security'] = security;\n }\n if (typeof httpUser !== 'undefined') {\n payload['httpUser'] = httpUser;\n }\n if (typeof httpPass !== 'undefined') {\n payload['httpPass'] = httpPass;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Webhook\n *\n *\n * @param {string} projectId\n * @param {string} webhookId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.getWebhook = function (projectId, webhookId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof webhookId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"webhookId\"');\n }\n path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Webhook\n *\n *\n * @param {string} projectId\n * @param {string} webhookId\n * @param {string} name\n * @param {string[]} events\n * @param {string} url\n * @param {boolean} security\n * @param {string} httpUser\n * @param {string} httpPass\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateWebhook = function (projectId, webhookId, name, events, url, security, httpUser, httpPass) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof webhookId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"webhookId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n if (typeof events === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"events\"');\n }\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"url\"');\n }\n if (typeof security === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"security\"');\n }\n path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof events !== 'undefined') {\n payload['events'] = events;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof security !== 'undefined') {\n payload['security'] = security;\n }\n if (typeof httpUser !== 'undefined') {\n payload['httpUser'] = httpUser;\n }\n if (typeof httpPass !== 'undefined') {\n payload['httpPass'] = httpPass;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Webhook\n *\n *\n * @param {string} projectId\n * @param {string} webhookId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.deleteWebhook = function (projectId, webhookId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof webhookId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"webhookId\"');\n }\n path = '/projects/{projectId}/webhooks/{webhookId}'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Webhook Signature Key\n *\n *\n * @param {string} projectId\n * @param {string} webhookId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Projects.prototype.updateWebhookSignature = function (projectId, webhookId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof projectId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"projectId\"');\n }\n if (typeof webhookId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"webhookId\"');\n }\n path = '/projects/{projectId}/webhooks/{webhookId}/signature'.replace('{projectId}', projectId).replace('{webhookId}', webhookId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Projects;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/projects.ts?");
|
|
655
|
-
|
|
656
|
-
/***/ }),
|
|
657
|
-
|
|
658
|
-
/***/ "./src/sdk-console/services/proxy.ts":
|
|
659
|
-
/*!*******************************************!*\
|
|
660
|
-
!*** ./src/sdk-console/services/proxy.ts ***!
|
|
661
|
-
\*******************************************/
|
|
662
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
663
|
-
|
|
664
|
-
"use strict";
|
|
665
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ProxyService\": () => (/* binding */ ProxyService)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar ProxyService = /** @class */ (function (_super) {\n __extends(ProxyService, _super);\n function ProxyService(client) {\n return _super.call(this, client) || this;\n }\n /**\n * List Rules\n *\n * Get a list of all the proxy rules. You can use the query params to filter\n * your results.\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n ProxyService.prototype.listRules = function (queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/proxy/rules';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Rule\n *\n * Create a new proxy rule.\n *\n * @param {string} domain\n * @param {string} resourceType\n * @param {string} resourceId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n ProxyService.prototype.createRule = function (domain, resourceType, resourceId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof domain === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"domain\"');\n }\n if (typeof resourceType === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"resourceType\"');\n }\n path = '/proxy/rules';\n payload = {};\n if (typeof domain !== 'undefined') {\n payload['domain'] = domain;\n }\n if (typeof resourceType !== 'undefined') {\n payload['resourceType'] = resourceType;\n }\n if (typeof resourceId !== 'undefined') {\n payload['resourceId'] = resourceId;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Rule\n *\n * Get a proxy rule by its unique ID.\n *\n * @param {string} ruleId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n ProxyService.prototype.getRule = function (ruleId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof ruleId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"ruleId\"');\n }\n path = '/proxy/rules/{ruleId}'.replace('{ruleId}', ruleId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Rule\n *\n * Delete a proxy rule by its unique ID.\n *\n * @param {string} ruleId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n ProxyService.prototype.deleteRule = function (ruleId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof ruleId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"ruleId\"');\n }\n path = '/proxy/rules/{ruleId}'.replace('{ruleId}', ruleId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Rule Verification Status\n *\n *\n * @param {string} ruleId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n ProxyService.prototype.updateRuleVerification = function (ruleId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof ruleId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"ruleId\"');\n }\n path = '/proxy/rules/{ruleId}/verification'.replace('{ruleId}', ruleId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return ProxyService;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/proxy.ts?");
|
|
666
|
-
|
|
667
|
-
/***/ }),
|
|
668
|
-
|
|
669
|
-
/***/ "./src/sdk-console/services/qdms.ts":
|
|
670
|
-
/*!******************************************!*\
|
|
671
|
-
!*** ./src/sdk-console/services/qdms.ts ***!
|
|
672
|
-
\******************************************/
|
|
673
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
674
|
-
|
|
675
|
-
"use strict";
|
|
676
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"QDMS\": () => (/* binding */ QDMS)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nfunction jsonToUrlEncoded(obj) {\n var formBody = [];\n for (var property in obj) {\n var encodedKey = encodeURIComponent(property);\n var encodedValue = encodeURIComponent(obj[property]);\n formBody.push(encodedKey + \"=\" + encodedValue);\n }\n return formBody.join(\"&\");\n}\nvar QDMS = /** @class */ (function (_super) {\n __extends(QDMS, _super);\n function QDMS(client) {\n return _super.call(this, client) || this;\n }\n QDMS.prototype.getToken = function (url, user, password) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, formData, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"url\"');\n }\n if (typeof user === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"user\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/service/qdms/token';\n payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof user !== 'undefined') {\n payload['user'] = user;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n formData = jsonToUrlEncoded({\n url: url,\n user: user,\n password: password\n });\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/x-www-form-urlencoded'\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n QDMS.prototype.listUsers = function (url, token) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"url\"');\n }\n if (typeof token === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"token\"');\n }\n path = '/service/qdms/users';\n payload = {};\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof token !== 'undefined') {\n payload['token'] = token;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/x-www-form-urlencoded'\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return QDMS;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/qdms.ts?");
|
|
677
|
-
|
|
678
|
-
/***/ }),
|
|
679
|
-
|
|
680
|
-
/***/ "./src/sdk-console/services/storage.ts":
|
|
681
|
-
/*!*********************************************!*\
|
|
682
|
-
!*** ./src/sdk-console/services/storage.ts ***!
|
|
683
|
-
\*********************************************/
|
|
684
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
685
|
-
|
|
686
|
-
"use strict";
|
|
687
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Storage\": () => (/* binding */ Storage)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar Storage = /** @class */ (function (_super) {\n __extends(Storage, _super);\n function Storage(client) {\n return _super.call(this, client) || this;\n }\n /**\n * List buckets\n *\n * Get a list of all the storage buckets. You can use the query params to\n * filter your results.\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.listBuckets = function (queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/storage/buckets';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create bucket\n *\n * Create a new storage bucket.\n *\n * @param {string} bucketId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} fileSecurity\n * @param {boolean} enabled\n * @param {number} maximumFileSize\n * @param {string[]} allowedFileExtensions\n * @param {string} compression\n * @param {boolean} encryption\n * @param {boolean} antivirus\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.createBucket = function (bucketId, name, permissions, fileSecurity, enabled, maximumFileSize, allowedFileExtensions, compression, encryption, antivirus) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/storage/buckets';\n payload = {};\n if (typeof bucketId !== 'undefined') {\n payload['bucketId'] = bucketId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n if (typeof fileSecurity !== 'undefined') {\n payload['fileSecurity'] = fileSecurity;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof maximumFileSize !== 'undefined') {\n payload['maximumFileSize'] = maximumFileSize;\n }\n if (typeof allowedFileExtensions !== 'undefined') {\n payload['allowedFileExtensions'] = allowedFileExtensions;\n }\n if (typeof compression !== 'undefined') {\n payload['compression'] = compression;\n }\n if (typeof encryption !== 'undefined') {\n payload['encryption'] = encryption;\n }\n if (typeof antivirus !== 'undefined') {\n payload['antivirus'] = antivirus;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Bucket\n *\n * Get a storage bucket by its unique ID. This endpoint response returns a\n * JSON object with the storage bucket metadata.\n *\n * @param {string} bucketId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.getBucket = function (bucketId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n path = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Bucket\n *\n * Update a storage bucket by its unique ID.\n *\n * @param {string} bucketId\n * @param {string} name\n * @param {string[]} permissions\n * @param {boolean} fileSecurity\n * @param {boolean} enabled\n * @param {number} maximumFileSize\n * @param {string[]} allowedFileExtensions\n * @param {string} compression\n * @param {boolean} encryption\n * @param {boolean} antivirus\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.updateBucket = function (bucketId, name, permissions, fileSecurity, enabled, maximumFileSize, allowedFileExtensions, compression, encryption, antivirus) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n if (typeof fileSecurity !== 'undefined') {\n payload['fileSecurity'] = fileSecurity;\n }\n if (typeof enabled !== 'undefined') {\n payload['enabled'] = enabled;\n }\n if (typeof maximumFileSize !== 'undefined') {\n payload['maximumFileSize'] = maximumFileSize;\n }\n if (typeof allowedFileExtensions !== 'undefined') {\n payload['allowedFileExtensions'] = allowedFileExtensions;\n }\n if (typeof compression !== 'undefined') {\n payload['compression'] = compression;\n }\n if (typeof encryption !== 'undefined') {\n payload['encryption'] = encryption;\n }\n if (typeof antivirus !== 'undefined') {\n payload['antivirus'] = antivirus;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Bucket\n *\n * Delete a storage bucket by its unique ID.\n *\n * @param {string} bucketId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.deleteBucket = function (bucketId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n path = '/storage/buckets/{bucketId}'.replace('{bucketId}', bucketId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Files\n *\n * Get a list of all the user files. You can use the query params to filter\n * your results.\n *\n * @param {string} bucketId\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.listFiles = function (bucketId, queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n path = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create File\n *\n * Create a new file. Before using this route, you should create a new bucket\n * resource using either a [server\n * integration](/docs/server/storage#storageCreateBucket) API or directly from\n * your realmocean console.\n *\n * Larger files should be uploaded using multiple requests with the\n * [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range)\n * header to send a partial request with a maximum supported chunk of `5MB`.\n * The `content-range` header values should always be in bytes.\n *\n * When the first request is sent, the server will return the **File** object,\n * and the subsequent part request must include the file's **id** in\n * `x-realmocean-id` header to allow the server to know that the partial upload\n * is for the existing file and not for a new one.\n *\n * If you're creating a new file using one of the realmocean SDKs, all the\n * chunking logic will be managed by the SDK internally.\n *\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @param {File} file\n * @param {string[]} permissions\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.createFile = function (bucketId_1, fileId_1, file_1, permissions_1) {\n return __awaiter(this, arguments, void 0, function (bucketId, fileId, file, permissions, onProgress) {\n var path, payload, uri, size, id, response, headers, counter, totalCounters, e_1, start, end, stream;\n if (onProgress === void 0) { onProgress = function (progress) { }; }\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"fileId\"');\n }\n if (typeof file === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"file\"');\n }\n path = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);\n payload = {};\n if (typeof fileId !== 'undefined') {\n payload['fileId'] = fileId;\n }\n if (typeof file !== 'undefined') {\n payload['file'] = file;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n uri = new URL(this.client.config.endpoint + path);\n if (!(file instanceof File)) {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Parameter \"file\" has to be a File.');\n }\n size = file.size;\n if (!(size <= _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'multipart/form-data',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n case 2:\n id = undefined;\n response = undefined;\n headers = {\n 'content-type': 'multipart/form-data',\n };\n counter = 0;\n totalCounters = Math.ceil(size / _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE);\n if (!(fileId != 'unique()')) return [3 /*break*/, 6];\n _a.label = 3;\n case 3:\n _a.trys.push([3, 5, , 6]);\n return [4 /*yield*/, this.client.call('GET', new URL(this.client.config.endpoint + path + '/' + fileId), headers)];\n case 4:\n response = _a.sent();\n counter = response.chunksUploaded;\n return [3 /*break*/, 6];\n case 5:\n e_1 = _a.sent();\n return [3 /*break*/, 6];\n case 6:\n counter;\n _a.label = 7;\n case 7:\n if (!(counter < totalCounters)) return [3 /*break*/, 10];\n start = (counter * _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE);\n end = Math.min((((counter * _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE) + _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE) - 1), size);\n headers['content-range'] = 'bytes ' + start + '-' + end + '/' + size;\n if (id) {\n headers['x-realmocean-id'] = id;\n }\n stream = file.slice(start, end + 1);\n payload['file'] = new File([stream], file.name);\n return [4 /*yield*/, this.client.call('post', uri, headers, payload)];\n case 8:\n response = _a.sent();\n if (!id) {\n id = response['$id'];\n }\n if (onProgress) {\n onProgress({\n $id: response.$id,\n progress: Math.min((counter + 1) * _service__WEBPACK_IMPORTED_MODULE_0__.Service.CHUNK_SIZE - 1, size) / size * 100,\n sizeUploaded: end,\n chunksTotal: response.chunksTotal,\n chunksUploaded: response.chunksUploaded\n });\n }\n _a.label = 9;\n case 9:\n counter++;\n return [3 /*break*/, 7];\n case 10: return [2 /*return*/, response];\n }\n });\n });\n };\n /**\n * Get File\n *\n * Get a file by its unique ID. This endpoint response returns a JSON object\n * with the file metadata.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.getFile = function (bucketId, fileId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"fileId\"');\n }\n path = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update File\n *\n * Update a file by its unique ID. Only users with write permissions have\n * access to update this resource.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @param {string} name\n * @param {string[]} permissions\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.updateFile = function (bucketId, fileId, name, permissions) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"fileId\"');\n }\n path = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete File\n *\n * Delete a file by its unique ID. Only users with write permissions have\n * access to delete this resource.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.deleteFile = function (bucketId, fileId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"fileId\"');\n }\n path = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get File for Download\n *\n * Get a file content by its unique ID. The endpoint response return with a\n * 'Content-Disposition: attachment' header that tells the browser to start\n * downloading the file to user downloads directory.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Storage.prototype.getFileDownload = function (bucketId, fileId) {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"fileId\"');\n }\n var path = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n var payload = {};\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n /**\n * Get File Preview\n *\n * Get a file preview image. Currently, this method supports preview for image\n * files (jpg, png, and gif), other supported formats, like pdf, docs, slides,\n * and spreadsheets, will return the file icon image. You can also pass query\n * string arguments for cutting and resizing your preview image. Preview is\n * supported only for image files smaller than 10MB.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @param {number} width\n * @param {number} height\n * @param {string} gravity\n * @param {number} quality\n * @param {number} borderWidth\n * @param {string} borderColor\n * @param {number} borderRadius\n * @param {number} opacity\n * @param {number} rotation\n * @param {string} background\n * @param {string} output\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Storage.prototype.getFilePreview = function (bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output) {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"fileId\"');\n }\n var path = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n var payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof gravity !== 'undefined') {\n payload['gravity'] = gravity;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n if (typeof borderWidth !== 'undefined') {\n payload['borderWidth'] = borderWidth;\n }\n if (typeof borderColor !== 'undefined') {\n payload['borderColor'] = borderColor;\n }\n if (typeof borderRadius !== 'undefined') {\n payload['borderRadius'] = borderRadius;\n }\n if (typeof opacity !== 'undefined') {\n payload['opacity'] = opacity;\n }\n if (typeof rotation !== 'undefined') {\n payload['rotation'] = rotation;\n }\n if (typeof background !== 'undefined') {\n payload['background'] = background;\n }\n if (typeof output !== 'undefined') {\n payload['output'] = output;\n }\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n /**\n * Get File for View\n *\n * Get a file content by its unique ID. This endpoint is similar to the\n * download method but returns with no 'Content-Disposition: attachment'\n * header.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {RealmoceanException}\n * @returns {URL}\n */\n Storage.prototype.getFileView = function (bucketId, fileId) {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"fileId\"');\n }\n var path = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n var payload = {};\n var uri = new URL(this.client.config.endpoint + path);\n payload['project'] = this.client.config.project;\n for (var _i = 0, _a = Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload)); _i < _a.length; _i++) {\n var _b = _a[_i], key = _b[0], value = _b[1];\n uri.searchParams.append(key, value);\n }\n return uri;\n };\n /**\n * Get usage stats for storage\n *\n *\n * @param {string} range\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.getUsage = function (range) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/storage/usage';\n payload = {};\n if (typeof range !== 'undefined') {\n payload['range'] = range;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get usage stats for a storage bucket\n *\n *\n * @param {string} bucketId\n * @param {string} range\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Storage.prototype.getBucketUsage = function (bucketId, range) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"bucketId\"');\n }\n path = '/storage/{bucketId}/usage'.replace('{bucketId}', bucketId);\n payload = {};\n if (typeof range !== 'undefined') {\n payload['range'] = range;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Storage;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/storage.ts?");
|
|
688
|
-
|
|
689
|
-
/***/ }),
|
|
690
|
-
|
|
691
|
-
/***/ "./src/sdk-console/services/teams.ts":
|
|
692
|
-
/*!*******************************************!*\
|
|
693
|
-
!*** ./src/sdk-console/services/teams.ts ***!
|
|
694
|
-
\*******************************************/
|
|
695
|
-
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
696
|
-
|
|
697
|
-
"use strict";
|
|
698
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Teams\": () => (/* binding */ Teams)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar Teams = /** @class */ (function (_super) {\n __extends(Teams, _super);\n function Teams(client) {\n return _super.call(this, client) || this;\n }\n /**\n * List Teams\n *\n * Get a list of all the teams in which the current user is a member. You can\n * use the parameters to filter your results.\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.list = function (queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/teams';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Team\n *\n * Create a new team. The user who creates the team will automatically be\n * assigned as the owner of the team. Only the users with the owner role can\n * invite new members, add new owners and delete or update the team.\n *\n * @param {string} teamId\n * @param {string} name\n * @param {string[]} roles\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.create = function (teamId, name, roles) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/teams';\n payload = {};\n if (typeof teamId !== 'undefined') {\n payload['teamId'] = teamId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Team\n *\n * Get a team by its ID. All team members have read access for this resource.\n *\n * @param {string} teamId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.get = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n path = '/teams/{teamId}'.replace('{teamId}', teamId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Teams.prototype.getDomain = function () {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/teams/domain';\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Name\n *\n * Update the team's name by its unique ID.\n *\n * @param {string} teamId\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.updateName = function (teamId, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/teams/{teamId}'.replace('{teamId}', teamId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Team\n *\n * Delete a team using its ID. Only team members with the owner role can\n * delete the team.\n *\n * @param {string} teamId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.delete = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n path = '/teams/{teamId}'.replace('{teamId}', teamId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Team Logs\n *\n * Get the team activity logs list by its unique ID.\n *\n * @param {string} teamId\n * @param {string[]} queries\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.listLogs = function (teamId, queries) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n path = '/teams/{teamId}/logs'.replace('{teamId}', teamId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Team Memberships\n *\n * Use this endpoint to list a team's members using the team's ID. All team\n * members have read access to this endpoint.\n *\n * @param {string} teamId\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.listMemberships = function (teamId, queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n path = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create Team Membership\n *\n * Invite a new member to join your team. Provide an ID for existing users, or\n * invite unregistered users using an email or phone number. If initiated from\n * a Client SDK, realmocean will send an email or sms with a link to join the\n * team to the invited user, and an account will be created for them if one\n * doesn't exist. If initiated from a Server SDK, the new member will be added\n * automatically to the team.\n *\n * You only need to provide one of a user ID, email, or phone number. realmocean\n * will prioritize accepting the user ID > email > phone number if you provide\n * more than one of these parameters.\n *\n * Use the `url` parameter to redirect the user from the invitation email to\n * your app. After the user is redirected, use the [Update Team Membership\n * Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow\n * the user to accept the invitation to the team.\n *\n * Please note that to avoid a [Redirect\n * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)\n * realmocean will accept the only redirect URLs under the domains you have\n * added as a platform on the realmocean Console.\n *\n *\n * @param {string} teamId\n * @param {string[]} roles\n * @param {string} url\n * @param {string} email\n * @param {string} userId\n * @param {string} phone\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.createMembership = function (teamId, roles, url, email, userId, phone, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n if (typeof roles === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"roles\"');\n }\n if (typeof url === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"url\"');\n }\n path = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);\n payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof phone !== 'undefined') {\n payload['phone'] = phone;\n }\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Team Membership\n *\n * Get a team member by the membership unique id. All team members have read\n * access for this resource.\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.getMembership = function (teamId, membershipId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"membershipId\"');\n }\n path = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Membership\n *\n * Modify the roles of a team member. Only team members with the owner role\n * have access to this endpoint. Learn more about [roles and\n * permissions](/docs/permissions).\n *\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @param {string[]} roles\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.updateMembership = function (teamId, membershipId, roles) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"membershipId\"');\n }\n if (typeof roles === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"roles\"');\n }\n path = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n payload = {};\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Team Membership\n *\n * This endpoint allows a user to leave a team or for a team owner to delete\n * the membership of any other team member. You can also use this endpoint to\n * delete a user membership even if it is not accepted.\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.deleteMembership = function (teamId, membershipId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"membershipId\"');\n }\n path = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Team Membership Status\n *\n * Use this endpoint to allow a user to accept an invitation to join a team\n * after being redirected back to your app from the invitation email received\n * by the user.\n *\n * If the request is successful, a session for the user is automatically\n * created.\n *\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @param {string} userId\n * @param {string} secret\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.updateMembershipStatus = function (teamId, membershipId, userId, secret) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"membershipId\"');\n }\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"secret\"');\n }\n path = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get Team Preferences\n *\n * Get the team's shared preferences by its unique ID. If a preference doesn't\n * need to be shared by all team members, prefer storing them in [user\n * preferences](/docs/client/account#accountGetPrefs).\n *\n * @param {string} teamId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.getPrefs = function (teamId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n path = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Preferences\n *\n * Update the team's preferences by its unique ID. The object you pass is\n * stored as is and replaces any previous value. The maximum allowed prefs\n * size is 64kB and throws an error if exceeded.\n *\n * @param {string} teamId\n * @param {object} prefs\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Teams.prototype.updatePrefs = function (teamId, prefs) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"teamId\"');\n }\n if (typeof prefs === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"prefs\"');\n }\n path = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);\n payload = {};\n if (typeof prefs !== 'undefined') {\n payload['prefs'] = prefs;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Teams;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/teams.ts?");
|
|
699
|
-
|
|
700
|
-
/***/ }),
|
|
701
|
-
|
|
702
|
-
/***/ "./src/sdk-console/services/users.ts":
|
|
703
|
-
/*!*******************************************!*\
|
|
704
|
-
!*** ./src/sdk-console/services/users.ts ***!
|
|
705
|
-
\*******************************************/
|
|
233
|
+
/***/ "./src/services/locale.ts":
|
|
234
|
+
/*!********************************!*\
|
|
235
|
+
!*** ./src/services/locale.ts ***!
|
|
236
|
+
\********************************/
|
|
706
237
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
707
238
|
|
|
708
|
-
"use
|
|
709
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Users\": () => (/* binding */ Users)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar Users = /** @class */ (function (_super) {\n __extends(Users, _super);\n function Users(client) {\n return _super.call(this, client) || this;\n }\n /**\n * List Users\n *\n * Get a list of all the project's users. You can use the query params to\n * filter your results.\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.list = function (queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/users';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create User\n *\n * Create a new user.\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} phone\n * @param {string} password\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.create = function (userId, email, phone, password, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n path = '/users';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof phone !== 'undefined') {\n payload['phone'] = phone;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create User with Argon2 Password\n *\n * Create a new user. Password provided must be hashed with the\n * [Argon2](https://en.wikipedia.org/wiki/Argon2) algorithm. Use the [POST\n * /users](/docs/server/users#usersCreate) endpoint to create users with a\n * plain text password.\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} password\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.createArgon2User = function (userId, email, password, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/users/argon2';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create User with Bcrypt Password\n *\n * Create a new user. Password provided must be hashed with the\n * [Bcrypt](https://en.wikipedia.org/wiki/Bcrypt) algorithm. Use the [POST\n * /users](/docs/server/users#usersCreate) endpoint to create users with a\n * plain text password.\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} password\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.createBcryptUser = function (userId, email, password, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/users/bcrypt';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Identities\n *\n * Get identities for all users.\n *\n * @param {string} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.listIdentities = function (queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/users/identities';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Identity\n *\n * Delete an identity by its unique ID.\n *\n * @param {string} identityId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.deleteIdentity = function (identityId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof identityId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"identityId\"');\n }\n path = '/users/identities/{identityId}'.replace('{identityId}', identityId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create User with MD5 Password\n *\n * Create a new user. Password provided must be hashed with the\n * [MD5](https://en.wikipedia.org/wiki/MD5) algorithm. Use the [POST\n * /users](/docs/server/users#usersCreate) endpoint to create users with a\n * plain text password.\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} password\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.createMD5User = function (userId, email, password, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/users/md5';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create User with PHPass Password\n *\n * Create a new user. Password provided must be hashed with the\n * [PHPass](https://www.openwall.com/phpass/) algorithm. Use the [POST\n * /users](/docs/server/users#usersCreate) endpoint to create users with a\n * plain text password.\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} password\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.createPHPassUser = function (userId, email, password, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/users/phpass';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create User with Scrypt Password\n *\n * Create a new user. Password provided must be hashed with the\n * [Scrypt](https://github.com/Tarsnap/scrypt) algorithm. Use the [POST\n * /users](/docs/server/users#usersCreate) endpoint to create users with a\n * plain text password.\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} password\n * @param {string} passwordSalt\n * @param {number} passwordCpu\n * @param {number} passwordMemory\n * @param {number} passwordParallel\n * @param {number} passwordLength\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.createScryptUser = function (userId, email, password, passwordSalt, passwordCpu, passwordMemory, passwordParallel, passwordLength, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n if (typeof passwordSalt === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"passwordSalt\"');\n }\n if (typeof passwordCpu === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"passwordCpu\"');\n }\n if (typeof passwordMemory === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"passwordMemory\"');\n }\n if (typeof passwordParallel === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"passwordParallel\"');\n }\n if (typeof passwordLength === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"passwordLength\"');\n }\n path = '/users/scrypt';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof passwordSalt !== 'undefined') {\n payload['passwordSalt'] = passwordSalt;\n }\n if (typeof passwordCpu !== 'undefined') {\n payload['passwordCpu'] = passwordCpu;\n }\n if (typeof passwordMemory !== 'undefined') {\n payload['passwordMemory'] = passwordMemory;\n }\n if (typeof passwordParallel !== 'undefined') {\n payload['passwordParallel'] = passwordParallel;\n }\n if (typeof passwordLength !== 'undefined') {\n payload['passwordLength'] = passwordLength;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create User with Scrypt Modified Password\n *\n * Create a new user. Password provided must be hashed with the [Scrypt\n * Modified](https://gist.github.com/Meldiron/eecf84a0225eccb5a378d45bb27462cc)\n * algorithm. Use the [POST /users](/docs/server/users#usersCreate) endpoint\n * to create users with a plain text password.\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} password\n * @param {string} passwordSalt\n * @param {string} passwordSaltSeparator\n * @param {string} passwordSignerKey\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.createScryptModifiedUser = function (userId, email, password, passwordSalt, passwordSaltSeparator, passwordSignerKey, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n if (typeof passwordSalt === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"passwordSalt\"');\n }\n if (typeof passwordSaltSeparator === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"passwordSaltSeparator\"');\n }\n if (typeof passwordSignerKey === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"passwordSignerKey\"');\n }\n path = '/users/scrypt-modified';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof passwordSalt !== 'undefined') {\n payload['passwordSalt'] = passwordSalt;\n }\n if (typeof passwordSaltSeparator !== 'undefined') {\n payload['passwordSaltSeparator'] = passwordSaltSeparator;\n }\n if (typeof passwordSignerKey !== 'undefined') {\n payload['passwordSignerKey'] = passwordSignerKey;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create User with SHA Password\n *\n * Create a new user. Password provided must be hashed with the\n * [SHA](https://en.wikipedia.org/wiki/Secure_Hash_Algorithm) algorithm. Use\n * the [POST /users](/docs/server/users#usersCreate) endpoint to create users\n * with a plain text password.\n *\n * @param {string} userId\n * @param {string} email\n * @param {string} password\n * @param {string} passwordVersion\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.createSHAUser = function (userId, email, password, passwordVersion, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/users/sha';\n payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n if (typeof passwordVersion !== 'undefined') {\n payload['passwordVersion'] = passwordVersion;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get usage stats for the users API\n *\n *\n * @param {string} range\n * @param {string} provider\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.getUsage = function (range, provider) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/users/usage';\n payload = {};\n if (typeof range !== 'undefined') {\n payload['range'] = range;\n }\n if (typeof provider !== 'undefined') {\n payload['provider'] = provider;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get User\n *\n * Get a user by its unique ID.\n *\n * @param {string} userId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.get = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n path = '/users/{userId}'.replace('{userId}', userId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete User\n *\n * Delete a user by its unique ID, thereby releasing it's ID. Since ID is\n * released and can be reused, all user-related resources like documents or\n * storage files should be deleted before user deletion. If you want to keep\n * ID reserved, use the [updateStatus](/docs/server/users#usersUpdateStatus)\n * endpoint instead.\n *\n * @param {string} userId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.delete = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n path = '/users/{userId}'.replace('{userId}', userId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Email\n *\n * Update the user email by its unique ID.\n *\n * @param {string} userId\n * @param {string} email\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.updateEmail = function (userId, email) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof email === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"email\"');\n }\n path = '/users/{userId}/email'.replace('{userId}', userId);\n payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update User Labels\n *\n * Update the user labels by its unique ID.\n *\n * Labels can be used to grant access to resources. While teams are a way for\n * user's to share access to a resource, labels can be defined by the\n * developer to grant access without an invitation. See the [Permissions\n * docs](/docs/permissions) for more info.\n *\n * @param {string} userId\n * @param {string[]} labels\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.updateLabels = function (userId, labels) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof labels === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"labels\"');\n }\n path = '/users/{userId}/labels'.replace('{userId}', userId);\n payload = {};\n if (typeof labels !== 'undefined') {\n payload['labels'] = labels;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('put', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List User Logs\n *\n * Get the user activity logs list by its unique ID.\n *\n * @param {string} userId\n * @param {string[]} queries\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.listLogs = function (userId, queries) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n path = '/users/{userId}/logs'.replace('{userId}', userId);\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List User Memberships\n *\n * Get the user membership list by its unique ID.\n *\n * @param {string} userId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.listMemberships = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n path = '/users/{userId}/memberships'.replace('{userId}', userId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Name\n *\n * Update the user name by its unique ID.\n *\n * @param {string} userId\n * @param {string} name\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.updateName = function (userId, name) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n path = '/users/{userId}/name'.replace('{userId}', userId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Password\n *\n * Update the user password by its unique ID.\n *\n * @param {string} userId\n * @param {string} password\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.updatePassword = function (userId, password) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof password === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"password\"');\n }\n path = '/users/{userId}/password'.replace('{userId}', userId);\n payload = {};\n if (typeof password !== 'undefined') {\n payload['password'] = password;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Phone\n *\n * Update the user phone by its unique ID.\n *\n * @param {string} userId\n * @param {string} number\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.updatePhone = function (userId, number) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof number === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"number\"');\n }\n path = '/users/{userId}/phone'.replace('{userId}', userId);\n payload = {};\n if (typeof number !== 'undefined') {\n payload['number'] = number;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get User Preferences\n *\n * Get the user preferences by its unique ID.\n *\n * @param {string} userId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.getPrefs = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n path = '/users/{userId}/prefs'.replace('{userId}', userId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update User Preferences\n *\n * Update the user preferences by its unique ID. The object you pass is stored\n * as is, and replaces any previous value. The maximum allowed prefs size is\n * 64kB and throws error if exceeded.\n *\n * @param {string} userId\n * @param {object} prefs\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.updatePrefs = function (userId, prefs) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof prefs === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"prefs\"');\n }\n path = '/users/{userId}/prefs'.replace('{userId}', userId);\n payload = {};\n if (typeof prefs !== 'undefined') {\n payload['prefs'] = prefs;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List User Sessions\n *\n * Get the user sessions list by its unique ID.\n *\n * @param {string} userId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.listSessions = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n path = '/users/{userId}/sessions'.replace('{userId}', userId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete User Sessions\n *\n * Delete all user's sessions by using the user's unique ID.\n *\n * @param {string} userId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.deleteSessions = function (userId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n path = '/users/{userId}/sessions'.replace('{userId}', userId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete User Session\n *\n * Delete a user sessions by its unique ID.\n *\n * @param {string} userId\n * @param {string} sessionId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.deleteSession = function (userId, sessionId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof sessionId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"sessionId\"');\n }\n path = '/users/{userId}/sessions/{sessionId}'.replace('{userId}', userId).replace('{sessionId}', sessionId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update User Status\n *\n * Update the user status by its unique ID. Use this endpoint as an\n * alternative to deleting a user if you want to keep user's ID reserved.\n *\n * @param {string} userId\n * @param {boolean} status\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.updateStatus = function (userId, status) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof status === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"status\"');\n }\n path = '/users/{userId}/status'.replace('{userId}', userId);\n payload = {};\n if (typeof status !== 'undefined') {\n payload['status'] = status;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Email Verification\n *\n * Update the user email verification status by its unique ID.\n *\n * @param {string} userId\n * @param {boolean} emailVerification\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.updateEmailVerification = function (userId, emailVerification) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof emailVerification === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"emailVerification\"');\n }\n path = '/users/{userId}/verification'.replace('{userId}', userId);\n payload = {};\n if (typeof emailVerification !== 'undefined') {\n payload['emailVerification'] = emailVerification;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Update Phone Verification\n *\n * Update the user phone verification status by its unique ID.\n *\n * @param {string} userId\n * @param {boolean} phoneVerification\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Users.prototype.updatePhoneVerification = function (userId, phoneVerification) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"userId\"');\n }\n if (typeof phoneVerification === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"phoneVerification\"');\n }\n path = '/users/{userId}/verification/phone'.replace('{userId}', userId);\n payload = {};\n if (typeof phoneVerification !== 'undefined') {\n payload['phoneVerification'] = phoneVerification;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Users;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/users.ts?");
|
|
239
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Locale\": () => (/* binding */ Locale)\n/* harmony export */ });\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nclass Locale {\n constructor(client) {\n this.client = client;\n }\n /**\n * Get user locale\n *\n * Get the current user location based on IP. Returns an object with user country code, country name, continent name, continent code, ip address and suggested currency. You can use the locale header to get the data in a supported language.\n\n([IP Geolocation by DB-IP](https://db-ip.com))\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.Locale>}\n */\n get() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/locale';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * List Locale Codes\n *\n * List of all locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.LocaleCodeList>}\n */\n listCodes() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/locale/codes';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * List continents\n *\n * List of all continents. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.ContinentList>}\n */\n listContinents() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/locale/continents';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * List countries\n *\n * List of all countries. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.CountryList>}\n */\n listCountries() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/locale/countries';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * List EU countries\n *\n * List of all countries that are currently members of the EU. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.CountryList>}\n */\n listCountriesEU() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/locale/countries/eu';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * List countries phone codes\n *\n * List of all countries phone codes. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.PhoneList>}\n */\n listCountriesPhones() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/locale/countries/phones';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * List currencies\n *\n * List of all currencies, including currency symbol, name, plural, and decimal digits for all major and minor currencies. You can use the locale header to get the data in a supported language.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.CurrencyList>}\n */\n listCurrencies() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/locale/currencies';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * List languages\n *\n * List of all languages classified by ISO 639-1 including 2-letter code, name in English, and name in the respective language.\n *\n * @throws {AppcondaException}\n * @returns {Promise<Models.LanguageList>}\n */\n listLanguages() {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/locale/languages';\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/services/locale.ts?");
|
|
710
240
|
|
|
711
241
|
/***/ }),
|
|
712
242
|
|
|
713
|
-
/***/ "./src/
|
|
714
|
-
|
|
715
|
-
!*** ./src/
|
|
716
|
-
|
|
243
|
+
/***/ "./src/services/messaging.ts":
|
|
244
|
+
/*!***********************************!*\
|
|
245
|
+
!*** ./src/services/messaging.ts ***!
|
|
246
|
+
\***********************************/
|
|
717
247
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
718
248
|
|
|
719
|
-
"
|
|
720
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Vcs\": () => (/* binding */ Vcs)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/sdk-console/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/sdk-console/client.ts\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (undefined && undefined.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\n\n\nvar Vcs = /** @class */ (function (_super) {\n __extends(Vcs, _super);\n function Vcs(client) {\n return _super.call(this, client) || this;\n }\n /**\n * List Repositories\n *\n *\n * @param {string} installationId\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Vcs.prototype.listRepositories = function (installationId, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof installationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"installationId\"');\n }\n path = '/vcs/github/installations/{installationId}/providerRepositories'.replace('{installationId}', installationId);\n payload = {};\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Create repository\n *\n *\n * @param {string} installationId\n * @param {string} name\n * @param {boolean} xprivate\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Vcs.prototype.createRepository = function (installationId, name, xprivate) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof installationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"installationId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"name\"');\n }\n if (typeof xprivate === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"xprivate\"');\n }\n path = '/vcs/github/installations/{installationId}/providerRepositories'.replace('{installationId}', installationId);\n payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof xprivate !== 'undefined') {\n payload['private'] = xprivate;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get repository\n *\n *\n * @param {string} installationId\n * @param {string} providerRepositoryId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Vcs.prototype.getRepository = function (installationId, providerRepositoryId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof installationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"installationId\"');\n }\n if (typeof providerRepositoryId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"providerRepositoryId\"');\n }\n path = '/vcs/github/installations/{installationId}/providerRepositories/{providerRepositoryId}'.replace('{installationId}', installationId).replace('{providerRepositoryId}', providerRepositoryId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List Repository Branches\n *\n *\n * @param {string} installationId\n * @param {string} providerRepositoryId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Vcs.prototype.listRepositoryBranches = function (installationId, providerRepositoryId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof installationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"installationId\"');\n }\n if (typeof providerRepositoryId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"providerRepositoryId\"');\n }\n path = '/vcs/github/installations/{installationId}/providerRepositories/{providerRepositoryId}/branches'.replace('{installationId}', installationId).replace('{providerRepositoryId}', providerRepositoryId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Detect runtime settings from source code\n *\n *\n * @param {string} installationId\n * @param {string} providerRepositoryId\n * @param {string} providerRootDirectory\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Vcs.prototype.createRepositoryDetection = function (installationId, providerRepositoryId, providerRootDirectory) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof installationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"installationId\"');\n }\n if (typeof providerRepositoryId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"providerRepositoryId\"');\n }\n path = '/vcs/github/installations/{installationId}/providerRepositories/{providerRepositoryId}/detection'.replace('{installationId}', installationId).replace('{providerRepositoryId}', providerRepositoryId);\n payload = {};\n if (typeof providerRootDirectory !== 'undefined') {\n payload['providerRootDirectory'] = providerRootDirectory;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('post', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Authorize external deployment\n *\n *\n * @param {string} installationId\n * @param {string} repositoryId\n * @param {string} providerPullRequestId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Vcs.prototype.updateExternalDeployments = function (installationId, repositoryId, providerPullRequestId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof installationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"installationId\"');\n }\n if (typeof repositoryId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"repositoryId\"');\n }\n if (typeof providerPullRequestId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"providerPullRequestId\"');\n }\n path = '/vcs/github/installations/{installationId}/repositories/{repositoryId}'.replace('{installationId}', installationId).replace('{repositoryId}', repositoryId);\n payload = {};\n if (typeof providerPullRequestId !== 'undefined') {\n payload['providerPullRequestId'] = providerPullRequestId;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('patch', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * List installations\n *\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Vcs.prototype.listInstallations = function (queries, search) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n path = '/vcs/installations';\n payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Get installation\n *\n *\n * @param {string} installationId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Vcs.prototype.getInstallation = function (installationId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof installationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"installationId\"');\n }\n path = '/vcs/installations/{installationId}'.replace('{installationId}', installationId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('get', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n /**\n * Delete Installation\n *\n *\n * @param {string} installationId\n * @throws {RealmoceanException}\n * @returns {Promise}\n */\n Vcs.prototype.deleteInstallation = function (installationId) {\n return __awaiter(this, void 0, void 0, function () {\n var path, payload, uri;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (typeof installationId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.RealmoceanException('Missing required parameter: \"installationId\"');\n }\n path = '/vcs/installations/{installationId}'.replace('{installationId}', installationId);\n payload = {};\n uri = new URL(this.client.config.endpoint + path);\n return [4 /*yield*/, this.client.call('delete', uri, {\n 'content-type': 'application/json',\n }, payload)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n return Vcs;\n}(_service__WEBPACK_IMPORTED_MODULE_0__.Service));\n\n;\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/sdk-console/services/vcs.ts?");
|
|
249
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Messaging\": () => (/* binding */ Messaging)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../client */ \"./src/client.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nclass Messaging {\n constructor(client) {\n this.client = client;\n }\n /**\n * Create subscriber\n *\n * Create a new subscriber.\n *\n * @param {string} topicId\n * @param {string} subscriberId\n * @param {string} targetId\n * @throws {AppcondaException}\n * @returns {Promise<Models.Subscriber>}\n */\n createSubscriber(topicId, subscriberId, targetId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof topicId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"topicId\"');\n }\n if (typeof subscriberId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"subscriberId\"');\n }\n if (typeof targetId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"targetId\"');\n }\n const apiPath = '/messaging/topics/{topicId}/subscribers'.replace('{topicId}', topicId);\n const payload = {};\n if (typeof subscriberId !== 'undefined') {\n payload['subscriberId'] = subscriberId;\n }\n if (typeof targetId !== 'undefined') {\n payload['targetId'] = targetId;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Delete subscriber\n *\n * Delete a subscriber by its unique ID.\n *\n * @param {string} topicId\n * @param {string} subscriberId\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n deleteSubscriber(topicId, subscriberId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof topicId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"topicId\"');\n }\n if (typeof subscriberId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"subscriberId\"');\n }\n const apiPath = '/messaging/topics/{topicId}/subscribers/{subscriberId}'.replace('{topicId}', topicId).replace('{subscriberId}', subscriberId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('delete', uri, apiHeaders, payload);\n });\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/services/messaging.ts?");
|
|
721
250
|
|
|
722
251
|
/***/ }),
|
|
723
252
|
|
|
724
|
-
/***/ "./src/
|
|
725
|
-
|
|
726
|
-
!*** ./src/
|
|
727
|
-
|
|
253
|
+
/***/ "./src/services/storage.ts":
|
|
254
|
+
/*!*********************************!*\
|
|
255
|
+
!*** ./src/services/storage.ts ***!
|
|
256
|
+
\*********************************/
|
|
728
257
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
729
258
|
|
|
730
|
-
"use strict";
|
|
731
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"setUpProject\": () => (/* reexport safe */ _setUpProject__WEBPACK_IMPORTED_MODULE_0__.setUpProject)\n/* harmony export */ });\n/* harmony import */ var _setUpProject__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./setUpProject */ \"./src/utils/setUpProject.ts\");\n\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/utils/index.ts?");
|
|
259
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Storage\": () => (/* binding */ Storage)\n/* harmony export */ });\n/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../service */ \"./src/service.ts\");\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../client */ \"./src/client.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nclass Storage {\n constructor(client) {\n this.client = client;\n }\n /**\n * List files\n *\n * Get a list of all the user files. You can use the query params to filter your results.\n *\n * @param {string} bucketId\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppcondaException}\n * @returns {Promise<Models.FileList>}\n */\n listFiles(bucketId, queries, search) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"bucketId\"');\n }\n const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);\n const payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Create file\n *\n * Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](https://appconda.io/docs/server/storage#storageCreateBucket) API or directly from your Appconda console.\n\nLarger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.\n\nWhen the first request is sent, the server will return the **File** object, and the subsequent part request must include the file's **id** in `x-realmocean-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.\n\nIf you're creating a new file using one of the Appconda SDKs, all the chunking logic will be managed by the SDK internally.\n\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @param {File} file\n * @param {string[]} permissions\n * @throws {AppcondaException}\n * @returns {Promise<Models.File>}\n */\n createFile(bucketId_1, fileId_1, file_1, permissions_1) {\n return __awaiter(this, arguments, void 0, function* (bucketId, fileId, file, permissions, onProgress = (progress) => { }) {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"fileId\"');\n }\n if (typeof file === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"file\"');\n }\n const apiPath = '/storage/buckets/{bucketId}/files'.replace('{bucketId}', bucketId);\n const payload = {};\n if (typeof fileId !== 'undefined') {\n payload['fileId'] = fileId;\n }\n if (typeof file !== 'undefined') {\n payload['file'] = file;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'multipart/form-data',\n };\n return yield this.client.chunkedUpload('post', uri, apiHeaders, payload, onProgress);\n });\n }\n /**\n * Get file\n *\n * Get a file by its unique ID. This endpoint response returns a JSON object with the file metadata.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppcondaException}\n * @returns {Promise<Models.File>}\n */\n getFile(bucketId, fileId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"fileId\"');\n }\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Update file\n *\n * Update a file by its unique ID. Only users with write permissions have access to update this resource.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @param {string} name\n * @param {string[]} permissions\n * @throws {AppcondaException}\n * @returns {Promise<Models.File>}\n */\n updateFile(bucketId, fileId, name, permissions) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"fileId\"');\n }\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof permissions !== 'undefined') {\n payload['permissions'] = permissions;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n /**\n * Delete File\n *\n * Delete a file by its unique ID. Only users with write permissions have access to delete this resource.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n deleteFile(bucketId, fileId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"fileId\"');\n }\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('delete', uri, apiHeaders, payload);\n });\n }\n /**\n * Get file for download\n *\n * Get a file content by its unique ID. The endpoint response return with a 'Content-Disposition: attachment' header that tells the browser to start downloading the file to user downloads directory.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppcondaException}\n * @returns {string}\n */\n getFileDownload(bucketId, fileId) {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"fileId\"');\n }\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_client__WEBPACK_IMPORTED_MODULE_1__.Client.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n return uri.toString();\n }\n /**\n * Get file preview\n *\n * Get a file preview image. Currently, this method supports preview for image files (jpg, png, and gif), other supported formats, like pdf, docs, slides, and spreadsheets, will return the file icon image. You can also pass query string arguments for cutting and resizing your preview image. Preview is supported only for image files smaller than 10MB.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @param {number} width\n * @param {number} height\n * @param {ImageGravity} gravity\n * @param {number} quality\n * @param {number} borderWidth\n * @param {string} borderColor\n * @param {number} borderRadius\n * @param {number} opacity\n * @param {number} rotation\n * @param {string} background\n * @param {ImageFormat} output\n * @throws {AppcondaException}\n * @returns {string}\n */\n getFilePreview(bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output) {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"fileId\"');\n }\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload = {};\n if (typeof width !== 'undefined') {\n payload['width'] = width;\n }\n if (typeof height !== 'undefined') {\n payload['height'] = height;\n }\n if (typeof gravity !== 'undefined') {\n payload['gravity'] = gravity;\n }\n if (typeof quality !== 'undefined') {\n payload['quality'] = quality;\n }\n if (typeof borderWidth !== 'undefined') {\n payload['borderWidth'] = borderWidth;\n }\n if (typeof borderColor !== 'undefined') {\n payload['borderColor'] = borderColor;\n }\n if (typeof borderRadius !== 'undefined') {\n payload['borderRadius'] = borderRadius;\n }\n if (typeof opacity !== 'undefined') {\n payload['opacity'] = opacity;\n }\n if (typeof rotation !== 'undefined') {\n payload['rotation'] = rotation;\n }\n if (typeof background !== 'undefined') {\n payload['background'] = background;\n }\n if (typeof output !== 'undefined') {\n payload['output'] = output;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_client__WEBPACK_IMPORTED_MODULE_1__.Client.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n return uri.toString();\n }\n /**\n * Get file for view\n *\n * Get a file content by its unique ID. This endpoint is similar to the download method but returns with no 'Content-Disposition: attachment' header.\n *\n * @param {string} bucketId\n * @param {string} fileId\n * @throws {AppcondaException}\n * @returns {string}\n */\n getFileView(bucketId, fileId) {\n if (typeof bucketId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"bucketId\"');\n }\n if (typeof fileId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_1__.AppcondaException('Missing required parameter: \"fileId\"');\n }\n const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_service__WEBPACK_IMPORTED_MODULE_0__.Service.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n payload['project'] = this.client.config.project;\n for (const [key, value] of Object.entries(_client__WEBPACK_IMPORTED_MODULE_1__.Client.flatten(payload))) {\n uri.searchParams.append(key, value);\n }\n return uri.toString();\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/services/storage.ts?");
|
|
732
260
|
|
|
733
261
|
/***/ }),
|
|
734
262
|
|
|
735
|
-
/***/ "./src/
|
|
736
|
-
|
|
737
|
-
!*** ./src/
|
|
738
|
-
|
|
263
|
+
/***/ "./src/services/teams.ts":
|
|
264
|
+
/*!*******************************!*\
|
|
265
|
+
!*** ./src/services/teams.ts ***!
|
|
266
|
+
\*******************************/
|
|
739
267
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
740
268
|
|
|
741
|
-
"use strict";
|
|
742
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"setUpProject\": () => (/* binding */ setUpProject)\n/* harmony export */ });\n/* harmony import */ var _brokers_CelminoProvider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../brokers/CelminoProvider */ \"./src/brokers/CelminoProvider.ts\");\n\nfunction setUpProject(projectId, mode) {\n _brokers_CelminoProvider__WEBPACK_IMPORTED_MODULE_0__.client.setProject(projectId);\n _brokers_CelminoProvider__WEBPACK_IMPORTED_MODULE_0__.client.setMode(mode);\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/utils/setUpProject.ts?");
|
|
743
|
-
|
|
744
|
-
/***/ }),
|
|
745
|
-
|
|
746
|
-
/***/ "./node_modules/web-vitals/dist/web-vitals.attribution.js":
|
|
747
|
-
/*!****************************************************************!*\
|
|
748
|
-
!*** ./node_modules/web-vitals/dist/web-vitals.attribution.js ***!
|
|
749
|
-
\****************************************************************/
|
|
750
|
-
/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
|
751
|
-
|
|
752
|
-
"use strict";
|
|
753
|
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CLSThresholds\": () => (/* binding */ A),\n/* harmony export */ \"FCPThresholds\": () => (/* binding */ M),\n/* harmony export */ \"FIDThresholds\": () => (/* binding */ H),\n/* harmony export */ \"INPThresholds\": () => (/* binding */ J),\n/* harmony export */ \"LCPThresholds\": () => (/* binding */ ee),\n/* harmony export */ \"TTFBThresholds\": () => (/* binding */ re),\n/* harmony export */ \"onCLS\": () => (/* binding */ F),\n/* harmony export */ \"onFCP\": () => (/* binding */ I),\n/* harmony export */ \"onFID\": () => (/* binding */ O),\n/* harmony export */ \"onINP\": () => (/* binding */ $),\n/* harmony export */ \"onLCP\": () => (/* binding */ ne),\n/* harmony export */ \"onTTFB\": () => (/* binding */ oe)\n/* harmony export */ });\nvar e,t,n,r,i,a=function(){return window.performance&&performance.getEntriesByType&&performance.getEntriesByType(\"navigation\")[0]},o=function(e){if(\"loading\"===document.readyState)return\"loading\";var t=a();if(t){if(e<t.domInteractive)return\"loading\";if(0===t.domContentLoadedEventStart||e<t.domContentLoadedEventStart)return\"dom-interactive\";if(0===t.domComplete||e<t.domComplete)return\"dom-content-loaded\"}return\"complete\"},u=function(e){var t=e.nodeName;return 1===e.nodeType?t.toLowerCase():t.toUpperCase().replace(/^#/,\"\")},c=function(e,t){var n=\"\";try{for(;e&&9!==e.nodeType;){var r=e,i=r.id?\"#\"+r.id:u(r)+(r.classList&&r.classList.value&&r.classList.value.trim()&&r.classList.value.trim().length?\".\"+r.classList.value.trim().replace(/\\s+/g,\".\"):\"\");if(n.length+i.length>(t||100)-1)return n||i;if(n=n?i+\">\"+n:i,r.id)break;e=r.parentNode}}catch(e){}return n},s=-1,f=function(){return s},d=function(e){addEventListener(\"pageshow\",(function(t){t.persisted&&(s=t.timeStamp,e(t))}),!0)},l=function(){var e=a();return e&&e.activationStart||0},m=function(e,t){var n=a(),r=\"navigate\";f()>=0?r=\"back-forward-cache\":n&&(document.prerendering||l()>0?r=\"prerender\":document.wasDiscarded?r=\"restore\":n.type&&(r=n.type.replace(/_/g,\"-\")));return{name:e,value:void 0===t?-1:t,rating:\"good\",delta:0,entries:[],id:\"v3-\".concat(Date.now(),\"-\").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:r}},v=function(e,t,n){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var r=new PerformanceObserver((function(e){Promise.resolve().then((function(){t(e.getEntries())}))}));return r.observe(Object.assign({type:e,buffered:!0},n||{})),r}}catch(e){}},p=function(e,t,n,r){var i,a;return function(o){t.value>=0&&(o||r)&&((a=t.value-(i||0))||void 0===i)&&(i=t.value,t.delta=a,t.rating=function(e,t){return e>t[1]?\"poor\":e>t[0]?\"needs-improvement\":\"good\"}(t.value,n),e(t))}},h=function(e){requestAnimationFrame((function(){return requestAnimationFrame((function(){return e()}))}))},g=function(e){var t=function(t){\"pagehide\"!==t.type&&\"hidden\"!==document.visibilityState||e(t)};addEventListener(\"visibilitychange\",t,!0),addEventListener(\"pagehide\",t,!0)},T=function(e){var t=!1;return function(n){t||(e(n),t=!0)}},y=-1,E=function(){return\"hidden\"!==document.visibilityState||document.prerendering?1/0:0},S=function(e){\"hidden\"===document.visibilityState&&y>-1&&(y=\"visibilitychange\"===e.type?e.timeStamp:0,b())},L=function(){addEventListener(\"visibilitychange\",S,!0),addEventListener(\"prerenderingchange\",S,!0)},b=function(){removeEventListener(\"visibilitychange\",S,!0),removeEventListener(\"prerenderingchange\",S,!0)},C=function(){return y<0&&(y=E(),L(),d((function(){setTimeout((function(){y=E(),L()}),0)}))),{get firstHiddenTime(){return y}}},w=function(e){document.prerendering?addEventListener(\"prerenderingchange\",(function(){return e()}),!0):e()},M=[1800,3e3],x=function(e,t){t=t||{},w((function(){var n,r=C(),i=m(\"FCP\"),a=v(\"paint\",(function(e){e.forEach((function(e){\"first-contentful-paint\"===e.name&&(a.disconnect(),e.startTime<r.firstHiddenTime&&(i.value=Math.max(e.startTime-l(),0),i.entries.push(e),n(!0)))}))}));a&&(n=p(e,i,M,t.reportAllChanges),d((function(r){i=m(\"FCP\"),n=p(e,i,M,t.reportAllChanges),h((function(){i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},A=[.1,.25],F=function(e,t){!function(e,t){t=t||{},x(T((function(){var n,r=m(\"CLS\",0),i=0,a=[],o=function(e){e.forEach((function(e){if(!e.hadRecentInput){var t=a[0],n=a[a.length-1];i&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(i+=e.value,a.push(e)):(i=e.value,a=[e])}})),i>r.value&&(r.value=i,r.entries=a,n())},u=v(\"layout-shift\",o);u&&(n=p(e,r,A,t.reportAllChanges),g((function(){o(u.takeRecords()),n(!0)})),d((function(){i=0,r=m(\"CLS\",0),n=p(e,r,A,t.reportAllChanges),h((function(){return n()}))})),setTimeout(n,0))})))}((function(t){!function(e){if(e.entries.length){var t=e.entries.reduce((function(e,t){return e&&e.value>t.value?e:t}));if(t&&t.sources&&t.sources.length){var n=(r=t.sources).find((function(e){return e.node&&1===e.node.nodeType}))||r[0];if(n)return void(e.attribution={largestShiftTarget:c(n.node),largestShiftTime:t.startTime,largestShiftValue:t.value,largestShiftSource:n,largestShiftEntry:t,loadState:o(t.startTime)})}}var r;e.attribution={}}(t),e(t)}),t)},I=function(e,t){x((function(t){!function(e){if(e.entries.length){var t=a(),n=e.entries[e.entries.length-1];if(t){var r=t.activationStart||0,i=Math.max(0,t.responseStart-r);return void(e.attribution={timeToFirstByte:i,firstByteToFCP:e.value-i,loadState:o(e.entries[0].startTime),navigationEntry:t,fcpEntry:n})}}e.attribution={timeToFirstByte:0,firstByteToFCP:e.value,loadState:o(f())}}(t),e(t)}),t)},P={passive:!0,capture:!0},B=new Date,D=function(r,i){e||(e=i,t=r,n=new Date,q(removeEventListener),k())},k=function(){if(t>=0&&t<n-B){var i={entryType:\"first-input\",name:e.type,target:e.target,cancelable:e.cancelable,startTime:e.timeStamp,processingStart:e.timeStamp+t};r.forEach((function(e){e(i)})),r=[]}},R=function(e){if(e.cancelable){var t=(e.timeStamp>1e12?new Date:performance.now())-e.timeStamp;\"pointerdown\"==e.type?function(e,t){var n=function(){D(e,t),i()},r=function(){i()},i=function(){removeEventListener(\"pointerup\",n,P),removeEventListener(\"pointercancel\",r,P)};addEventListener(\"pointerup\",n,P),addEventListener(\"pointercancel\",r,P)}(t,e):D(t,e)}},q=function(e){[\"mousedown\",\"keydown\",\"touchstart\",\"pointerdown\"].forEach((function(t){return e(t,R,P)}))},H=[100,300],N=function(n,i){i=i||{},w((function(){var a,o=C(),u=m(\"FID\"),c=function(e){e.startTime<o.firstHiddenTime&&(u.value=e.processingStart-e.startTime,u.entries.push(e),a(!0))},s=function(e){e.forEach(c)},f=v(\"first-input\",s);a=p(n,u,H,i.reportAllChanges),f&&g(T((function(){s(f.takeRecords()),f.disconnect()}))),f&&d((function(){var o;u=m(\"FID\"),a=p(n,u,H,i.reportAllChanges),r=[],t=-1,e=null,q(addEventListener),o=c,r.push(o),k()}))}))},O=function(e,t){N((function(t){!function(e){var t=e.entries[0];e.attribution={eventTarget:c(t.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:o(t.startTime)}}(t),e(t)}),t)},j=0,U=1/0,V=0,_=function(e){e.forEach((function(e){e.interactionId&&(U=Math.min(U,e.interactionId),V=Math.max(V,e.interactionId),j=V?(V-U)/7+1:0)}))},z=function(){return i?j:performance.interactionCount||0},G=function(){\"interactionCount\"in performance||i||(i=v(\"event\",_,{type:\"event\",buffered:!0,durationThreshold:0}))},J=[200,500],K=0,Q=function(){return z()-K},W=[],X={},Y=function(e){var t=W[W.length-1],n=X[e.interactionId];if(n||W.length<10||e.duration>t.latency){if(n)n.entries.push(e),n.latency=Math.max(n.latency,e.duration);else{var r={id:e.interactionId,latency:e.duration,entries:[e]};X[r.id]=r,W.push(r)}W.sort((function(e,t){return t.latency-e.latency})),W.splice(10).forEach((function(e){delete X[e.id]}))}},Z=function(e,t){t=t||{},w((function(){var n;G();var r,i=m(\"INP\"),a=function(e){e.forEach((function(e){(e.interactionId&&Y(e),\"first-input\"===e.entryType)&&(!W.some((function(t){return t.entries.some((function(t){return e.duration===t.duration&&e.startTime===t.startTime}))}))&&Y(e))}));var t,n=(t=Math.min(W.length-1,Math.floor(Q()/50)),W[t]);n&&n.latency!==i.value&&(i.value=n.latency,i.entries=n.entries,r())},o=v(\"event\",a,{durationThreshold:null!==(n=t.durationThreshold)&&void 0!==n?n:40});r=p(e,i,J,t.reportAllChanges),o&&(\"PerformanceEventTiming\"in window&&\"interactionId\"in PerformanceEventTiming.prototype&&o.observe({type:\"first-input\",buffered:!0}),g((function(){a(o.takeRecords()),i.value<0&&Q()>0&&(i.value=0,i.entries=[]),r(!0)})),d((function(){W=[],K=z(),i=m(\"INP\"),r=p(e,i,J,t.reportAllChanges)})))}))},$=function(e,t){Z((function(t){!function(e){if(e.entries.length){var t=e.entries.sort((function(e,t){return t.duration-e.duration||t.processingEnd-t.processingStart-(e.processingEnd-e.processingStart)}))[0],n=e.entries.find((function(e){return e.target}));e.attribution={eventTarget:c(n&&n.target),eventType:t.name,eventTime:t.startTime,eventEntry:t,loadState:o(t.startTime)}}else e.attribution={}}(t),e(t)}),t)},ee=[2500,4e3],te={},ne=function(e,t){!function(e,t){t=t||{},w((function(){var n,r=C(),i=m(\"LCP\"),a=function(e){var t=e[e.length-1];t&&t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-l(),0),i.entries=[t],n())},o=v(\"largest-contentful-paint\",a);if(o){n=p(e,i,ee,t.reportAllChanges);var u=T((function(){te[i.id]||(a(o.takeRecords()),o.disconnect(),te[i.id]=!0,n(!0))}));[\"keydown\",\"click\"].forEach((function(e){addEventListener(e,(function(){return setTimeout(u,0)}),!0)})),g(u),d((function(r){i=m(\"LCP\"),n=p(e,i,ee,t.reportAllChanges),h((function(){i.value=performance.now()-r.timeStamp,te[i.id]=!0,n(!0)}))}))}}))}((function(t){!function(e){if(e.entries.length){var t=a();if(t){var n=t.activationStart||0,r=e.entries[e.entries.length-1],i=r.url&&performance.getEntriesByType(\"resource\").filter((function(e){return e.name===r.url}))[0],o=Math.max(0,t.responseStart-n),u=Math.max(o,i?(i.requestStart||i.startTime)-n:0),s=Math.max(u,i?i.responseEnd-n:0),f=Math.max(s,r?r.startTime-n:0),d={element:c(r.element),timeToFirstByte:o,resourceLoadDelay:u-o,resourceLoadTime:s-u,elementRenderDelay:f-s,navigationEntry:t,lcpEntry:r};return r.url&&(d.url=r.url),i&&(d.lcpResourceEntry=i),void(e.attribution=d)}}e.attribution={timeToFirstByte:0,resourceLoadDelay:0,resourceLoadTime:0,elementRenderDelay:e.value}}(t),e(t)}),t)},re=[800,1800],ie=function e(t){document.prerendering?w((function(){return e(t)})):\"complete\"!==document.readyState?addEventListener(\"load\",(function(){return e(t)}),!0):setTimeout(t,0)},ae=function(e,t){t=t||{};var n=m(\"TTFB\"),r=p(e,n,re,t.reportAllChanges);ie((function(){var i=a();if(i){var o=i.responseStart;if(o<=0||o>performance.now())return;n.value=Math.max(o-l(),0),n.entries=[i],r(!0),d((function(){n=m(\"TTFB\",0),(r=p(e,n,re,t.reportAllChanges))(!0)}))}}))},oe=function(e,t){ae((function(t){!function(e){if(e.entries.length){var t=e.entries[0],n=t.activationStart||0,r=Math.max(t.domainLookupStart-n,0),i=Math.max(t.connectStart-n,0),a=Math.max(t.requestStart-n,0);e.attribution={waitingTime:r,dnsTime:i-r,connectionTime:a-i,requestTime:e.value-a,navigationEntry:t}}else e.attribution={waitingTime:0,dnsTime:0,connectionTime:0,requestTime:0}}(t),e(t)}),t)};\n\n\n//# sourceURL=webpack://@appconda/sdk/./node_modules/web-vitals/dist/web-vitals.attribution.js?");
|
|
269
|
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Teams\": () => (/* binding */ Teams)\n/* harmony export */ });\n/* harmony import */ var _client__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../client */ \"./src/client.ts\");\nvar __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\nclass Teams {\n constructor(client) {\n this.client = client;\n }\n /**\n * List teams\n *\n * Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.\n *\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppcondaException}\n * @returns {Promise<Models.TeamList<Preferences>>}\n */\n list(queries, search) {\n return __awaiter(this, void 0, void 0, function* () {\n const apiPath = '/teams';\n const payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Create team\n *\n * Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.\n *\n * @param {string} teamId\n * @param {string} name\n * @param {string[]} roles\n * @throws {AppcondaException}\n * @returns {Promise<Models.Team<Preferences>>}\n */\n create(teamId, name, roles) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"name\"');\n }\n const apiPath = '/teams';\n const payload = {};\n if (typeof teamId !== 'undefined') {\n payload['teamId'] = teamId;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Get team\n *\n * Get a team by its ID. All team members have read access for this resource.\n *\n * @param {string} teamId\n * @throws {AppcondaException}\n * @returns {Promise<Models.Team<Preferences>>}\n */\n get(teamId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Update name\n *\n * Update the team's name by its unique ID.\n *\n * @param {string} teamId\n * @param {string} name\n * @throws {AppcondaException}\n * @returns {Promise<Models.Team<Preferences>>}\n */\n updateName(teamId, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n if (typeof name === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"name\"');\n }\n const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);\n const payload = {};\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n /**\n * Delete team\n *\n * Delete a team using its ID. Only team members with the owner role can delete the team.\n *\n * @param {string} teamId\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n delete(teamId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}'.replace('{teamId}', teamId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('delete', uri, apiHeaders, payload);\n });\n }\n /**\n * List team memberships\n *\n * Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.\n *\n * @param {string} teamId\n * @param {string[]} queries\n * @param {string} search\n * @throws {AppcondaException}\n * @returns {Promise<Models.MembershipList>}\n */\n listMemberships(teamId, queries, search) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);\n const payload = {};\n if (typeof queries !== 'undefined') {\n payload['queries'] = queries;\n }\n if (typeof search !== 'undefined') {\n payload['search'] = search;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Create team membership\n *\n * Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appconda will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.\n\nYou only need to provide one of a user ID, email, or phone number. Appconda will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.\n\nUse the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appconda.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.\n\nPlease note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appconda will accept the only redirect URLs under the domains you have added as a platform on the Appconda Console.\n\n *\n * @param {string} teamId\n * @param {string[]} roles\n * @param {string} email\n * @param {string} userId\n * @param {string} phone\n * @param {string} url\n * @param {string} name\n * @throws {AppcondaException}\n * @returns {Promise<Models.Membership>}\n */\n createMembership(teamId, roles, email, userId, phone, url, name) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n if (typeof roles === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"roles\"');\n }\n const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', teamId);\n const payload = {};\n if (typeof email !== 'undefined') {\n payload['email'] = email;\n }\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof phone !== 'undefined') {\n payload['phone'] = phone;\n }\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\n }\n if (typeof url !== 'undefined') {\n payload['url'] = url;\n }\n if (typeof name !== 'undefined') {\n payload['name'] = name;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('post', uri, apiHeaders, payload);\n });\n }\n /**\n * Get team membership\n *\n * Get a team member by the membership unique id. All team members have read access for this resource.\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @throws {AppcondaException}\n * @returns {Promise<Models.Membership>}\n */\n getMembership(teamId, membershipId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"membershipId\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Update membership\n *\n * Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](https://appconda.io/docs/permissions).\n\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @param {string[]} roles\n * @throws {AppcondaException}\n * @returns {Promise<Models.Membership>}\n */\n updateMembership(teamId, membershipId, roles) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"membershipId\"');\n }\n if (typeof roles === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"roles\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n const payload = {};\n if (typeof roles !== 'undefined') {\n payload['roles'] = roles;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Delete team membership\n *\n * This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @throws {AppcondaException}\n * @returns {Promise<{}>}\n */\n deleteMembership(teamId, membershipId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"membershipId\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('delete', uri, apiHeaders, payload);\n });\n }\n /**\n * Update team membership status\n *\n * Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.\n\nIf the request is successful, a session for the user is automatically created.\n\n *\n * @param {string} teamId\n * @param {string} membershipId\n * @param {string} userId\n * @param {string} secret\n * @throws {AppcondaException}\n * @returns {Promise<Models.Membership>}\n */\n updateMembershipStatus(teamId, membershipId, userId, secret) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n if (typeof membershipId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"membershipId\"');\n }\n if (typeof userId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"userId\"');\n }\n if (typeof secret === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"secret\"');\n }\n const apiPath = '/teams/{teamId}/memberships/{membershipId}/status'.replace('{teamId}', teamId).replace('{membershipId}', membershipId);\n const payload = {};\n if (typeof userId !== 'undefined') {\n payload['userId'] = userId;\n }\n if (typeof secret !== 'undefined') {\n payload['secret'] = secret;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('patch', uri, apiHeaders, payload);\n });\n }\n /**\n * Get team preferences\n *\n * Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appconda.io/docs/references/cloud/client-web/account#getPrefs).\n *\n * @param {string} teamId\n * @throws {AppcondaException}\n * @returns {Promise<Preferences>}\n */\n getPrefs(teamId) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);\n const payload = {};\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('get', uri, apiHeaders, payload);\n });\n }\n /**\n * Update preferences\n *\n * Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.\n *\n * @param {string} teamId\n * @param {object} prefs\n * @throws {AppcondaException}\n * @returns {Promise<Preferences>}\n */\n updatePrefs(teamId, prefs) {\n return __awaiter(this, void 0, void 0, function* () {\n if (typeof teamId === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"teamId\"');\n }\n if (typeof prefs === 'undefined') {\n throw new _client__WEBPACK_IMPORTED_MODULE_0__.AppcondaException('Missing required parameter: \"prefs\"');\n }\n const apiPath = '/teams/{teamId}/prefs'.replace('{teamId}', teamId);\n const payload = {};\n if (typeof prefs !== 'undefined') {\n payload['prefs'] = prefs;\n }\n const uri = new URL(this.client.config.endpoint + apiPath);\n const apiHeaders = {\n 'content-type': 'application/json',\n };\n return yield this.client.call('put', uri, apiHeaders, payload);\n });\n }\n}\n\n\n//# sourceURL=webpack://@appconda/sdk/./src/services/teams.ts?");
|
|
754
270
|
|
|
755
271
|
/***/ })
|
|
756
272
|
|
|
@@ -781,18 +297,6 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
781
297
|
/******/ }
|
|
782
298
|
/******/
|
|
783
299
|
/************************************************************************/
|
|
784
|
-
/******/ /* webpack/runtime/compat get default export */
|
|
785
|
-
/******/ (() => {
|
|
786
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
787
|
-
/******/ __webpack_require__.n = (module) => {
|
|
788
|
-
/******/ var getter = module && module.__esModule ?
|
|
789
|
-
/******/ () => (module['default']) :
|
|
790
|
-
/******/ () => (module);
|
|
791
|
-
/******/ __webpack_require__.d(getter, { a: getter });
|
|
792
|
-
/******/ return getter;
|
|
793
|
-
/******/ };
|
|
794
|
-
/******/ })();
|
|
795
|
-
/******/
|
|
796
300
|
/******/ /* webpack/runtime/define property getters */
|
|
797
301
|
/******/ (() => {
|
|
798
302
|
/******/ // define getter functions for harmony exports
|
|
@@ -805,18 +309,6 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac
|
|
|
805
309
|
/******/ };
|
|
806
310
|
/******/ })();
|
|
807
311
|
/******/
|
|
808
|
-
/******/ /* webpack/runtime/global */
|
|
809
|
-
/******/ (() => {
|
|
810
|
-
/******/ __webpack_require__.g = (function() {
|
|
811
|
-
/******/ if (typeof globalThis === 'object') return globalThis;
|
|
812
|
-
/******/ try {
|
|
813
|
-
/******/ return this || new Function('return this')();
|
|
814
|
-
/******/ } catch (e) {
|
|
815
|
-
/******/ if (typeof window === 'object') return window;
|
|
816
|
-
/******/ }
|
|
817
|
-
/******/ })();
|
|
818
|
-
/******/ })();
|
|
819
|
-
/******/
|
|
820
312
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
821
313
|
/******/ (() => {
|
|
822
314
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|