@kfijolek/boardgamegeekclient
Version:
TypeScript client to interact with BoardGameGeek public XML API
165 lines • 6.35 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, JsonManagedReference, JsonProperty, } from 'jackson-js';
import { BggPollDto } from './subdto/BggPollDto';
import { BggStatisticsPaginatedDto, BggThingVideoPaginatedDto, BggThingCommentPaginatedDto, } from './paginated';
import { BggLinkDto, BggThingMarketlistingsDto, BggThingVersionDto, } from './subdto';
export class BggThingDto {
}
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Number] }),
JsonAlias({ values: ['@_id'] })
], BggThingDto.prototype, "id", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [String] }),
JsonDeserialize({
using: (value) => value.map((item) => item['@_value'])[0],
})
], BggThingDto.prototype, "name", void 0);
__decorate([
JsonProperty({ value: 'name' }),
JsonClassType({ type: () => [Array, [String]] }),
JsonAlias({ values: ['name'] }),
JsonDeserialize({
using: (value) => {
return Array.isArray(value)
? value.map((item) => item === null || item === void 0 ? void 0 : item['@_value']).filter(Boolean)
: [];
},
})
], BggThingDto.prototype, "alternateNames", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [String] }),
JsonAlias({ values: ['@_type'] })
], BggThingDto.prototype, "type", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [String] })
], BggThingDto.prototype, "description", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [String] })
], BggThingDto.prototype, "thumbnail", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [String] })
], BggThingDto.prototype, "image", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Number] }),
JsonDeserialize({
using: (value) => value.map((item) => item['@_value'])[0],
})
], BggThingDto.prototype, "yearpublished", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Number] }),
JsonDeserialize({
using: (value) => value.map((item) => item['@_value'])[0],
})
], BggThingDto.prototype, "minplayers", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Number] }),
JsonDeserialize({
using: (value) => value.map((item) => item['@_value'])[0],
})
], BggThingDto.prototype, "maxplayers", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Number] }),
JsonDeserialize({
using: (value) => value.map((item) => item['@_value'])[0],
})
], BggThingDto.prototype, "playingtime", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Number] }),
JsonDeserialize({
using: (value) => value.map((item) => item['@_value'])[0],
})
], BggThingDto.prototype, "minplaytime", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Number] }),
JsonDeserialize({
using: (value) => value.map((item) => item['@_value'])[0],
})
], BggThingDto.prototype, "maxplaytime", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Number] }),
JsonDeserialize({
using: (value) => value.map((item) => item['@_value'])[0],
})
], BggThingDto.prototype, "minage", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Array, [BggLinkDto]] }),
JsonManagedReference(),
JsonAlias({ values: ['link'] })
], BggThingDto.prototype, "links", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [BggStatisticsPaginatedDto] }),
JsonManagedReference(),
JsonDeserialize({
//eslint-disable-next-line @typescript-eslint/no-explicit-any
using: (items) => items[0],
})
], BggThingDto.prototype, "statistics", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [BggThingVideoPaginatedDto] }),
JsonManagedReference(),
JsonDeserialize({
//eslint-disable-next-line @typescript-eslint/no-explicit-any
using: (items) => items[0],
})
], BggThingDto.prototype, "videos", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [BggThingCommentPaginatedDto] }),
JsonManagedReference(),
JsonDeserialize({
//eslint-disable-next-line @typescript-eslint/no-explicit-any
using: (items) => items[0],
})
], BggThingDto.prototype, "comments", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Array, [BggThingMarketlistingsDto]] }),
JsonManagedReference(),
JsonDeserialize({
//eslint-disable-next-line @typescript-eslint/no-explicit-any
using: (items) => { var _a; return (_a = items[0]) === null || _a === void 0 ? void 0 : _a.listing; },
})
], BggThingDto.prototype, "marketplacelistings", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Array, [BggPollDto]] }),
JsonManagedReference(),
JsonAlias({ values: ['poll'] })
], BggThingDto.prototype, "polls", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Array, [BggThingVersionDto]] }),
JsonManagedReference(),
JsonDeserialize({
//eslint-disable-next-line @typescript-eslint/no-explicit-any
using: (items) => { var _a; return (_a = items[0]) === null || _a === void 0 ? void 0 : _a.item; },
})
], BggThingDto.prototype, "versions", void 0);
__decorate([
JsonProperty(),
JsonClassType({ type: () => [Object] }),
JsonAlias({ values: ['poll-summary'] })
], BggThingDto.prototype, "pollSummary", void 0);
//# sourceMappingURL=BggThingDto.js.map