UNPKG

@kfijolek/boardgamegeekclient

Version:

Javascript client to interact with BoardGameGeek public XML API

61 lines 3.19 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.BggThingMarketlistingsDto = void 0; const jackson_js_1 = require("jackson-js"); class BggThingMarketlistingsDto { } __decorate([ jackson_js_1.JsonProperty(), jackson_js_1.JsonClassType({ type: () => [String] }), jackson_js_1.JsonAlias({ values: ["condition"] }), jackson_js_1.JsonDeserialize({ //eslint-disable-next-line @typescript-eslint/no-explicit-any using: (items) => items.map(item => item['@_value'])[0] }) ], BggThingMarketlistingsDto.prototype, "condition", void 0); __decorate([ jackson_js_1.JsonProperty(), jackson_js_1.JsonClassType({ type: () => [Object, [String, String]] }), jackson_js_1.JsonAlias({ values: ["link"] }), jackson_js_1.JsonDeserialize({ // using: (items: any[]) => { const item = items[0]; return { href: item[""] } } // using: (items: any[]) => items.map(({ foo }) => foo)[0] using: (items) => items.map(item => ({ href: item['@_href'], title: item['@_title'] }))[0] }) ], BggThingMarketlistingsDto.prototype, "link", void 0); __decorate([ jackson_js_1.JsonProperty(), jackson_js_1.JsonClassType({ type: () => [String] }), jackson_js_1.JsonAlias({ values: ["listdate"] }), jackson_js_1.JsonDeserialize({ //eslint-disable-next-line @typescript-eslint/no-explicit-any using: (items) => items.map(item => item['@_value'])[0] }) ], BggThingMarketlistingsDto.prototype, "listdate", void 0); __decorate([ jackson_js_1.JsonProperty(), jackson_js_1.JsonClassType({ type: () => [String] }), jackson_js_1.JsonAlias({ values: ["notes"] }), jackson_js_1.JsonDeserialize({ //eslint-disable-next-line @typescript-eslint/no-explicit-any using: (items) => items.map(item => item['@_value'])[0] }) ], BggThingMarketlistingsDto.prototype, "notes", void 0); __decorate([ jackson_js_1.JsonProperty(), jackson_js_1.JsonClassType({ type: () => [Object, [String, Number]] }), jackson_js_1.JsonAlias({ values: ["price"] }), jackson_js_1.JsonDeserialize({ // using: (items: any[]) => { const item = items[0]; return { href: item[""] } } // using: (items: any[]) => items.map(({ foo }) => foo)[0] using: (items) => items.map(item => ({ currency: item['@_currency'], value: item['@_value'] }))[0] }) ], BggThingMarketlistingsDto.prototype, "price", void 0); exports.BggThingMarketlistingsDto = BggThingMarketlistingsDto; //# sourceMappingURL=BggThingMarketlistingsDto.js.map