UNPKG

@zeplin/sdk

Version:
881 lines (880 loc) 198 kB
"use strict"; require("core-js/modules/es.symbol.to-primitive.js"); require("core-js/modules/es.date.to-primitive.js"); require("core-js/modules/es.number.constructor.js"); require("core-js/modules/es.object.define-property.js"); require("core-js/modules/es.object.keys.js"); require("core-js/modules/es.array.filter.js"); require("core-js/modules/es.object.get-own-property-descriptor.js"); require("core-js/modules/es.array.for-each.js"); require("core-js/modules/web.dom-collections.for-each.js"); require("core-js/modules/es.object.get-own-property-descriptors.js"); require("core-js/modules/es.object.define-properties.js"); require("core-js/modules/es.object.set-prototype-of.js"); require("core-js/modules/es.function.bind.js"); require("core-js/modules/es.object.get-prototype-of.js"); require("core-js/modules/es.reflect.construct.js"); require("core-js/modules/es.object.create.js"); require("core-js/modules/es.symbol.iterator.js"); function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } Object.defineProperty(exports, "__esModule", { value: true }); exports.ScreensApiFp = exports.ScreensApiAxiosParamCreator = exports.ScreensApi = void 0; require("regenerator-runtime/runtime.js"); require("core-js/modules/es.regexp.exec.js"); require("core-js/modules/es.string.replace.js"); require("core-js/modules/es.array.iterator.js"); require("core-js/modules/es.object.to-string.js"); require("core-js/modules/es.string.iterator.js"); require("core-js/modules/web.dom-collections.iterator.js"); require("core-js/modules/web.url.js"); require("core-js/modules/es.array.join.js"); require("core-js/modules/es.object.assign.js"); require("core-js/modules/es.array.sort.js"); require("core-js/modules/es.function.name.js"); require("core-js/modules/es.symbol.js"); require("core-js/modules/es.symbol.description.js"); require("core-js/modules/es.array.map.js"); require("core-js/modules/es.promise.js"); var _axios = _interopRequireDefault(require("axios")); var _formData = _interopRequireDefault(require("form-data")); var _common = require("../common"); var _base = require("../base"); var _models = require("../models"); function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); } function _setPrototypeOf(t, e) { return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, _setPrototypeOf(t, e); } function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; } function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return _assertThisInitialized(t); } function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(t) { return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, _getPrototypeOf(t); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } /* tslint:disable */ /* eslint-disable */ /** * Zeplin API * Access your resources in Zeplin * * Contact: support@zeplin.io * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ // Some imports not used depending on template conditions // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore // @ts-ignore /** * ScreensApi - axios parameter creator * @export */ var ScreensApiAxiosParamCreator = function ScreensApiAxiosParamCreator(configuration) { return { /** * Create a new screen in the project * @summary Create a new screen * @param {string} projectId Project id * @param {string} name Name of the screen * @param {any} image Binary data of the screen image. The image has to be in JPEG or PNG format, and its size cannot exceed 5MB. * @param {string} [description] Description for the screen * @param {string} [commitMessage] Commit message for the screen version * @param {string} [commitColor] Commit color for the screen version * @param {Array<string>} [tags] Tags for the screen * @param {string} [sectionId] Unique id of the screen section * @param {*} [options] Override http request option. * @throws {RequiredError} */ createScreen: function () { var _createScreen = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(projectId, name, image, description, commitMessage, commitColor, tags, sectionId) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, localVarFormParams, headersFromBaseOptions, _args = arguments; return regeneratorRuntime.wrap(function _callee$(_context) { while (1) { switch (_context.prev = _context.next) { case 0: options = _args.length > 8 && _args[8] !== undefined ? _args[8] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('createScreen', 'projectId', projectId); // verify required parameter 'name' is not null or undefined (0, _common.assertParamExists)('createScreen', 'name', name); // verify required parameter 'image' is not null or undefined (0, _common.assertParamExists)('createScreen', 'image', image); localVarPath = "/v1/projects/{project_id}/screens".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'POST' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; localVarFormParams = new _formData["default"](); // authentication OAuth2 required // oauth required _context.next = 13; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration); case 13: _context.next = 15; return (0, _common.setBearerAuthToObject)(localVarHeaderParameter, configuration); case 15: if (name !== undefined) { localVarFormParams.append('name', name); } if (image !== undefined) { localVarFormParams.append('image', image.file, "image.".concat(image.type)); } if (description !== undefined) { localVarFormParams.append('description', description); } if (commitMessage !== undefined) { localVarFormParams.append('commit_message', commitMessage); } if (commitColor !== undefined) { localVarFormParams.append('commit_color', commitColor); } if (tags) { localVarFormParams.append('tags', tags.join(_base.COLLECTION_FORMATS.csv)); } if (sectionId !== undefined) { localVarFormParams.append('section_id', sectionId); } if (localVarFormParams.getHeaders) { Object.assign(localVarHeaderParameter, localVarFormParams.getHeaders()); } else { localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; } (0, _common.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = _objectSpread(_objectSpread(_objectSpread({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = localVarFormParams; return _context.abrupt("return", { url: (0, _common.toPathString)(localVarUrlObj), options: localVarRequestOptions }); case 28: case "end": return _context.stop(); } } }, _callee); })); function createScreen(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8) { return _createScreen.apply(this, arguments); } return createScreen; }(), /** * Create an annotation on the screen * @summary Create an annotation * @param {string} projectId Project id * @param {string} screenId Screen id * @param {ScreenAnnotationCreateBody} screenAnnotationCreateBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ createScreenAnnotation: function () { var _createScreenAnnotation = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(projectId, screenId, screenAnnotationCreateBody) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions, _args2 = arguments; return regeneratorRuntime.wrap(function _callee2$(_context2) { while (1) { switch (_context2.prev = _context2.next) { case 0: options = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('createScreenAnnotation', 'projectId', projectId); // verify required parameter 'screenId' is not null or undefined (0, _common.assertParamExists)('createScreenAnnotation', 'screenId', screenId); // verify required parameter 'screenAnnotationCreateBody' is not null or undefined (0, _common.assertParamExists)('createScreenAnnotation', 'screenAnnotationCreateBody', screenAnnotationCreateBody); localVarPath = "/v1/projects/{project_id}/screens/{screen_id}/annotations".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))).replace("{".concat("screen_id", "}"), encodeURIComponent(String(screenId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'POST' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; // authentication OAuth2 required // oauth required _context2.next = 12; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration); case 12: _context2.next = 14; return (0, _common.setBearerAuthToObject)(localVarHeaderParameter, configuration); case 14: localVarHeaderParameter['Content-Type'] = 'application/json'; (0, _common.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = _objectSpread(_objectSpread(_objectSpread({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, _common.serializeDataIfNeeded)((0, _models.transformScreenAnnotationCreateBodyToJSON)(screenAnnotationCreateBody), localVarRequestOptions, configuration); return _context2.abrupt("return", { url: (0, _common.toPathString)(localVarUrlObj), options: localVarRequestOptions }); case 20: case "end": return _context2.stop(); } } }, _callee2); })); function createScreenAnnotation(_x9, _x10, _x11) { return _createScreenAnnotation.apply(this, arguments); } return createScreenAnnotation; }(), /** * Create comment on the screen note * @summary Create a comment * @param {string} projectId Project id * @param {string} screenId Screen id * @param {string} noteId Screen note id * @param {CommentCreateBody} commentCreateBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ createScreenComment: function () { var _createScreenComment = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(projectId, screenId, noteId, commentCreateBody) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions, _args3 = arguments; return regeneratorRuntime.wrap(function _callee3$(_context3) { while (1) { switch (_context3.prev = _context3.next) { case 0: options = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('createScreenComment', 'projectId', projectId); // verify required parameter 'screenId' is not null or undefined (0, _common.assertParamExists)('createScreenComment', 'screenId', screenId); // verify required parameter 'noteId' is not null or undefined (0, _common.assertParamExists)('createScreenComment', 'noteId', noteId); // verify required parameter 'commentCreateBody' is not null or undefined (0, _common.assertParamExists)('createScreenComment', 'commentCreateBody', commentCreateBody); localVarPath = "/v1/projects/{project_id}/screens/{screen_id}/notes/{note_id}/comments".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))).replace("{".concat("screen_id", "}"), encodeURIComponent(String(screenId))).replace("{".concat("note_id", "}"), encodeURIComponent(String(noteId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'POST' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; // authentication OAuth2 required // oauth required _context3.next = 13; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration); case 13: _context3.next = 15; return (0, _common.setBearerAuthToObject)(localVarHeaderParameter, configuration); case 15: localVarHeaderParameter['Content-Type'] = 'application/json'; (0, _common.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = _objectSpread(_objectSpread(_objectSpread({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, _common.serializeDataIfNeeded)((0, _models.transformCommentCreateBodyToJSON)(commentCreateBody), localVarRequestOptions, configuration); return _context3.abrupt("return", { url: (0, _common.toPathString)(localVarUrlObj), options: localVarRequestOptions }); case 21: case "end": return _context3.stop(); } } }, _callee3); })); function createScreenComment(_x12, _x13, _x14, _x15) { return _createScreenComment.apply(this, arguments); } return createScreenComment; }(), /** * Create a note on the screen * @summary Create a note * @param {string} projectId Project id * @param {string} screenId Screen id * @param {ScreenNoteCreateBody} screenNoteCreateBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ createScreenNote: function () { var _createScreenNote = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(projectId, screenId, screenNoteCreateBody) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions, _args4 = arguments; return regeneratorRuntime.wrap(function _callee4$(_context4) { while (1) { switch (_context4.prev = _context4.next) { case 0: options = _args4.length > 3 && _args4[3] !== undefined ? _args4[3] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('createScreenNote', 'projectId', projectId); // verify required parameter 'screenId' is not null or undefined (0, _common.assertParamExists)('createScreenNote', 'screenId', screenId); // verify required parameter 'screenNoteCreateBody' is not null or undefined (0, _common.assertParamExists)('createScreenNote', 'screenNoteCreateBody', screenNoteCreateBody); localVarPath = "/v1/projects/{project_id}/screens/{screen_id}/notes".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))).replace("{".concat("screen_id", "}"), encodeURIComponent(String(screenId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'POST' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; // authentication OAuth2 required // oauth required _context4.next = 12; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration); case 12: _context4.next = 14; return (0, _common.setBearerAuthToObject)(localVarHeaderParameter, configuration); case 14: localVarHeaderParameter['Content-Type'] = 'application/json'; (0, _common.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = _objectSpread(_objectSpread(_objectSpread({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = (0, _common.serializeDataIfNeeded)((0, _models.transformScreenNoteCreateBodyToJSON)(screenNoteCreateBody), localVarRequestOptions, configuration); return _context4.abrupt("return", { url: (0, _common.toPathString)(localVarUrlObj), options: localVarRequestOptions }); case 20: case "end": return _context4.stop(); } } }, _callee4); })); function createScreenNote(_x16, _x17, _x18) { return _createScreenNote.apply(this, arguments); } return createScreenNote; }(), /** * Create a new screen version in the project * @summary Create a new screen version * @param {string} projectId Project id * @param {string} screenId Screen id * @param {any} image Binary data of the screen image. The image has to be in JPEG or PNG format, and its size cannot exceed 5MB. * @param {string} [commitMessage] Commit message for the screen version * @param {string} [commitColor] Commit color for the screen version * @param {*} [options] Override http request option. * @throws {RequiredError} */ createScreenVersion: function () { var _createScreenVersion = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(projectId, screenId, image, commitMessage, commitColor) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, localVarFormParams, headersFromBaseOptions, _args5 = arguments; return regeneratorRuntime.wrap(function _callee5$(_context5) { while (1) { switch (_context5.prev = _context5.next) { case 0: options = _args5.length > 5 && _args5[5] !== undefined ? _args5[5] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('createScreenVersion', 'projectId', projectId); // verify required parameter 'screenId' is not null or undefined (0, _common.assertParamExists)('createScreenVersion', 'screenId', screenId); // verify required parameter 'image' is not null or undefined (0, _common.assertParamExists)('createScreenVersion', 'image', image); localVarPath = "/v1/projects/{project_id}/screens/{screen_id}/versions".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))).replace("{".concat("screen_id", "}"), encodeURIComponent(String(screenId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'POST' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; localVarFormParams = new _formData["default"](); // authentication OAuth2 required // oauth required _context5.next = 13; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration); case 13: _context5.next = 15; return (0, _common.setBearerAuthToObject)(localVarHeaderParameter, configuration); case 15: if (image !== undefined) { localVarFormParams.append('image', image.file, "image.".concat(image.type)); } if (commitMessage !== undefined) { localVarFormParams.append('commit_message', commitMessage); } if (commitColor !== undefined) { localVarFormParams.append('commit_color', commitColor); } if (localVarFormParams.getHeaders) { Object.assign(localVarHeaderParameter, localVarFormParams.getHeaders()); } else { localVarHeaderParameter['Content-Type'] = 'multipart/form-data'; } (0, _common.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = _objectSpread(_objectSpread(_objectSpread({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = localVarFormParams; return _context5.abrupt("return", { url: (0, _common.toPathString)(localVarUrlObj), options: localVarRequestOptions }); case 24: case "end": return _context5.stop(); } } }, _callee5); })); function createScreenVersion(_x19, _x20, _x21, _x22, _x23) { return _createScreenVersion.apply(this, arguments); } return createScreenVersion; }(), /** * Delete an annotation on the screen * @summary Delete an annotation * @param {string} projectId Project id * @param {string} screenId Screen id * @param {string} annotationId Screen annotation id * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteScreenAnnotation: function () { var _deleteScreenAnnotation = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee6(projectId, screenId, annotationId) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions, _args6 = arguments; return regeneratorRuntime.wrap(function _callee6$(_context6) { while (1) { switch (_context6.prev = _context6.next) { case 0: options = _args6.length > 3 && _args6[3] !== undefined ? _args6[3] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('deleteScreenAnnotation', 'projectId', projectId); // verify required parameter 'screenId' is not null or undefined (0, _common.assertParamExists)('deleteScreenAnnotation', 'screenId', screenId); // verify required parameter 'annotationId' is not null or undefined (0, _common.assertParamExists)('deleteScreenAnnotation', 'annotationId', annotationId); localVarPath = "/v1/projects/{project_id}/screens/{screen_id}/annotations/{annotation_id}".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))).replace("{".concat("screen_id", "}"), encodeURIComponent(String(screenId))).replace("{".concat("annotation_id", "}"), encodeURIComponent(String(annotationId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'DELETE' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; // authentication OAuth2 required // oauth required _context6.next = 12; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration); case 12: _context6.next = 14; return (0, _common.setBearerAuthToObject)(localVarHeaderParameter, configuration); case 14: (0, _common.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = _objectSpread(_objectSpread(_objectSpread({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return _context6.abrupt("return", { url: (0, _common.toPathString)(localVarUrlObj), options: localVarRequestOptions }); case 18: case "end": return _context6.stop(); } } }, _callee6); })); function deleteScreenAnnotation(_x24, _x25, _x26) { return _deleteScreenAnnotation.apply(this, arguments); } return deleteScreenAnnotation; }(), /** * Delete a comment on the screen note * @summary Delete comment * @param {string} projectId Project id * @param {string} screenId Screen id * @param {string} noteId Screen note id * @param {string} commentId Screen comment id * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteScreenComment: function () { var _deleteScreenComment = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee7(projectId, screenId, noteId, commentId) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions, _args7 = arguments; return regeneratorRuntime.wrap(function _callee7$(_context7) { while (1) { switch (_context7.prev = _context7.next) { case 0: options = _args7.length > 4 && _args7[4] !== undefined ? _args7[4] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('deleteScreenComment', 'projectId', projectId); // verify required parameter 'screenId' is not null or undefined (0, _common.assertParamExists)('deleteScreenComment', 'screenId', screenId); // verify required parameter 'noteId' is not null or undefined (0, _common.assertParamExists)('deleteScreenComment', 'noteId', noteId); // verify required parameter 'commentId' is not null or undefined (0, _common.assertParamExists)('deleteScreenComment', 'commentId', commentId); localVarPath = "/v1/projects/{project_id}/screens/{screen_id}/notes/{note_id}/comments/{comment_id}".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))).replace("{".concat("screen_id", "}"), encodeURIComponent(String(screenId))).replace("{".concat("note_id", "}"), encodeURIComponent(String(noteId))).replace("{".concat("comment_id", "}"), encodeURIComponent(String(commentId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'DELETE' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; // authentication OAuth2 required // oauth required _context7.next = 13; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration); case 13: _context7.next = 15; return (0, _common.setBearerAuthToObject)(localVarHeaderParameter, configuration); case 15: (0, _common.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = _objectSpread(_objectSpread(_objectSpread({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return _context7.abrupt("return", { url: (0, _common.toPathString)(localVarUrlObj), options: localVarRequestOptions }); case 19: case "end": return _context7.stop(); } } }, _callee7); })); function deleteScreenComment(_x27, _x28, _x29, _x30) { return _deleteScreenComment.apply(this, arguments); } return deleteScreenComment; }(), /** * Delete a note on the screen * @summary Delete a note * @param {string} projectId Project id * @param {string} screenId Screen id * @param {string} noteId Screen note id * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteScreenNote: function () { var _deleteScreenNote = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee8(projectId, screenId, noteId) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions, _args8 = arguments; return regeneratorRuntime.wrap(function _callee8$(_context8) { while (1) { switch (_context8.prev = _context8.next) { case 0: options = _args8.length > 3 && _args8[3] !== undefined ? _args8[3] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('deleteScreenNote', 'projectId', projectId); // verify required parameter 'screenId' is not null or undefined (0, _common.assertParamExists)('deleteScreenNote', 'screenId', screenId); // verify required parameter 'noteId' is not null or undefined (0, _common.assertParamExists)('deleteScreenNote', 'noteId', noteId); localVarPath = "/v1/projects/{project_id}/screens/{screen_id}/notes/{note_id}".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))).replace("{".concat("screen_id", "}"), encodeURIComponent(String(screenId))).replace("{".concat("note_id", "}"), encodeURIComponent(String(noteId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'DELETE' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; // authentication OAuth2 required // oauth required _context8.next = 12; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration); case 12: _context8.next = 14; return (0, _common.setBearerAuthToObject)(localVarHeaderParameter, configuration); case 14: (0, _common.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = _objectSpread(_objectSpread(_objectSpread({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return _context8.abrupt("return", { url: (0, _common.toPathString)(localVarUrlObj), options: localVarRequestOptions }); case 18: case "end": return _context8.stop(); } } }, _callee8); })); function deleteScreenNote(_x31, _x32, _x33) { return _deleteScreenNote.apply(this, arguments); } return deleteScreenNote; }(), /** * Get details of the latest version * @summary Get the latest screen version * @param {string} projectId Project id * @param {string} screenId Screen id * @param {*} [options] Override http request option. * @throws {RequiredError} */ getLatestScreenVersion: function () { var _getLatestScreenVersion = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee9(projectId, screenId) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions, _args9 = arguments; return regeneratorRuntime.wrap(function _callee9$(_context9) { while (1) { switch (_context9.prev = _context9.next) { case 0: options = _args9.length > 2 && _args9[2] !== undefined ? _args9[2] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('getLatestScreenVersion', 'projectId', projectId); // verify required parameter 'screenId' is not null or undefined (0, _common.assertParamExists)('getLatestScreenVersion', 'screenId', screenId); localVarPath = "/v1/projects/{project_id}/screens/{screen_id}/versions/latest".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))).replace("{".concat("screen_id", "}"), encodeURIComponent(String(screenId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'GET' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; // authentication OAuth2 required // oauth required _context9.next = 11; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration); case 11: _context9.next = 13; return (0, _common.setBearerAuthToObject)(localVarHeaderParameter, configuration); case 13: (0, _common.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = _objectSpread(_objectSpread(_objectSpread({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return _context9.abrupt("return", { url: (0, _common.toPathString)(localVarUrlObj), options: localVarRequestOptions }); case 17: case "end": return _context9.stop(); } } }, _callee9); })); function getLatestScreenVersion(_x34, _x35) { return _getLatestScreenVersion.apply(this, arguments); } return getLatestScreenVersion; }(), /** * List all screens of the project * @summary Get project screens * @param {string} projectId Project id * @param {string} [sectionId] Filter by section id * @param {'section' | 'created'} [sort] Sort screens by their &#x60;section&#x60; or their &#x60;created&#x60; date * @param {number} [limit] Pagination limit * @param {number} [offset] Pagination offset * @param {*} [options] Override http request option. * @throws {RequiredError} */ getProjectScreens: function () { var _getProjectScreens = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee10(projectId, sectionId, sort, limit, offset) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions, _args10 = arguments; return regeneratorRuntime.wrap(function _callee10$(_context10) { while (1) { switch (_context10.prev = _context10.next) { case 0: options = _args10.length > 5 && _args10[5] !== undefined ? _args10[5] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('getProjectScreens', 'projectId', projectId); localVarPath = "/v1/projects/{project_id}/screens".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'GET' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; // authentication OAuth2 required // oauth required _context10.next = 10; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [], configuration); case 10: _context10.next = 12; return (0, _common.setBearerAuthToObject)(localVarHeaderParameter, configuration); case 12: if (sectionId !== undefined) { localVarQueryParameter['section_id'] = sectionId; } if (sort !== undefined) { localVarQueryParameter['sort'] = sort; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } if (offset !== undefined) { localVarQueryParameter['offset'] = offset; } (0, _common.setSearchParams)(localVarUrlObj, localVarQueryParameter, options.query); headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = _objectSpread(_objectSpread(_objectSpread({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return _context10.abrupt("return", { url: (0, _common.toPathString)(localVarUrlObj), options: localVarRequestOptions }); case 20: case "end": return _context10.stop(); } } }, _callee10); })); function getProjectScreens(_x36, _x37, _x38, _x39, _x40) { return _getProjectScreens.apply(this, arguments); } return getProjectScreens; }(), /** * Get a single screen by id * @summary Get a single screen * @param {string} projectId Project id * @param {string} screenId Screen id * @param {*} [options] Override http request option. * @throws {RequiredError} */ getScreen: function () { var _getScreen = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee11(projectId, screenId) { var options, localVarPath, localVarUrlObj, baseOptions, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions, _args11 = arguments; return regeneratorRuntime.wrap(function _callee11$(_context11) { while (1) { switch (_context11.prev = _context11.next) { case 0: options = _args11.length > 2 && _args11[2] !== undefined ? _args11[2] : {}; // verify required parameter 'projectId' is not null or undefined (0, _common.assertParamExists)('getScreen', 'projectId', projectId); // verify required parameter 'screenId' is not null or undefined (0, _common.assertParamExists)('getScreen', 'screenId', screenId); localVarPath = "/v1/projects/{project_id}/screens/{screen_id}".replace("{".concat("project_id", "}"), encodeURIComponent(String(projectId))).replace("{".concat("screen_id", "}"), encodeURIComponent(String(screenId))); // use dummy base URL string because the URL constructor only accepts absolute URLs. localVarUrlObj = new URL(localVarPath, _common.DUMMY_BASE_URL); if (configuration) { baseOptions = configuration.baseOptions; } localVarRequestOptions = _objectSpread(_objectSpread({ method: 'GET' }, baseOptions), options); localVarHeaderParameter = {}; localVarQueryParameter = {}; // authentication OAuth2 required // oauth required _context11.next = 11; return (0, _common.setOAuthToObject)(localVarHeaderParameter, "OAuth2", [],