1/// <reference path="./base-service.ts" /> 2var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 3 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 4 return new (P || (P = Promise))(function (resolve, reject) { 5 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 6 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 7 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 8 step((generator = generator.apply(thisArg, _arguments || [])).next()); 9 }); 10}; 11var __generator = (this && this.__generator) || function (thisArg, body) { 12 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); 13 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 14 function verb(n) { return function (v) { return step([n, v]); }; } 15 function step(op) { 16 if (f) throw new TypeError("Generator is already executing."); 17 while (g && (g = 0, op[0] && (_ = 0)), _) try { 18 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; 19 if (y = 0, t) op = [op[0] & 2, t.value]; 20 switch (op[0]) { 21 case 0: case 1: t = op; break; 22 case 4: _.label++; return { value: op[1], done: false }; 23 case 5: _.label++; y = op[1]; op = [0]; continue; 24 case 7: op = _.ops.pop(); _.trys.pop(); continue; 25 default: 26 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 27 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 28 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 29 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 30 if (t[2]) _.ops.pop(); 31 _.trys.pop(); continue; 32 } 33 op = body.call(thisArg, _); 34 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 35 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 36 } 37}; 38var AppServices; 39(function (AppServices) { 40 var TagService = /** @class */ (function () { 41 function TagService() { 42 this.baseUrl = '/api/tag/'; 43 this._api = null; 44 this._api = new BaseService.ApiService(); 45 } 46 TagService.prototype.GetTags = function (clubWebsiteId_1) { 47 return __awaiter(this, arguments, void 0, function (clubWebsiteId, isNewsArticle, isEvent, isNewsFilter) { 48 var url, result, error_1; 49 if (isNewsArticle === void 0) { isNewsArticle = false; } 50 if (isEvent === void 0) { isEvent = false; } 51 if (isNewsFilter === void 0) { isNewsFilter = false; } 52 return __generator(this, function (_a) { 53 switch (_a.label) { 54 case 0: 55 url = "".concat(this.baseUrl, "GetTags"); 56 _a.label = 1; 57 case 1: 58 _a.trys.push([1, 3, , 4]); 59 return [4 /*yield*/, this._api.get(url, { 60 clubWebsiteId: clubWebsiteId, 61 isNewsArticle: isNewsArticle, 62 isEvent: isEvent, 63 isNewsFilter: isNewsFilter, 64 })]; 65 case 2: 66 result = _a.sent(); 67 return [2 /*return*/, result.data]; 68 case 3: 69 error_1 = _a.sent(); 70 return [2 /*return*/, { 71 successful: false, 72 errorMessage: error_1.response, 73 }]; 74 case 4: return [2 /*return*/]; 75 } 76 }); 77 }); 78 }; 79 TagService.prototype.GetAllTags = function (clubWebsiteId) { 80 return __awaiter(this, void 0, void 0, function () { 81 var url, result, error_2; 82 return __generator(this, function (_a) { 83 switch (_a.label) { 84 case 0: 85 url = "".concat(this.baseUrl, "GetAllTags?clubWebsiteId=").concat(clubWebsiteId); 86 _a.label = 1; 87 case 1: 88 _a.trys.push([1, 3, , 4]); 89 return [4 /*yield*/, this._api.get(url)]; 90 case 2: 91 result = _a.sent(); 92 return [2 /*return*/, result.data]; 93 case 3: 94 error_2 = _a.sent(); 95 return [2 /*return*/, { 96 successful: false, 97 errorMessage: error_2.response, 98 }]; 99 case 4: return [2 /*return*/]; 100 } 101 }); 102 }); 103 }; 104 TagService.prototype.GetGroupsByTagId = function (tagId) { 105 return __awaiter(this, void 0, void 0, function () { 106 var url, result, error_3; 107 return __generator(this, function (_a) { 108 switch (_a.label) { 109 case 0: 110 url = "".concat(this.baseUrl, "GetGroupsByTagId?tagId=").concat(tagId); 111 _a.label = 1; 112 case 1: 113 _a.trys.push([1, 3, , 4]); 114 return [4 /*yield*/, this._api.get(url)]; 115 case 2: 116 result = _a.sent(); 117 return [2 /*return*/, result.data]; 118 case 3: 119 error_3 = _a.sent(); 120 return [2 /*return*/, { 121 successful: false, 122 errorMessage: error_3.response, 123 }]; 124 case 4: return [2 /*return*/]; 125 } 126 }); 127 }); 128 }; 129 TagService.prototype.GetTagReferences = function (clubWebsiteId, tagId) { 130 return __awaiter(this, void 0, void 0, function () { 131 var url, result, error_4; 132 return __generator(this, function (_a) { 133 switch (_a.label) { 134 case 0: 135 url = "".concat(this.baseUrl, "GetTagReferences?tagId=").concat(tagId, "&clubWebsiteId=").concat(clubWebsiteId); 136 _a.label = 1; 137 case 1: 138 _a.trys.push([1, 3, , 4]); 139 return [4 /*yield*/, this._api.get(url)]; 140 case 2: 141 result = _a.sent(); 142 return [2 /*return*/, result.data]; 143 case 3: 144 error_4 = _a.sent(); 145 return [2 /*return*/, { 146 successful: false, 147 errorMessage: error_4.response, 148 }]; 149 case 4: return [2 /*return*/]; 150 } 151 }); 152 }); 153 }; 154 TagService.prototype.DeleteTag = function (tagId) { 155 return __awaiter(this, void 0, void 0, function () { 156 var url, result, error_5; 157 return __generator(this, function (_a) { 158 switch (_a.label) { 159 case 0: 160 url = "".concat(this.baseUrl, "DeleteTag?tagId=").concat(tagId); 161 _a.label = 1; 162 case 1: 163 _a.trys.push([1, 3, , 4]); 164 return [4 /*yield*/, this._api.post(url)]; 165 case 2: 166 result = _a.sent(); 167 return [2 /*return*/, result.data]; 168 case 3: 169 error_5 = _a.sent(); 170 return [2 /*return*/, { 171 successful: false, 172 errorMessage: error_5.response, 173 }]; 174 case 4: return [2 /*return*/]; 175 } 176 }); 177 }); 178 }; 179 TagService.prototype.RemoveTagReference = function (tagId, newsArticleId, imageContentId) { 180 return __awaiter(this, void 0, void 0, function () { 181 var url, result, error_6; 182 return __generator(this, function (_a) { 183 switch (_a.label) { 184 case 0: 185 url = "".concat(this.baseUrl, "DeleteTagReference?tagId=").concat(tagId, "&newsArticleId=").concat(newsArticleId ? newsArticleId : null, "&imageContentId=").concat(imageContentId ? imageContentId : null); 186 _a.label = 1; 187 case 1: 188 _a.trys.push([1, 3, , 4]); 189 return [4 /*yield*/, this._api.post(url)]; 190 case 2: 191 result = _a.sent(); 192 return [2 /*return*/, result.data]; 193 case 3: 194 error_6 = _a.sent(); 195 return [2 /*return*/, { 196 successful: false, 197 errorMessage: error_6.response, 198 }]; 199 case 4: return [2 /*return*/]; 200 } 201 }); 202 }); 203 }; 204 TagService.prototype.UpsertTag = function (payload) { 205 return __awaiter(this, void 0, void 0, function () { 206 var url, result, error_7; 207 return __generator(this, function (_a) { 208 switch (_a.label) { 209 case 0: 210 url = "".concat(this.baseUrl, "UpsertTag"); 211 _a.label = 1; 212 case 1: 213 _a.trys.push([1, 3, , 4]); 214 return [4 /*yield*/, this._api.post(url, payload)]; 215 case 2: 216 result = _a.sent(); 217 return [2 /*return*/, { 218 data: result.data, 219 successful: true, 220 }]; 221 case 3: 222 error_7 = _a.sent(); 223 return [2 /*return*/, { 224 successful: false, 225 errorMessage: error_7.response.data, 226 }]; 227 case 4: return [2 /*return*/]; 228 } 229 }); 230 }); 231 }; 232 return TagService; 233 }()); 234 AppServices.TagService = TagService; 235})(AppServices || (AppServices = {}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.