@sparted/shared-library 1.0.8-alpha.5 → 1.0.8

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 (363) hide show
  1. package/{dist/cdn → cdn}/utils/extract-info-from-url.util.js +3 -0
  2. package/{dist/cdn → cdn}/utils/extract-info-from-url.util.js.map +1 -1
  3. package/{src/index.ts → index.d.ts} +14 -15
  4. package/{dist/index.js → index.js} +0 -2
  5. package/{dist/index.js.map → index.js.map} +1 -1
  6. package/package.json +3 -7
  7. package/.circleci/config.yml +0 -40
  8. package/.eslintignore +0 -1
  9. package/.eslintrc.js +0 -17
  10. package/.gitignore +0 -37
  11. package/CHANGELOG.md +0 -34
  12. package/README.md +0 -26
  13. package/dist/github/branch/create-branch.d.ts +0 -11
  14. package/dist/github/branch/create-branch.js +0 -27
  15. package/dist/github/branch/create-branch.js.map +0 -1
  16. package/dist/github/branch/index.d.ts +0 -2
  17. package/dist/github/branch/index.js +0 -12
  18. package/dist/github/branch/index.js.map +0 -1
  19. package/dist/github/branch/update-branch.d.ts +0 -11
  20. package/dist/github/branch/update-branch.js +0 -26
  21. package/dist/github/branch/update-branch.js.map +0 -1
  22. package/dist/github/commit/create-git-blob.d.ts +0 -26
  23. package/dist/github/commit/create-git-blob.js +0 -42
  24. package/dist/github/commit/create-git-blob.js.map +0 -1
  25. package/dist/github/commit/create-git-commit.d.ts +0 -23
  26. package/dist/github/commit/create-git-commit.js +0 -39
  27. package/dist/github/commit/create-git-commit.js.map +0 -1
  28. package/dist/github/commit/create-git-tree.d.ts +0 -29
  29. package/dist/github/commit/create-git-tree.js +0 -47
  30. package/dist/github/commit/create-git-tree.js.map +0 -1
  31. package/dist/github/commit/get-sha-last-commit-of-branch.d.ts +0 -21
  32. package/dist/github/commit/get-sha-last-commit-of-branch.js +0 -35
  33. package/dist/github/commit/get-sha-last-commit-of-branch.js.map +0 -1
  34. package/dist/github/commit/get-tree-by-commit-sha.d.ts +0 -23
  35. package/dist/github/commit/get-tree-by-commit-sha.js +0 -37
  36. package/dist/github/commit/get-tree-by-commit-sha.js.map +0 -1
  37. package/dist/github/commit/index.d.ts +0 -6
  38. package/dist/github/commit/index.js +0 -20
  39. package/dist/github/commit/run-new-commit-process.d.ts +0 -27
  40. package/dist/github/commit/run-new-commit-process.js +0 -49
  41. package/dist/github/commit/run-new-commit-process.js.map +0 -1
  42. package/dist/github/commit/utils.d.ts +0 -1
  43. package/dist/github/commit/utils.js +0 -29
  44. package/dist/github/commit/utils.js.map +0 -1
  45. package/dist/github/content/get-file-content.d.ts +0 -20
  46. package/dist/github/content/get-file-content.js +0 -38
  47. package/dist/github/content/get-file-content.js.map +0 -1
  48. package/dist/github/github.d.ts +0 -25
  49. package/dist/github/github.js +0 -65
  50. package/dist/github/github.js.map +0 -1
  51. package/dist/github/index.d.ts +0 -1
  52. package/dist/github/index.js +0 -10
  53. package/dist/github/merge/create-pull-request.d.ts +0 -13
  54. package/dist/github/merge/create-pull-request.js +0 -29
  55. package/dist/github/merge/create-pull-request.js.map +0 -1
  56. package/dist/github/merge/index.d.ts +0 -2
  57. package/dist/github/merge/index.js +0 -12
  58. package/dist/github/merge/index.js.map +0 -1
  59. package/dist/github/merge/merge-pull-request.d.ts +0 -13
  60. package/dist/github/merge/merge-pull-request.js +0 -28
  61. package/dist/github/merge/merge-pull-request.js.map +0 -1
  62. package/dist/index.d.ts +0 -15
  63. package/dist/package.json +0 -65
  64. package/dist/string/index.js.map +0 -1
  65. package/dist/time/index.js.map +0 -1
  66. package/global.d.ts +0 -2
  67. package/rollup.config.ts +0 -15
  68. package/src/array/__tests__/array-to-map.test.ts +0 -50
  69. package/src/array/__tests__/get-values-from-keys.test.ts +0 -14
  70. package/src/array/array-to-map.ts +0 -32
  71. package/src/array/get-values-from-keys.ts +0 -3
  72. package/src/array/index.ts +0 -2
  73. package/src/cdn/__tests__/cdn.factory.test.ts +0 -120
  74. package/src/cdn/__tests__/utils.test.ts +0 -456
  75. package/src/cdn/cdn.factory.ts +0 -63
  76. package/src/cdn/index.ts +0 -2
  77. package/src/cdn/types/cdn-factory.type.ts +0 -35
  78. package/src/cdn/types/index.ts +0 -1
  79. package/src/cdn/utils/extract-info-from-url.util.ts +0 -21
  80. package/src/cdn/utils/get-cdn-from-s3-url.util.ts +0 -20
  81. package/src/cdn/utils/get-cdn-url.util.ts +0 -26
  82. package/src/formatting/__tests__/format-number.test.ts +0 -11
  83. package/src/formatting/format-number.ts +0 -14
  84. package/src/formatting/index.ts +0 -1
  85. package/src/fp/__tests__/run-while.test.ts +0 -29
  86. package/src/fp/index.ts +0 -1
  87. package/src/fp/run-while.ts +0 -54
  88. package/src/github/branch/create-branch.ts +0 -36
  89. package/src/github/branch/index.ts +0 -2
  90. package/src/github/branch/update-branch.ts +0 -35
  91. package/src/github/commit/create-git-blob.ts +0 -57
  92. package/src/github/commit/create-git-commit.ts +0 -57
  93. package/src/github/commit/create-git-tree.ts +0 -68
  94. package/src/github/commit/get-sha-last-commit-of-branch.ts +0 -50
  95. package/src/github/commit/get-tree-by-commit-sha.ts +0 -52
  96. package/src/github/commit/index.ts +0 -6
  97. package/src/github/commit/run-new-commit-process.ts +0 -88
  98. package/src/github/commit/utils.ts +0 -31
  99. package/src/github/content/get-file-content.ts +0 -50
  100. package/src/github/github.ts +0 -93
  101. package/src/github/index.ts +0 -1
  102. package/src/github/merge/create-pull-request.ts +0 -40
  103. package/src/github/merge/index.ts +0 -2
  104. package/src/github/merge/merge-pull-request.ts +0 -39
  105. package/src/http/__tests__/encode-search-object.test.ts +0 -34
  106. package/src/http/__tests__/fetch-with-timeout.test.ts +0 -50
  107. package/src/http/encode-search-object.ts +0 -39
  108. package/src/http/fetch-with-timeout.ts +0 -24
  109. package/src/http/index.ts +0 -2
  110. package/src/linked-list/__tests__/apply-diff-linked-list.test.ts +0 -103
  111. package/src/linked-list/__tests__/create-linked-list.test.ts +0 -204
  112. package/src/linked-list/__tests__/find-linked-list.test.ts +0 -40
  113. package/src/linked-list/__tests__/get-linked-list.test.ts +0 -28
  114. package/src/linked-list/__tests__/insert-linked-list.test.ts +0 -186
  115. package/src/linked-list/__tests__/linked-list-utils.test.ts +0 -252
  116. package/src/linked-list/__tests__/reduce-linked-list.test.ts +0 -31
  117. package/src/linked-list/__tests__/remove-linked-list.test.ts +0 -129
  118. package/src/linked-list/__tests__/update-linked-list.test.ts +0 -53
  119. package/src/linked-list/__tests__/while-linked-list.test.ts +0 -58
  120. package/src/linked-list/apply-diff-linked-list.ts +0 -35
  121. package/src/linked-list/create-linked-list.ts +0 -79
  122. package/src/linked-list/find-linked-list.ts +0 -26
  123. package/src/linked-list/get-linked-list.ts +0 -9
  124. package/src/linked-list/index.ts +0 -2
  125. package/src/linked-list/insert-linked-list.ts +0 -50
  126. package/src/linked-list/linked-list-utils.ts +0 -143
  127. package/src/linked-list/reduce-linked-list.ts +0 -18
  128. package/src/linked-list/remove-linked-list.ts +0 -36
  129. package/src/linked-list/type.ts +0 -38
  130. package/src/linked-list/update-linked-list.ts +0 -29
  131. package/src/linked-list/while-linked-list.ts +0 -33
  132. package/src/math/__tests__/clamp-number.test.ts +0 -30
  133. package/src/math/__tests__/interpolate.test.ts +0 -28
  134. package/src/math/__tests__/number-range.test.ts +0 -59
  135. package/src/math/__tests__/random-number.test.ts +0 -11
  136. package/src/math/clamp-number.ts +0 -8
  137. package/src/math/index.ts +0 -4
  138. package/src/math/interpolate.ts +0 -18
  139. package/src/math/number-range.ts +0 -16
  140. package/src/math/random-number.ts +0 -10
  141. package/src/object/__tests__/merge-deep.test.ts +0 -56
  142. package/src/object/index.ts +0 -1
  143. package/src/object/merge-deep.ts +0 -27
  144. package/src/parsing/__tests__/parse-boolean.test.ts +0 -15
  145. package/src/parsing/__tests__/parse-enum.test.ts +0 -19
  146. package/src/parsing/__tests__/parse-number.test.ts +0 -20
  147. package/src/parsing/index.ts +0 -3
  148. package/src/parsing/parse-boolean.ts +0 -10
  149. package/src/parsing/parse-enum.ts +0 -16
  150. package/src/parsing/parse-number.ts +0 -12
  151. package/src/predicates/__tests__/is-function.test.ts +0 -11
  152. package/src/predicates/__tests__/is-null.test.ts +0 -11
  153. package/src/predicates/__tests__/is-object.test.ts +0 -11
  154. package/src/predicates/__tests__/is-primitive.test.ts +0 -42
  155. package/src/predicates/__tests__/is-undefined.test.ts +0 -11
  156. package/src/predicates/__tests__/is-uuid.test.ts +0 -13
  157. package/src/predicates/index.ts +0 -5
  158. package/src/predicates/is-function.ts +0 -3
  159. package/src/predicates/is-null.ts +0 -3
  160. package/src/predicates/is-object.ts +0 -3
  161. package/src/predicates/is-primitive.ts +0 -19
  162. package/src/predicates/is-undefined.ts +0 -3
  163. package/src/predicates/is-uuid.ts +0 -3
  164. package/src/promise/__tests__/delay.test.ts +0 -13
  165. package/src/promise/__tests__/execute-or-resolve-default.test.ts +0 -25
  166. package/src/promise/__tests__/execute-with-delay.test.ts +0 -24
  167. package/src/promise/delay.ts +0 -3
  168. package/src/promise/execute-or-resolve-default.ts +0 -14
  169. package/src/promise/execute-with-delay.ts +0 -6
  170. package/src/promise/index.ts +0 -3
  171. package/src/string/__tests__/replace-in-template.test.ts +0 -52
  172. package/src/string/index.ts +0 -1
  173. package/src/string/replace-in-template.ts +0 -45
  174. package/src/time/__tests__/convert.test.ts +0 -14
  175. package/src/time/__tests__/format-minutes.test.ts +0 -10
  176. package/src/time/__tests__/get-time-diff-as-string.test.ts +0 -128
  177. package/src/time/constants.ts +0 -4
  178. package/src/time/convert.ts +0 -5
  179. package/src/time/format-minutes.ts +0 -9
  180. package/src/time/get-time-diff-as-string.ts +0 -196
  181. package/src/time/index.ts +0 -4
  182. package/src/types/function.ts +0 -1
  183. package/src/types/general.ts +0 -8
  184. package/src/types/index.ts +0 -4
  185. package/src/types/object.ts +0 -33
  186. package/src/types/search.ts +0 -29
  187. package/tsconfig.eslint.json +0 -8
  188. package/tsconfig.json +0 -25
  189. /package/{dist/_virtual → _virtual}/_tslib.js +0 -0
  190. /package/{dist/_virtual → _virtual}/_tslib.js.map +0 -0
  191. /package/{dist/array → array}/array-to-map.d.ts +0 -0
  192. /package/{dist/array → array}/array-to-map.js +0 -0
  193. /package/{dist/array → array}/array-to-map.js.map +0 -0
  194. /package/{dist/array → array}/get-values-from-keys.d.ts +0 -0
  195. /package/{dist/array → array}/get-values-from-keys.js +0 -0
  196. /package/{dist/array → array}/get-values-from-keys.js.map +0 -0
  197. /package/{dist/array → array}/index.d.ts +0 -0
  198. /package/{dist/array → array}/index.js +0 -0
  199. /package/{dist/array → array}/index.js.map +0 -0
  200. /package/{dist/cdn → cdn}/cdn.factory.d.ts +0 -0
  201. /package/{dist/cdn → cdn}/cdn.factory.js +0 -0
  202. /package/{dist/cdn → cdn}/cdn.factory.js.map +0 -0
  203. /package/{dist/cdn → cdn}/index.d.ts +0 -0
  204. /package/{dist/cdn → cdn}/index.js +0 -0
  205. /package/{dist/cdn → cdn}/index.js.map +0 -0
  206. /package/{dist/cdn → cdn}/types/cdn-factory.type.d.ts +0 -0
  207. /package/{dist/cdn → cdn}/types/index.d.ts +0 -0
  208. /package/{dist/cdn → cdn}/types/index.js +0 -0
  209. /package/{dist/cdn → cdn}/types/index.js.map +0 -0
  210. /package/{dist/cdn → cdn}/utils/extract-info-from-url.util.d.ts +0 -0
  211. /package/{dist/cdn → cdn}/utils/get-cdn-from-s3-url.util.d.ts +0 -0
  212. /package/{dist/cdn → cdn}/utils/get-cdn-from-s3-url.util.js +0 -0
  213. /package/{dist/cdn → cdn}/utils/get-cdn-from-s3-url.util.js.map +0 -0
  214. /package/{dist/cdn → cdn}/utils/get-cdn-url.util.d.ts +0 -0
  215. /package/{dist/cdn → cdn}/utils/get-cdn-url.util.js +0 -0
  216. /package/{dist/cdn → cdn}/utils/get-cdn-url.util.js.map +0 -0
  217. /package/{dist/formatting → formatting}/format-number.d.ts +0 -0
  218. /package/{dist/formatting → formatting}/format-number.js +0 -0
  219. /package/{dist/formatting → formatting}/format-number.js.map +0 -0
  220. /package/{dist/formatting → formatting}/index.d.ts +0 -0
  221. /package/{dist/formatting → formatting}/index.js +0 -0
  222. /package/{dist/formatting → formatting}/index.js.map +0 -0
  223. /package/{dist/fp → fp}/index.d.ts +0 -0
  224. /package/{dist/fp → fp}/index.js +0 -0
  225. /package/{dist/fp → fp}/index.js.map +0 -0
  226. /package/{dist/fp → fp}/run-while.d.ts +0 -0
  227. /package/{dist/fp → fp}/run-while.js +0 -0
  228. /package/{dist/fp → fp}/run-while.js.map +0 -0
  229. /package/{dist/http → http}/encode-search-object.d.ts +0 -0
  230. /package/{dist/http → http}/encode-search-object.js +0 -0
  231. /package/{dist/http → http}/encode-search-object.js.map +0 -0
  232. /package/{dist/http → http}/fetch-with-timeout.d.ts +0 -0
  233. /package/{dist/http → http}/fetch-with-timeout.js +0 -0
  234. /package/{dist/http → http}/fetch-with-timeout.js.map +0 -0
  235. /package/{dist/http → http}/index.d.ts +0 -0
  236. /package/{dist/http → http}/index.js +0 -0
  237. /package/{dist/http → http}/index.js.map +0 -0
  238. /package/{dist/linked-list → linked-list}/apply-diff-linked-list.d.ts +0 -0
  239. /package/{dist/linked-list → linked-list}/apply-diff-linked-list.js +0 -0
  240. /package/{dist/linked-list → linked-list}/apply-diff-linked-list.js.map +0 -0
  241. /package/{dist/linked-list → linked-list}/create-linked-list.d.ts +0 -0
  242. /package/{dist/linked-list → linked-list}/create-linked-list.js +0 -0
  243. /package/{dist/linked-list → linked-list}/create-linked-list.js.map +0 -0
  244. /package/{dist/linked-list → linked-list}/find-linked-list.d.ts +0 -0
  245. /package/{dist/linked-list → linked-list}/find-linked-list.js +0 -0
  246. /package/{dist/linked-list → linked-list}/find-linked-list.js.map +0 -0
  247. /package/{dist/linked-list → linked-list}/get-linked-list.d.ts +0 -0
  248. /package/{dist/linked-list → linked-list}/get-linked-list.js +0 -0
  249. /package/{dist/linked-list → linked-list}/get-linked-list.js.map +0 -0
  250. /package/{dist/linked-list → linked-list}/index.d.ts +0 -0
  251. /package/{dist/linked-list → linked-list}/index.js +0 -0
  252. /package/{dist/github → linked-list}/index.js.map +0 -0
  253. /package/{dist/linked-list → linked-list}/insert-linked-list.d.ts +0 -0
  254. /package/{dist/linked-list → linked-list}/insert-linked-list.js +0 -0
  255. /package/{dist/linked-list → linked-list}/insert-linked-list.js.map +0 -0
  256. /package/{dist/linked-list → linked-list}/linked-list-utils.d.ts +0 -0
  257. /package/{dist/linked-list → linked-list}/linked-list-utils.js +0 -0
  258. /package/{dist/linked-list → linked-list}/linked-list-utils.js.map +0 -0
  259. /package/{dist/linked-list → linked-list}/reduce-linked-list.d.ts +0 -0
  260. /package/{dist/linked-list → linked-list}/reduce-linked-list.js +0 -0
  261. /package/{dist/linked-list → linked-list}/reduce-linked-list.js.map +0 -0
  262. /package/{dist/linked-list → linked-list}/remove-linked-list.d.ts +0 -0
  263. /package/{dist/linked-list → linked-list}/remove-linked-list.js +0 -0
  264. /package/{dist/linked-list → linked-list}/remove-linked-list.js.map +0 -0
  265. /package/{dist/linked-list → linked-list}/type.d.ts +0 -0
  266. /package/{dist/linked-list → linked-list}/update-linked-list.d.ts +0 -0
  267. /package/{dist/linked-list → linked-list}/update-linked-list.js +0 -0
  268. /package/{dist/linked-list → linked-list}/update-linked-list.js.map +0 -0
  269. /package/{dist/linked-list → linked-list}/while-linked-list.d.ts +0 -0
  270. /package/{dist/linked-list → linked-list}/while-linked-list.js +0 -0
  271. /package/{dist/linked-list → linked-list}/while-linked-list.js.map +0 -0
  272. /package/{dist/math → math}/clamp-number.d.ts +0 -0
  273. /package/{dist/math → math}/clamp-number.js +0 -0
  274. /package/{dist/math → math}/clamp-number.js.map +0 -0
  275. /package/{dist/math → math}/index.d.ts +0 -0
  276. /package/{dist/math → math}/index.js +0 -0
  277. /package/{dist/math → math}/index.js.map +0 -0
  278. /package/{dist/math → math}/interpolate.d.ts +0 -0
  279. /package/{dist/math → math}/interpolate.js +0 -0
  280. /package/{dist/math → math}/interpolate.js.map +0 -0
  281. /package/{dist/math → math}/number-range.d.ts +0 -0
  282. /package/{dist/math → math}/number-range.js +0 -0
  283. /package/{dist/math → math}/number-range.js.map +0 -0
  284. /package/{dist/math → math}/random-number.d.ts +0 -0
  285. /package/{dist/math → math}/random-number.js +0 -0
  286. /package/{dist/math → math}/random-number.js.map +0 -0
  287. /package/{dist/object → object}/index.d.ts +0 -0
  288. /package/{dist/object → object}/index.js +0 -0
  289. /package/{dist/linked-list → object}/index.js.map +0 -0
  290. /package/{dist/object → object}/merge-deep.d.ts +0 -0
  291. /package/{dist/object → object}/merge-deep.js +0 -0
  292. /package/{dist/object → object}/merge-deep.js.map +0 -0
  293. /package/{dist/parsing → parsing}/index.d.ts +0 -0
  294. /package/{dist/parsing → parsing}/index.js +0 -0
  295. /package/{dist/parsing → parsing}/index.js.map +0 -0
  296. /package/{dist/parsing → parsing}/parse-boolean.d.ts +0 -0
  297. /package/{dist/parsing → parsing}/parse-boolean.js +0 -0
  298. /package/{dist/parsing → parsing}/parse-boolean.js.map +0 -0
  299. /package/{dist/parsing → parsing}/parse-enum.d.ts +0 -0
  300. /package/{dist/parsing → parsing}/parse-enum.js +0 -0
  301. /package/{dist/parsing → parsing}/parse-enum.js.map +0 -0
  302. /package/{dist/parsing → parsing}/parse-number.d.ts +0 -0
  303. /package/{dist/parsing → parsing}/parse-number.js +0 -0
  304. /package/{dist/parsing → parsing}/parse-number.js.map +0 -0
  305. /package/{dist/predicates → predicates}/index.d.ts +0 -0
  306. /package/{dist/predicates → predicates}/index.js +0 -0
  307. /package/{dist/predicates → predicates}/index.js.map +0 -0
  308. /package/{dist/predicates → predicates}/is-function.d.ts +0 -0
  309. /package/{dist/predicates → predicates}/is-function.js +0 -0
  310. /package/{dist/predicates → predicates}/is-function.js.map +0 -0
  311. /package/{dist/predicates → predicates}/is-null.d.ts +0 -0
  312. /package/{dist/predicates → predicates}/is-null.js +0 -0
  313. /package/{dist/predicates → predicates}/is-null.js.map +0 -0
  314. /package/{dist/predicates → predicates}/is-object.d.ts +0 -0
  315. /package/{dist/predicates → predicates}/is-object.js +0 -0
  316. /package/{dist/predicates → predicates}/is-object.js.map +0 -0
  317. /package/{dist/predicates → predicates}/is-primitive.d.ts +0 -0
  318. /package/{dist/predicates → predicates}/is-primitive.js +0 -0
  319. /package/{dist/predicates → predicates}/is-primitive.js.map +0 -0
  320. /package/{dist/predicates → predicates}/is-undefined.d.ts +0 -0
  321. /package/{dist/predicates → predicates}/is-undefined.js +0 -0
  322. /package/{dist/predicates → predicates}/is-undefined.js.map +0 -0
  323. /package/{dist/predicates → predicates}/is-uuid.d.ts +0 -0
  324. /package/{dist/promise → promise}/delay.d.ts +0 -0
  325. /package/{dist/promise → promise}/delay.js +0 -0
  326. /package/{dist/promise → promise}/delay.js.map +0 -0
  327. /package/{dist/promise → promise}/execute-or-resolve-default.d.ts +0 -0
  328. /package/{dist/promise → promise}/execute-or-resolve-default.js +0 -0
  329. /package/{dist/promise → promise}/execute-or-resolve-default.js.map +0 -0
  330. /package/{dist/promise → promise}/execute-with-delay.d.ts +0 -0
  331. /package/{dist/promise → promise}/execute-with-delay.js +0 -0
  332. /package/{dist/promise → promise}/execute-with-delay.js.map +0 -0
  333. /package/{dist/promise → promise}/index.d.ts +0 -0
  334. /package/{dist/promise → promise}/index.js +0 -0
  335. /package/{dist/promise → promise}/index.js.map +0 -0
  336. /package/{dist/string → string}/index.d.ts +0 -0
  337. /package/{dist/string → string}/index.js +0 -0
  338. /package/{dist/object → string}/index.js.map +0 -0
  339. /package/{dist/string → string}/replace-in-template.d.ts +0 -0
  340. /package/{dist/string → string}/replace-in-template.js +0 -0
  341. /package/{dist/string → string}/replace-in-template.js.map +0 -0
  342. /package/{dist/time → time}/constants.d.ts +0 -0
  343. /package/{dist/time → time}/constants.js +0 -0
  344. /package/{dist/time → time}/constants.js.map +0 -0
  345. /package/{dist/time → time}/convert.d.ts +0 -0
  346. /package/{dist/time → time}/convert.js +0 -0
  347. /package/{dist/time → time}/convert.js.map +0 -0
  348. /package/{dist/time → time}/format-minutes.d.ts +0 -0
  349. /package/{dist/time → time}/format-minutes.js +0 -0
  350. /package/{dist/time → time}/format-minutes.js.map +0 -0
  351. /package/{dist/time → time}/get-time-diff-as-string.d.ts +0 -0
  352. /package/{dist/time → time}/get-time-diff-as-string.js +0 -0
  353. /package/{dist/time → time}/get-time-diff-as-string.js.map +0 -0
  354. /package/{dist/time → time}/index.d.ts +0 -0
  355. /package/{dist/time → time}/index.js +0 -0
  356. /package/{dist/github/commit → time}/index.js.map +0 -0
  357. /package/{dist/types → types}/function.d.ts +0 -0
  358. /package/{dist/types → types}/general.d.ts +0 -0
  359. /package/{dist/types → types}/index.d.ts +0 -0
  360. /package/{dist/types → types}/index.js +0 -0
  361. /package/{dist/types → types}/index.js.map +0 -0
  362. /package/{dist/types → types}/object.d.ts +0 -0
  363. /package/{dist/types → types}/search.d.ts +0 -0
