@firestone-hs/content-craetor-input 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,6 @@
1
1
  export interface BgsCompAdvice {
2
2
  readonly compId: string;
3
3
  readonly name?: string;
4
- readonly needAnyTribeCombinaisonInLobby: readonly TribeList[];
5
4
  readonly difficulty: 'EASY' | 'MEDIUM' | 'HARD';
6
5
  readonly powerLevel: 'LOW' | 'MEDIUM' | 'HIGH';
7
6
  readonly cards: BgsCompCardAdvice[];
@@ -28,4 +27,3 @@ export interface BgsCompCardTip {
28
27
  readonly language: string;
29
28
  readonly tip: string;
30
29
  }
31
- export type TribeList = readonly string[];
@@ -1 +1 @@
1
- {"version":3,"file":"data-model.js","sourceRoot":"","sources":["../src/data-model.ts"],"names":[],"mappings":"","sourcesContent":["export interface BgsCompAdvice {\r\n\treadonly compId: string;\r\n\treadonly name?: string;\r\n\treadonly needAnyTribeCombinaisonInLobby: readonly TribeList[];\r\n\treadonly difficulty: 'EASY' | 'MEDIUM' | 'HARD';\r\n\treadonly powerLevel: 'LOW' | 'MEDIUM' | 'HIGH';\r\n\treadonly cards: BgsCompCardAdvice[];\r\n\treadonly tips: BgsCompTip[];\r\n}\r\nexport interface BgsCompCardAdvice {\r\n\treadonly cardId: string;\r\n\treadonly name?: string;\r\n\treadonly status: 'CORE' | 'ADDON';\r\n\treadonly tips: BgsCompCardTip[];\r\n}\r\nexport interface BgsCompTip {\r\n\treadonly author: string;\r\n\treadonly date: string;\r\n\treadonly patchNumber: number;\r\n\treadonly language: string;\r\n\treadonly tip: string;\r\n\treadonly whenToCommit: string;\r\n}\r\nexport interface BgsCompCardTip {\r\n\treadonly author: string;\r\n\treadonly date: string;\r\n\treadonly patchNumber: number;\r\n\treadonly language: string;\r\n\treadonly tip: string;\r\n}\r\nexport type TribeList = readonly string[];\r\n"]}
1
+ {"version":3,"file":"data-model.js","sourceRoot":"","sources":["../src/data-model.ts"],"names":[],"mappings":"","sourcesContent":["export interface BgsCompAdvice {\r\n\treadonly compId: string;\r\n\treadonly name?: string;\r\n\treadonly difficulty: 'EASY' | 'MEDIUM' | 'HARD';\r\n\treadonly powerLevel: 'LOW' | 'MEDIUM' | 'HIGH';\r\n\treadonly cards: BgsCompCardAdvice[];\r\n\treadonly tips: BgsCompTip[];\r\n}\r\nexport interface BgsCompCardAdvice {\r\n\treadonly cardId: string;\r\n\treadonly name?: string;\r\n\treadonly status: 'CORE' | 'ADDON';\r\n\treadonly tips: BgsCompCardTip[];\r\n}\r\nexport interface BgsCompTip {\r\n\treadonly author: string;\r\n\treadonly date: string;\r\n\treadonly patchNumber: number;\r\n\treadonly language: string;\r\n\treadonly tip: string;\r\n\treadonly whenToCommit: string;\r\n}\r\nexport interface BgsCompCardTip {\r\n\treadonly author: string;\r\n\treadonly date: string;\r\n\treadonly patchNumber: number;\r\n\treadonly language: string;\r\n\treadonly tip: string;\r\n}\r\n"]}
@@ -17,7 +17,6 @@ export interface BgsCompsInput {
17
17
  export interface BgsCompsDataRow {
18
18
  readonly compId: string;
19
19
  readonly name: string;
20
- readonly tribes: string;
21
20
  readonly difficulty: 'EASY' | 'MEDIUM' | 'HARD';
22
21
  readonly powerLevel: 'LOW' | 'MEDIUM' | 'HIGH';
23
22
  readonly patchNumber: number;
@@ -1 +1 @@
1
- {"version":3,"file":"input-model.js","sourceRoot":"","sources":["../src/input-model.ts"],"names":[],"mappings":"","sourcesContent":["export interface Input {\r\n\treadonly type: 'bgs-trinkets' | 'bgs-heroes';\r\n\treadonly author: string;\r\n\treadonly data: readonly InputCard[];\r\n}\r\n\r\nexport interface InputCard {\r\n\treadonly cardId: string;\r\n\treadonly patchNumber: number;\r\n\treadonly date: string;\r\n\treadonly tip: string;\r\n}\r\n\r\nexport interface BgsCompsInput {\r\n\treadonly author: string;\r\n\treadonly compsData: readonly BgsCompsDataRow[];\r\n\treadonly cardsData: readonly BgsCompsCardDataRow[];\r\n}\r\n\r\nexport interface BgsCompsDataRow {\r\n\treadonly compId: string;\r\n\treadonly name: string;\r\n\treadonly tribes: string;\r\n\treadonly difficulty: 'EASY' | 'MEDIUM' | 'HARD';\r\n\treadonly powerLevel: 'LOW' | 'MEDIUM' | 'HIGH';\r\n\treadonly patchNumber: number;\r\n\treadonly date: string;\r\n\treadonly tip: string;\r\n\treadonly whenToCommit: string;\r\n}\r\n\r\nexport interface BgsCompsCardDataRow {\r\n\treadonly compId: string;\r\n\treadonly cardId: string;\r\n\treadonly compName: string;\r\n\treadonly cardName: string;\r\n\treadonly status: 'CORE' | 'ADDON';\r\n\treadonly patchNumber: number;\r\n\treadonly date: string;\r\n\treadonly tip: string;\r\n}\r\n\r\n// export interface BgsCompInput {\r\n// \treadonly compId: string;\r\n// \treadonly name: string;\r\n// \treadonly tribes: readonly TribeList[];\r\n// \treadonly difficulty: 'EASY' | 'MEDIUM' | 'HARD';\r\n// \treadonly powerLevel: 'LOW' | 'MEDIUM' | 'HIGH';\r\n// \treadonly patchNumber: number;\r\n// \treadonly date: string;\r\n// \treadonly tip: string;\r\n// \treadonly whenToCommit: string;\r\n// \treadonly cards: readonly BgsCompCardInput[];\r\n// }\r\n\r\n// // Tribes that need to be together in the lobby for the comp to work\r\n// export type TribeList = readonly string[];\r\n\r\n// export interface BgsCompCardInput {\r\n// \treadonly cardId: string;\r\n// \treadonly cardName: string;\r\n// \treadonly patchNumber: number;\r\n// \treadonly date: string;\r\n// \treadonly status: 'CORE' | 'ADDON';\r\n// \treadonly tip: string;\r\n// }\r\n"]}
1
+ {"version":3,"file":"input-model.js","sourceRoot":"","sources":["../src/input-model.ts"],"names":[],"mappings":"","sourcesContent":["export interface Input {\r\n\treadonly type: 'bgs-trinkets' | 'bgs-heroes';\r\n\treadonly author: string;\r\n\treadonly data: readonly InputCard[];\r\n}\r\n\r\nexport interface InputCard {\r\n\treadonly cardId: string;\r\n\treadonly patchNumber: number;\r\n\treadonly date: string;\r\n\treadonly tip: string;\r\n}\r\n\r\nexport interface BgsCompsInput {\r\n\treadonly author: string;\r\n\treadonly compsData: readonly BgsCompsDataRow[];\r\n\treadonly cardsData: readonly BgsCompsCardDataRow[];\r\n}\r\n\r\nexport interface BgsCompsDataRow {\r\n\treadonly compId: string;\r\n\treadonly name: string;\r\n\treadonly difficulty: 'EASY' | 'MEDIUM' | 'HARD';\r\n\treadonly powerLevel: 'LOW' | 'MEDIUM' | 'HIGH';\r\n\treadonly patchNumber: number;\r\n\treadonly date: string;\r\n\treadonly tip: string;\r\n\treadonly whenToCommit: string;\r\n}\r\n\r\nexport interface BgsCompsCardDataRow {\r\n\treadonly compId: string;\r\n\treadonly cardId: string;\r\n\treadonly compName: string;\r\n\treadonly cardName: string;\r\n\treadonly status: 'CORE' | 'ADDON';\r\n\treadonly patchNumber: number;\r\n\treadonly date: string;\r\n\treadonly tip: string;\r\n}\r\n\r\n// export interface BgsCompInput {\r\n// \treadonly compId: string;\r\n// \treadonly name: string;\r\n// \treadonly tribes: readonly TribeList[];\r\n// \treadonly difficulty: 'EASY' | 'MEDIUM' | 'HARD';\r\n// \treadonly powerLevel: 'LOW' | 'MEDIUM' | 'HIGH';\r\n// \treadonly patchNumber: number;\r\n// \treadonly date: string;\r\n// \treadonly tip: string;\r\n// \treadonly whenToCommit: string;\r\n// \treadonly cards: readonly BgsCompCardInput[];\r\n// }\r\n\r\n// // Tribes that need to be together in the lobby for the comp to work\r\n// export type TribeList = readonly string[];\r\n\r\n// export interface BgsCompCardInput {\r\n// \treadonly cardId: string;\r\n// \treadonly cardName: string;\r\n// \treadonly patchNumber: number;\r\n// \treadonly date: string;\r\n// \treadonly status: 'CORE' | 'ADDON';\r\n// \treadonly tip: string;\r\n// }\r\n"]}
@@ -62,7 +62,6 @@ const updateComp = (inputComp, result, author, bgPatch) => {
62
62
  cards: [],
63
63
  difficulty: inputComp.difficulty,
64
64
  powerLevel: inputComp.powerLevel,
65
- needAnyTribeCombinaisonInLobby: buildTribes(inputComp.tribes),
66
65
  tips: [],
67
66
  };
68
67
  result.push(existingComp);
@@ -89,13 +88,6 @@ const updateComp = (inputComp, result, author, bgPatch) => {
89
88
  }
90
89
  return existingComp;
91
90
  };
92
- const buildTribes = (tribes) => {
93
- if (!tribes?.length) {
94
- return [];
95
- }
96
- const tribeGroups = tribes.split('|');
97
- return tribeGroups.map((group) => group.split('+'));
98
- };
99
91
  const loadExistingInfo = async () => {
100
92
  const s3 = new aws_lambda_utils_1.S3();
101
93
  const asString = await s3.readGzipContent(bucket, fileKey, 5);
@@ -1 +1 @@
1
- {"version":3,"file":"bgs-comps.js","sourceRoot":"","sources":["../../src/types/bgs-comps.ts"],"names":[],"mappings":";;;AACA,qEAA+D;AAE/D,+BAAgC;AAGhC,oCAA8C;AAE9C,MAAM,MAAM,GAAG,yBAAyB,CAAC;AACzC,MAAM,OAAO,GAAG,wEAAwE,CAAC;AAElF,MAAM,eAAe,GAAG,KAAK,EAAE,KAAoB,EAAE,OAAkB,EAAE,QAAyB,EAAE,EAAE;IAC5G,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5B,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAExC,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,SAAS,EAAE;QACxC,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC5D,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,CAAC,CAAC;QACrF,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;YAC7B,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;SAC5C;KACD;IAED,OAAO,CAAC,KAAK,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;IAEpB,MAAM,QAAQ,GAAG,MAAM,EAAE,CAAC,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC;IAE9D,IAAI,CAAC,QAAQ,EAAE;QACd,OAAO,EAAE,CAAC;KACV;IACD,OAAO,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,KAAK,EAAE,IAA8B,EAAE,EAAE;IACzD,MAAM,EAAE,GAAG,IAAI,qBAAE,EAAE,CAAC;IACpB,MAAM,EAAE,CAAC,SAAS,CAAC,IAAA,eAAQ,EAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;AACjG,CAAC,CAAC","sourcesContent":["/* eslint-disable no-extra-boolean-cast */\r\nimport { PatchInfo, S3 } from '@firestone-hs/aws-lambda-utils';\r\nimport { AllCardsService } from '@firestone-hs/reference-data';\r\nimport { gzipSync } from 'zlib';\r\nimport { BgsCompAdvice, BgsCompCardAdvice, BgsCompCardTip, BgsCompTip, TribeList } from '../data-model';\r\nimport { BgsCompsCardDataRow, BgsCompsDataRow, BgsCompsInput } from '../input-model';\r\nimport { deepEqual, Mutable } from '../utils';\r\n\r\nconst bucket = 'static.zerotoheroes.com';\r\nconst fileKey = 'hearthstone/data/battlegrounds-strategies/bgs-comps-strategies.gz.json';\r\n\r\nexport const processBgsComps = async (input: BgsCompsInput, bgPatch: PatchInfo, allCards: AllCardsService) => {\r\n\tconst author = input.author;\r\n\tconsole.debug('processing', author, input);\r\n\tconst result = await loadExistingInfo();\r\n\r\n\tfor (const inputComp of input.compsData) {\r\n\t\tconst comp = updateComp(inputComp, result, author, bgPatch);\r\n\t\tconst cardsData = input.cardsData.filter((card) => card.compId === inputComp.compId);\r\n\t\tfor (const card of cardsData) {\r\n\t\t\tupdateCompCard(card, comp, author, bgPatch);\r\n\t\t}\r\n\t}\r\n\r\n\tconsole.debug('built aggregated tips', result);\r\n\tawait saveInfo(result);\r\n\tconsole.debug('saved aggregated tips');\r\n};\r\n\r\nconst updateCompCard = (\r\n\tinputCard: BgsCompsCardDataRow,\r\n\tcomp: MutableBgsCompAdvice,\r\n\tauthor: string,\r\n\tbgPatch: PatchInfo,\r\n): void => {\r\n\tconsole.debug('updating card', comp.compId, inputCard.cardId, inputCard.tip, inputCard);\r\n\tlet existingCard: Mutable<BgsCompCardAdvice> = comp.cards.find((t) => t.cardId === inputCard.cardId);\r\n\tif (!existingCard) {\r\n\t\texistingCard = {\r\n\t\t\tcardId: inputCard.cardId,\r\n\t\t\tname: inputCard.cardName,\r\n\t\t\ttips: [],\r\n\t\t} as BgsCompCardAdvice;\r\n\t\tcomp.cards.push(existingCard);\r\n\t}\r\n\texistingCard.status = inputCard.status;\r\n\r\n\tif (!!inputCard.tip?.length) {\r\n\t\tlet existingTip: Mutable<BgsCompCardTip> = existingCard.tips.find((t) => t.author === author);\r\n\t\tif (!existingTip) {\r\n\t\t\texistingTip = {\r\n\t\t\t\tauthor: author,\r\n\t\t\t\tlanguage: 'enUS',\r\n\t\t\t} as BgsCompTip;\r\n\t\t\texistingCard.tips.push(existingTip);\r\n\t\t}\r\n\t\tif (!deepEqual(existingTip.tip, inputCard.tip)) {\r\n\t\t\texistingTip.tip = inputCard.tip;\r\n\t\t\texistingTip.date = new Date().toISOString().substring(0, 10);\r\n\t\t\texistingTip.patchNumber = bgPatch.number;\r\n\t\t}\r\n\t} else {\r\n\t\texistingCard.tips = existingCard.tips.filter((t) => t.author !== author);\r\n\t}\r\n};\r\n\r\nconst updateComp = (\r\n\tinputComp: BgsCompsDataRow,\r\n\tresult: MutableBgsCompAdvice[],\r\n\tauthor: string,\r\n\tbgPatch: PatchInfo,\r\n): MutableBgsCompAdvice => {\r\n\tlet existingComp = result.find((t) => t.compId === inputComp.compId);\r\n\tif (!existingComp) {\r\n\t\t// This should maybe come from another process to handle the ref data\r\n\t\texistingComp = {\r\n\t\t\tcompId: inputComp.compId,\r\n\t\t\tname: inputComp.name,\r\n\t\t\tcards: [],\r\n\t\t\tdifficulty: inputComp.difficulty,\r\n\t\t\tpowerLevel: inputComp.powerLevel,\r\n\t\t\tneedAnyTribeCombinaisonInLobby: buildTribes(inputComp.tribes),\r\n\t\t\ttips: [],\r\n\t\t};\r\n\t\tresult.push(existingComp);\r\n\t}\r\n\r\n\tif (!!inputComp.tip?.length) {\r\n\t\tlet existingTip: Mutable<BgsCompTip> = existingComp.tips.find((t) => t.author === author);\r\n\t\tif (!existingTip) {\r\n\t\t\texistingTip = {\r\n\t\t\t\tauthor: author,\r\n\t\t\t\tlanguage: 'enUS',\r\n\t\t\t} as BgsCompTip;\r\n\t\t\texistingComp.tips.push(existingTip);\r\n\t\t}\r\n\t\tif (\r\n\t\t\t!deepEqual(existingTip.tip, inputComp.tip) ||\r\n\t\t\t!deepEqual(existingTip.whenToCommit, inputComp.whenToCommit)\r\n\t\t) {\r\n\t\t\texistingTip.tip = inputComp.tip;\r\n\t\t\texistingTip.whenToCommit = inputComp.whenToCommit;\r\n\t\t\texistingTip.date = new Date().toISOString().substring(0, 10);\r\n\t\t\texistingTip.patchNumber = bgPatch.number;\r\n\t\t}\r\n\t} else {\r\n\t\texistingComp.tips = existingComp.tips.filter((t) => t.author !== author);\r\n\t}\r\n\treturn existingComp;\r\n};\r\n\r\nconst buildTribes = (tribes: string): readonly TribeList[] => {\r\n\tif (!tribes?.length) {\r\n\t\treturn [];\r\n\t}\r\n\r\n\tconst tribeGroups = tribes.split('|');\r\n\treturn tribeGroups.map((group) => group.split('+'));\r\n};\r\n\r\nconst loadExistingInfo = async (): Promise<MutableBgsCompAdvice[]> => {\r\n\tconst s3 = new S3();\r\n\t// console.debug('created s3');\r\n\tconst asString = await s3.readGzipContent(bucket, fileKey, 5);\r\n\t// console.debug('loaded existing info', asString?.length);\r\n\tif (!asString) {\r\n\t\treturn [];\r\n\t}\r\n\treturn JSON.parse(asString);\r\n};\r\n\r\nconst saveInfo = async (info: readonly BgsCompAdvice[]) => {\r\n\tconst s3 = new S3();\r\n\tawait s3.writeFile(gzipSync(JSON.stringify(info)), bucket, fileKey, 'application/json', 'gzip');\r\n};\r\n\r\ntype MutableBgsCompAdvice = Mutable<BgsCompAdvice>;\r\n"]}
1
+ {"version":3,"file":"bgs-comps.js","sourceRoot":"","sources":["../../src/types/bgs-comps.ts"],"names":[],"mappings":";;;AACA,qEAA+D;AAE/D,+BAAgC;AAGhC,oCAA8C;AAE9C,MAAM,MAAM,GAAG,yBAAyB,CAAC;AACzC,MAAM,OAAO,GAAG,wEAAwE,CAAC;AAElF,MAAM,eAAe,GAAG,KAAK,EAAE,KAAoB,EAAE,OAAkB,EAAE,QAAyB,EAAE,EAAE;IAC5G,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5B,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAExC,KAAK,MAAM,SAAS,IAAI,KAAK,CAAC,SAAS,EAAE;QACxC,MAAM,IAAI,GAAG,UAAU,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;QAC5D,MAAM,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM,CAAC,CAAC;QACrF,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE;YAC7B,cAAc,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;SAC5C;KACD;IAED,OAAO,CAAC,KAAK,CAAC,uBAAuB,EAAE,MAAM,CAAC,CAAC;IAC/C,MAAM,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvB,OAAO,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;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,CAAC","sourcesContent":["/* eslint-disable no-extra-boolean-cast */\r\nimport { PatchInfo, S3 } from '@firestone-hs/aws-lambda-utils';\r\nimport { AllCardsService } from '@firestone-hs/reference-data';\r\nimport { gzipSync } from 'zlib';\r\nimport { BgsCompAdvice, BgsCompCardAdvice, BgsCompCardTip, BgsCompTip } from '../data-model';\r\nimport { BgsCompsCardDataRow, BgsCompsDataRow, BgsCompsInput } from '../input-model';\r\nimport { deepEqual, Mutable } from '../utils';\r\n\r\nconst bucket = 'static.zerotoheroes.com';\r\nconst fileKey = 'hearthstone/data/battlegrounds-strategies/bgs-comps-strategies.gz.json';\r\n\r\nexport const processBgsComps = async (input: BgsCompsInput, bgPatch: PatchInfo, allCards: AllCardsService) => {\r\n\tconst author = input.author;\r\n\tconsole.debug('processing', author, input);\r\n\tconst result = await loadExistingInfo();\r\n\r\n\tfor (const inputComp of input.compsData) {\r\n\t\tconst comp = updateComp(inputComp, result, author, bgPatch);\r\n\t\tconst cardsData = input.cardsData.filter((card) => card.compId === inputComp.compId);\r\n\t\tfor (const card of cardsData) {\r\n\t\t\tupdateCompCard(card, comp, author, bgPatch);\r\n\t\t}\r\n\t}\r\n\r\n\tconsole.debug('built aggregated tips', result);\r\n\tawait saveInfo(result);\r\n\tconsole.debug('saved aggregated tips');\r\n};\r\n\r\nconst updateCompCard = (\r\n\tinputCard: BgsCompsCardDataRow,\r\n\tcomp: MutableBgsCompAdvice,\r\n\tauthor: string,\r\n\tbgPatch: PatchInfo,\r\n): void => {\r\n\tconsole.debug('updating card', comp.compId, inputCard.cardId, inputCard.tip, inputCard);\r\n\tlet existingCard: Mutable<BgsCompCardAdvice> = comp.cards.find((t) => t.cardId === inputCard.cardId);\r\n\tif (!existingCard) {\r\n\t\texistingCard = {\r\n\t\t\tcardId: inputCard.cardId,\r\n\t\t\tname: inputCard.cardName,\r\n\t\t\ttips: [],\r\n\t\t} as BgsCompCardAdvice;\r\n\t\tcomp.cards.push(existingCard);\r\n\t}\r\n\texistingCard.status = inputCard.status;\r\n\r\n\tif (!!inputCard.tip?.length) {\r\n\t\tlet existingTip: Mutable<BgsCompCardTip> = existingCard.tips.find((t) => t.author === author);\r\n\t\tif (!existingTip) {\r\n\t\t\texistingTip = {\r\n\t\t\t\tauthor: author,\r\n\t\t\t\tlanguage: 'enUS',\r\n\t\t\t} as BgsCompTip;\r\n\t\t\texistingCard.tips.push(existingTip);\r\n\t\t}\r\n\t\tif (!deepEqual(existingTip.tip, inputCard.tip)) {\r\n\t\t\texistingTip.tip = inputCard.tip;\r\n\t\t\texistingTip.date = new Date().toISOString().substring(0, 10);\r\n\t\t\texistingTip.patchNumber = bgPatch.number;\r\n\t\t}\r\n\t} else {\r\n\t\texistingCard.tips = existingCard.tips.filter((t) => t.author !== author);\r\n\t}\r\n};\r\n\r\nconst updateComp = (\r\n\tinputComp: BgsCompsDataRow,\r\n\tresult: MutableBgsCompAdvice[],\r\n\tauthor: string,\r\n\tbgPatch: PatchInfo,\r\n): MutableBgsCompAdvice => {\r\n\tlet existingComp = result.find((t) => t.compId === inputComp.compId);\r\n\tif (!existingComp) {\r\n\t\t// This should maybe come from another process to handle the ref data\r\n\t\texistingComp = {\r\n\t\t\tcompId: inputComp.compId,\r\n\t\t\tname: inputComp.name,\r\n\t\t\tcards: [],\r\n\t\t\tdifficulty: inputComp.difficulty,\r\n\t\t\tpowerLevel: inputComp.powerLevel,\r\n\t\t\ttips: [],\r\n\t\t};\r\n\t\tresult.push(existingComp);\r\n\t}\r\n\r\n\tif (!!inputComp.tip?.length) {\r\n\t\tlet existingTip: Mutable<BgsCompTip> = existingComp.tips.find((t) => t.author === author);\r\n\t\tif (!existingTip) {\r\n\t\t\texistingTip = {\r\n\t\t\t\tauthor: author,\r\n\t\t\t\tlanguage: 'enUS',\r\n\t\t\t} as BgsCompTip;\r\n\t\t\texistingComp.tips.push(existingTip);\r\n\t\t}\r\n\t\tif (\r\n\t\t\t!deepEqual(existingTip.tip, inputComp.tip) ||\r\n\t\t\t!deepEqual(existingTip.whenToCommit, inputComp.whenToCommit)\r\n\t\t) {\r\n\t\t\texistingTip.tip = inputComp.tip;\r\n\t\t\texistingTip.whenToCommit = inputComp.whenToCommit;\r\n\t\t\texistingTip.date = new Date().toISOString().substring(0, 10);\r\n\t\t\texistingTip.patchNumber = bgPatch.number;\r\n\t\t}\r\n\t} else {\r\n\t\texistingComp.tips = existingComp.tips.filter((t) => t.author !== author);\r\n\t}\r\n\treturn existingComp;\r\n};\r\n\r\nconst loadExistingInfo = async (): Promise<MutableBgsCompAdvice[]> => {\r\n\tconst s3 = new S3();\r\n\t// console.debug('created s3');\r\n\tconst asString = await s3.readGzipContent(bucket, fileKey, 5);\r\n\t// console.debug('loaded existing info', asString?.length);\r\n\tif (!asString) {\r\n\t\treturn [];\r\n\t}\r\n\treturn JSON.parse(asString);\r\n};\r\n\r\nconst saveInfo = async (info: readonly BgsCompAdvice[]) => {\r\n\tconst s3 = new S3();\r\n\tawait s3.writeFile(gzipSync(JSON.stringify(info)), bucket, fileKey, 'application/json', 'gzip');\r\n};\r\n\r\ntype MutableBgsCompAdvice = Mutable<BgsCompAdvice>;\r\n"]}
@@ -21,7 +21,7 @@ const processBgsHero = async (input, bgPatch, allCards) => {
21
21
  };
22
22
  result.push(existingCardTip);
23
23
  }
24
- if (!!cardTip.tip?.length) {
24
+ if (!!cardTip.tip?.trim()?.length) {
25
25
  let existingTip = existingCardTip.tips.find((t) => t.author === author);
26
26
  if (!existingTip) {
27
27
  existingTip = {
@@ -1 +1 @@
1
- {"version":3,"file":"bgs-heroes.js","sourceRoot":"","sources":["../../src/types/bgs-heroes.ts"],"names":[],"mappings":";;;AACA,qEAA+D;AAE/D,+BAAgC;AAEhC,oCAAqC;AAErC,MAAM,MAAM,GAAG,yBAAyB,CAAC;AACzC,MAAM,OAAO,GAAG,uEAAuE,CAAC;AAEjF,MAAM,cAAc,GAAG,KAAK,EAAE,KAAY,EAAE,OAAkB,EAAE,QAAyB,EAAE,EAAE;IACnG,MAAM,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AC,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,CAAC,CAAC;AACjG,CAAC,CAAC;AAeF,MAAM,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2yBpB,CAAC","sourcesContent":["/* eslint-disable no-extra-boolean-cast */\r\nimport { PatchInfo, S3 } from '@firestone-hs/aws-lambda-utils';\r\nimport { AllCardsService } from '@firestone-hs/reference-data';\r\nimport { gzipSync } from 'zlib';\r\nimport { Input } from '../input-model';\r\nimport { deepEqual } from '../utils';\r\n\r\nconst bucket = 'static.zerotoheroes.com';\r\nconst fileKey = 'hearthstone/data/battlegrounds-strategies/bgs-hero-strategies.gz.json';\r\n\r\nexport const processBgsHero = async (input: Input, bgPatch: PatchInfo, allCards: AllCardsService) => {\r\n\tconst author = input.author;\r\n\tconsole.debug('processing', author);\r\n\tconst existing = await loadExistingInfo();\r\n\tconst result = existing.heroes;\r\n\t// console.debug('loaded existing info');\r\n\tfor (const cardTip of input.data) {\r\n\t\t// console.debug('processing card', cardTip.cardId);\r\n\t\tlet existingCardTip = result.find((t) => t.cardId === cardTip.cardId);\r\n\t\tif (!existingCardTip) {\r\n\t\t\texistingCardTip = {\r\n\t\t\t\tcardId: cardTip.cardId,\r\n\t\t\t\tname: allCards.getCard(cardTip.cardId)?.name,\r\n\t\t\t\ttips: [],\r\n\t\t\t};\r\n\t\t\tresult.push(existingCardTip);\r\n\t\t}\r\n\t\tif (!!cardTip.tip?.length) {\r\n\t\t\tlet existingTip = existingCardTip.tips.find((t) => t.author === author);\r\n\t\t\tif (!existingTip) {\r\n\t\t\t\texistingTip = {\r\n\t\t\t\t\tauthor: author,\r\n\t\t\t\t} as CardTip;\r\n\t\t\t\texistingCardTip.tips.push(existingTip);\r\n\t\t\t}\r\n\t\t\texistingTip.language = 'enUS';\r\n\t\t\tif (\r\n\t\t\t\t!deepEqual(existingTip.summary, cardTip.tip) ||\r\n\t\t\t\t(cardTip.patchNumber && existingTip.patch !== cardTip.patchNumber)\r\n\t\t\t) {\r\n\t\t\t\texistingTip.summary = cardTip.tip;\r\n\t\t\t\texistingTip.date = new Date().toISOString().substring(0, 10);\r\n\t\t\t\texistingTip.patch = bgPatch.number;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\texistingCardTip.tips = existingCardTip.tips.filter((t) => t.author !== author);\r\n\t\t}\r\n\t}\r\n\tconsole.debug('built aggregated tips', result);\r\n\tawait saveInfo({\r\n\t\theroes: result,\r\n\t\tcurves: existing.curves,\r\n\t});\r\n\tconsole.debug('saved aggregated tips');\r\n};\r\n\r\nconst loadExistingInfo = async (): Promise<{ heroes: CardItem[]; curves: any[] }> => {\r\n\tconst s3 = new S3();\r\n\t// console.debug('created s3');\r\n\tconst asString = await s3.readGzipContent(bucket, fileKey, 5);\r\n\t// console.debug('loaded existing info', asString?.length);\r\n\tif (!asString) {\r\n\t\treturn { heroes: [], curves: JSON.parse(curvesString) };\r\n\t}\r\n\treturn JSON.parse(asString);\r\n};\r\n\r\nconst saveInfo = async (info: { heroes: CardItem[]; curves: any[] }) => {\r\n\tconst s3 = new S3();\r\n\tawait s3.writeFile(gzipSync(JSON.stringify(info)), bucket, fileKey, 'application/json', 'gzip');\r\n};\r\n\r\ninterface CardItem {\r\n\tcardId: string;\r\n\tname: string;\r\n\ttips: CardTip[];\r\n}\r\ninterface CardTip {\r\n\tsummary: string;\r\n\tauthor: string;\r\n\tlanguage: string;\r\n\tpatch: number;\r\n\tdate: string;\r\n}\r\n\r\nconst curvesString = `\r\n[\r\n\t\t{\r\n\t\t\t\"id\": \"basic\",\r\n\t\t\t\"name\": \"Basic Curve\",\r\n\t\t\t\"notes\": \"Stronger with a token start, turn 4 shop RNG weakness. No heropower requirement.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"sell\", \"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\",\r\n\t\t\t\t\t\t\"buy\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"fast-basic\",\r\n\t\t\t\"name\": \"Fast Basic Curve\",\r\n\t\t\t\"notes\": \"Stronger with a token start, turn 4 shop RNG weakness. No heropower requirement.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"sell\", \"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"jeef\",\r\n\t\t\t\"name\": \"Jeef Curve\",\r\n\t\t\t\"notes\": \"Uses tier 1 economy and strong pairs for a flexible start to the game with its variations.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"sell\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"sell\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"fast-jeef\",\r\n\t\t\t\"name\": \"Fast Jeef Curve\",\r\n\t\t\t\"notes\": \"Uses tier 1 economy and strong pairs for a flexible start to the game with its variations. Pushes levels quickly.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"sell\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\"]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"slow-jeef\",\r\n\t\t\t\"name\": \"Slow Jeef Curve\",\r\n\t\t\t\"notes\": \"Uses tier 1 economy and strong pairs for a flexible start to the game with its variations. Stays on tier 2 to solidify the board.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"sell\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"sell\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"warrior\",\r\n\t\t\t\"name\": \"Warrior Curve\",\r\n\t\t\t\"notes\": \"A highly valueable line if tier 1 economy and forced triples are strong.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"sell\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"extended-warrior\",\r\n\t\t\t\"name\": \"Extended Warrior Curve\",\r\n\t\t\t\"notes\": \"A highly valueable line if tier 1 economy and forced triples are strong. This variant is a fallback option in case a triple hasn't shown up yet playing regular warrior curve.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"sell\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"basic-yogg\",\r\n\t\t\t\"name\": \"Basic Yogg Curve\",\r\n\t\t\t\"notes\": \"Uses a 2-cost heropower to get to tier 3 faster.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"sell\", \"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"aggro-yogg\",\r\n\t\t\t\"name\": \"Aggro Yogg Curve\",\r\n\t\t\t\"notes\": \"Uses a 2-cost heropower to get good tier 1s on board before leveling to 3 faster\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"sell\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"roll\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"rafaam\",\r\n\t\t\t\"name\": \"Rafaam Curve\",\r\n\t\t\t\"notes\": \"Clean leveling using 1-cost heropower, 2-cost heropower with economy, or tavern tippers\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"slow-rafaam\",\r\n\t\t\t\"name\": \"Slow Rafaam Curve\",\r\n\t\t\t\"notes\": \"Clean leveling using 1-cost heropower, 2-cost heropower with economy, or tavern tippers. Cut off on tier 2 to get stronger\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"3-on-3\",\r\n\t\t\t\"name\": \"3 on 3 (Level on 8)\",\r\n\t\t\t\"notes\": \"Sacrifices early health to get very fast access to tier 3 minions, then pushes levels\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\", \"roll\"]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"3-on-3-bis\",\r\n\t\t\t\"name\": \"3 on 3 (Level on 9)\",\r\n\t\t\t\"notes\": \"Sacrifices early health to fill the board with tier 3 minions\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\",\r\n\t\t\t\t\t\t\"roll\",\r\n\t\t\t\t\t\t\"buy\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"4-on-4\",\r\n\t\t\t\"name\": \"4 on 4\",\r\n\t\t\t\"notes\": \"Sacrifices early health to get very fast access to tier 3 minions. A fallback option in case of a bad shop after 3 on 3; requires economy\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy-token\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\", \"roll\"]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"toki\",\r\n\t\t\t\"name\": \"Toki Curve\",\r\n\t\t\t\"notes\": \"A way to use 1 cost heropowers that don't provide tempo\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy-token\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"sell\", \"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\"roll\", \"buy\", \"roll\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 7\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"pocky\",\r\n\t\t\t\"name\": \"Pocky Curve\",\r\n\t\t\t\"notes\": \"A very niche use for 1 cost heropowers\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy-token\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"hero-power\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\",\r\n\t\t\t\t\t\t\"buy\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n`;\r\n"]}
1
+ {"version":3,"file":"bgs-heroes.js","sourceRoot":"","sources":["../../src/types/bgs-heroes.ts"],"names":[],"mappings":";;;AACA,qEAA+D;AAE/D,+BAAgC;AAEhC,oCAAqC;AAErC,MAAM,MAAM,GAAG,yBAAyB,CAAC;AACzC,MAAM,OAAO,GAAG,uEAAuE,CAAC;AAEjF,MAAM,cAAc,GAAG,KAAK,EAAE,KAAY,EAAE,OAAkB,EAAE,QAAyB,EAAE,EAAE;IACnG,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IAC5B,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,MAAM,gBAAgB,EAAE,CAAC;IAC1C,MAAM,MAAM,GAAG,QAAQ,CAAC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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2yBpB,CAAC","sourcesContent":["/* eslint-disable no-extra-boolean-cast */\r\nimport { PatchInfo, S3 } from '@firestone-hs/aws-lambda-utils';\r\nimport { AllCardsService } from '@firestone-hs/reference-data';\r\nimport { gzipSync } from 'zlib';\r\nimport { Input } from '../input-model';\r\nimport { deepEqual } from '../utils';\r\n\r\nconst bucket = 'static.zerotoheroes.com';\r\nconst fileKey = 'hearthstone/data/battlegrounds-strategies/bgs-hero-strategies.gz.json';\r\n\r\nexport const processBgsHero = async (input: Input, bgPatch: PatchInfo, allCards: AllCardsService) => {\r\n\tconst author = input.author;\r\n\tconsole.debug('processing', author);\r\n\tconst existing = await loadExistingInfo();\r\n\tconst result = existing.heroes;\r\n\t// console.debug('loaded existing info');\r\n\tfor (const cardTip of input.data) {\r\n\t\t// console.debug('processing card', cardTip.cardId);\r\n\t\tlet existingCardTip = result.find((t) => t.cardId === cardTip.cardId);\r\n\t\tif (!existingCardTip) {\r\n\t\t\texistingCardTip = {\r\n\t\t\t\tcardId: cardTip.cardId,\r\n\t\t\t\tname: allCards.getCard(cardTip.cardId)?.name,\r\n\t\t\t\ttips: [],\r\n\t\t\t};\r\n\t\t\tresult.push(existingCardTip);\r\n\t\t}\r\n\t\tif (!!cardTip.tip?.trim()?.length) {\r\n\t\t\tlet existingTip = existingCardTip.tips.find((t) => t.author === author);\r\n\t\t\tif (!existingTip) {\r\n\t\t\t\texistingTip = {\r\n\t\t\t\t\tauthor: author,\r\n\t\t\t\t} as CardTip;\r\n\t\t\t\texistingCardTip.tips.push(existingTip);\r\n\t\t\t}\r\n\t\t\texistingTip.language = 'enUS';\r\n\t\t\tif (\r\n\t\t\t\t!deepEqual(existingTip.summary, cardTip.tip) ||\r\n\t\t\t\t(cardTip.patchNumber && existingTip.patch !== cardTip.patchNumber)\r\n\t\t\t) {\r\n\t\t\t\texistingTip.summary = cardTip.tip;\r\n\t\t\t\texistingTip.date = new Date().toISOString().substring(0, 10);\r\n\t\t\t\texistingTip.patch = bgPatch.number;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\texistingCardTip.tips = existingCardTip.tips.filter((t) => t.author !== author);\r\n\t\t}\r\n\t}\r\n\tconsole.debug('built aggregated tips', result);\r\n\tawait saveInfo({\r\n\t\theroes: result,\r\n\t\tcurves: existing.curves,\r\n\t});\r\n\tconsole.debug('saved aggregated tips');\r\n};\r\n\r\nconst loadExistingInfo = async (): Promise<{ heroes: CardItem[]; curves: any[] }> => {\r\n\tconst s3 = new S3();\r\n\t// console.debug('created s3');\r\n\tconst asString = await s3.readGzipContent(bucket, fileKey, 5);\r\n\t// console.debug('loaded existing info', asString?.length);\r\n\tif (!asString) {\r\n\t\treturn { heroes: [], curves: JSON.parse(curvesString) };\r\n\t}\r\n\treturn JSON.parse(asString);\r\n};\r\n\r\nconst saveInfo = async (info: { heroes: CardItem[]; curves: any[] }) => {\r\n\tconst s3 = new S3();\r\n\tawait s3.writeFile(gzipSync(JSON.stringify(info)), bucket, fileKey, 'application/json', 'gzip');\r\n};\r\n\r\ninterface CardItem {\r\n\tcardId: string;\r\n\tname: string;\r\n\ttips: CardTip[];\r\n}\r\ninterface CardTip {\r\n\tsummary: string;\r\n\tauthor: string;\r\n\tlanguage: string;\r\n\tpatch: number;\r\n\tdate: string;\r\n}\r\n\r\nconst curvesString = `\r\n[\r\n\t\t{\r\n\t\t\t\"id\": \"basic\",\r\n\t\t\t\"name\": \"Basic Curve\",\r\n\t\t\t\"notes\": \"Stronger with a token start, turn 4 shop RNG weakness. No heropower requirement.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"sell\", \"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\",\r\n\t\t\t\t\t\t\"buy\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"fast-basic\",\r\n\t\t\t\"name\": \"Fast Basic Curve\",\r\n\t\t\t\"notes\": \"Stronger with a token start, turn 4 shop RNG weakness. No heropower requirement.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"sell\", \"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"jeef\",\r\n\t\t\t\"name\": \"Jeef Curve\",\r\n\t\t\t\"notes\": \"Uses tier 1 economy and strong pairs for a flexible start to the game with its variations.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"sell\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"sell\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"fast-jeef\",\r\n\t\t\t\"name\": \"Fast Jeef Curve\",\r\n\t\t\t\"notes\": \"Uses tier 1 economy and strong pairs for a flexible start to the game with its variations. Pushes levels quickly.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"sell\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\"]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"slow-jeef\",\r\n\t\t\t\"name\": \"Slow Jeef Curve\",\r\n\t\t\t\"notes\": \"Uses tier 1 economy and strong pairs for a flexible start to the game with its variations. Stays on tier 2 to solidify the board.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"sell\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"sell\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"warrior\",\r\n\t\t\t\"name\": \"Warrior Curve\",\r\n\t\t\t\"notes\": \"A highly valueable line if tier 1 economy and forced triples are strong.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"sell\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"extended-warrior\",\r\n\t\t\t\"name\": \"Extended Warrior Curve\",\r\n\t\t\t\"notes\": \"A highly valueable line if tier 1 economy and forced triples are strong. This variant is a fallback option in case a triple hasn't shown up yet playing regular warrior curve.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"sell\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"basic-yogg\",\r\n\t\t\t\"name\": \"Basic Yogg Curve\",\r\n\t\t\t\"notes\": \"Uses a 2-cost heropower to get to tier 3 faster.\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"sell\", \"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"aggro-yogg\",\r\n\t\t\t\"name\": \"Aggro Yogg Curve\",\r\n\t\t\t\"notes\": \"Uses a 2-cost heropower to get good tier 1s on board before leveling to 3 faster\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"sell\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"roll\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"rafaam\",\r\n\t\t\t\"name\": \"Rafaam Curve\",\r\n\t\t\t\"notes\": \"Clean leveling using 1-cost heropower, 2-cost heropower with economy, or tavern tippers\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"slow-rafaam\",\r\n\t\t\t\"name\": \"Slow Rafaam Curve\",\r\n\t\t\t\"notes\": \"Clean leveling using 1-cost heropower, 2-cost heropower with economy, or tavern tippers. Cut off on tier 2 to get stronger\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"roll\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"buy\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"3-on-3\",\r\n\t\t\t\"name\": \"3 on 3 (Level on 8)\",\r\n\t\t\t\"notes\": \"Sacrifices early health to get very fast access to tier 3 minions, then pushes levels\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"buy\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\", \"roll\"]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"3-on-3-bis\",\r\n\t\t\t\"name\": \"3 on 3 (Level on 9)\",\r\n\t\t\t\"notes\": \"Sacrifices early health to fill the board with tier 3 minions\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\",\r\n\t\t\t\t\t\t\"roll\",\r\n\t\t\t\t\t\t\"buy\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"4-on-4\",\r\n\t\t\t\"name\": \"4 on 4\",\r\n\t\t\t\"notes\": \"Sacrifices early health to get very fast access to tier 3 minions. A fallback option in case of a bad shop after 3 on 3; requires economy\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy-token\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"roll\", \"roll\", \"roll\"]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"toki\",\r\n\t\t\t\"name\": \"Toki Curve\",\r\n\t\t\t\"notes\": \"A way to use 1 cost heropowers that don't provide tempo\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy-token\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"sell\", \"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"hero-power\", \"buy\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\"roll\", \"buy\", \"roll\", \"buy\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 7,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 7\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t},\r\n\t\t{\r\n\t\t\t\"id\": \"pocky\",\r\n\t\t\t\"name\": \"Pocky Curve\",\r\n\t\t\t\"notes\": \"A very niche use for 1 cost heropowers\",\r\n\t\t\t\"steps\": [\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 1,\r\n\t\t\t\t\t\"actions\": [\"buy-token\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 2,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 2\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 3,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"hero-power\", \"roll\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 4,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 3\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"sell\",\r\n\t\t\t\t\t\t\"hero-power\"\r\n\t\t\t\t\t]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 5,\r\n\t\t\t\t\t\"actions\": [\"buy\", \"buy\", \"hero-power\"]\r\n\t\t\t\t},\r\n\t\t\t\t{\r\n\t\t\t\t\t\"turn\": 6,\r\n\t\t\t\t\t\"actions\": [\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\"type\": \"level\",\r\n\t\t\t\t\t\t\t\"param\": 4\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\"roll\",\r\n\t\t\t\t\t\t\"buy\"\r\n\t\t\t\t\t]\r\n\t\t\t\t}\r\n\t\t\t]\r\n\t\t}\r\n\t]\r\n`;\r\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firestone-hs/content-craetor-input",
3
- "version": "0.0.3",
3
+ "version": "0.0.4",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "lint": "eslint --color --fix --ext .ts .",
@@ -49,4 +49,4 @@
49
49
  "webpack-cli": "^5.0.2",
50
50
  "yaml-cfn": "^0.2.2"
51
51
  }
52
- }
52
+ }