@roster-lock/shared 0.1.0

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.
Files changed (314) hide show
  1. package/LICENSE.md +11 -0
  2. package/dist/index.js +19 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/match-lock-file/config-types.js +3 -0
  5. package/dist/match-lock-file/config-types.js.map +1 -0
  6. package/dist/match-lock-file/index.js +19 -0
  7. package/dist/match-lock-file/index.js.map +1 -0
  8. package/dist/match-lock-file/match-config/index.js +18 -0
  9. package/dist/match-lock-file/match-config/index.js.map +1 -0
  10. package/dist/match-lock-file/match-config/version-1/draft/index.js +44 -0
  11. package/dist/match-lock-file/match-config/version-1/draft/index.js.map +1 -0
  12. package/dist/match-lock-file/match-config/version-1/draft/roster-piece-info.js +32 -0
  13. package/dist/match-lock-file/match-config/version-1/draft/roster-piece-info.js.map +1 -0
  14. package/dist/match-lock-file/match-config/version-1/draft/selection-script-info.js +13 -0
  15. package/dist/match-lock-file/match-config/version-1/draft/selection-script-info.js.map +1 -0
  16. package/dist/match-lock-file/match-config/version-1/index.js +22 -0
  17. package/dist/match-lock-file/match-config/version-1/index.js.map +1 -0
  18. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/asset/index.js +37 -0
  19. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/asset/index.js.map +1 -0
  20. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/asset/keywords.js +43 -0
  21. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/asset/keywords.js.map +1 -0
  22. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/index.js +7 -0
  23. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/index.js.map +1 -0
  24. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/officialSelections.js +41 -0
  25. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/officialSelections.js.map +1 -0
  26. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/requirements/index.js +20 -0
  27. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/requirements/index.js.map +1 -0
  28. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/requirements/keywords.js +31 -0
  29. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/requirements/keywords.js.map +1 -0
  30. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/schema.js +40 -0
  31. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/schema.js.map +1 -0
  32. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/variables/index.js +17 -0
  33. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/variables/index.js.map +1 -0
  34. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/variables/keywords.js +16 -0
  35. package/dist/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/variables/keywords.js.map +1 -0
  36. package/dist/match-lock-file/match-config/version-1/lock/engine/index.js +19 -0
  37. package/dist/match-lock-file/match-config/version-1/lock/engine/index.js.map +1 -0
  38. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/error.js +25 -0
  39. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/error.js.map +1 -0
  40. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/index.js +33 -0
  41. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/index.js.map +1 -0
  42. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/filepath-component.js +31 -0
  43. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/filepath-component.js.map +1 -0
  44. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/filepath.js +37 -0
  45. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/filepath.js.map +1 -0
  46. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/index.js +22 -0
  47. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/index.js.map +1 -0
  48. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/pathvariables.js +24 -0
  49. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/pathvariables.js.map +1 -0
  50. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/index.js +39 -0
  51. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/index.js.map +1 -0
  52. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/index.js +46 -0
  53. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/index.js.map +1 -0
  54. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/path-variables.js +23 -0
  55. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/path-variables.js.map +1 -0
  56. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/requirements.js +99 -0
  57. package/dist/match-lock-file/match-config/version-1/lock/engine/validate/piece/requirements.js.map +1 -0
  58. package/dist/match-lock-file/match-config/version-1/lock/index.js +56 -0
  59. package/dist/match-lock-file/match-config/version-1/lock/index.js.map +1 -0
  60. package/dist/match-lock-file/match-config/version-1/lock/piece-meta/caster-json-schema/index.js +87 -0
  61. package/dist/match-lock-file/match-config/version-1/lock/piece-meta/caster-json-schema/index.js.map +1 -0
  62. package/dist/match-lock-file/match-config/version-1/lock/piece-meta/index.js +19 -0
  63. package/dist/match-lock-file/match-config/version-1/lock/piece-meta/index.js.map +1 -0
  64. package/dist/match-lock-file/match-config/version-1/lock/piece-meta/validate/index.js +94 -0
  65. package/dist/match-lock-file/match-config/version-1/lock/piece-meta/validate/index.js.map +1 -0
  66. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/downloadableSources.js +18 -0
  67. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/downloadableSources.js.map +1 -0
  68. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/human.js +28 -0
  69. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/human.js.map +1 -0
  70. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/id.js +31 -0
  71. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/id.js.map +1 -0
  72. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/index.js +68 -0
  73. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/index.js.map +1 -0
  74. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/pathVariables.js +49 -0
  75. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/pathVariables.js.map +1 -0
  76. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/requiresPieces.js +62 -0
  77. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/requiresPieces.js.map +1 -0
  78. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/version.js +21 -0
  79. package/dist/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/version.js.map +1 -0
  80. package/dist/match-lock-file/match-config/version-1/lock/rosters/index.js +19 -0
  81. package/dist/match-lock-file/match-config/version-1/lock/rosters/index.js.map +1 -0
  82. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/downloadable-source.js +10 -0
  83. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/downloadable-source.js.map +1 -0
  84. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/human.js +27 -0
  85. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/human.js.map +1 -0
  86. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/id.js +27 -0
  87. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/id.js.map +1 -0
  88. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/index.js +74 -0
  89. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/index.js.map +1 -0
  90. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/path-variables.js +31 -0
  91. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/path-variables.js.map +1 -0
  92. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/required-pieces.js +25 -0
  93. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/required-pieces.js.map +1 -0
  94. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/utils.js +23 -0
  95. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/utils.js.map +1 -0
  96. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/version.js +19 -0
  97. package/dist/match-lock-file/match-config/version-1/lock/rosters/validate/version.js.map +1 -0
  98. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/index.js +42 -0
  99. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/index.js.map +1 -0
  100. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/script.js +46 -0
  101. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/script.js.map +1 -0
  102. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/game-controlled.js +12 -0
  103. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/game-controlled.js.map +1 -0
  104. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/normal.js +49 -0
  105. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/normal.js.map +1 -0
  106. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/preselected.js +32 -0
  107. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/preselected.js.map +1 -0
  108. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/unselectable.js +12 -0
  109. package/dist/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/unselectable.js.map +1 -0
  110. package/dist/match-lock-file/match-config/version-1/lock/selection/index.js +19 -0
  111. package/dist/match-lock-file/match-config/version-1/lock/selection/index.js.map +1 -0
  112. package/dist/match-lock-file/match-config/version-1/lock/selection/validate/index.js +33 -0
  113. package/dist/match-lock-file/match-config/version-1/lock/selection/validate/index.js.map +1 -0
  114. package/dist/match-lock-file/match-config/version-1/lock/selection/validate/script.js +23 -0
  115. package/dist/match-lock-file/match-config/version-1/lock/selection/validate/script.js.map +1 -0
  116. package/dist/match-lock-file/match-config/version-1/lock/selection/validate/selections/normal.js +49 -0
  117. package/dist/match-lock-file/match-config/version-1/lock/selection/validate/selections/normal.js.map +1 -0
  118. package/dist/match-lock-file/match-config/version-1/lock/selection/validate/selections/preselected.js +14 -0
  119. package/dist/match-lock-file/match-config/version-1/lock/selection/validate/selections/preselected.js.map +1 -0
  120. package/dist/match-lock-file/match-config/version-1/piece-info/file-paths.js +5 -0
  121. package/dist/match-lock-file/match-config/version-1/piece-info/file-paths.js.map +1 -0
  122. package/dist/match-lock-file/match-config/version-1/piece-info/index.js +23 -0
  123. package/dist/match-lock-file/match-config/version-1/piece-info/index.js.map +1 -0
  124. package/dist/match-lock-file/match-config/version-1/piece-info/keywords.js +29 -0
  125. package/dist/match-lock-file/match-config/version-1/piece-info/keywords.js.map +1 -0
  126. package/dist/match-lock-file/match-config/version-1/piece-info/schema.js +19 -0
  127. package/dist/match-lock-file/match-config/version-1/piece-info/schema.js.map +1 -0
  128. package/dist/match-lock-file/match-config/version-1/shared/Identity.js +15 -0
  129. package/dist/match-lock-file/match-config/version-1/shared/Identity.js.map +1 -0
  130. package/dist/match-lock-file/match-config/version-1/shared/SelectedPiece.js +38 -0
  131. package/dist/match-lock-file/match-config/version-1/shared/SelectedPiece.js.map +1 -0
  132. package/dist/match-lock-file/match-config/version-1/shared/count.js +48 -0
  133. package/dist/match-lock-file/match-config/version-1/shared/count.js.map +1 -0
  134. package/dist/match-lock-file/match-config/version-1/shared/index.js +25 -0
  135. package/dist/match-lock-file/match-config/version-1/shared/index.js.map +1 -0
  136. package/dist/match-lock-file/match-config/version-1/usage/calculatePieceVersion.js +70 -0
  137. package/dist/match-lock-file/match-config/version-1/usage/calculatePieceVersion.js.map +1 -0
  138. package/dist/match-lock-file/match-config/version-1/usage/empty-configs.js +49 -0
  139. package/dist/match-lock-file/match-config/version-1/usage/empty-configs.js.map +1 -0
  140. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/constants.js +8 -0
  141. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/constants.js.map +1 -0
  142. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/getAssetsOfFiles.js +75 -0
  143. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/getAssetsOfFiles.js.map +1 -0
  144. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/getMatchingAsset.js +28 -0
  145. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/getMatchingAsset.js.map +1 -0
  146. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/index.js +20 -0
  147. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/index.js.map +1 -0
  148. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/types.js +3 -0
  149. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/types.js.map +1 -0
  150. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/validateAssetFileCount.js +33 -0
  151. package/dist/match-lock-file/match-config/version-1/usage/files-and-assets/validateAssetFileCount.js.map +1 -0
  152. package/dist/match-lock-file/match-config/version-1/usage/index.js +22 -0
  153. package/dist/match-lock-file/match-config/version-1/usage/index.js.map +1 -0
  154. package/dist/match-lock-file/match-config/version-1/usage/publish/SemVer.js +63 -0
  155. package/dist/match-lock-file/match-config/version-1/usage/publish/SemVer.js.map +1 -0
  156. package/dist/match-lock-file/match-config/version-1/usage/publish/diffLocks.js +51 -0
  157. package/dist/match-lock-file/match-config/version-1/usage/publish/diffLocks.js.map +1 -0
  158. package/dist/match-lock-file/match-config/version-1/usage/publish/index.js +19 -0
  159. package/dist/match-lock-file/match-config/version-1/usage/publish/index.js.map +1 -0
  160. package/dist/match-lock-file/match-config/version-1/usage/validate-select/constants.js +14 -0
  161. package/dist/match-lock-file/match-config/version-1/usage/validate-select/constants.js.map +1 -0
  162. package/dist/match-lock-file/match-config/version-1/usage/validate-select/ensure-pieces-are-in-roster.js +53 -0
  163. package/dist/match-lock-file/match-config/version-1/usage/validate-select/ensure-pieces-are-in-roster.js.map +1 -0
  164. package/dist/match-lock-file/match-config/version-1/usage/validate-select/handle-validation.js +49 -0
  165. package/dist/match-lock-file/match-config/version-1/usage/validate-select/handle-validation.js.map +1 -0
  166. package/dist/match-lock-file/match-config/version-1/usage/validate-select/index.js +68 -0
  167. package/dist/match-lock-file/match-config/version-1/usage/validate-select/index.js.map +1 -0
  168. package/dist/match-lock-file/match-config/version-1/usage/validate-select/selection-types/game-controlled.js +38 -0
  169. package/dist/match-lock-file/match-config/version-1/usage/validate-select/selection-types/game-controlled.js.map +1 -0
  170. package/dist/match-lock-file/match-config/version-1/usage/validate-select/selection-types/normal/cast-result.js +40 -0
  171. package/dist/match-lock-file/match-config/version-1/usage/validate-select/selection-types/normal/cast-result.js.map +1 -0
  172. package/dist/match-lock-file/match-config/version-1/usage/validate-select/selection-types/normal/index.js +78 -0
  173. package/dist/match-lock-file/match-config/version-1/usage/validate-select/selection-types/normal/index.js.map +1 -0
  174. package/dist/match-lock-file/match-config/version-1/usage/validate-select/selection-types/normal/validate-user-selection.js +43 -0
  175. package/dist/match-lock-file/match-config/version-1/usage/validate-select/selection-types/normal/validate-user-selection.js.map +1 -0
  176. package/dist/match-lock-file/match-config/version-1/usage/validate-select/selection-types/preselected.js +26 -0
  177. package/dist/match-lock-file/match-config/version-1/usage/validate-select/selection-types/preselected.js.map +1 -0
  178. package/dist/match-lock-file/util-types/json-schema/JSONSchemaCaster.js +45 -0
  179. package/dist/match-lock-file/util-types/json-schema/JSONSchemaCaster.js.map +1 -0
  180. package/dist/match-lock-file/util-types/json-schema/defineKeyword.js +30 -0
  181. package/dist/match-lock-file/util-types/json-schema/defineKeyword.js.map +1 -0
  182. package/dist/match-lock-file/util-types/json-schema/index.js +21 -0
  183. package/dist/match-lock-file/util-types/json-schema/index.js.map +1 -0
  184. package/dist/match-lock-file/util-types/json-schema/safe-keyword.js +3 -0
  185. package/dist/match-lock-file/util-types/json-schema/safe-keyword.js.map +1 -0
  186. package/dist/match-lock-file/util-types/json-schema/schema-types.js +3 -0
  187. package/dist/match-lock-file/util-types/json-schema/schema-types.js.map +1 -0
  188. package/package.json +49 -0
  189. package/src/index.ts +3 -0
  190. package/src/match-lock-file/config-types.ts +10 -0
  191. package/src/match-lock-file/index.ts +4 -0
  192. package/src/match-lock-file/match-config/index.ts +2 -0
  193. package/src/match-lock-file/match-config/version-0/pieces/caster-runtypes/index.ts +99 -0
  194. package/src/match-lock-file/match-config/version-0/pieces/caster-runtypes/util-casters.ts +155 -0
  195. package/src/match-lock-file/match-config/version-0/pieces/index.ts +3 -0
  196. package/src/match-lock-file/match-config/version-0/pieces/types.ts +49 -0
  197. package/src/match-lock-file/match-config/version-0/pieces/validate/definition/assetCount.ts +33 -0
  198. package/src/match-lock-file/match-config/version-0/pieces/validate/definition/assetType.ts +22 -0
  199. package/src/match-lock-file/match-config/version-0/pieces/validate/definition/index.ts +30 -0
  200. package/src/match-lock-file/match-config/version-0/pieces/validate/definition/pathVariables.ts +39 -0
  201. package/src/match-lock-file/match-config/version-0/pieces/validate/index.ts +4 -0
  202. package/src/match-lock-file/match-config/version-0/pieces/validate/sha.ts +23 -0
  203. package/src/match-lock-file/match-config/version-0/pieces/validate/version.ts +66 -0
  204. package/src/match-lock-file/match-config/version-0/restriction/casters.ts +52 -0
  205. package/src/match-lock-file/match-config/version-0/restriction/index.ts +4 -0
  206. package/src/match-lock-file/match-config/version-0/restriction/types.ts +42 -0
  207. package/src/match-lock-file/match-config/version-0/restriction/validate/index.ts +15 -0
  208. package/src/match-lock-file/match-config/version-0/restriction/validate/piece/index.ts +46 -0
  209. package/src/match-lock-file/match-config/version-0/restriction/validate/sha.ts +19 -0
  210. package/src/match-lock-file/match-config/version-0/selection/casters.ts +105 -0
  211. package/src/match-lock-file/match-config/version-0/selection/validate/count.ts +16 -0
  212. package/src/match-lock-file/match-config/version-0/selection/validate/index.ts +40 -0
  213. package/src/match-lock-file/match-config/version-0/selection/validate/scriptMeta.ts +26 -0
  214. package/src/match-lock-file/match-config/version-1/draft/index.ts +52 -0
  215. package/src/match-lock-file/match-config/version-1/draft/roster-piece-info.ts +33 -0
  216. package/src/match-lock-file/match-config/version-1/draft/selection-script-info.ts +16 -0
  217. package/src/match-lock-file/match-config/version-1/index.ts +7 -0
  218. package/src/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/asset/index.ts +46 -0
  219. package/src/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/asset/keywords.ts +48 -0
  220. package/src/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/index.ts +6 -0
  221. package/src/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/officialSelections.ts +42 -0
  222. package/src/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/requirements/index.ts +26 -0
  223. package/src/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/requirements/keywords.ts +34 -0
  224. package/src/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/schema.ts +47 -0
  225. package/src/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/variables/index.ts +22 -0
  226. package/src/match-lock-file/match-config/version-1/lock/engine/caster-json-schema/variables/keywords.ts +14 -0
  227. package/src/match-lock-file/match-config/version-1/lock/engine/index.ts +3 -0
  228. package/src/match-lock-file/match-config/version-1/lock/engine/validate/constants.ts +7 -0
  229. package/src/match-lock-file/match-config/version-1/lock/engine/validate/error.ts +21 -0
  230. package/src/match-lock-file/match-config/version-1/lock/engine/validate/index.ts +18 -0
  231. package/src/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/filepath-component.ts +41 -0
  232. package/src/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/filepath.ts +55 -0
  233. package/src/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/index.ts +21 -0
  234. package/src/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/glob/pathvariables.ts +28 -0
  235. package/src/match-lock-file/match-config/version-1/lock/engine/validate/piece/assets/index.ts +46 -0
  236. package/src/match-lock-file/match-config/version-1/lock/engine/validate/piece/index.ts +37 -0
  237. package/src/match-lock-file/match-config/version-1/lock/engine/validate/piece/path-variables.ts +21 -0
  238. package/src/match-lock-file/match-config/version-1/lock/engine/validate/piece/requirements.ts +117 -0
  239. package/src/match-lock-file/match-config/version-1/lock/index.ts +51 -0
  240. package/src/match-lock-file/match-config/version-1/lock/piece-meta/caster-json-schema/index.ts +97 -0
  241. package/src/match-lock-file/match-config/version-1/lock/piece-meta/index.ts +3 -0
  242. package/src/match-lock-file/match-config/version-1/lock/piece-meta/validate/index.ts +114 -0
  243. package/src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/downloadableSources.ts +25 -0
  244. package/src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/human.ts +33 -0
  245. package/src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/id.ts +33 -0
  246. package/src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/index.ts +103 -0
  247. package/src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/pathVariables.ts +59 -0
  248. package/src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/requiresPieces.ts +71 -0
  249. package/src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/version.ts +22 -0
  250. package/src/match-lock-file/match-config/version-1/lock/rosters/index.ts +3 -0
  251. package/src/match-lock-file/match-config/version-1/lock/rosters/validate/downloadable-source.ts +9 -0
  252. package/src/match-lock-file/match-config/version-1/lock/rosters/validate/human.ts +22 -0
  253. package/src/match-lock-file/match-config/version-1/lock/rosters/validate/id.ts +20 -0
  254. package/src/match-lock-file/match-config/version-1/lock/rosters/validate/index.ts +83 -0
  255. package/src/match-lock-file/match-config/version-1/lock/rosters/validate/path-variables.ts +40 -0
  256. package/src/match-lock-file/match-config/version-1/lock/rosters/validate/required-pieces.ts +30 -0
  257. package/src/match-lock-file/match-config/version-1/lock/rosters/validate/utils.ts +17 -0
  258. package/src/match-lock-file/match-config/version-1/lock/rosters/validate/version.ts +22 -0
  259. package/src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/index.ts +53 -0
  260. package/src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/script.ts +54 -0
  261. package/src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/game-controlled.ts +11 -0
  262. package/src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/normal.ts +58 -0
  263. package/src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/preselected.ts +37 -0
  264. package/src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/unselectable.ts +11 -0
  265. package/src/match-lock-file/match-config/version-1/lock/selection/index.ts +3 -0
  266. package/src/match-lock-file/match-config/version-1/lock/selection/validate/index.ts +37 -0
  267. package/src/match-lock-file/match-config/version-1/lock/selection/validate/script.ts +28 -0
  268. package/src/match-lock-file/match-config/version-1/lock/selection/validate/selections/normal.ts +69 -0
  269. package/src/match-lock-file/match-config/version-1/lock/selection/validate/selections/preselected.ts +18 -0
  270. package/src/match-lock-file/match-config/version-1/piece-info/file-paths.ts +2 -0
  271. package/src/match-lock-file/match-config/version-1/piece-info/index.ts +14 -0
  272. package/src/match-lock-file/match-config/version-1/piece-info/keywords.ts +39 -0
  273. package/src/match-lock-file/match-config/version-1/piece-info/schema.ts +29 -0
  274. package/src/match-lock-file/match-config/version-1/shared/Identity.ts +14 -0
  275. package/src/match-lock-file/match-config/version-1/shared/SelectedPiece.ts +49 -0
  276. package/src/match-lock-file/match-config/version-1/shared/count.ts +47 -0
  277. package/src/match-lock-file/match-config/version-1/shared/index.ts +9 -0
  278. package/src/match-lock-file/match-config/version-1/usage/calculatePieceVersion.ts +85 -0
  279. package/src/match-lock-file/match-config/version-1/usage/empty-configs.ts +61 -0
  280. package/src/match-lock-file/match-config/version-1/usage/files-and-assets/constants.ts +6 -0
  281. package/src/match-lock-file/match-config/version-1/usage/files-and-assets/getAssetsOfFiles.ts +88 -0
  282. package/src/match-lock-file/match-config/version-1/usage/files-and-assets/getMatchingAsset.ts +42 -0
  283. package/src/match-lock-file/match-config/version-1/usage/files-and-assets/index.ts +4 -0
  284. package/src/match-lock-file/match-config/version-1/usage/files-and-assets/types.ts +5 -0
  285. package/src/match-lock-file/match-config/version-1/usage/files-and-assets/validateAssetFileCount.ts +34 -0
  286. package/src/match-lock-file/match-config/version-1/usage/index.ts +6 -0
  287. package/src/match-lock-file/match-config/version-1/usage/publish/SemVer.ts +67 -0
  288. package/src/match-lock-file/match-config/version-1/usage/publish/diffLocks.ts +66 -0
  289. package/src/match-lock-file/match-config/version-1/usage/publish/index.ts +2 -0
  290. package/src/match-lock-file/match-config/version-1/usage/validate-select/constants.ts +9 -0
  291. package/src/match-lock-file/match-config/version-1/usage/validate-select/ensure-pieces-are-in-roster.ts +61 -0
  292. package/src/match-lock-file/match-config/version-1/usage/validate-select/handle-validation.ts +54 -0
  293. package/src/match-lock-file/match-config/version-1/usage/validate-select/index.ts +98 -0
  294. package/src/match-lock-file/match-config/version-1/usage/validate-select/selection-types/game-controlled.ts +49 -0
  295. package/src/match-lock-file/match-config/version-1/usage/validate-select/selection-types/normal/cast-result.ts +39 -0
  296. package/src/match-lock-file/match-config/version-1/usage/validate-select/selection-types/normal/include-mandatory-require.ts +44 -0
  297. package/src/match-lock-file/match-config/version-1/usage/validate-select/selection-types/normal/index.ts +101 -0
  298. package/src/match-lock-file/match-config/version-1/usage/validate-select/selection-types/normal/validate-user-selection.ts +51 -0
  299. package/src/match-lock-file/match-config/version-1/usage/validate-select/selection-types/preselected.ts +36 -0
  300. package/src/match-lock-file/util-types/json-schema/JSONSchemaCaster.ts +52 -0
  301. package/src/match-lock-file/util-types/json-schema/checkVersion.ts +9 -0
  302. package/src/match-lock-file/util-types/json-schema/defineKeyword.ts +50 -0
  303. package/src/match-lock-file/util-types/json-schema/index.ts +4 -0
  304. package/src/match-lock-file/util-types/json-schema/safe-keyword.ts +27 -0
  305. package/src/match-lock-file/util-types/json-schema/schema-types.ts +5 -0
  306. package/tests/engine/assets.spec.ts +147 -0
  307. package/tests/engine/official-selections.spec.ts +67 -0
  308. package/tests/engine/requirements.spec.ts +43 -0
  309. package/tests/piece-info/cast.spec.ts +20 -0
  310. package/tests/piece-info/rosterlock.piece-info.json +15 -0
  311. package/tests/piece-meta/cast.spec.ts +60 -0
  312. package/tests/rosters/path-variables.spec.ts +52 -0
  313. package/tests/selection/cast-result.spec.ts +72 -0
  314. package/tsconfig.json +20 -0
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateAllExpectedPathVariableNamesSet = validateAllExpectedPathVariableNamesSet;
4
+ exports.validatePathVariableNameIsExpected = validatePathVariableNameIsExpected;
5
+ exports.validatePathVariableValue = validatePathVariableValue;
6
+ const pathvariables_1 = require("../../engine/validate/piece/assets/glob/pathvariables");
7
+ function validateAllExpectedPathVariableNamesSet(pathVariableValues, pieceConfig) {
8
+ for (const variableName of pieceConfig.pathVariables) {
9
+ if (!(variableName in pathVariableValues)) {
10
+ throw new Error(`Piece is missing value for path variable ${variableName}`);
11
+ }
12
+ }
13
+ }
14
+ function validatePathVariableNameIsExpected(variableName, pieceConfig) {
15
+ if (!pieceConfig.pathVariables.includes(variableName)) {
16
+ throw new Error(`Piece does not have path variable ${variableName}`);
17
+ }
18
+ }
19
+ function validatePathVariableValue(variableValue) {
20
+ if (variableValue.length < pathvariables_1.PATH_VARIABLE_VALUE_VALIDATION.minLength) {
21
+ throw new Error(`Path variable value is too short`);
22
+ }
23
+ if (variableValue.length > pathvariables_1.PATH_VARIABLE_VALUE_VALIDATION.maxLength) {
24
+ throw new Error(`Path variable value is too long`);
25
+ }
26
+ const charsetRegex = new RegExp(`^[${pathvariables_1.PATH_VARIABLE_VALUE_VALIDATION.charset}]+$`);
27
+ if (!charsetRegex.test(variableValue)) {
28
+ throw new Error(`Path variable value contains invalid characters`);
29
+ }
30
+ }
31
+ //# sourceMappingURL=path-variables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path-variables.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/validate/path-variables.ts"],"names":[],"mappings":";;;;;AACA,yFAAuG;AAGvG,iDACE,kBAAoD,EACpD,WAAqE;IAErE,KAAI,MAAM,YAAY,IAAI,WAAW,CAAC,aAAa,EAAC,CAAC;QACnD,IAAG,CAAC,CAAC,YAAY,IAAI,kBAAkB,CAAC,EAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,4CAA4C,YAAY,EAAE,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;AACH,CAAC;AAED,4CACE,YAAoB,EACpB,WAAqE;IAErE,IAAG,CAAC,WAAW,CAAC,aAAa,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAC,CAAC;QACpD,MAAM,IAAI,KAAK,CAAC,qCAAqC,YAAY,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC;AAED,mCACE,aAAqB;IAErB,IAAI,aAAa,CAAC,MAAM,GAAG,8CAA8B,CAAC,SAAS,EAAE,CAAC;QACpE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IAED,IAAI,aAAa,CAAC,MAAM,GAAG,8CAA8B,CAAC,SAAS,EAAE,CAAC;QACpE,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,KAAK,8CAA8B,CAAC,OAAO,KAAK,CAAC,CAAC;IAClF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;IACrE,CAAC;AACH,CAAC"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateAllExpectedRequiredPieceTypesSet = validateAllExpectedRequiredPieceTypesSet;
4
+ exports.validateRequiredPieceType = validateRequiredPieceType;
5
+ exports.validateRequiredPieceValue = validateRequiredPieceValue;
6
+ function validateAllExpectedRequiredPieceTypesSet(requiredPieces, pieceConfig) {
7
+ for (const requiredPieceType of pieceConfig.requires) {
8
+ if (!(requiredPieceType in requiredPieces)) {
9
+ throw new Error(`Piece is missing required piece type ${requiredPieceType}`);
10
+ }
11
+ }
12
+ }
13
+ function validateRequiredPieceType(pieceType, { engine, rosters }) {
14
+ const pieceDefinition = engine.pieceDefinitions[pieceType];
15
+ if (!pieceDefinition)
16
+ throw new Error(`Piece type ${pieceType} is not defined in engine`);
17
+ if (!(pieceType in rosters))
18
+ throw new Error(`Piece type ${pieceType} is not defined in roster`);
19
+ }
20
+ function validateRequiredPieceValue(pieceType, pieceId, roster) {
21
+ if (!roster.find((p) => p.id === pieceId)) {
22
+ throw new Error(`Piece type ${pieceType} does not have the required piece with id ${pieceId}`);
23
+ }
24
+ }
25
+ //# sourceMappingURL=required-pieces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-pieces.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/validate/required-pieces.ts"],"names":[],"mappings":";;;;;AAEA,kDACE,cAA0E,EAC1E,WAAqE;IAErE,KAAI,MAAM,iBAAiB,IAAI,WAAW,CAAC,QAAQ,EAAC,CAAC;QACnD,IAAG,CAAC,CAAC,iBAAiB,IAAI,cAAc,CAAC,EAAC,CAAC;YACzC,MAAM,IAAI,KAAK,CAAC,wCAAwC,iBAAiB,EAAE,CAAC,CAAC;QAC/E,CAAC;IACH,CAAC;AACH,CAAC;AAED,mCACE,SAAiB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAsB;IAE1D,MAAM,eAAe,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC3D,IAAG,CAAC,eAAe;QACjB,MAAM,IAAI,KAAK,CAAC,cAAc,SAAS,2BAA2B,CAAC,CAAC;IACtE,IAAG,CAAC,CAAC,SAAS,IAAI,OAAO,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,cAAc,SAAS,2BAA2B,CAAC,CAAC;AACxE,CAAC;AAED,oCACE,SAAiB,EAAE,OAAe,EAAE,MAA6C;IAEjF,IAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,EAAC,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,cAAc,SAAS,6CAA6C,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateSha256 = validateSha256;
4
+ exports.validateURL = validateURL;
5
+ function validateSha256(value) {
6
+ if (/^[0-9a-f]{64}$/i.test(value))
7
+ return;
8
+ throw new Error(`${value} is not a valid SHA-256 (64-char hex)`);
9
+ }
10
+ function validateURL(value) {
11
+ let url;
12
+ try {
13
+ url = new URL(value);
14
+ }
15
+ catch {
16
+ throw new Error(`${value} is not a valid URL`);
17
+ }
18
+ if (url.protocol === "http:" && url.hostname === "localhost")
19
+ return;
20
+ if (!["https:"].includes(url.protocol))
21
+ throw new Error(`${value} is not a valid https`);
22
+ }
23
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/validate/utils.ts"],"names":[],"mappings":";;;;AACA,wBAA+B,KAAa;IAE1C,IAAI,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO;IAC1C,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,uCAAuC,CAAC,CAAC;AACnE,CAAC;AAED,qBAA4B,KAAa;IACvC,IAAI,GAAQ,CAAC;IACb,IAAI,CAAC;QACH,GAAG,GAAG,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,qBAAqB,CAAC,CAAC;IACjD,CAAC;IACD,IAAG,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,WAAW;QAAE,OAAO;IACpE,IAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,KAAK,uBAAuB,CAAC,CAAC;AAC1F,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateVersions = validateVersions;
4
+ exports.validateVersionUniqueness = validateVersionUniqueness;
5
+ const utils_1 = require("./utils");
6
+ function validateVersions(versions) {
7
+ (0, utils_1.validateSha256)(versions.logic);
8
+ (0, utils_1.validateSha256)(versions.media);
9
+ (0, utils_1.validateSha256)(versions.docs);
10
+ }
11
+ function validateVersionUniqueness(versions, index, rosters) {
12
+ for (let i = 0; i < rosters.length; i++) {
13
+ if (i === index)
14
+ continue;
15
+ if (rosters[i].version.logic === versions.logic)
16
+ throw new Error(`Duplicate Logic Version ${versions.logic}`);
17
+ }
18
+ }
19
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/validate/version.ts"],"names":[],"mappings":";;;;AAGA,mCAAyC;AAGzC,0BACE,QAAsB;IAEtB,IAAA,sBAAc,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAA,sBAAc,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC/B,IAAA,sBAAc,EAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,mCACE,QAAsB,EAAE,KAAa,EAAE,OAA8C;IAErF,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC,CAAC;QACtC,IAAG,CAAC,KAAK,KAAK;YAAE,SAAS;QACzB,IAAG,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC;IAC/G,CAAC;AACH,CAAC"}
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.selectionKeywords = exports.selectionConfigSchema = exports.untrustedScriptRefSchema = void 0;
4
+ const preselected_1 = require("./selection-types/preselected");
5
+ const normal_1 = require("./selection-types/normal");
6
+ const game_controlled_1 = require("./selection-types/game-controlled");
7
+ const unselectable_1 = require("./selection-types/unselectable");
8
+ const script_1 = require("./script");
9
+ Object.defineProperty(exports, "untrustedScriptRefSchema", { enumerable: true, get: function () { return script_1.untrustedScriptRefSchema; } });
10
+ exports.selectionConfigSchema = {
11
+ type: "object",
12
+ required: ["piece", "scriptDictionary"],
13
+ additionalProperties: false,
14
+ properties: {
15
+ piece: {
16
+ type: "object",
17
+ required: [],
18
+ additionalProperties: {
19
+ oneOf: [
20
+ preselected_1.preselectedSelectionSchema,
21
+ normal_1.normalSelectionSchema,
22
+ game_controlled_1.gameControlledSelectionSchema,
23
+ unselectable_1.unselectableSelectionSchema
24
+ ],
25
+ },
26
+ },
27
+ globalValidation: {
28
+ type: "array",
29
+ items: script_1.untrustedScriptRefSchema,
30
+ },
31
+ scriptDictionary: script_1.untrustedScriptDictionarySchema
32
+ },
33
+ };
34
+ const normal_2 = require("./selection-types/normal");
35
+ const preselected_2 = require("./selection-types/preselected");
36
+ exports.selectionKeywords = [
37
+ normal_2.banListSchemaValidator,
38
+ preselected_2.preselectedSchemaValidator,
39
+ script_1.scriptRefSrcSchemaValidator,
40
+ script_1.scriptRefMethodSchemaValidator,
41
+ ];
42
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/index.ts"],"names":[],"mappings":";;;AAKA,+DAA2E;AAC3E,qDAAiE;AACjE,uEAAkF;AAClF,iEAA6E;AAE7E,qCAGkB;yGAFhB,iCAAwB;AAKb,QAAA,qBAAqB,GAAoD;IACpF,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,OAAO,EAAE,kBAAkB,CAAC;IACvC,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,QAAQ,EAAE,EAAE;YACZ,oBAAoB,EAAE;gBACpB,KAAK,EAAE;oBACL,wCAA0B;oBAC1B,8BAAqB;oBACrB,+CAA6B;oBAC7B,0CAA2B;iBAC5B;aACF;SACF;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,iCAAwB;SAChC;QACD,gBAAgB,EAAE,wCAA+B;KAClD;CACF,CAAC;AAGF,qDAAkE;AAClE,+DAA2E;AAE9D,QAAA,iBAAiB,GAAG;IAC/B,+BAAsB;IAEtB,wCAA0B;IAE1B,oCAA2B;IAC3B,uCAA8B;CAC/B,CAAC"}
@@ -0,0 +1,46 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.untrustedScriptDictionarySchema = exports.untrustedScriptRefSchema = exports.scriptRefMethodSchemaValidator = exports.scriptRefSrcSchemaValidator = void 0;
4
+ const json_schema_1 = require("../../../../../util-types/json-schema");
5
+ const script_1 = require("../validate/script");
6
+ exports.scriptRefSrcSchemaValidator = (0, json_schema_1.defineKeyword)({
7
+ keyword: "untrustedScriptSrc",
8
+ type: "string",
9
+ validate(value, config) {
10
+ (0, script_1.validateUntrustedScriptSrc)(value, config);
11
+ }
12
+ });
13
+ exports.scriptRefMethodSchemaValidator = (0, json_schema_1.defineKeyword)({
14
+ keyword: "untrustedScriptMethod",
15
+ type: "string",
16
+ validate(value, config) {
17
+ (0, script_1.validateUntrustedScriptMethod)(value);
18
+ }
19
+ });
20
+ exports.untrustedScriptRefSchema = {
21
+ type: "object",
22
+ required: ["src"],
23
+ additionalProperties: false,
24
+ properties: {
25
+ src: {
26
+ type: "string",
27
+ [exports.scriptRefSrcSchemaValidator.keyword]: true
28
+ },
29
+ method: {
30
+ type: "string", nullable: true,
31
+ [exports.scriptRefMethodSchemaValidator.keyword]: true
32
+ }
33
+ },
34
+ };
35
+ exports.untrustedScriptDictionarySchema = {
36
+ type: "object", required: [],
37
+ propertyNames: { type: "string" },
38
+ additionalProperties: {
39
+ type: "object", required: ["content"],
40
+ additionalProperties: false,
41
+ properties: {
42
+ content: { type: "string" },
43
+ }
44
+ }
45
+ };
46
+ //# sourceMappingURL=script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/script.ts"],"names":[],"mappings":";;;AAGA,uEAAsE;AAEtE,+CAG4B;AAEf,QAAA,2BAA2B,GAAG,IAAA,2BAAa,EAAC;IACvD,OAAO,EAAE,oBAAoB;IAC7B,IAAI,EAAE,QAAQ;IACd,QAAQ,CAAC,KAAK,EAAE,MAA0B;QACxC,IAAA,mCAA0B,EAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,8BAA8B,GAAG,IAAA,2BAAa,EAAC;IAC1D,OAAO,EAAE,uBAAuB;IAChC,IAAI,EAAE,QAAQ;IACd,QAAQ,CAAC,KAAK,EAAE,MAA0B;QACxC,IAAA,sCAA6B,EAAC,KAAK,CAAC,CAAC;IACvC,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAuC;IAC1E,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,KAAK,CAAC;IACjB,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,CAAC,QAAA,2BAA2B,CAAC,OAAO,CAAC,EAAE,IAAI;SAC5C;QACD,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI;YAC9B,CAAC,QAAA,8BAA8B,CAAC,OAAO,CAAC,EAAE,IAAI;SAC/C;KACF;CACF,CAAC;AAGW,QAAA,+BAA+B,GAAwE;IAClH,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE;IAC5B,aAAa,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;IACjC,oBAAoB,EAAE;QACpB,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC;QACrC,oBAAoB,EAAE,KAAK;QAC3B,UAAU,EAAE;YACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC5B;KACF;CACF,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gameControlledSelectionSchema = void 0;
4
+ exports.gameControlledSelectionSchema = {
5
+ type: "object",
6
+ required: ["type"],
7
+ additionalProperties: false,
8
+ properties: {
9
+ type: { type: "string", const: "game-controlled" },
10
+ },
11
+ };
12
+ //# sourceMappingURL=game-controlled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"game-controlled.js","sourceRoot":"","sources":["../../../../../../../../src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/game-controlled.ts"],"names":[],"mappings":";;;AAGa,QAAA,6BAA6B,GAAkD;IAC1F,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,iBAAiB,EAAE;KACnD;CACF,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalSelectionSchema = exports.banListSchemaValidator = void 0;
4
+ const script_1 = require("../script");
5
+ const normal_1 = require("../../validate/selections/normal");
6
+ const json_schema_1 = require("../../../../../../util-types/json-schema");
7
+ const count_1 = require("../../../../shared/count");
8
+ exports.banListSchemaValidator = (0, json_schema_1.defineKeyword)({
9
+ keyword: "selectionBanList",
10
+ type: "array",
11
+ validate: function (banList, { rosters }, path) {
12
+ if (!banList)
13
+ return;
14
+ const pieceType = path.split("/").at(-3);
15
+ if (!pieceType)
16
+ throw new Error("Invalid path");
17
+ const roster = rosters[pieceType];
18
+ (0, normal_1.validateSelectionBanList)(banList, roster);
19
+ }
20
+ });
21
+ const userSelectionValidationSchema = {
22
+ type: "object",
23
+ required: ["count", "unique", "customValidation"],
24
+ additionalProperties: false,
25
+ properties: {
26
+ count: count_1.countSchema,
27
+ unique: { type: "boolean" },
28
+ banList: {
29
+ type: "array",
30
+ items: { type: "string" },
31
+ [exports.banListSchemaValidator.keyword]: true,
32
+ },
33
+ customValidation: {
34
+ type: "array",
35
+ items: script_1.untrustedScriptRefSchema,
36
+ },
37
+ },
38
+ };
39
+ exports.normalSelectionSchema = {
40
+ type: "object",
41
+ required: ["type"],
42
+ additionalProperties: false,
43
+ properties: {
44
+ type: { type: "string", const: "normal" },
45
+ validation: userSelectionValidationSchema,
46
+ mergeAlgorithm: { ...script_1.untrustedScriptRefSchema, nullable: true },
47
+ },
48
+ };
49
+ //# sourceMappingURL=normal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normal.js","sourceRoot":"","sources":["../../../../../../../../src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/normal.ts"],"names":[],"mappings":";;;AAQA,sCAAqD;AACrD,6DAA4E;AAC5E,0EAAyE;AACzE,oDAAuD;AAE1C,QAAA,sBAAsB,GAAG,IAAA,2BAAa,EAAC;IAClD,OAAO,EAAE,kBAAkB;IAC3B,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,UAAU,OAAsB,EAAE,EAAE,OAAO,EAAsB,EAAE,IAAI;QAC/E,IAAG,CAAC,OAAO;YAAE,OAAO;QAEpB,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,IAAG,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;QAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAClC,IAAA,iCAAwB,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC5C,CAAC;CACF,CAAC,CAAC;AAGH,MAAM,6BAA6B,GAA4C;IAC7E,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,CAAC;IACjD,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,KAAK,EAAE,mBAAW;QAClB,MAAM,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QAC3B,OAAO,EAAE;YACP,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,CAAC,QAAA,sBAAsB,CAAC,OAAO,CAAC,EAAE,IAAI;SACvC;QACD,gBAAgB,EAAE;YAChB,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,iCAAwB;SAChC;KACF;CACF,CAAC;AAEW,QAAA,qBAAqB,GAA0C;IAC1E,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE;QACzC,UAAU,EAAE,6BAA6B;QACzC,cAAc,EAAE,EAAE,GAAG,iCAAwB,EAAE,QAAQ,EAAE,IAAI,EAAE;KAChE;CACF,CAAC"}
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.preselectedSelectionSchema = exports.preselectedSchemaValidator = void 0;
4
+ const preselected_1 = require("../../validate/selections/preselected");
5
+ const json_schema_1 = require("../../../../../../util-types/json-schema");
6
+ const shared_1 = require("../../../../shared");
7
+ exports.preselectedSchemaValidator = (0, json_schema_1.defineKeyword)({
8
+ keyword: "selectionPreselected",
9
+ type: "array",
10
+ validate: function (selection, config, path) {
11
+ const pieceType = path.split("/").at(-2);
12
+ if (!pieceType)
13
+ throw new Error("Invalid path");
14
+ (0, preselected_1.validatePreselected)(selection, pieceType, config);
15
+ }
16
+ });
17
+ exports.preselectedSelectionSchema = {
18
+ $id: "preselectedSelectionSchema",
19
+ type: "object",
20
+ required: ["type", "pieces"],
21
+ additionalProperties: false,
22
+ ...shared_1.SelectedPieceSchemaDef,
23
+ properties: {
24
+ type: { type: "string", const: "preselected" },
25
+ pieces: {
26
+ type: "array",
27
+ [exports.preselectedSchemaValidator.keyword]: true,
28
+ items: shared_1.SelectedPieceSchema,
29
+ },
30
+ },
31
+ };
32
+ //# sourceMappingURL=preselected.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preselected.js","sourceRoot":"","sources":["../../../../../../../../src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/preselected.ts"],"names":[],"mappings":";;;AAGA,uEAA4E;AAC5E,0EAAyE;AACzE,+CAAiF;AAEpE,QAAA,0BAA0B,GAAG,IAAA,2BAAa,EAAC;IACtD,OAAO,EAAE,sBAAsB;IAC/B,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,UACR,SAA+C,EAC/C,MAA0B,EAC1B,IAAI;QAGJ,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACzC,IAAG,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,cAAc,CAAC,CAAC;QAC/C,IAAA,iCAAmB,EAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,0BAA0B,GAAG;IACxC,GAAG,EAAE,4BAA4B;IACjC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;IAC5B,oBAAoB,EAAE,KAAK;IAC3B,GAAG,+BAAsB;IACzB,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE;QAC9C,MAAM,EAAE;YACN,IAAI,EAAE,OAAO;YACb,CAAC,QAAA,0BAA0B,CAAC,OAAO,CAAC,EAAE,IAAI;YAC1C,KAAK,EAAE,4BAAmB;SAC3B;KACF;CACuD,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.unselectableSelectionSchema = void 0;
4
+ exports.unselectableSelectionSchema = {
5
+ type: "object",
6
+ required: ["type"],
7
+ additionalProperties: false,
8
+ properties: {
9
+ type: { type: "string", const: "unselectable" },
10
+ },
11
+ };
12
+ //# sourceMappingURL=unselectable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unselectable.js","sourceRoot":"","sources":["../../../../../../../../src/match-lock-file/match-config/version-1/lock/selection/caster-json-schema/selection-types/unselectable.ts"],"names":[],"mappings":";;;AAGa,QAAA,2BAA2B,GAAgD;IACtF,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE;KAChD;CACF,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./validate"), exports);
18
+ __exportStar(require("./caster-json-schema"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/match-lock-file/match-config/version-1/lock/selection/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,uDAAqC"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateSelectionConfig = validateSelectionConfig;
4
+ const normal_1 = require("./selections/normal");
5
+ const preselected_1 = require("./selections/preselected");
6
+ const script_1 = require("./script");
7
+ function validateSelectionConfig(selectionConfig, config) {
8
+ const { engine, rosters } = config;
9
+ for (const [pieceType, selection] of Object.entries(selectionConfig.piece)) {
10
+ const pieceDefinition = engine.pieceDefinitions[pieceType];
11
+ if (!pieceDefinition) {
12
+ throw new Error(`Piece type ${pieceType} is not defined in engine`);
13
+ }
14
+ switch (selection.type) {
15
+ case "preselected":
16
+ (0, preselected_1.validatePreselected)(selection.pieces, pieceType, config);
17
+ break;
18
+ case "normal":
19
+ (0, normal_1.validateNormal)(selection, pieceType, config);
20
+ break;
21
+ case "game-controlled":
22
+ break;
23
+ case "unselectable":
24
+ break;
25
+ }
26
+ }
27
+ if (selectionConfig.globalValidation) {
28
+ for (const script of selectionConfig.globalValidation) {
29
+ (0, script_1.validateUntrustedScript)(script, config);
30
+ }
31
+ }
32
+ }
33
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/selection/validate/index.ts"],"names":[],"mappings":";;;AAEA,gDAAqD;AACrD,0DAA+D;AAE/D,qCAAmD;AAEnD,iCACE,eAAgD,EAChD,MAA0B;IAE1B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACnC,KAAI,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,EAAC,CAAC;QACzE,MAAM,eAAe,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAG,CAAC,eAAe,EAAC,CAAC;YACnB,MAAM,IAAI,KAAK,CAAC,cAAc,SAAS,2BAA2B,CAAC,CAAC;QACtE,CAAC;QACD,QAAO,SAAS,CAAC,IAAI,EAAC,CAAC;YACrB,KAAK,aAAa;gBAChB,IAAA,iCAAmB,EAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;gBACzD,MAAM;YACR,KAAK,QAAQ;gBACX,IAAA,uBAAc,EAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;gBAC7C,MAAM;YACR,KAAK,iBAAiB;gBACpB,MAAM;YACR,KAAK,cAAc;gBACjB,MAAM;QACV,CAAC;IACH,CAAC;IACD,IAAG,eAAe,CAAC,gBAAgB,EAAC,CAAC;QACnC,KAAI,MAAM,MAAM,IAAI,eAAe,CAAC,gBAAgB,EAAC,CAAC;YACpD,IAAA,gCAAuB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateUntrustedScript = validateUntrustedScript;
4
+ exports.validateUntrustedScriptSrc = validateUntrustedScriptSrc;
5
+ exports.validateUntrustedScriptMethod = validateUntrustedScriptMethod;
6
+ function validateUntrustedScript(script, config) {
7
+ validateUntrustedScriptSrc(script.src, config);
8
+ validateUntrustedScriptMethod(script.method);
9
+ }
10
+ function validateUntrustedScriptSrc(scriptSrc, { selection }) {
11
+ if (!(scriptSrc in selection.scriptDictionary)) {
12
+ throw new Error("Script src is not in scripts");
13
+ }
14
+ }
15
+ const VALID_IDENTIFIER = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
16
+ function validateUntrustedScriptMethod(method) {
17
+ if (method === undefined)
18
+ return;
19
+ if (!VALID_IDENTIFIER.test(method)) {
20
+ throw new Error("Script method must be a valid identifier");
21
+ }
22
+ }
23
+ //# sourceMappingURL=script.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"script.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/selection/validate/script.ts"],"names":[],"mappings":";;;;;AAEA,iCACE,MAA0B,EAC1B,MAA0B;IAE1B,0BAA0B,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IAC/C,6BAA6B,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAC/C,CAAC;AAED,oCACE,SAAoC,EACpC,EAAE,SAAS,EAAsB;IAEjC,IAAG,CAAC,CAAC,SAAS,IAAI,SAAS,CAAC,gBAAgB,CAAC,EAAC,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAClD,CAAC;AACH,CAAC;AAED,MAAM,gBAAgB,GAAG,0BAA0B,CAAC;AACpD,uCACE,MAAoC;IAEpC,IAAG,MAAM,KAAK,SAAS;QAAE,OAAO;IAChC,IAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,EAAC,CAAC;QACjC,MAAM,IAAI,KAAK,CAAC,0CAA0C,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateNormal = validateNormal;
4
+ exports.validateSelection = validateSelection;
5
+ exports.validateSelectionBanList = validateSelectionBanList;
6
+ const script_1 = require("../script");
7
+ const count_1 = require("../../../../shared/count");
8
+ function validateNormal(selection, pieceType, config) {
9
+ validateRequiredProperties(selection, pieceType, config);
10
+ if ("validation" in selection && selection.validation) {
11
+ validateSelection(selection.validation, pieceType, config);
12
+ }
13
+ if (selection.mergeAlgorithm) {
14
+ (0, script_1.validateUntrustedScript)(selection.mergeAlgorithm, config);
15
+ }
16
+ }
17
+ function validateRequiredProperties(selection, pieceType, config) {
18
+ const pieceDefinition = config.engine.pieceDefinitions[pieceType];
19
+ if (pieceDefinition.selectionStrategy === "on demand") {
20
+ if ("validation" in selection && selection.validation) {
21
+ throw new Error(`On demand piece ${pieceType} cannot have validation`);
22
+ }
23
+ if ("mergeAlgorithm" in selection && selection.mergeAlgorithm) {
24
+ throw new Error(`On demand piece ${pieceType} cannot have a merge algorithm`);
25
+ }
26
+ return;
27
+ }
28
+ if (pieceDefinition.selectionStrategy === "shared") {
29
+ if (!("mergeAlgorithm" in selection && selection.mergeAlgorithm)) {
30
+ throw new Error(`Shared piece ${pieceType} must have a merge algorithm`);
31
+ }
32
+ return;
33
+ }
34
+ }
35
+ function validateSelection(validation, pieceType, config) {
36
+ (0, count_1.validateCount)(validation.count);
37
+ validateSelectionBanList(validation.banList || [], config.rosters[pieceType]);
38
+ for (const script of validation.customValidation) {
39
+ (0, script_1.validateUntrustedScript)(script, config);
40
+ }
41
+ }
42
+ function validateSelectionBanList(banList, roster) {
43
+ for (const pieceId of banList) {
44
+ if (!roster.find(p => p.id === pieceId)) {
45
+ throw new Error(`Ban list contains piece ${pieceId} which does not exist`);
46
+ }
47
+ }
48
+ }
49
+ //# sourceMappingURL=normal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normal.js","sourceRoot":"","sources":["../../../../../../../../src/match-lock-file/match-config/version-1/lock/selection/validate/selections/normal.ts"],"names":[],"mappings":";;;;;AAEA,sCAAoD;AACpD,oDAAyD;AAEzD,wBACE,SAAgC,EAChC,SAAoB,EACpB,MAA0B;IAE1B,0BAA0B,CAAC,SAAS,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAEzD,IAAG,YAAY,IAAI,SAAS,IAAI,SAAS,CAAC,UAAU,EAAC,CAAC;QACpD,iBAAiB,CAAC,SAAS,CAAC,UAAU,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IAC7D,CAAC;IACD,IAAG,SAAS,CAAC,cAAc,EAAC,CAAC;QAC3B,IAAA,gCAAuB,EAAC,SAAS,CAAC,cAAc,EAAE,MAAM,CAAC,CAAC;IAC5D,CAAC;AACH,CAAC;AAED,SAAS,0BAA0B,CACjC,SAAgC,EAChC,SAAoB,EACpB,MAA0B;IAE1B,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAClE,IAAG,eAAe,CAAC,iBAAiB,KAAK,WAAW,EAAC,CAAC;QACpD,IAAG,YAAY,IAAI,SAAS,IAAI,SAAS,CAAC,UAAU,EAAC,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,mBAAmB,SAAS,yBAAyB,CAAC,CAAC;QACzE,CAAC;QACD,IAAG,gBAAgB,IAAI,SAAS,IAAI,SAAS,CAAC,cAAc,EAAC,CAAC;YAC5D,MAAM,IAAI,KAAK,CAAC,mBAAmB,SAAS,gCAAgC,CAAC,CAAC;QAChF,CAAC;QACD,OAAO;IACT,CAAC;IAED,IAAG,eAAe,CAAC,iBAAiB,KAAK,QAAQ,EAAC,CAAC;QACjD,IAAG,CAAC,CAAC,gBAAgB,IAAI,SAAS,IAAI,SAAS,CAAC,cAAc,CAAC,EAAC,CAAC;YAC/D,MAAM,IAAI,KAAK,CAAC,gBAAgB,SAAS,8BAA8B,CAAC,CAAC;QAC3E,CAAC;QACD,OAAO;IACT,CAAC;AACH,CAAC;AAID,2BACE,UAA+B,EAC/B,SAAoB,EACpB,MAA0B;IAE1B,IAAA,qBAAa,EAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,wBAAwB,CAAC,UAAU,CAAC,OAAO,IAAI,EAAE,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC;IAC9E,KAAI,MAAM,MAAM,IAAI,UAAU,CAAC,gBAAgB,EAAC,CAAC;QAC/C,IAAA,gCAAuB,EAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1C,CAAC;AACH,CAAC;AAGD,kCACE,OAAsB,EACtB,MAA6C;IAE7C,KAAI,MAAM,OAAO,IAAI,OAAO,EAAC,CAAC;QAC5B,IAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,CAAC,EAAE,KAAK,OAAO,CAAC,EAAC,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,2BAA2B,OAAO,uBAAuB,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validatePreselected = validatePreselected;
4
+ const ensure_pieces_are_in_roster_1 = require("../../../../usage/validate-select/ensure-pieces-are-in-roster");
5
+ const PRESELECTABLE_STRATEGIES = ["shared", "personal"];
6
+ function validatePreselected(selections, pieceType, config) {
7
+ const { engine } = config;
8
+ const defintion = engine.pieceDefinitions[pieceType];
9
+ if (!PRESELECTABLE_STRATEGIES.includes(defintion.selectionStrategy)) {
10
+ throw new Error(`Piece type ${pieceType} is not preselectable`);
11
+ }
12
+ (0, ensure_pieces_are_in_roster_1.ensurePiecesAreInRoster)(config, pieceType, selections);
13
+ }
14
+ //# sourceMappingURL=preselected.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"preselected.js","sourceRoot":"","sources":["../../../../../../../../src/match-lock-file/match-config/version-1/lock/selection/validate/selections/preselected.ts"],"names":[],"mappings":";;;AAGA,+GAAwG;AAExG,MAAM,wBAAwB,GAAG,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;AACxD,6BACE,UAAgD,EAChD,SAAoB,EACpB,MAA0B;IAE1B,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IAC1B,MAAM,SAAS,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IACrD,IAAG,CAAC,wBAAwB,CAAC,QAAQ,CAAC,SAAS,CAAC,iBAAiB,CAAC,EAAC,CAAC;QAClE,MAAM,IAAI,KAAK,CAAC,cAAc,SAAS,uBAAuB,CAAC,CAAC;IAClE,CAAC;IACD,IAAA,qDAAuB,EAAC,MAAM,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC;AACzD,CAAC"}
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PATH_ROSTERLOCK_PIECE_INFO = void 0;
4
+ exports.PATH_ROSTERLOCK_PIECE_INFO = "rosterlock.piece-info.json";
5
+ //# sourceMappingURL=file-paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-paths.js","sourceRoot":"","sources":["../../../../../src/match-lock-file/match-config/version-1/piece-info/file-paths.ts"],"names":[],"mappings":";;;AACa,QAAA,0BAA0B,GAAG,4BAA4B,CAAA"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ROSTERLOCK_V1_PIECEINFO_CASTER_JSONSCHEMA = void 0;
18
+ const json_schema_1 = require("../../../util-types/json-schema");
19
+ const keywords_1 = require("./keywords");
20
+ const schema_1 = require("./schema");
21
+ exports.ROSTERLOCK_V1_PIECEINFO_CASTER_JSONSCHEMA = new json_schema_1.JSONSchemaCaster(schema_1.rosterLockPieceInfoSchema, keywords_1.rosterLockPieceInfoKeywords);
22
+ __exportStar(require("./file-paths"), exports);
23
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/match-lock-file/match-config/version-1/piece-info/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,iEAAmE;AAInE,yCAAyD;AAEzD,qCAAqD;AAExC,QAAA,yCAAyC,GAAG,IAAI,8BAAgB,CAC3E,kCAAyB,EACzB,sCAA2B,CAC5B,CAAC;AAEF,+CAA4B"}
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rosterLockPieceInfoKeywords = void 0;
4
+ const human_1 = require("../lock/rosters/caster-json-schema/human");
5
+ const downloadableSources_1 = require("../lock/rosters/caster-json-schema/downloadableSources");
6
+ const pathVariables_1 = require("../lock/rosters/caster-json-schema/pathVariables");
7
+ const json_schema_1 = require("../../../util-types/json-schema");
8
+ function ignore() { return true; }
9
+ exports.rosterLockPieceInfoKeywords = [
10
+ human_1.urlSchemaValidator,
11
+ human_1.friendlyStringSchemaValidator,
12
+ downloadableSources_1.downloadableSourceListSchemaValidator,
13
+ (0, json_schema_1.defineKeyword)({
14
+ keyword: pathVariables_1.pathVariableNameSchemaValidator.keyword,
15
+ type: pathVariables_1.pathVariableNameSchemaValidator.type,
16
+ validate: ignore,
17
+ }),
18
+ (0, json_schema_1.defineKeyword)({
19
+ keyword: pathVariables_1.pathVariableValueSchemaValidator.keyword,
20
+ type: pathVariables_1.pathVariableValueSchemaValidator.type,
21
+ validate: ignore,
22
+ }),
23
+ (0, json_schema_1.defineKeyword)({
24
+ keyword: pathVariables_1.allPathVariableNameSetSchemaValidator.keyword,
25
+ type: pathVariables_1.allPathVariableNameSetSchemaValidator.type,
26
+ validate: ignore,
27
+ }),
28
+ ];
29
+ //# sourceMappingURL=keywords.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keywords.js","sourceRoot":"","sources":["../../../../../src/match-lock-file/match-config/version-1/piece-info/keywords.ts"],"names":[],"mappings":";;;AACA,oEAGkD;AAClD,gGAEgE;AAChE,oFAI0D;AAE1D,iEAAgE;AAEhE,SAAS,MAAM,KAAI,OAAO,IAAI,CAAC,CAAC,CAAC;AAEpB,QAAA,2BAA2B,GAAG;IACzC,0BAAkB;IAClB,qCAA6B;IAE7B,2DAAqC;IACrC,IAAA,2BAAa,EAAC;QACZ,OAAO,EAAE,+CAA+B,CAAC,OAAO;QAChD,IAAI,EAAE,+CAA+B,CAAC,IAAI;QAC1C,QAAQ,EAAE,MAAM;KACjB,CAAC;IACF,IAAA,2BAAa,EAAC;QACZ,OAAO,EAAE,gDAAgC,CAAC,OAAO;QACjD,IAAI,EAAE,gDAAgC,CAAC,IAAI;QAC3C,QAAQ,EAAE,MAAM;KACjB,CAAC;IACF,IAAA,2BAAa,EAAC;QACZ,OAAO,EAAE,qDAAqC,CAAC,OAAO;QACtD,IAAI,EAAE,qDAAqC,CAAC,IAAI;QAChD,QAAQ,EAAE,MAAM;KACjB,CAAC;CACH,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rosterLockPieceInfoSchema = void 0;
4
+ const human_1 = require("../lock/rosters/caster-json-schema/human");
5
+ const downloadableSources_1 = require("../lock/rosters/caster-json-schema/downloadableSources");
6
+ const pathVariables_1 = require("../lock/rosters/caster-json-schema/pathVariables");
7
+ const shared_1 = require("../shared");
8
+ exports.rosterLockPieceInfoSchema = {
9
+ type: "object",
10
+ required: ["configIdentity", "humanInfo", "downloadSources", "pathVariables"],
11
+ additionalProperties: false,
12
+ properties: {
13
+ configIdentity: (0, shared_1.buildIdentity)("piece-info", 1),
14
+ humanInfo: human_1.humanInfoSchema,
15
+ downloadSources: downloadableSources_1.downloadableSourcesSchema,
16
+ pathVariables: pathVariables_1.pathVariablesSchema,
17
+ },
18
+ };
19
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../src/match-lock-file/match-config/version-1/piece-info/schema.ts"],"names":[],"mappings":";;;AACA,oEAA2E;AAC3E,gGAEgE;AAChE,oFAE0D;AAM1D,sCAA0C;AAG7B,QAAA,yBAAyB,GAA0C;IAC9E,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,CAAC,gBAAgB,EAAE,WAAW,EAAE,iBAAiB,EAAE,eAAe,CAAC;IAC7E,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,cAAc,EAAE,IAAA,sBAAa,EAAC,YAAY,EAAE,CAAC,CAAC;QAE9C,SAAS,EAAE,uBAAe;QAC1B,eAAe,EAAE,+CAAyB;QAC1C,aAAa,EAAE,mCAAmB;KACnC;CACF,CAAA"}