@@ -4,6 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const S3_URL_RE = /https:\/\/sparted-prod-([^.]+)\.s3(\.eu-west-1)?(\.amazonaws\.com)?(\.fr-par\.scw\.cloud)?(\/[^?]+)/;
6
6
  const extractInfoFromUrl = (url) => {
7
+ if (typeof url !== 'string') {
8
+ return undefined;
9
+ }
7
10
  const matchS3Url = url.match(S3_URL_RE);
8
11
  if (!matchS3Url) {
9
12
  return undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"extract-info-from-url.util.js","sources":["../../../src/cdn/utils/extract-info-from-url.util.ts"],"sourcesContent":["type ExtractInfoFromUrl = (url: string) =>\n| {\n instanceId: string;\n path: `/${string}`;\n}\n| undefined;\n\nconst S3_URL_RE = /https:\\/\\/sparted-prod-([^.]+)\\.s3(\\.eu-west-1)?(\\.amazonaws\\.com)?(\\.fr-par\\.scw\\.cloud)?(\\/[^?]+)/;\n\nexport const extractInfoFromUrl: ExtractInfoFromUrl = (url) => {\n const matchS3Url = url.match(S3_URL_RE);\n\n if (!matchS3Url) {\n return undefined;\n }\n\n const instanceId = matchS3Url[1];\n const path = matchS3Url[5] as `/${string}`;\n\n return { instanceId, path };\n};\n"],"names":[],"mappings":";;;;AAOA,MAAM,SAAS,GAAG,qGAAqG,CAAC;AAE3G,MAAA,kBAAkB,GAAuB,CAAC,GAAG,KAAI;IAC5D,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAExC,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,SAAS,CAAC;AAClB,KAAA;AAED,IAAA,MAAM,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AACjC,IAAA,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAiB,CAAC;AAE3C,IAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAC9B;;;;"}
1
+ {"version":3,"file":"extract-info-from-url.util.js","sources":["../../../src/cdn/utils/extract-info-from-url.util.ts"],"sourcesContent":["type ExtractInfoFromUrl = (url: string) =>\n| {\n instanceId: string;\n path: `/${string}`;\n}\n| undefined;\n\nconst S3_URL_RE = /https:\\/\\/sparted-prod-([^.]+)\\.s3(\\.eu-west-1)?(\\.amazonaws\\.com)?(\\.fr-par\\.scw\\.cloud)?(\\/[^?]+)/;\n\nexport const extractInfoFromUrl: ExtractInfoFromUrl = (url) => {\n if (typeof url !== 'string') {\n return undefined;\n }\n\n const matchS3Url = url.match(S3_URL_RE);\n\n if (!matchS3Url) {\n return undefined;\n }\n\n const instanceId = matchS3Url[1];\n const path = matchS3Url[5] as `/${string}`;\n\n return { instanceId, path };\n};\n"],"names":[],"mappings":";;;;AAOA,MAAM,SAAS,GAAG,qGAAqG,CAAC;AAE3G,MAAA,kBAAkB,GAAuB,CAAC,GAAG,KAAI;AAC5D,IAAA,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE;AAC3B,QAAA,OAAO,SAAS,CAAC;AAClB,KAAA;IAED,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;IAExC,IAAI,CAAC,UAAU,EAAE;AACf,QAAA,OAAO,SAAS,CAAC;AAClB,KAAA;AAED,IAAA,MAAM,UAAU,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AACjC,IAAA,MAAM,IAAI,GAAG,UAAU,CAAC,CAAC,CAAiB,CAAC;AAE3C,IAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;AAC9B;;;;"}
@@ -1,15 +1,14 @@
1
- export * from './array';
2
- export * from './cdn';
3
- export * from './time';
4
- export * from './formatting';
5
- export * from './fp';
6
- export * from './github';
7
- export * from './http';
8
- export * from './linked-list';
9
- export * from './math';
10
- export * from './object';
11
- export * from './parsing';
12
- export * from './predicates';
13
- export * from './promise';
14
- export * from './string';
15
- export * from './types';
1
+ export * from './array';
2
+ export * from './cdn';
3
+ export * from './time';
4
+ export * from './formatting';
5
+ export * from './fp';
6
+ export * from './http';
7
+ export * from './linked-list';
8
+ export * from './math';
9
+ export * from './object';
10
+ export * from './parsing';
11
+ export * from './predicates';
12
+ export * from './promise';
13
+ export * from './string';
14
+ export * from './types';
@@ -11,7 +11,6 @@ var formatMinutes = require('./time/format-minutes.js');
11
11
  var getTimeDiffAsString = require('./time/get-time-diff-as-string.js');
12
12
  var formatNumber = require('./formatting/format-number.js');
13
13
  var runWhile = require('./fp/run-while.js');
14
- var github = require('./github/github.js');
15
14
  var encodeSearchObject = require('./http/encode-search-object.js');
16
15
  var fetchWithTimeout = require('./http/fetch-with-timeout.js');
17
16
  var createLinkedList = require('./linked-list/create-linked-list.js');
@@ -48,7 +47,6 @@ exports.formatMinutes = formatMinutes.formatMinutes;
48
47
  exports.getTimeDiffAsString = getTimeDiffAsString.getTimeDiffAsString;
49
48
  exports.formatNumber = formatNumber.formatNumber;
50
49
  exports.runWhile = runWhile.runWhile;
51
- exports.githubSdk = github.githubSdk;
52
50
  exports.encodeSearchObject = encodeSearchObject.encodeSearchObject;
53
51
  exports.encodeSearchValue = encodeSearchObject.encodeSearchValue;
54
52
  exports.fetchWithTimeout = fetchWithTimeout.fetchWithTimeout;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@sparted/shared-library",
3
- "version": "1.0.8-alpha.5",
3
+ "version": "1.0.8",
4
4
  "repository": "git@github.com:Sparted/shared-library.git",
5
5
  "author": "Thomas <duprethomasfr@gmail.com>",
6
6
  "license": "MIT",
7
7
  "sideEffets": false,
8
- "main": "dist/index.js",
9
- "module": "dist/index.js",
8
+ "main": "index.js",
9
+ "module": "index.js",
10
10
  "files": [
11
11
  "**/*",
12
12
  "**/**"
@@ -57,9 +57,5 @@
57
57
  "transform": {
58
58
  "^.+\\.(t|j)s$": "ts-jest"
59
59
  }
60
- },
61
- "dependencies": {
62
- "axios": "^1.3.4",
63
- "zod": "^3.21.4"
64
60
  }
65
61
  }
