@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,94 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.validatePieceMeta = validatePieceMeta;
7
+ exports.validatePieceMetaConfig = validatePieceMetaConfig;
8
+ exports.validateMetaDefaultValue = validateMetaDefaultValue;
9
+ exports.validateMetaForPiece = validateMetaForPiece;
10
+ const ajv_1 = __importDefault(require("ajv"));
11
+ const utils_1 = require("@roster-lock/utils");
12
+ function validatePieceMeta(config) {
13
+ for (const [pieceType, meta] of Object.entries(config.pieceMeta)) {
14
+ validatePieceMetaConfig(meta, pieceType, config);
15
+ }
16
+ }
17
+ function validatePieceMetaConfig(meta, pieceType, { engine, rosters }) {
18
+ const pieceDefinition = engine.pieceDefinitions[pieceType];
19
+ if (!pieceDefinition) {
20
+ throw new Error(`Piece type ${pieceType} is not defined in engine`);
21
+ }
22
+ const roster = rosters[pieceType];
23
+ if (!roster) {
24
+ throw new Error(`Piece type ${pieceType} is not defined in roster`);
25
+ }
26
+ validateMetaDefaultValue(meta.schema, meta.defaultMeta);
27
+ for (const [pieceId, pieceValue] of Object.entries(meta.values)) {
28
+ validateMetaForPiece(meta.schema, pieceId, pieceValue, roster);
29
+ }
30
+ }
31
+ function simpleSchemaToJSONSchemaType(schema) {
32
+ const required = [];
33
+ const properties = {};
34
+ for (const [key, value] of Object.entries(schema)) {
35
+ required.push(key);
36
+ switch (value) {
37
+ case "boolean":
38
+ properties[key] = { type: "boolean" };
39
+ break;
40
+ case "number":
41
+ properties[key] = { type: "number" };
42
+ break;
43
+ case "string":
44
+ properties[key] = { type: "string" };
45
+ break;
46
+ case "boolean[]":
47
+ properties[key] = { type: "array", items: { type: "boolean" } };
48
+ break;
49
+ case "number[]":
50
+ properties[key] = { type: "array", items: { type: "number" } };
51
+ break;
52
+ case "string[]":
53
+ properties[key] = { type: "array", items: { type: "string" } };
54
+ break;
55
+ }
56
+ }
57
+ const jsonSchema = {
58
+ type: "object",
59
+ required,
60
+ additionalProperties: false,
61
+ properties,
62
+ };
63
+ return jsonSchema;
64
+ }
65
+ function validateMetaDefaultValue(simpleSchema, meta) {
66
+ const metaSchema = simpleSchemaToJSONSchemaType(simpleSchema);
67
+ const defaultMeta = Object.keys(meta);
68
+ if (defaultMeta.length !== metaSchema.required.length) {
69
+ throw new Error(`Piece meta default meta must have all required keys`);
70
+ }
71
+ for (const key of metaSchema.required) {
72
+ if (!defaultMeta.includes(key)) {
73
+ throw new Error(`Piece meta default meta must have all required keys`);
74
+ }
75
+ }
76
+ const ajv = new ajv_1.default();
77
+ if (!ajv.validate(metaSchema, meta)) {
78
+ throw new Error(`Piece meta default meta does not match schema`);
79
+ }
80
+ }
81
+ function validateMetaForPiece(simpleSchema, pieceId, meta, roster) {
82
+ const metaSchema = simpleSchemaToJSONSchemaType(simpleSchema);
83
+ const piece = roster.find(p => p.id === pieceId);
84
+ if (!piece) {
85
+ throw new Error(`Piece meta references piece ${pieceId} which is not in the roster`);
86
+ }
87
+ const cloned = (0, utils_1.cloneJSON)(metaSchema);
88
+ cloned.required = [];
89
+ const ajv = new ajv_1.default();
90
+ if (!ajv.validate(cloned, meta)) {
91
+ throw new Error(`Piece meta does not match schema`);
92
+ }
93
+ }
94
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/piece-meta/validate/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8CAA0C;AAI1C,8CAA+C;AAE/C,2BACE,MAA0B;IAE1B,KAAI,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAC,CAAC;QAC/D,uBAAuB,CAAC,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;IACnD,CAAC;AACH,CAAC;AAED,iCACE,IAA6B,EAC7B,SAAoB,EACpB,EAAE,MAAM,EAAE,OAAO,EAAsB;IAEvC,MAAM,eAAe,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC3D,IAAG,CAAC,eAAe,EAAC,CAAC;QACnB,MAAM,IAAI,KAAK,CAAC,cAAc,SAAS,2BAA2B,CAAC,CAAC;IACtE,CAAC;IACD,MAAM,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAClC,IAAG,CAAC,MAAM,EAAC,CAAC;QACV,MAAM,IAAI,KAAK,CAAC,cAAc,SAAS,2BAA2B,CAAC,CAAC;IACtE,CAAC;IAED,wBAAwB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;IAExD,KAAI,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAC,CAAC;QAC9D,oBAAoB,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;AACH,CAAC;AAED,SAAS,4BAA4B,CAAC,MAAyC;IAC7E,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,MAAM,UAAU,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;IACtD,CAAC;AACH,CAAC"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.downloadableSourcesSchema = exports.downloadableSourceListSchemaValidator = void 0;
4
+ const json_schema_1 = require("../../../../../util-types/json-schema");
5
+ const validate_1 = require("../validate");
6
+ exports.downloadableSourceListSchemaValidator = (0, json_schema_1.defineKeyword)({
7
+ keyword: "rosterDownloadableSourceList",
8
+ type: "array",
9
+ validate: validate_1.validateDownloadableSourceList
10
+ });
11
+ exports.downloadableSourcesSchema = {
12
+ type: "array",
13
+ [exports.downloadableSourceListSchemaValidator.keyword]: true,
14
+ items: {
15
+ type: "string",
16
+ },
17
+ };
18
+ //# sourceMappingURL=downloadableSources.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"downloadableSources.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/downloadableSources.ts"],"names":[],"mappings":";;;AAGA,uEAAsE;AAEtE,0CAEqB;AAER,QAAA,qCAAqC,GAAG,IAAA,2BAAa,EAAC;IACjE,OAAO,EAAE,8BAA8B;IACvC,IAAI,EAAE,OAAO;IACb,QAAQ,EAAE,yCAA8B;CACzC,CAAC,CAAC;AAGU,QAAA,yBAAyB,GAAuD;IAC3F,IAAI,EAAE,OAAO;IACb,CAAC,QAAA,qCAAqC,CAAC,OAAO,CAAC,EAAE,IAAI;IACrD,KAAK,EAAE;QACL,IAAI,EAAE,QAAQ;KACf;CACF,CAAC"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.humanInfoSchema = exports.friendlyStringSchemaValidator = exports.urlSchemaValidator = void 0;
4
+ const json_schema_1 = require("../../../../../util-types/json-schema");
5
+ const validate_1 = require("../validate");
6
+ exports.urlSchemaValidator = (0, json_schema_1.defineKeyword)({
7
+ keyword: "URL",
8
+ type: "string",
9
+ validate: validate_1.validateURL
10
+ });
11
+ const human_1 = require("../validate/human");
12
+ exports.friendlyStringSchemaValidator = (0, json_schema_1.defineKeyword)({
13
+ keyword: "friendlyString",
14
+ type: "string",
15
+ validate: human_1.validateFriendlyString
16
+ });
17
+ exports.humanInfoSchema = {
18
+ type: "object",
19
+ additionalProperties: false,
20
+ required: ["name", "author", "url"],
21
+ properties: {
22
+ name: { type: "string", [exports.friendlyStringSchemaValidator.keyword]: true },
23
+ author: { type: "string", [exports.friendlyStringSchemaValidator.keyword]: true },
24
+ url: { type: "string", [exports.urlSchemaValidator.keyword]: true },
25
+ image: { type: "string", [exports.urlSchemaValidator.keyword]: true, nullable: true },
26
+ },
27
+ };
28
+ //# sourceMappingURL=human.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/human.ts"],"names":[],"mappings":";;;AAGA,uEAAsE;AAGtE,0CAA0C;AAC7B,QAAA,kBAAkB,GAAG,IAAA,2BAAa,EAAC;IAC9C,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,sBAAW;CACtB,CAAC,CAAC;AAEH,6CAA2D;AAC9C,QAAA,6BAA6B,GAAG,IAAA,2BAAa,EAAC;IACzD,OAAO,EAAE,gBAAgB;IACzB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,8BAAsB;CACjC,CAAC,CAAC;AAGU,QAAA,eAAe,GAAiD;IAC3E,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC;IACnC,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,QAAA,6BAA6B,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE;QACvE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,QAAA,6BAA6B,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE;QACzE,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,QAAA,kBAAkB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE;QAC3D,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,QAAA,kBAAkB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC9E;CACF,CAAA"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.idSchema = exports.idUniquenessSchemaValidator = exports.idSchemaValidator = void 0;
4
+ const json_schema_1 = require("../../../../../util-types/json-schema");
5
+ const validate_1 = require("../validate");
6
+ exports.idSchemaValidator = (0, json_schema_1.defineKeyword)({
7
+ keyword: "rosterPieceId",
8
+ type: "string",
9
+ validate: validate_1.validatePieceId
10
+ });
11
+ exports.idUniquenessSchemaValidator = (0, json_schema_1.defineKeyword)({
12
+ keyword: "rosterPieceIdUniqueness",
13
+ type: "string",
14
+ validate: function (id, { rosters }, path) {
15
+ const pathParts = path.split("/");
16
+ const pieceIndex = Number(pathParts.at(-2));
17
+ if (Number.isNaN(pieceIndex))
18
+ throw new Error(`Invalid path: pieceIndex ${pieceIndex} is not a number`);
19
+ const pieceType = pathParts.at(-3);
20
+ if (!pieceType)
21
+ throw new Error("Invalid path: no pieceType");
22
+ const pieceList = rosters[pieceType];
23
+ (0, validate_1.validatePieceIdUniqueness)(id, pieceIndex, pieceList);
24
+ }
25
+ });
26
+ exports.idSchema = {
27
+ type: "string",
28
+ [exports.idSchemaValidator.keyword]: true,
29
+ [exports.idUniquenessSchemaValidator.keyword]: true,
30
+ };
31
+ //# sourceMappingURL=id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/id.ts"],"names":[],"mappings":";;;AAEA,uEAAsE;AACtE,0CAAyE;AAI5D,QAAA,iBAAiB,GAAG,IAAA,2BAAa,EAAC;IAC7C,OAAO,EAAE,eAAe;IACxB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,0BAAe;CAC1B,CAAC,CAAC;AAEU,QAAA,2BAA2B,GAAG,IAAA,2BAAa,EAAC;IACvD,OAAO,EAAE,yBAAyB;IAClC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,UAAU,EAAU,EAAE,EAAE,OAAO,EAAsB,EAAE,IAAI;QAEnE,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAClC,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5C,IAAG,MAAM,CAAC,KAAK,CAAC,UAAU,CAAC;YAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,UAAU,kBAAkB,CAAC,CAAC;QACvG,MAAM,SAAS,GAAG,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACnC,IAAG,CAAC,SAAS;YAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;QAC7D,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QACrC,IAAA,oCAAyB,EAAC,EAAE,EAAE,UAAU,EAAE,SAAS,CAAC,CAAC;IACvD,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,QAAQ,GAA2B;IAC9C,IAAI,EAAE,QAAQ;IACd,CAAC,QAAA,iBAAiB,CAAC,OAAO,CAAC,EAAE,IAAI;IACjC,CAAC,QAAA,2BAA2B,CAAC,OAAO,CAAC,EAAE,IAAI;CAC5C,CAAA"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rosterKeywords = exports.rostersSchema = exports.rosterLockPiece = void 0;
4
+ const json_schema_1 = require("../../../../../util-types/json-schema");
5
+ const id_1 = require("./id");
6
+ const version_1 = require("./version");
7
+ const human_1 = require("./human");
8
+ const downloadableSources_1 = require("./downloadableSources");
9
+ const pathVariables_1 = require("./pathVariables");
10
+ const requiresPieces_1 = require("./requiresPieces");
11
+ const pieceTypeInEngineSchemaValidator = (0, json_schema_1.defineKeyword)({
12
+ keyword: "rosterPieceTypeInEngine",
13
+ type: "object",
14
+ validate: function (piece, { engine }, path) {
15
+ const pieceType = path.split("/").at(-2);
16
+ if (!pieceType)
17
+ throw new Error("Invalid path");
18
+ (0, validate_1.validatePieceInEngine)(pieceType, engine);
19
+ }
20
+ });
21
+ exports.rosterLockPiece = {
22
+ type: "object",
23
+ [pieceTypeInEngineSchemaValidator.keyword]: true,
24
+ required: ["id", "version", "humanInfo", "downloadSources", "pathVariables", "requiredPieces"],
25
+ additionalProperties: false,
26
+ properties: {
27
+ id: id_1.idSchema,
28
+ version: version_1.versionSchema,
29
+ humanInfo: human_1.humanInfoSchema,
30
+ downloadSources: downloadableSources_1.downloadableSourcesSchema,
31
+ pathVariables: pathVariables_1.pathVariablesSchema,
32
+ requiredPieces: requiresPieces_1.requiredPiecesSchema,
33
+ },
34
+ };
35
+ const validate_1 = require("../validate");
36
+ const allPieceTypesInEngineSchemaValidator = (0, json_schema_1.defineKeyword)({
37
+ keyword: "allEnginePieceTypesInRoster",
38
+ type: "object",
39
+ validate: function (rosters, { engine }, path) {
40
+ (0, validate_1.validateAllEnginePiecesDefined)(rosters, engine);
41
+ }
42
+ });
43
+ exports.rostersSchema = {
44
+ type: "object",
45
+ [allPieceTypesInEngineSchemaValidator.keyword]: true,
46
+ required: [],
47
+ additionalProperties: {
48
+ type: "array",
49
+ items: exports.rosterLockPiece,
50
+ },
51
+ };
52
+ exports.rosterKeywords = [
53
+ downloadableSources_1.downloadableSourceListSchemaValidator,
54
+ human_1.urlSchemaValidator,
55
+ human_1.friendlyStringSchemaValidator,
56
+ id_1.idSchemaValidator,
57
+ id_1.idUniquenessSchemaValidator,
58
+ pathVariables_1.pathVariableNameSchemaValidator,
59
+ pathVariables_1.pathVariableValueSchemaValidator,
60
+ pathVariables_1.allPathVariableNameSetSchemaValidator,
61
+ requiresPieces_1.allRequiredPieceTypesSetSchemaValidator,
62
+ requiresPieces_1.requiredPieceValueSchemaValidator,
63
+ requiresPieces_1.requiredPieceTypeSchemaValidator,
64
+ version_1.sha256SchemaValidator,
65
+ allPieceTypesInEngineSchemaValidator,
66
+ pieceTypeInEngineSchemaValidator,
67
+ ];
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/index.ts"],"names":[],"mappings":";;;AACA,uEAAsE;AAItE,6BAAgF;AAChF,uCAAiE;AACjE,mCAA6F;AAC7F,+DAG+B;AAC/B,mDAKyB;AACzB,qDAK0B;AAG1B,MAAM,gCAAgC,GAAG,IAAA,2BAAa,EAAC;IACrD,OAAO,EAAE,yBAAyB;IAClC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,UAAU,KAAsB,EAAE,EAAE,MAAM,EAAsB,EAAE,IAAI;QAE9E,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,gCAAqB,EAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,eAAe,GAAoC;IAC9D,IAAI,EAAE,QAAQ;IACd,CAAC,gCAAgC,CAAC,OAAO,CAAC,EAAE,IAAI;IAChD,QAAQ,EAAE,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,CAAC;IAC9F,oBAAoB,EAAE,KAAK;IAC3B,UAAU,EAAE;QACV,EAAE,EAAE,aAAQ;QACZ,OAAO,EAAE,uBAAa;QACtB,SAAS,EAAE,uBAAe;QAC1B,eAAe,EAAE,+CAAyB;QAC1C,aAAa,EAAE,mCAAmB;QAClC,cAAc,EAAE,qCAAoB;KACrC;CACF,CAAC;AAGF,0CAAoF;AACpF,MAAM,oCAAoC,GAAG,IAAA,2BAAa,EAAC;IACzD,OAAO,EAAE,6BAA6B;IACtC,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,UAAU,OAAsC,EAAE,EAAE,MAAM,EAAsB,EAAE,IAAI;QAC9F,IAAA,yCAA8B,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAClD,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,aAAa,GAAkD;IAC1E,IAAI,EAAE,QAAQ;IACd,CAAC,oCAAoC,CAAC,OAAO,CAAC,EAAE,IAAI;IACpD,QAAQ,EAAE,EAAE;IACZ,oBAAoB,EAAE;QACpB,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,QAAA,eAAe;KACvB;CACF,CAAC;AAGW,QAAA,cAAc,GAAG;IAE5B,2DAAqC;IAGrC,0BAAkB;IAClB,qCAA6B;IAG7B,sBAAiB;IACjB,gCAA2B;IAG3B,+CAA+B;IAC/B,gDAAgC;IAChC,qDAAqC;IAGrC,wDAAuC;IACvC,kDAAiC;IACjC,iDAAgC;IAGhC,+BAAqB;IAIrB,oCAAoC;IACpC,gCAAgC;CACjC,CAAC"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.pathVariablesSchema = exports.allPathVariableNameSetSchemaValidator = exports.pathVariableValueSchemaValidator = exports.pathVariableNameSchemaValidator = void 0;
4
+ const json_schema_1 = require("../../../../../util-types/json-schema");
5
+ const validate_1 = require("../validate");
6
+ exports.pathVariableNameSchemaValidator = (0, json_schema_1.defineKeyword)({
7
+ keyword: "rosterPathVariableName",
8
+ type: "string",
9
+ validate: function (pathVariableValue, { engine }, path) {
10
+ const pathParts = path.split("/");
11
+ const variableName = pathParts.at(-1);
12
+ if (!variableName)
13
+ throw new Error(`Invalid variable name path`);
14
+ const pieceType = pathParts.at(-4);
15
+ if (!pieceType)
16
+ throw new Error(`Invalid piece type path`);
17
+ const pieceDefinition = engine.pieceDefinitions[pieceType];
18
+ (0, validate_1.validatePathVariableNameIsExpected)(variableName, pieceDefinition);
19
+ }
20
+ });
21
+ exports.pathVariableValueSchemaValidator = (0, json_schema_1.defineKeyword)({
22
+ keyword: "rosterPathVariableValue",
23
+ type: "string",
24
+ validate: function (pathVariableValue, { engine }, path) {
25
+ (0, validate_1.validatePathVariableValue)(pathVariableValue);
26
+ }
27
+ });
28
+ exports.allPathVariableNameSetSchemaValidator = (0, json_schema_1.defineKeyword)({
29
+ keyword: "rosterAllPathVariableNameSet",
30
+ type: "object",
31
+ validate: function (pathVariables, { engine }, path) {
32
+ const pieceType = path.split("/").at(-3);
33
+ if (!pieceType)
34
+ throw new Error(`Invalid piece type path`);
35
+ const pieceDefinition = engine.pieceDefinitions[pieceType];
36
+ (0, validate_1.validateAllExpectedPathVariableNamesSet)(pathVariables, pieceDefinition);
37
+ }
38
+ });
39
+ exports.pathVariablesSchema = {
40
+ type: "object",
41
+ [exports.allPathVariableNameSetSchemaValidator.keyword]: true,
42
+ required: [],
43
+ additionalProperties: {
44
+ type: "string",
45
+ [exports.pathVariableNameSchemaValidator.keyword]: true,
46
+ [exports.pathVariableValueSchemaValidator.keyword]: true,
47
+ },
48
+ };
49
+ //# sourceMappingURL=pathVariables.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pathVariables.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/pathVariables.ts"],"names":[],"mappings":";;;AAGA,uEAAsE;AACtE,0CAIqB;AAER,QAAA,+BAA+B,GAAG,IAAA,2BAAa,EAAC;IAC3D,OAAO,EAAE,wBAAwB;IACjC,IAAI,EAAE,QAAQ;IACd,QAAQ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3D,IAAA,kDAAuC,EAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IAC1E,CAAC;CACF,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAqD;IACnF,IAAI,EAAE,QAAQ;IACd,CAAC,QAAA,qCAAqC,CAAC,OAAO,CAAC,EAAE,IAAI;IACrD,QAAQ,EAAE,EAAE;IACZ,oBAAoB,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,CAAC,QAAA,+BAA+B,CAAC,OAAO,CAAC,EAAE,IAAI;QAC/C,CAAC,QAAA,gCAAgC,CAAC,OAAO,CAAC,EAAE,IAAI;KACjD;CACF,CAAA"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.requiredPiecesSchema = exports.requiredPieceTypeSchemaValidator = exports.requiredPieceValueSchemaValidator = exports.allRequiredPieceTypesSetSchemaValidator = void 0;
4
+ const json_schema_1 = require("../../../../../util-types/json-schema");
5
+ const validate_1 = require("../validate");
6
+ exports.allRequiredPieceTypesSetSchemaValidator = (0, json_schema_1.defineKeyword)({
7
+ keyword: "rosterAllRequiredPieceTypesSet",
8
+ type: "object",
9
+ validate: function (requiredPieces, { engine }, path) {
10
+ const pieceType = path.split("/").at(-3);
11
+ if (!pieceType)
12
+ throw new Error("Invalid path");
13
+ const pieceDefinition = engine.pieceDefinitions[pieceType];
14
+ (0, validate_1.validateAllExpectedRequiredPieceTypesSet)(requiredPieces, pieceDefinition);
15
+ }
16
+ });
17
+ exports.requiredPieceValueSchemaValidator = (0, json_schema_1.defineKeyword)({
18
+ keyword: "rosterRequiredPieceValue",
19
+ type: "string",
20
+ validate: function (requiredPiece, { rosters }, path) {
21
+ const pathParts = path.split("/");
22
+ pathParts.pop();
23
+ const pieceType = pathParts.at(-2);
24
+ if (!pieceType)
25
+ throw new Error("Invalid path");
26
+ const pieceValues = rosters[pieceType];
27
+ (0, validate_1.validateRequiredPieceValue)(pieceType, requiredPiece, pieceValues);
28
+ }
29
+ });
30
+ exports.requiredPieceTypeSchemaValidator = (0, json_schema_1.defineKeyword)({
31
+ keyword: "rosterRequiredPieceType",
32
+ type: "object",
33
+ validate: function (requiredPiece, config, path) {
34
+ const pathParts = path.split("/");
35
+ const pieceType = pathParts.at(-1);
36
+ if (!pieceType)
37
+ throw new Error("Invalid path");
38
+ (0, validate_1.validateRequiredPieceType)(pieceType, config);
39
+ }
40
+ });
41
+ exports.requiredPiecesSchema = {
42
+ type: "object",
43
+ [exports.allRequiredPieceTypesSetSchemaValidator.keyword]: true,
44
+ required: [],
45
+ additionalProperties: {
46
+ type: "object",
47
+ [exports.requiredPieceTypeSchemaValidator.keyword]: true,
48
+ required: ["expected", "selectable"],
49
+ additionalProperties: false,
50
+ properties: {
51
+ expected: {
52
+ type: "array",
53
+ items: {
54
+ type: "string",
55
+ [exports.requiredPieceValueSchemaValidator.keyword]: true,
56
+ },
57
+ },
58
+ selectable: { type: "boolean" },
59
+ },
60
+ }
61
+ };
62
+ //# sourceMappingURL=requiresPieces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requiresPieces.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/caster-json-schema/requiresPieces.ts"],"names":[],"mappings":";;;AAGA,uEAAsE;AACtE,0CAIqB;AAER,QAAA,uCAAuC,GAAG,IAAA,2BAAa,EAAC;IACnE,OAAO,EAAE,gCAAgC;IACzC,IAAI,EAAE,QAAQ;IAEd,QAAQ,EAAE,UAAU,cAAc,EAAE,EAAE,MAAM,EAAsB,EAAE,IAAI;QACtE,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,eAAe,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC3D,IAAA,mDAA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,oBAAoB,EAAE;QACpB,IAAI,EAAE,QAAQ;QACd,CAAC,QAAA,gCAAgC,CAAC,OAAO,CAAC,EAAE,IAAI;QAChD,QAAQ,EAAE,CAAC,UAAU,EAAE,YAAY,CAAC;QACpC,oBAAoB,EAAE,KAAK;QAC3B,UAAU,EAAE;YACV,QAAQ,EAAE;gBACR,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,CAAC,QAAA,iCAAiC,CAAC,OAAO,CAAC,EAAE,IAAI;iBAClD;aACF;YACD,UAAU,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;SAChC;KACF;CACF,CAAC"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.versionSchema = exports.sha256SchemaValidator = void 0;
4
+ const json_schema_1 = require("../../../../../util-types/json-schema");
5
+ const validate_1 = require("../validate");
6
+ exports.sha256SchemaValidator = (0, json_schema_1.defineKeyword)({
7
+ keyword: "sha256",
8
+ type: "string",
9
+ validate: validate_1.validateSha256
10
+ });
11
+ exports.versionSchema = {
12
+ type: "object",
13
+ additionalProperties: false,
14
+ required: ["logic", "media", "docs"],
15
+ properties: {
16
+ logic: { type: "string", [exports.sha256SchemaValidator.keyword]: true },
17
+ media: { type: "string", [exports.sha256SchemaValidator.keyword]: true },
18
+ docs: { type: "string", [exports.sha256SchemaValidator.keyword]: true },
19
+ },
20
+ };
21
+ //# 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/caster-json-schema/version.ts"],"names":[],"mappings":";;;AAGA,uEAAsE;AAEtE,0CAA6C;AAChC,QAAA,qBAAqB,GAAG,IAAA,2BAAa,EAAC;IACjD,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,yBAAc;CACzB,CAAC,CAAC;AAEU,QAAA,aAAa,GAA+C;IACvE,IAAI,EAAE,QAAQ;IACd,oBAAoB,EAAE,KAAK;IAC3B,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC;IACpC,UAAU,EAAE;QACV,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,QAAA,qBAAqB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE;QAChE,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,QAAA,qBAAqB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE;QAChE,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,QAAA,qBAAqB,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE;KAChE;CACF,CAAA"}
@@ -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/rosters/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,6CAA2B;AAC3B,uDAAqC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateDownloadableSourceList = validateDownloadableSourceList;
4
+ function validateDownloadableSourceList(sources) {
5
+ if (sources.length === 0)
6
+ throw new Error("Expecting at least 1 source");
7
+ if (new Set(sources).size !== sources.length)
8
+ throw new Error("Has duplicate sources");
9
+ }
10
+ //# sourceMappingURL=downloadable-source.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"downloadable-source.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/validate/downloadable-source.ts"],"names":[],"mappings":";;;AAEA,wCAA+C,OAAsB;IACnE,IAAG,OAAO,CAAC,MAAM,KAAK,CAAC;QACrB,MAAM,IAAI,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACjD,IAAG,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,KAAK,OAAO,CAAC,MAAM;QACzC,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;AAC7C,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateHumanInfo = validateHumanInfo;
4
+ exports.validateFriendlyString = validateFriendlyString;
5
+ const utils_1 = require("./utils");
6
+ function validateHumanInfo(humanInfo) {
7
+ validateFriendlyString(humanInfo.name);
8
+ validateFriendlyString(humanInfo.author);
9
+ (0, utils_1.validateURL)(humanInfo.url);
10
+ if (humanInfo.image)
11
+ (0, utils_1.validateURL)(humanInfo.image);
12
+ }
13
+ function validateFriendlyString(value) {
14
+ if (!value.trim())
15
+ throw new Error("String is required");
16
+ if (value.length > 100)
17
+ throw new Error("String is too long");
18
+ if (value.length < 3)
19
+ throw new Error("String is too short");
20
+ if (value.includes('\0'))
21
+ throw new Error("ID contains null character");
22
+ if (/[\x00-\x1F\x7F-\x9F]/.test(value))
23
+ throw new Error("ID contains control character");
24
+ if (/[\r\n\t\v\f]/.test(value))
25
+ throw new Error("ID contains whitespace character");
26
+ }
27
+ //# sourceMappingURL=human.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"human.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/validate/human.ts"],"names":[],"mappings":";;;;AACA,mCAAsC;AAGtC,2BACE,SAAgE;IAEhE,sBAAsB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACvC,sBAAsB,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC;IACzC,IAAA,mBAAW,EAAC,SAAS,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAG,SAAS,CAAC,KAAK;QAAE,IAAA,mBAAW,EAAC,SAAS,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC;AAED,gCAAuC,KAAa;IAClD,IAAG,CAAC,KAAK,CAAC,IAAI,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxD,IAAG,KAAK,CAAC,MAAM,GAAG,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IAC7D,IAAG,KAAK,CAAC,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAE5D,IAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACvE,IAAG,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACxF,IAAI,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;AACtF,CAAC"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validatePieceId = validatePieceId;
4
+ exports.validatePieceIdUniqueness = validatePieceIdUniqueness;
5
+ function validatePieceId(id) {
6
+ if (id.length === 0)
7
+ throw new Error("ID is empty");
8
+ if (id.length > 128)
9
+ throw new Error("ID is too long");
10
+ if (id !== id.trim())
11
+ throw new Error("ID contains a trailing or leading space");
12
+ if (id.includes('\0'))
13
+ throw new Error("ID contains null character");
14
+ if (/[\x00-\x1F\x7F-\x9F]/.test(id))
15
+ throw new Error("ID contains control character");
16
+ if (/[\r\n\t\v\f]/.test(id))
17
+ throw new Error("ID contains whitespace character");
18
+ }
19
+ function validatePieceIdUniqueness(id, index, rosters) {
20
+ for (let i = 0; i < rosters.length; i++) {
21
+ if (i === index)
22
+ continue;
23
+ if (rosters[i].id === id)
24
+ throw new Error(`Duplicate ID ${id}`);
25
+ }
26
+ }
27
+ //# sourceMappingURL=id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/validate/id.ts"],"names":[],"mappings":";;;;AAEA,yBAAgC,EAAU;IACxC,IAAG,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;IACnD,IAAG,EAAE,CAAC,MAAM,GAAG,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC;IACtD,IAAG,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;IAEhF,IAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IACpE,IAAG,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACrF,IAAI,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;AACnF,CAAC;AAED,mCACE,EAAU,EAAE,KAAa,EAAE,OAA8C;IAEzE,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,EAAE,KAAK,EAAE;YAAE,MAAM,IAAI,KAAK,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAC;IACjE,CAAC;AACH,CAAC"}
@@ -0,0 +1,74 @@
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.validateRosterLockPieces = validateRosterLockPieces;
18
+ exports.validateAllEnginePiecesDefined = validateAllEnginePiecesDefined;
19
+ exports.validatePieceInEngine = validatePieceInEngine;
20
+ __exportStar(require("./id"), exports);
21
+ __exportStar(require("./downloadable-source"), exports);
22
+ __exportStar(require("./human"), exports);
23
+ __exportStar(require("./path-variables"), exports);
24
+ __exportStar(require("./required-pieces"), exports);
25
+ __exportStar(require("./utils"), exports);
26
+ __exportStar(require("./version"), exports);
27
+ const version_1 = require("./version");
28
+ const human_1 = require("./human");
29
+ const downloadable_source_1 = require("./downloadable-source");
30
+ const path_variables_1 = require("./path-variables");
31
+ const required_pieces_1 = require("./required-pieces");
32
+ const id_1 = require("./id");
33
+ function validateRosterLockPieces(config) {
34
+ const { engine, rosters } = config;
35
+ validateAllEnginePiecesDefined(rosters, engine);
36
+ for (const [pieceType, pieceList] of Object.entries(rosters)) {
37
+ for (let i = 0; i < pieceList.length; i++) {
38
+ const piece = pieceList[i];
39
+ validatePieceInEngine(pieceType, engine);
40
+ const pieceConfig = engine.pieceDefinitions[pieceType];
41
+ (0, id_1.validatePieceId)(piece.id);
42
+ (0, id_1.validatePieceIdUniqueness)(piece.id, i, pieceList);
43
+ (0, version_1.validateVersions)(piece.version);
44
+ (0, version_1.validateVersionUniqueness)(piece.version, i, pieceList);
45
+ (0, human_1.validateHumanInfo)(piece.humanInfo);
46
+ (0, downloadable_source_1.validateDownloadableSourceList)(piece.downloadSources);
47
+ (0, path_variables_1.validateAllExpectedPathVariableNamesSet)(piece.pathVariables, pieceConfig);
48
+ for (const [variableName, variableValue] of Object.entries(piece.pathVariables)) {
49
+ (0, path_variables_1.validatePathVariableNameIsExpected)(variableName, pieceConfig);
50
+ (0, path_variables_1.validatePathVariableValue)(variableValue);
51
+ }
52
+ (0, required_pieces_1.validateAllExpectedRequiredPieceTypesSet)(piece.requiredPieces, pieceConfig);
53
+ for (const [requiredPieceType, requiredPiece] of Object.entries(piece.requiredPieces)) {
54
+ (0, required_pieces_1.validateRequiredPieceType)(requiredPieceType, config);
55
+ for (const pieceSha of requiredPiece.expected) {
56
+ (0, required_pieces_1.validateRequiredPieceValue)(requiredPieceType, pieceSha, rosters[requiredPieceType]);
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
62
+ function validateAllEnginePiecesDefined(rosters, engine) {
63
+ for (const pieceType of Object.keys(engine.pieceDefinitions)) {
64
+ if (!(pieceType in rosters)) {
65
+ throw new Error(`Piece type ${pieceType} is defined in engine but not in roster`);
66
+ }
67
+ }
68
+ }
69
+ function validatePieceInEngine(pieceType, engine) {
70
+ if (!(pieceType in engine.pieceDefinitions)) {
71
+ throw new Error(`Piece type ${pieceType} is not defined in engine`);
72
+ }
73
+ }
74
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../src/match-lock-file/match-config/version-1/lock/rosters/validate/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAEA,uCAAqB;AACrB,wDAAsC;AACtC,0CAAwB;AACxB,mDAAiC;AACjC,oDAAkC;AAClC,0CAAwB;AACxB,4CAA0B;AAE1B,uCAAwE;AACxE,mCAA4C;AAC5C,+DAE+B;AAC/B,qDAI0B;AAC1B,uDAI2B;AAC3B,6BAAkE;AAClE,kCACE,MAA0B;IAE1B,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,CAAC;IACnC,8BAA8B,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChD,KAAI,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAC,CAAC;QAC3D,KAAI,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC,CAAC;YACxC,MAAM,KAAK,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;YAC3B,qBAAqB,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;YACzC,MAAM,WAAW,GAAG,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;YAEvD,IAAA,oBAAe,EAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAC1B,IAAA,8BAAyB,EAAC,KAAK,CAAC,EAAE,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;YAElD,IAAA,0BAAgB,EAAC,KAAK,CAAC,OAAO,CAAC,CAAC;YAChC,IAAA,mCAAyB,EAAC,KAAK,CAAC,OAAO,EAAE,CAAC,EAAE,SAAS,CAAC,CAAC;YAEvD,IAAA,yBAAiB,EAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAEnC,IAAA,oDAA8B,EAAC,KA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