UNPKG

warframe-worldstate-parser

Version:

An Open parser for Warframe's Worldstate in Javascript

88 lines (87 loc) 2.7 kB
import { n as __decorateMetadata, t as __decorate } from "../../decorate-BCC26nnB.mjs"; import { Kinepage } from "./Kinepage.mjs"; import { SentientOutpost } from "./SentientOutpost.mjs"; import { Type } from "class-transformer"; import { IsDate, IsInt, IsOptional, Min, ValidateNested } from "class-validator"; //#region lib/models/Tmp.ts var FaceoffBonus = class { activation; expiry; next; }; __decorate([ IsDate(), Type(() => Date), __decorateMetadata("design:type", typeof Date === "undefined" ? Object : Date) ], FaceoffBonus.prototype, "activation", void 0); __decorate([ IsDate(), Type(() => Date), __decorateMetadata("design:type", typeof Date === "undefined" ? Object : Date) ], FaceoffBonus.prototype, "expiry", void 0); __decorate([ IsDate(), Type(() => Date), __decorateMetadata("design:type", typeof Date === "undefined" ? Object : Date) ], FaceoffBonus.prototype, "next", void 0); var QuestProgress = class { count; goal; }; __decorate([ IsInt(), Min(0), __decorateMetadata("design:type", Number) ], QuestProgress.prototype, "count", void 0); __decorate([ IsInt(), Min(0), __decorateMetadata("design:type", Number) ], QuestProgress.prototype, "goal", void 0); var Tmp = class { sentientOutposts; kinepage; faceoffBonus; questToConquerCancer; constructor(json, deps = { locale: "en" }) { const tmp = JSON.parse(json); this.sentientOutposts = new SentientOutpost(tmp.sfn, deps); this.kinepage = new Kinepage(tmp.pgr, deps.locale); if (tmp.fbst) { const toDate = (ms) => /* @__PURE__ */ new Date(ms * 1e3); this.faceoffBonus = { activation: toDate(tmp.fbst.a), expiry: toDate(tmp.fbst.e), next: toDate(tmp.fbst.n) }; } if (tmp.QTCCFloofCount) this.questToConquerCancer = { count: tmp.QTCCFloofCount, goal: tmp.QTCCFloofLimit }; } }; __decorate([ ValidateNested(), Type(() => SentientOutpost), __decorateMetadata("design:type", typeof SentientOutpost === "undefined" ? Object : SentientOutpost) ], Tmp.prototype, "sentientOutposts", void 0); __decorate([ ValidateNested(), Type(() => Kinepage), __decorateMetadata("design:type", typeof Kinepage === "undefined" ? Object : Kinepage) ], Tmp.prototype, "kinepage", void 0); __decorate([ IsOptional(), ValidateNested(), Type(() => FaceoffBonus), __decorateMetadata("design:type", typeof FaceoffBonus === "undefined" ? Object : FaceoffBonus) ], Tmp.prototype, "faceoffBonus", void 0); __decorate([ IsOptional(), ValidateNested(), Type(() => QuestProgress), __decorateMetadata("design:type", typeof QuestProgress === "undefined" ? Object : QuestProgress) ], Tmp.prototype, "questToConquerCancer", void 0); //#endregion export { FaceoffBonus, QuestProgress, Tmp };