@kfijolek/boardgamegeekclient
Version:
TypeScript client to interact with BoardGameGeek public XML API
57 lines • 2.79 kB
JavaScript
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;
};
import { JsonAlias, JsonClassType, JsonDeserialize, JsonProperty } from "jackson-js";
export class BggThingMarketlistingsDto {
}
__decorate([
JsonProperty(),
JsonClassType({ type: () => [String] }),
JsonAlias({ values: ["condition"] }),
JsonDeserialize({
//eslint-disable-next-line @typescript-eslint/no-explicit-any
using: (items) => items.map(item => item['@_value'])[0]
})
], BggThingMarketlistingsDto.prototype, "condition", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Object, [String, String]] }),
JsonAlias({ values: ["link"] }),
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([
JsonProperty(),
JsonClassType({ type: () => [String] }),
JsonAlias({ values: ["listdate"] }),
JsonDeserialize({
//eslint-disable-next-line @typescript-eslint/no-explicit-any
using: (items) => items.map(item => item['@_value'])[0]
})
], BggThingMarketlistingsDto.prototype, "listdate", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [String] }),
JsonAlias({ values: ["notes"] }),
JsonDeserialize({
//eslint-disable-next-line @typescript-eslint/no-explicit-any
using: (items) => items.map(item => item['@_value'])[0]
})
], BggThingMarketlistingsDto.prototype, "notes", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Object, [String, Number]] }),
JsonAlias({ values: ["price"] }),
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);
//# sourceMappingURL=BggThingMarketlistingsDto.js.map