@@ -1,40 +0,0 @@
1
- # Javascript Node CircleCI 2.0 configuration file
2
- #
3
- # Check https://circleci.com/docs/2.0/language-javascript/ for more details
4
- #
5
- version: 2.1
6
- jobs:
7
- test:
8
- docker:
9
- - image: cimg/node:18.10.0
10
-
11
- steps:
12
- - checkout
13
-
14
- - run:
15
- name: Set npm token
16
- command: 'echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc'
17
-
18
- - run:
19
- name: Install node modules
20
- command: yarn
21
-
22
- - run:
23
- name: Check lint
24
- command: yarn lint
25
-
26
- - run:
27
- name: Run tests
28
- # Limit resources as the default parameters overload the CPU of the machine and makes tests hang
29
- command: yarn test --maxWorkers=50%
30
-
31
- - run:
32
- name: Build
33
- command: yarn build
34
-
35
- workflows:
36
- version: 2
37
-
38
- autodeploy:
39
- jobs:
40
- - test
package/.eslintignore DELETED
@@ -1 +0,0 @@
1
- dist/
package/.eslintrc.js DELETED
@@ -1,17 +0,0 @@
1
- module.exports = {
2
- env: {
3
- es2021: true,
4
- node: true,
5
- },
6
- extends: '@sparted',
7
- parserOptions: {
8
- project: './tsconfig.eslint.json',
9
- },
10
- rules: {
11
- // Preference for this project
12
- 'import/prefer-default-export': 'off',
13
-
14
- // Preference for this project
15
- 'object-curly-newline': 'off',
16
- },
17
- };
package/.gitignore DELETED
@@ -1,37 +0,0 @@
1
- *.dat
2
- *.iml
3
- *.log
4
- *.out
5
- *.pid
6
- *.seed
7
- *.sublime-*
8
- *.swo
9
- *.swp
10
- *.tgz
11
- *.xml
12
- .tmp
13
- .env
14
- doc/*.json
15
-
16
- # Mac Related files
17
- .DS_Store
18
-
19
- # IDE Related Files
20
- .idea
21
- .project
22
-
23
- # eslint
24
- .eslintcache
25
-
26
- # jest
27
- jest-stare
28
-
29
- # JS Related files
30
- bower_components
31
- npm-debug.log
32
- node_modules
33
- nestjs/node_modules
34
- .npmrc
35
-
36
- # Build
37
- dist
package/CHANGELOG.md DELETED
@@ -1,34 +0,0 @@
1
- ## 1.0.7
2
- - Fix Twicpics resizing
3
-
4
- ## 1.0.6
5
- - Add current map to `dataModifier` function on `arrayToMap`
6
-
7
- ## 1.0.5
8
- - CDN abstraction for Imgix and Twicpics
9
-
10
- ## 1.0.0
11
- - Breaking change: rename date folder into time
12
- - Export convertion functions from time
13
-
14
- ## 0.0.18
15
- - Change update behavior to fully replace updated items
16
-
17
- ## 0.0.17
18
- - Remove error thrown when not every items have been visisted
19
-
20
- ## 0.0.16
21
- - Fix an issue when initializing an empty linked list
22
-
23
- ## 0.0.15
24
- - Rollback target version, change output format
25
-
26
- ## 0.0.14
27
- - Bump target version in tsconfig
28
-
29
- ## 0.0.13
30
- - Bring most utilities from the back-office, mobile-app and nest to this package (#32q6ude)
31
-
32
- ## 0.0.1
33
- - Library initialisation (#2ykhvcg)
34
- - Fix files taken as packaged
package/README.md DELETED
@@ -1,26 +0,0 @@
1
- # Shared-library
2
-
3
- Regroup low levels utils to share across Sparted's projects. Nothing should be platform specific and it should ideally not depend on any external library.
4
-
5
- # Publishing
6
-
7
- Since we want to be able to do the following sub imports when using the library:
8
-
9
- ```ts
10
- import { function1, function2 } from '@sparted/shared-library/array';
11
- import { function3, function4 } from '@sparted/shared-library/strings';
12
- ```
13
-
14
- While also being able to import everything from the root.
15
-
16
- We'll need to do some rollup/npm trickery to keep everything tree-shakable and intuitive.
17
-
18
- To do so, we copy the package.json inside the generated dist folder when building the library. Then we run `npm publish` from inside the dist folder.
19
-
20
- What this do, is take everything inside the dist folder and publish as its standalone package. This enables us to import directly from `@sparted/shared-library/array` without adding `dist` since `dist/array` becomes a root folder. If we do not do this and instead run `npm publish` in the root directory, the package would keep the folder structure and we would need to add `dist` in imports. eg: `@sparted/shared-library/dist/array`.
21
-
22
- ## How to publish
23
-
24
- 1. Update the `package.json` version
25
- 2. Run `yarn build-and-publish` (this command assumes the `package.json` version was not already published)
26
- 3. The new version should be commited and pushed
@@ -1,11 +0,0 @@
1
- import { AxiosInstance } from 'axios';
2
- export declare type CreateBranchArgs = {
3
- branchName: string;
4
- shaLastCommitOfBranch: string;
5
- };
6
- export declare type CreateBranchResponse = {
7
- ref: string;
8
- };
9
- export declare type CreateBranch = (args: CreateBranchArgs) => Promise<CreateBranchResponse>;
10
- export declare type CreateBranchFactory = (instance: AxiosInstance) => CreateBranch;
11
- export declare const createBranchFactory: CreateBranchFactory;
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _tslib = require('../../_virtual/_tslib.js');
6
- var zod = require('zod');
7
- var utils = require('../commit/utils.js');
8
-
9
- const createBranchResponseSchema = zod.z.object({
10
- ref: zod.z.string(),
11
- });
12
- const createBranchFactory = (instance) => (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
13
- const { branchName, shaLastCommitOfBranch } = args;
14
- try {
15
- const { data } = yield instance.post('/git/refs', {
16
- ref: `refs/heads/${branchName}`,
17
- sha: shaLastCommitOfBranch,
18
- });
19
- return createBranchResponseSchema.parse(data);
20
- }
21
- catch (error) {
22
- throw utils.handleError(error);
23
- }
24
- });
25
-
26
- exports.createBranchFactory = createBranchFactory;
27
- //# sourceMappingURL=create-branch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-branch.js","sources":["../../../src/github/branch/create-branch.ts"],"sourcesContent":["import { AxiosInstance } from 'axios';\nimport { z } from 'zod';\n\nimport { handleError } from '../commit/utils';\n\nexport type CreateBranchArgs = {\n branchName: string;\n shaLastCommitOfBranch: string;\n};\n\nexport type CreateBranchResponse = {\n ref: string;\n};\n\nconst createBranchResponseSchema = z.object({\n ref: z.string(),\n});\n\nexport type CreateBranch = (args: CreateBranchArgs) => Promise<CreateBranchResponse>;\n\nexport type CreateBranchFactory = (instance: AxiosInstance) => CreateBranch;\n\nexport const createBranchFactory: CreateBranchFactory = (instance) => async (args) => {\n const { branchName, shaLastCommitOfBranch } = args;\n\n try {\n const { data } = await instance.post<CreateBranchResponse>('/git/refs', {\n ref: `refs/heads/${branchName}`,\n sha: shaLastCommitOfBranch,\n });\n\n return createBranchResponseSchema.parse(data);\n } catch (error) {\n throw handleError(error);\n }\n};\n"],"names":["z","__awaiter","handleError"],"mappings":";;;;;;;;AAcA,MAAM,0BAA0B,GAAGA,KAAC,CAAC,MAAM,CAAC;AAC1C,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AAChB,CAAA,CAAC,CAAC;AAMI,MAAM,mBAAmB,GAAwB,CAAC,QAAQ,KAAK,CAAO,IAAI,KAAIC,gBAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;AACnF,IAAA,MAAM,EAAE,UAAU,EAAE,qBAAqB,EAAE,GAAG,IAAI,CAAC;IAEnD,IAAI;QACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAuB,WAAW,EAAE;YACtE,GAAG,EAAE,CAAc,WAAA,EAAA,UAAU,CAAE,CAAA;AAC/B,YAAA,GAAG,EAAE,qBAAqB;AAC3B,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC/C,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACd,QAAA,MAAMC,iBAAW,CAAC,KAAK,CAAC,CAAC;AAC1B,KAAA;AACH,CAAC;;;;"}
@@ -1,2 +0,0 @@
1
- export * from './create-branch';
2
- export * from './update-branch';
@@ -1,12 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var createBranch = require('./create-branch.js');
6
- var updateBranch = require('./update-branch.js');
7
-
8
-
9
-
10
- exports.createBranchFactory = createBranch.createBranchFactory;
11
- exports.updateBranchFactory = updateBranch.updateBranchFactory;
12
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
@@ -1,11 +0,0 @@
1
- import { AxiosInstance } from 'axios';
2
- export declare type UpdateBranchArgs = {
3
- branchName: string;
4
- shaTree: string;
5
- };
6
- export declare type UpdateBranchResponse = {
7
- ref: string;
8
- };
9
- export declare type UpdateBranch = (args: UpdateBranchArgs) => Promise<UpdateBranchResponse>;
10
- export declare type UpdateBranchFactory = (instance: AxiosInstance) => UpdateBranch;
11
- export declare const updateBranchFactory: UpdateBranchFactory;
@@ -1,26 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _tslib = require('../../_virtual/_tslib.js');
6
- var zod = require('zod');
7
- var utils = require('../commit/utils.js');
8
-
9
- const updateBranchResponseSchema = zod.z.object({
10
- ref: zod.z.string(),
11
- });
12
- const updateBranchFactory = (instance) => (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
13
- const { branchName, shaTree } = args;
14
- try {
15
- const { data } = yield instance.patch(`/git/refs/heads/${branchName}`, {
16
- sha: shaTree,
17
- });
18
- return updateBranchResponseSchema.parse(data);
19
- }
20
- catch (error) {
21
- throw utils.handleError(error);
22
- }
23
- });
24
-
25
- exports.updateBranchFactory = updateBranchFactory;
26
- //# sourceMappingURL=update-branch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"update-branch.js","sources":["../../../src/github/branch/update-branch.ts"],"sourcesContent":["import { AxiosInstance } from 'axios';\nimport { z } from 'zod';\n\nimport { handleError } from '../commit/utils';\n\nexport type UpdateBranchArgs = {\n branchName: string;\n shaTree: string;\n};\n\nexport type UpdateBranchResponse = {\n ref: string;\n};\n\nconst updateBranchResponseSchema = z.object({\n ref: z.string(),\n});\n\nexport type UpdateBranch = (args: UpdateBranchArgs) => Promise<UpdateBranchResponse>;\n\nexport type UpdateBranchFactory = (instance: AxiosInstance) => UpdateBranch;\n\nexport const updateBranchFactory: UpdateBranchFactory = (instance) => async (args) => {\n const { branchName, shaTree } = args;\n\n try {\n const { data } = await instance.patch<UpdateBranchResponse>(`/git/refs/heads/${branchName}`, {\n sha: shaTree,\n });\n\n return updateBranchResponseSchema.parse(data);\n } catch (error) {\n throw handleError(error);\n }\n};\n"],"names":["z","__awaiter","handleError"],"mappings":";;;;;;;;AAcA,MAAM,0BAA0B,GAAGA,KAAC,CAAC,MAAM,CAAC;AAC1C,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AAChB,CAAA,CAAC,CAAC;AAMI,MAAM,mBAAmB,GAAwB,CAAC,QAAQ,KAAK,CAAO,IAAI,KAAIC,gBAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;AACnF,IAAA,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAErC,IAAI;AACF,QAAA,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAuB,CAAA,gBAAA,EAAmB,UAAU,CAAA,CAAE,EAAE;AAC3F,YAAA,GAAG,EAAE,OAAO;AACb,SAAA,CAAC,CAAC;AAEH,QAAA,OAAO,0BAA0B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC/C,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACd,QAAA,MAAMC,iBAAW,CAAC,KAAK,CAAC,CAAC;AAC1B,KAAA;AACH,CAAC;;;;"}
@@ -1,26 +0,0 @@
1
- import type { AxiosInstance } from 'axios';
2
- export declare type CreateGitBlobArgs = {
3
- content: string;
4
- encoding: 'utf-8' | 'base64';
5
- };
6
- export declare type CreateGitBlobResponse = {
7
- sha: string;
8
- url: string;
9
- };
10
- export declare type CreateGitBlob = (args: CreateGitBlobArgs) => Promise<CreateGitBlobResponse>;
11
- export declare type CreateGitBlobFactory = (instance: AxiosInstance) => CreateGitBlob;
12
- /**
13
- * Create a git blob
14
- *
15
- * @param owner the owner of the repository
16
- * @param repo the name of the repository
17
- * @param token the github token
18
- * @param content the content of the file
19
- * @param encoding the encoding of the content. Default: utf-8
20
- * @returns CreateGitBlobResponse
21
- * @throws forbidden
22
- * @throws resource-not-found
23
- * @throws conflict
24
- * @throws validation-failed-or-the-endpoint-has-been-spammed
25
- */
26
- export declare const createGitBlobFactory: CreateGitBlobFactory;
@@ -1,42 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _tslib = require('../../_virtual/_tslib.js');
6
- var zod = require('zod');
7
- var utils = require('./utils.js');
8
-
9
- const createGitBlobResponseSchema = zod.z.object({
10
- sha: zod.z.string(),
11
- url: zod.z.string(),
12
- });
13
- /**
14
- * Create a git blob
15
- *
16
- * @param owner the owner of the repository
17
- * @param repo the name of the repository
18
- * @param token the github token
19
- * @param content the content of the file
20
- * @param encoding the encoding of the content. Default: utf-8
21
- * @returns CreateGitBlobResponse
22
- * @throws forbidden
23
- * @throws resource-not-found
24
- * @throws conflict
25
- * @throws validation-failed-or-the-endpoint-has-been-spammed
26
- */
27
- const createGitBlobFactory = (instance) => (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
28
- const { content, encoding = 'utf-8' } = args;
29
- try {
30
- const { data } = yield instance.post('/git/blobs', {
31
- content,
32
- encoding,
33
- });
34
- return createGitBlobResponseSchema.parse(data);
35
- }
36
- catch (error) {
37
- throw utils.handleError(error);
38
- }
39
- });
40
-
41
- exports.createGitBlobFactory = createGitBlobFactory;
42
- //# sourceMappingURL=create-git-blob.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-git-blob.js","sources":["../../../src/github/commit/create-git-blob.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios';\nimport { z } from 'zod';\n\nimport { handleError } from './utils';\n\nexport type CreateGitBlobArgs = {\n content: string;\n encoding: 'utf-8' | 'base64';\n};\n\nexport type CreateGitBlobResponse = {\n sha: string;\n url: string;\n};\n\nconst createGitBlobResponseSchema = z.object({\n sha: z.string(),\n url: z.string(),\n});\n\nexport type CreateGitBlob = (\n args: CreateGitBlobArgs\n) => Promise<CreateGitBlobResponse>;\n\nexport type CreateGitBlobFactory = (instance: AxiosInstance) => CreateGitBlob;\n\n/**\n * Create a git blob\n *\n * @param owner the owner of the repository\n * @param repo the name of the repository\n * @param token the github token\n * @param content the content of the file\n * @param encoding the encoding of the content. Default: utf-8\n * @returns CreateGitBlobResponse\n * @throws forbidden\n * @throws resource-not-found\n * @throws conflict\n * @throws validation-failed-or-the-endpoint-has-been-spammed\n */\nexport const createGitBlobFactory: CreateGitBlobFactory = (instance) => async (args) => {\n const { content, encoding = 'utf-8' } = args;\n\n try {\n const { data } = await instance.post<CreateGitBlobResponse>(\n '/git/blobs',\n {\n content,\n encoding,\n },\n );\n\n return createGitBlobResponseSchema.parse(data);\n } catch (error) {\n throw handleError(error);\n }\n};\n"],"names":["z","__awaiter","handleError"],"mappings":";;;;;;;;AAeA,MAAM,2BAA2B,GAAGA,KAAC,CAAC,MAAM,CAAC;AAC3C,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AACf,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AAChB,CAAA,CAAC,CAAC;AAQH;;;;;;;;;;;;;AAaG;AACI,MAAM,oBAAoB,GAAyB,CAAC,QAAQ,KAAK,CAAO,IAAI,KAAIC,gBAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;IACrF,MAAM,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC;IAE7C,IAAI;QACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,CAClC,YAAY,EACZ;YACE,OAAO;YACP,QAAQ;AACT,SAAA,CACF,CAAC;AAEF,QAAA,OAAO,2BAA2B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAChD,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACd,QAAA,MAAMC,iBAAW,CAAC,KAAK,CAAC,CAAC;AAC1B,KAAA;AACH,CAAC;;;;"}
@@ -1,23 +0,0 @@
1
- import type { AxiosInstance } from 'axios';
2
- export declare type CreateGitCommitArgs = {
3
- message: string;
4
- treeSha: string;
5
- parents: string[];
6
- };
7
- export declare type CreateGitCommitResponse = {
8
- sha: string;
9
- url: string;
10
- };
11
- export declare type CreateGitCommit = (args: CreateGitCommitArgs) => Promise<CreateGitCommitResponse>;
12
- export declare type CreateGitCommitFactory = (instance: AxiosInstance) => CreateGitCommit;
13
- /**
14
- * Create a git commit
15
- * @param owner the owner of the repository
16
- * @param repo the name of the repository
17
- * @param token the github token
18
- * @param message the commit message
19
- * @param treeSha the sha of the tree
20
- * @param parents the parents of the commit
21
- * @returns CreateGitCommitResponse
22
- */
23
- export declare const createGitCommitFactory: CreateGitCommitFactory;
@@ -1,39 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _tslib = require('../../_virtual/_tslib.js');
6
- var zod = require('zod');
7
- var utils = require('./utils.js');
8
-
9
- const createGitCommitSchema = zod.z.object({
10
- sha: zod.z.string(),
11
- url: zod.z.string(),
12
- });
13
- /**
14
- * Create a git commit
15
- * @param owner the owner of the repository
16
- * @param repo the name of the repository
17
- * @param token the github token
18
- * @param message the commit message
19
- * @param treeSha the sha of the tree
20
- * @param parents the parents of the commit
21
- * @returns CreateGitCommitResponse
22
- */
23
- const createGitCommitFactory = (instance) => (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
24
- const { message, treeSha, parents } = args;
25
- try {
26
- const { data } = yield instance.post('/git/commits', {
27
- message,
28
- tree: treeSha,
29
- parents,
30
- });
31
- return createGitCommitSchema.parse(data);
32
- }
33
- catch (error) {
34
- throw utils.handleError(error);
35
- }
36
- });
37
-
38
- exports.createGitCommitFactory = createGitCommitFactory;
39
- //# sourceMappingURL=create-git-commit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-git-commit.js","sources":["../../../src/github/commit/create-git-commit.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios';\nimport { z } from 'zod';\n\nimport { handleError } from './utils';\n\nexport type CreateGitCommitArgs = {\n message: string;\n treeSha: string;\n parents: string[];\n};\n\nexport type CreateGitCommitResponse = {\n sha: string;\n url: string;\n};\n\nconst createGitCommitSchema = z.object({\n sha: z.string(),\n url: z.string(),\n});\n\nexport type CreateGitCommit = (\n args: CreateGitCommitArgs\n) => Promise<CreateGitCommitResponse>;\n\nexport type CreateGitCommitFactory = (\n instance: AxiosInstance\n) => CreateGitCommit;\n\n/**\n * Create a git commit\n * @param owner the owner of the repository\n * @param repo the name of the repository\n * @param token the github token\n * @param message the commit message\n * @param treeSha the sha of the tree\n * @param parents the parents of the commit\n * @returns CreateGitCommitResponse\n */\nexport const createGitCommitFactory: CreateGitCommitFactory = (instance) => async (args) => {\n const { message, treeSha, parents } = args;\n\n try {\n const { data } = await instance.post<CreateGitCommitResponse>(\n '/git/commits',\n {\n message,\n tree: treeSha,\n parents,\n },\n );\n\n return createGitCommitSchema.parse(data);\n } catch (error) {\n throw handleError(error);\n }\n};\n"],"names":["z","__awaiter","handleError"],"mappings":";;;;;;;;AAgBA,MAAM,qBAAqB,GAAGA,KAAC,CAAC,MAAM,CAAC;AACrC,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AACf,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AAChB,CAAA,CAAC,CAAC;AAUH;;;;;;;;;AASG;AACI,MAAM,sBAAsB,GAA2B,CAAC,QAAQ,KAAK,CAAO,IAAI,KAAIC,gBAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;IACzF,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAE3C,IAAI;QACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,CAClC,cAAc,EACd;YACE,OAAO;AACP,YAAA,IAAI,EAAE,OAAO;YACb,OAAO;AACR,SAAA,CACF,CAAC;AAEF,QAAA,OAAO,qBAAqB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC1C,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACd,QAAA,MAAMC,iBAAW,CAAC,KAAK,CAAC,CAAC;AAC1B,KAAA;AACH,CAAC;;;;"}
@@ -1,29 +0,0 @@
1
- import type { AxiosInstance } from 'axios';
2
- export declare type Blob = {
3
- path: string;
4
- sha: string;
5
- };
6
- export declare type CreateGitTreeArgs = {
7
- baseTreeSha: string;
8
- blobs: Blob[];
9
- };
10
- export declare type CreateGitTreeResponse = {
11
- sha: string;
12
- url: string;
13
- };
14
- export declare type CreateGitTree = (args: CreateGitTreeArgs) => Promise<CreateGitTreeResponse>;
15
- export declare type CreateGitTreeFactory = (instance: AxiosInstance) => CreateGitTree;
16
- /**
17
- * Create a git tree
18
- *
19
- * @param owner the owner of the repository
20
- * @param repo the name of the repository
21
- * @param token the github token
22
- * @param baseTreeSha the sha of the base tree
23
- * @param blobs the blobs to add to the tree
24
- * @returns CreateGitTreeResponse
25
- * @throws forbidden
26
- * @throws resource-not-found
27
- * @throws validation-failed-or-the-endpoint-has-been-spammed
28
- */
29
- export declare const createGitTreeFactory: CreateGitTreeFactory;
@@ -1,47 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _tslib = require('../../_virtual/_tslib.js');
6
- var zod = require('zod');
7
- var utils = require('./utils.js');
8
-
9
- const createGitTreeSchema = zod.z.object({
10
- sha: zod.z.string(),
11
- url: zod.z.string(),
12
- });
13
- /**
14
- * Create a git tree
15
- *
16
- * @param owner the owner of the repository
17
- * @param repo the name of the repository
18
- * @param token the github token
19
- * @param baseTreeSha the sha of the base tree
20
- * @param blobs the blobs to add to the tree
21
- * @returns CreateGitTreeResponse
22
- * @throws forbidden
23
- * @throws resource-not-found
24
- * @throws validation-failed-or-the-endpoint-has-been-spammed
25
- */
26
- const createGitTreeFactory = (instance) => (args) => _tslib.__awaiter(void 0, void 0, void 0, function* () {
27
- const { baseTreeSha, blobs } = args;
28
- const tree = blobs.map((blob) => ({
29
- path: blob.path,
30
- mode: '100644',
31
- type: 'blob',
32
- sha: blob.sha,
33
- }));
34
- try {
35
- const { data } = yield instance.post('/git/trees', {
36
- base_tree: baseTreeSha,
37
- tree,
38
- });
39
- return createGitTreeSchema.parse(data);
40
- }
41
- catch (error) {
42
- throw utils.handleError(error);
43
- }
44
- });
45
-
46
- exports.createGitTreeFactory = createGitTreeFactory;
47
- //# sourceMappingURL=create-git-tree.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-git-tree.js","sources":["../../../src/github/commit/create-git-tree.ts"],"sourcesContent":["import type { AxiosInstance } from 'axios';\nimport { z } from 'zod';\n\nimport { handleError } from './utils';\n\nexport type Blob = {\n path: string;\n sha: string;\n};\n\nexport type CreateGitTreeArgs = {\n baseTreeSha: string;\n blobs: Blob[];\n};\n\nexport type CreateGitTreeResponse = {\n sha: string;\n url: string;\n};\n\nconst createGitTreeSchema = z.object({\n sha: z.string(),\n url: z.string(),\n});\n\nexport type CreateGitTree = (\n args: CreateGitTreeArgs\n) => Promise<CreateGitTreeResponse>;\n\nexport type CreateGitTreeFactory = (instance: AxiosInstance) => CreateGitTree;\n\n/**\n * Create a git tree\n *\n * @param owner the owner of the repository\n * @param repo the name of the repository\n * @param token the github token\n * @param baseTreeSha the sha of the base tree\n * @param blobs the blobs to add to the tree\n * @returns CreateGitTreeResponse\n * @throws forbidden\n * @throws resource-not-found\n * @throws validation-failed-or-the-endpoint-has-been-spammed\n */\nexport const createGitTreeFactory: CreateGitTreeFactory = (instance) => async (args) => {\n const { baseTreeSha, blobs } = args;\n\n const tree = blobs.map((blob) => ({\n path: blob.path,\n mode: '100644',\n type: 'blob',\n sha: blob.sha,\n }));\n\n try {\n const { data } = await instance.post<CreateGitTreeResponse>(\n '/git/trees',\n {\n base_tree: baseTreeSha,\n tree,\n },\n );\n\n return createGitTreeSchema.parse(data);\n } catch (error) {\n throw handleError(error);\n }\n};\n"],"names":["z","__awaiter","handleError"],"mappings":";;;;;;;;AAoBA,MAAM,mBAAmB,GAAGA,KAAC,CAAC,MAAM,CAAC;AACnC,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AACf,IAAA,GAAG,EAAEA,KAAC,CAAC,MAAM,EAAE;AAChB,CAAA,CAAC,CAAC;AAQH;;;;;;;;;;;;AAYG;AACI,MAAM,oBAAoB,GAAyB,CAAC,QAAQ,KAAK,CAAO,IAAI,KAAIC,gBAAA,CAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,KAAA,CAAA,EAAA,aAAA;AACrF,IAAA,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEpC,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,MAAM;QAChC,IAAI,EAAE,IAAI,CAAC,IAAI;AACf,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,IAAI,EAAE,MAAM;QACZ,GAAG,EAAE,IAAI,CAAC,GAAG;AACd,KAAA,CAAC,CAAC,CAAC;IAEJ,IAAI;QACF,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,IAAI,CAClC,YAAY,EACZ;AACE,YAAA,SAAS,EAAE,WAAW;YACtB,IAAI;AACL,SAAA,CACF,CAAC;AAEF,QAAA,OAAO,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AACxC,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACd,QAAA,MAAMC,iBAAW,CAAC,KAAK,CAAC,CAAC;AAC1B,KAAA;AACH,CAAC;;;;"}
@@ -1,21 +0,0 @@
1
- import type { AxiosInstance } from 'axios';
2
- export declare type GetShaLastCommitOfBranchArgs = {
3
- ref: `/heads/${string}`;
4
- };
5
- export declare type GetShaLastCommitOfBranchResponse = {
6
- sha: string;
7
- url: string;
8
- };
9
- export declare type GetShaLastCommitOfBranch = (args: GetShaLastCommitOfBranchArgs) => Promise<GetShaLastCommitOfBranchResponse>;
10
- export declare type GetShaLastCommitOfBranchFactory = (instance: AxiosInstance) => GetShaLastCommitOfBranch;
11
- /**
12
- * Get the sha of the last commit of a branch
13
- *
14
- * @param owner the owner of the repository
15
- * @param repo the name of the repository
16
- * @param ref the reference to a branch. Example: /heads/master
17
- * @param token the github token
18
- * @returns GetShaLastCommitOfBranchResponse
19
- * @throws ref-not-found
20
- */
21
- export declare const getShaLastCommitOfBranchFactory: GetShaLastCommitOfBranchFactory;