@strapi/data-transfer 0.0.0-experimental.62ce06180fe9a772eaeb3d43d238b26644f39f7c → 0.0.0-experimental.6340da17068c3bed7fb006e7bcc554c71129e282

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 (395) hide show
  1. package/LICENSE +19 -4
  2. package/dist/directory/index.d.ts +2 -0
  3. package/dist/directory/index.d.ts.map +1 -0
  4. package/dist/directory/index.js +8 -0
  5. package/dist/directory/index.js.map +1 -0
  6. package/dist/directory/index.mjs +3 -0
  7. package/dist/directory/index.mjs.map +1 -0
  8. package/dist/directory/providers/destination/index.d.ts +38 -0
  9. package/dist/directory/providers/destination/index.d.ts.map +1 -0
  10. package/dist/directory/providers/destination/index.js +184 -0
  11. package/dist/directory/providers/destination/index.js.map +1 -0
  12. package/dist/directory/providers/destination/index.mjs +177 -0
  13. package/dist/directory/providers/destination/index.mjs.map +1 -0
  14. package/dist/directory/providers/destination/utils.d.ts +8 -0
  15. package/dist/directory/providers/destination/utils.d.ts.map +1 -0
  16. package/dist/directory/providers/destination/utils.js +62 -0
  17. package/dist/directory/providers/destination/utils.js.map +1 -0
  18. package/dist/directory/providers/destination/utils.mjs +56 -0
  19. package/dist/directory/providers/destination/utils.mjs.map +1 -0
  20. package/dist/directory/providers/index.d.ts +3 -0
  21. package/dist/directory/providers/index.d.ts.map +1 -0
  22. package/dist/directory/providers/index.js +10 -0
  23. package/dist/directory/providers/index.js.map +1 -0
  24. package/dist/directory/providers/index.mjs +3 -0
  25. package/dist/directory/providers/index.mjs.map +1 -0
  26. package/dist/directory/providers/source/index.d.ts +27 -0
  27. package/dist/directory/providers/source/index.d.ts.map +1 -0
  28. package/dist/directory/providers/source/index.js +266 -0
  29. package/dist/directory/providers/source/index.js.map +1 -0
  30. package/dist/directory/providers/source/index.mjs +259 -0
  31. package/dist/directory/providers/source/index.mjs.map +1 -0
  32. package/dist/engine/errors.js +39 -0
  33. package/dist/engine/errors.js.map +1 -0
  34. package/dist/engine/errors.mjs +34 -0
  35. package/dist/engine/errors.mjs.map +1 -0
  36. package/dist/engine/index.d.ts +2 -3
  37. package/dist/engine/index.d.ts.map +1 -1
  38. package/dist/engine/index.js +922 -0
  39. package/dist/engine/index.js.map +1 -0
  40. package/dist/engine/index.mjs +917 -0
  41. package/dist/engine/index.mjs.map +1 -0
  42. package/dist/engine/validation/provider.d.ts +2 -2
  43. package/dist/engine/validation/provider.d.ts.map +1 -1
  44. package/dist/engine/validation/provider.js +19 -0
  45. package/dist/engine/validation/provider.js.map +1 -0
  46. package/dist/engine/validation/provider.mjs +17 -0
  47. package/dist/engine/validation/provider.mjs.map +1 -0
  48. package/dist/engine/validation/schemas/index.d.ts.map +1 -1
  49. package/dist/engine/validation/schemas/index.js +59 -0
  50. package/dist/engine/validation/schemas/index.js.map +1 -0
  51. package/dist/engine/validation/schemas/index.mjs +57 -0
  52. package/dist/engine/validation/schemas/index.mjs.map +1 -0
  53. package/dist/errors/base.js +13 -0
  54. package/dist/errors/base.js.map +1 -0
  55. package/dist/errors/base.mjs +11 -0
  56. package/dist/errors/base.mjs.map +1 -0
  57. package/dist/errors/constants.d.ts +1 -1
  58. package/dist/errors/constants.d.ts.map +1 -1
  59. package/dist/errors/constants.js +9 -0
  60. package/dist/errors/constants.js.map +1 -0
  61. package/dist/errors/constants.mjs +7 -0
  62. package/dist/errors/constants.mjs.map +1 -0
  63. package/dist/errors/providers.d.ts +1 -1
  64. package/dist/errors/providers.d.ts.map +1 -1
  65. package/dist/errors/providers.js +41 -0
  66. package/dist/errors/providers.js.map +1 -0
  67. package/dist/errors/providers.mjs +36 -0
  68. package/dist/errors/providers.mjs.map +1 -0
  69. package/dist/file/index.js +8 -0
  70. package/dist/file/index.js.map +1 -0
  71. package/dist/file/index.mjs +3 -0
  72. package/dist/file/index.mjs.map +1 -0
  73. package/dist/file/providers/destination/index.d.ts +3 -5
  74. package/dist/file/providers/destination/index.d.ts.map +1 -1
  75. package/dist/file/providers/destination/index.js +254 -0
  76. package/dist/file/providers/destination/index.js.map +1 -0
  77. package/dist/file/providers/destination/index.mjs +246 -0
  78. package/dist/file/providers/destination/index.mjs.map +1 -0
  79. package/dist/file/providers/destination/utils.d.ts +0 -1
  80. package/dist/file/providers/destination/utils.d.ts.map +1 -1
  81. package/dist/file/providers/destination/utils.js +63 -0
  82. package/dist/file/providers/destination/utils.js.map +1 -0
  83. package/dist/file/providers/destination/utils.mjs +60 -0
  84. package/dist/file/providers/destination/utils.mjs.map +1 -0
  85. package/dist/file/providers/index.js +10 -0
  86. package/dist/file/providers/index.js.map +1 -0
  87. package/dist/file/providers/index.mjs +3 -0
  88. package/dist/file/providers/index.mjs.map +1 -0
  89. package/dist/file/providers/source/index.d.ts +3 -3
  90. package/dist/file/providers/source/index.d.ts.map +1 -1
  91. package/dist/file/providers/source/index.js +336 -0
  92. package/dist/file/providers/source/index.js.map +1 -0
  93. package/dist/file/providers/source/index.mjs +328 -0
  94. package/dist/file/providers/source/index.mjs.map +1 -0
  95. package/dist/file/providers/source/utils.d.ts.map +1 -1
  96. package/dist/file/providers/source/utils.js +60 -0
  97. package/dist/file/providers/source/utils.js.map +1 -0
  98. package/dist/file/providers/source/utils.mjs +52 -0
  99. package/dist/file/providers/source/utils.mjs.map +1 -0
  100. package/dist/index.d.ts +1 -0
  101. package/dist/index.d.ts.map +1 -1
  102. package/dist/index.js +15 -4408
  103. package/dist/index.js.map +1 -1
  104. package/dist/index.mjs +10 -4382
  105. package/dist/index.mjs.map +1 -1
  106. package/dist/strapi/index.js +12 -0
  107. package/dist/strapi/index.js.map +1 -0
  108. package/dist/strapi/index.mjs +7 -0
  109. package/dist/strapi/index.mjs.map +1 -0
  110. package/dist/strapi/providers/index.js +18 -0
  111. package/dist/strapi/providers/index.js.map +1 -0
  112. package/dist/strapi/providers/index.mjs +8 -0
  113. package/dist/strapi/providers/index.mjs.map +1 -0
  114. package/dist/strapi/providers/local-destination/assets-destination-writable.d.ts +26 -0
  115. package/dist/strapi/providers/local-destination/assets-destination-writable.d.ts.map +1 -0
  116. package/dist/strapi/providers/local-destination/assets-destination-writable.js +125 -0
  117. package/dist/strapi/providers/local-destination/assets-destination-writable.js.map +1 -0
  118. package/dist/strapi/providers/local-destination/assets-destination-writable.mjs +123 -0
  119. package/dist/strapi/providers/local-destination/assets-destination-writable.mjs.map +1 -0
  120. package/dist/strapi/providers/local-destination/index.d.ts +5 -3
  121. package/dist/strapi/providers/local-destination/index.d.ts.map +1 -1
  122. package/dist/strapi/providers/local-destination/index.js +362 -0
  123. package/dist/strapi/providers/local-destination/index.js.map +1 -0
  124. package/dist/strapi/providers/local-destination/index.mjs +335 -0
  125. package/dist/strapi/providers/local-destination/index.mjs.map +1 -0
  126. package/dist/strapi/providers/local-destination/strategies/restore/configuration.d.ts +1 -2
  127. package/dist/strapi/providers/local-destination/strategies/restore/configuration.d.ts.map +1 -1
  128. package/dist/strapi/providers/local-destination/strategies/restore/configuration.js +58 -0
  129. package/dist/strapi/providers/local-destination/strategies/restore/configuration.js.map +1 -0
  130. package/dist/strapi/providers/local-destination/strategies/restore/configuration.mjs +51 -0
  131. package/dist/strapi/providers/local-destination/strategies/restore/configuration.mjs.map +1 -0
  132. package/dist/strapi/providers/local-destination/strategies/restore/entities.d.ts +1 -2
  133. package/dist/strapi/providers/local-destination/strategies/restore/entities.d.ts.map +1 -1
  134. package/dist/strapi/providers/local-destination/strategies/restore/entities.js +54 -0
  135. package/dist/strapi/providers/local-destination/strategies/restore/entities.js.map +1 -0
  136. package/dist/strapi/providers/local-destination/strategies/restore/entities.mjs +52 -0
  137. package/dist/strapi/providers/local-destination/strategies/restore/entities.mjs.map +1 -0
  138. package/dist/strapi/providers/local-destination/strategies/restore/index.d.ts.map +1 -1
  139. package/dist/strapi/providers/local-destination/strategies/restore/index.js +124 -0
  140. package/dist/strapi/providers/local-destination/strategies/restore/index.js.map +1 -0
  141. package/dist/strapi/providers/local-destination/strategies/restore/index.mjs +120 -0
  142. package/dist/strapi/providers/local-destination/strategies/restore/index.mjs.map +1 -0
  143. package/dist/strapi/providers/local-destination/strategies/restore/links.d.ts +1 -2
  144. package/dist/strapi/providers/local-destination/strategies/restore/links.d.ts.map +1 -1
  145. package/dist/strapi/providers/local-destination/strategies/restore/links.js +79 -0
  146. package/dist/strapi/providers/local-destination/strategies/restore/links.js.map +1 -0
  147. package/dist/strapi/providers/local-destination/strategies/restore/links.mjs +77 -0
  148. package/dist/strapi/providers/local-destination/strategies/restore/links.mjs.map +1 -0
  149. package/dist/strapi/providers/local-source/assets.d.ts +8 -2
  150. package/dist/strapi/providers/local-source/assets.d.ts.map +1 -1
  151. package/dist/strapi/providers/local-source/assets.js +151 -0
  152. package/dist/strapi/providers/local-source/assets.js.map +1 -0
  153. package/dist/strapi/providers/local-source/assets.mjs +147 -0
  154. package/dist/strapi/providers/local-source/assets.mjs.map +1 -0
  155. package/dist/strapi/providers/local-source/configuration.d.ts +0 -1
  156. package/dist/strapi/providers/local-source/configuration.d.ts.map +1 -1
  157. package/dist/strapi/providers/local-source/configuration.js +47 -0
  158. package/dist/strapi/providers/local-source/configuration.js.map +1 -0
  159. package/dist/strapi/providers/local-source/configuration.mjs +45 -0
  160. package/dist/strapi/providers/local-source/configuration.mjs.map +1 -0
  161. package/dist/strapi/providers/local-source/entities.d.ts +3 -2
  162. package/dist/strapi/providers/local-source/entities.d.ts.map +1 -1
  163. package/dist/strapi/providers/local-source/entities.js +66 -0
  164. package/dist/strapi/providers/local-source/entities.js.map +1 -0
  165. package/dist/strapi/providers/local-source/entities.mjs +63 -0
  166. package/dist/strapi/providers/local-source/entities.mjs.map +1 -0
  167. package/dist/strapi/providers/local-source/estimate-asset-totals.d.ts +11 -0
  168. package/dist/strapi/providers/local-source/estimate-asset-totals.d.ts.map +1 -0
  169. package/dist/strapi/providers/local-source/estimate-asset-totals.js +130 -0
  170. package/dist/strapi/providers/local-source/estimate-asset-totals.js.map +1 -0
  171. package/dist/strapi/providers/local-source/estimate-asset-totals.mjs +128 -0
  172. package/dist/strapi/providers/local-source/estimate-asset-totals.mjs.map +1 -0
  173. package/dist/strapi/providers/local-source/index.d.ts +6 -4
  174. package/dist/strapi/providers/local-source/index.d.ts.map +1 -1
  175. package/dist/strapi/providers/local-source/index.js +186 -0
  176. package/dist/strapi/providers/local-source/index.js.map +1 -0
  177. package/dist/strapi/providers/local-source/index.mjs +183 -0
  178. package/dist/strapi/providers/local-source/index.mjs.map +1 -0
  179. package/dist/strapi/providers/local-source/links.d.ts +0 -1
  180. package/dist/strapi/providers/local-source/links.d.ts.map +1 -1
  181. package/dist/strapi/providers/local-source/links.js +26 -0
  182. package/dist/strapi/providers/local-source/links.js.map +1 -0
  183. package/dist/strapi/providers/local-source/links.mjs +24 -0
  184. package/dist/strapi/providers/local-source/links.mjs.map +1 -0
  185. package/dist/strapi/providers/remote-destination/index.d.ts +13 -5
  186. package/dist/strapi/providers/remote-destination/index.d.ts.map +1 -1
  187. package/dist/strapi/providers/remote-destination/index.js +482 -0
  188. package/dist/strapi/providers/remote-destination/index.js.map +1 -0
  189. package/dist/strapi/providers/remote-destination/index.mjs +480 -0
  190. package/dist/strapi/providers/remote-destination/index.mjs.map +1 -0
  191. package/dist/strapi/providers/remote-source/index.d.ts +11 -6
  192. package/dist/strapi/providers/remote-source/index.d.ts.map +1 -1
  193. package/dist/strapi/providers/remote-source/index.js +538 -0
  194. package/dist/strapi/providers/remote-source/index.js.map +1 -0
  195. package/dist/strapi/providers/remote-source/index.mjs +536 -0
  196. package/dist/strapi/providers/remote-source/index.mjs.map +1 -0
  197. package/dist/strapi/providers/utils.d.ts +22 -16
  198. package/dist/strapi/providers/utils.d.ts.map +1 -1
  199. package/dist/strapi/providers/utils.js +178 -0
  200. package/dist/strapi/providers/utils.js.map +1 -0
  201. package/dist/strapi/providers/utils.mjs +174 -0
  202. package/dist/strapi/providers/utils.mjs.map +1 -0
  203. package/dist/strapi/queries/entity.d.ts.map +1 -1
  204. package/dist/strapi/queries/entity.js +125 -0
  205. package/dist/strapi/queries/entity.js.map +1 -0
  206. package/dist/strapi/queries/entity.mjs +123 -0
  207. package/dist/strapi/queries/entity.mjs.map +1 -0
  208. package/dist/strapi/queries/index.js +10 -0
  209. package/dist/strapi/queries/index.js.map +1 -0
  210. package/dist/strapi/queries/index.mjs +5 -0
  211. package/dist/strapi/queries/index.mjs.map +1 -0
  212. package/dist/strapi/queries/link.d.ts +1 -1
  213. package/dist/strapi/queries/link.d.ts.map +1 -1
  214. package/dist/strapi/queries/link.js +298 -0
  215. package/dist/strapi/queries/link.js.map +1 -0
  216. package/dist/strapi/queries/link.mjs +295 -0
  217. package/dist/strapi/queries/link.mjs.map +1 -0
  218. package/dist/strapi/remote/constants.d.ts.map +1 -1
  219. package/dist/strapi/remote/constants.js +11 -0
  220. package/dist/strapi/remote/constants.js.map +1 -0
  221. package/dist/strapi/remote/constants.mjs +8 -0
  222. package/dist/strapi/remote/constants.mjs.map +1 -0
  223. package/dist/strapi/remote/flows/default.d.ts.map +1 -1
  224. package/dist/strapi/remote/flows/default.js +43 -0
  225. package/dist/strapi/remote/flows/default.js.map +1 -0
  226. package/dist/strapi/remote/flows/default.mjs +41 -0
  227. package/dist/strapi/remote/flows/default.mjs.map +1 -0
  228. package/dist/strapi/remote/flows/index.d.ts +1 -1
  229. package/dist/strapi/remote/flows/index.d.ts.map +1 -1
  230. package/dist/strapi/remote/flows/index.js +54 -0
  231. package/dist/strapi/remote/flows/index.js.map +1 -0
  232. package/dist/strapi/remote/flows/index.mjs +52 -0
  233. package/dist/strapi/remote/flows/index.mjs.map +1 -0
  234. package/dist/strapi/remote/handlers/abstract.d.ts +4 -1
  235. package/dist/strapi/remote/handlers/abstract.d.ts.map +1 -1
  236. package/dist/strapi/remote/handlers/constants.js +10 -0
  237. package/dist/strapi/remote/handlers/constants.js.map +1 -0
  238. package/dist/strapi/remote/handlers/constants.mjs +8 -0
  239. package/dist/strapi/remote/handlers/constants.mjs.map +1 -0
  240. package/dist/strapi/remote/handlers/index.js +12 -0
  241. package/dist/strapi/remote/handlers/index.js.map +1 -0
  242. package/dist/strapi/remote/handlers/index.mjs +4 -0
  243. package/dist/strapi/remote/handlers/index.mjs.map +1 -0
  244. package/dist/strapi/remote/handlers/pull.d.ts +2 -3
  245. package/dist/strapi/remote/handlers/pull.d.ts.map +1 -1
  246. package/dist/strapi/remote/handlers/pull.js +369 -0
  247. package/dist/strapi/remote/handlers/pull.js.map +1 -0
  248. package/dist/strapi/remote/handlers/pull.mjs +367 -0
  249. package/dist/strapi/remote/handlers/pull.mjs.map +1 -0
  250. package/dist/strapi/remote/handlers/push.d.ts +16 -5
  251. package/dist/strapi/remote/handlers/push.d.ts.map +1 -1
  252. package/dist/strapi/remote/handlers/push.js +454 -0
  253. package/dist/strapi/remote/handlers/push.js.map +1 -0
  254. package/dist/strapi/remote/handlers/push.mjs +452 -0
  255. package/dist/strapi/remote/handlers/push.mjs.map +1 -0
  256. package/dist/strapi/remote/handlers/utils.d.ts +1 -2
  257. package/dist/strapi/remote/handlers/utils.d.ts.map +1 -1
  258. package/dist/strapi/remote/handlers/utils.js +318 -0
  259. package/dist/strapi/remote/handlers/utils.js.map +1 -0
  260. package/dist/strapi/remote/handlers/utils.mjs +312 -0
  261. package/dist/strapi/remote/handlers/utils.mjs.map +1 -0
  262. package/dist/strapi/remote/index.js +10 -0
  263. package/dist/strapi/remote/index.js.map +1 -0
  264. package/dist/strapi/remote/index.mjs +5 -0
  265. package/dist/strapi/remote/index.mjs.map +1 -0
  266. package/dist/strapi/utils/project-settings-logos.d.ts +29 -0
  267. package/dist/strapi/utils/project-settings-logos.d.ts.map +1 -0
  268. package/dist/strapi/utils/project-settings-logos.js +174 -0
  269. package/dist/strapi/utils/project-settings-logos.js.map +1 -0
  270. package/dist/strapi/utils/project-settings-logos.mjs +169 -0
  271. package/dist/strapi/utils/project-settings-logos.mjs.map +1 -0
  272. package/dist/types/common-entities.d.ts +149 -0
  273. package/dist/types/common-entities.d.ts.map +1 -0
  274. package/dist/types/encryption.d.ts +13 -0
  275. package/dist/types/encryption.d.ts.map +1 -0
  276. package/dist/types/index.d.ts +7 -0
  277. package/dist/types/index.d.ts.map +1 -0
  278. package/dist/types/providers.d.ts +49 -0
  279. package/dist/types/providers.d.ts.map +1 -0
  280. package/dist/types/remote/index.d.ts +2 -0
  281. package/dist/types/remote/index.d.ts.map +1 -0
  282. package/dist/types/remote/protocol/auth.d.ts +5 -0
  283. package/dist/types/remote/protocol/auth.d.ts.map +1 -0
  284. package/dist/types/remote/protocol/client/commands.d.ts +37 -0
  285. package/dist/types/remote/protocol/client/commands.d.ts.map +1 -0
  286. package/dist/types/remote/protocol/client/index.d.ts +9 -0
  287. package/dist/types/remote/protocol/client/index.d.ts.map +1 -0
  288. package/dist/types/remote/protocol/client/transfer/action.d.ts +5 -0
  289. package/dist/types/remote/protocol/client/transfer/action.d.ts.map +1 -0
  290. package/dist/types/remote/protocol/client/transfer/index.d.ts +12 -0
  291. package/dist/types/remote/protocol/client/transfer/index.d.ts.map +1 -0
  292. package/dist/types/remote/protocol/client/transfer/pull.d.ts +25 -0
  293. package/dist/types/remote/protocol/client/transfer/pull.d.ts.map +1 -0
  294. package/dist/types/remote/protocol/client/transfer/push.d.ts +29 -0
  295. package/dist/types/remote/protocol/client/transfer/push.d.ts.map +1 -0
  296. package/dist/types/remote/protocol/client/transfer/utils.d.ts +47 -0
  297. package/dist/types/remote/protocol/client/transfer/utils.d.ts.map +1 -0
  298. package/dist/types/remote/protocol/index.d.ts +4 -0
  299. package/dist/types/remote/protocol/index.d.ts.map +1 -0
  300. package/dist/types/remote/protocol/server/error.d.ts +18 -0
  301. package/dist/types/remote/protocol/server/error.d.ts.map +1 -0
  302. package/dist/types/remote/protocol/server/index.d.ts +3 -0
  303. package/dist/types/remote/protocol/server/index.d.ts.map +1 -0
  304. package/dist/types/remote/protocol/server/messaging.d.ts +37 -0
  305. package/dist/types/remote/protocol/server/messaging.d.ts.map +1 -0
  306. package/dist/types/transfer-engine.d.ts +148 -0
  307. package/dist/types/transfer-engine.d.ts.map +1 -0
  308. package/dist/types/utils.d.ts +82 -0
  309. package/dist/types/utils.d.ts.map +1 -0
  310. package/dist/utils/components.d.ts +23 -3
  311. package/dist/utils/components.d.ts.map +1 -1
  312. package/dist/utils/components.js +230 -0
  313. package/dist/utils/components.js.map +1 -0
  314. package/dist/utils/components.mjs +219 -0
  315. package/dist/utils/components.mjs.map +1 -0
  316. package/dist/{engine → utils}/diagnostic.d.ts +1 -0
  317. package/dist/utils/diagnostic.d.ts.map +1 -0
  318. package/dist/utils/diagnostic.js +51 -0
  319. package/dist/utils/diagnostic.js.map +1 -0
  320. package/dist/utils/diagnostic.mjs +49 -0
  321. package/dist/utils/diagnostic.mjs.map +1 -0
  322. package/dist/utils/encryption/decrypt.d.ts +6 -5
  323. package/dist/utils/encryption/decrypt.d.ts.map +1 -1
  324. package/dist/utils/encryption/decrypt.js +47 -0
  325. package/dist/utils/encryption/decrypt.js.map +1 -0
  326. package/dist/utils/encryption/decrypt.mjs +45 -0
  327. package/dist/utils/encryption/decrypt.mjs.map +1 -0
  328. package/dist/utils/encryption/encrypt.d.ts +6 -5
  329. package/dist/utils/encryption/encrypt.d.ts.map +1 -1
  330. package/dist/utils/encryption/encrypt.js +47 -0
  331. package/dist/utils/encryption/encrypt.js.map +1 -0
  332. package/dist/utils/encryption/encrypt.mjs +45 -0
  333. package/dist/utils/encryption/encrypt.mjs.map +1 -0
  334. package/dist/utils/encryption/index.js +10 -0
  335. package/dist/utils/encryption/index.js.map +1 -0
  336. package/dist/utils/encryption/index.mjs +3 -0
  337. package/dist/utils/encryption/index.mjs.map +1 -0
  338. package/dist/utils/index.d.ts +3 -0
  339. package/dist/utils/index.d.ts.map +1 -1
  340. package/dist/utils/index.js +28 -0
  341. package/dist/utils/index.js.map +1 -0
  342. package/dist/utils/index.mjs +17 -0
  343. package/dist/utils/index.mjs.map +1 -0
  344. package/dist/utils/json.d.ts.map +1 -1
  345. package/dist/utils/json.js +96 -0
  346. package/dist/utils/json.js.map +1 -0
  347. package/dist/utils/json.mjs +94 -0
  348. package/dist/utils/json.mjs.map +1 -0
  349. package/dist/utils/middleware.d.ts +1 -1
  350. package/dist/utils/middleware.d.ts.map +1 -1
  351. package/dist/utils/middleware.js +14 -0
  352. package/dist/utils/middleware.js.map +1 -0
  353. package/dist/utils/middleware.mjs +12 -0
  354. package/dist/utils/middleware.mjs.map +1 -0
  355. package/dist/utils/providers.js +12 -0
  356. package/dist/utils/providers.js.map +1 -0
  357. package/dist/utils/providers.mjs +10 -0
  358. package/dist/utils/providers.mjs.map +1 -0
  359. package/dist/utils/schema.d.ts.map +1 -1
  360. package/dist/utils/schema.js +32 -0
  361. package/dist/utils/schema.js.map +1 -0
  362. package/dist/utils/schema.mjs +29 -0
  363. package/dist/utils/schema.mjs.map +1 -0
  364. package/dist/utils/stream.d.ts +0 -1
  365. package/dist/utils/stream.d.ts.map +1 -1
  366. package/dist/utils/stream.js +96 -0
  367. package/dist/utils/stream.js.map +1 -0
  368. package/dist/utils/stream.mjs +92 -0
  369. package/dist/utils/stream.mjs.map +1 -0
  370. package/dist/utils/transaction.d.ts +1 -1
  371. package/dist/utils/transaction.d.ts.map +1 -1
  372. package/dist/utils/transaction.js +93 -0
  373. package/dist/utils/transaction.js.map +1 -0
  374. package/dist/utils/transaction.mjs +91 -0
  375. package/dist/utils/transaction.mjs.map +1 -0
  376. package/dist/utils/transfer-asset-chunk.d.ts +61 -0
  377. package/dist/utils/transfer-asset-chunk.d.ts.map +1 -0
  378. package/dist/utils/transfer-asset-chunk.js +118 -0
  379. package/dist/utils/transfer-asset-chunk.js.map +1 -0
  380. package/dist/utils/transfer-asset-chunk.mjs +112 -0
  381. package/dist/utils/transfer-asset-chunk.mjs.map +1 -0
  382. package/dist/utils/transfer-websocket-json.d.ts +24 -0
  383. package/dist/utils/transfer-websocket-json.d.ts.map +1 -0
  384. package/dist/utils/transfer-websocket-json.js +67 -0
  385. package/dist/utils/transfer-websocket-json.js.map +1 -0
  386. package/dist/utils/transfer-websocket-json.mjs +63 -0
  387. package/dist/utils/transfer-websocket-json.mjs.map +1 -0
  388. package/dist/utils/writable-async-write.d.ts +16 -0
  389. package/dist/utils/writable-async-write.d.ts.map +1 -0
  390. package/dist/utils/writable-async-write.js +61 -0
  391. package/dist/utils/writable-async-write.js.map +1 -0
  392. package/dist/utils/writable-async-write.mjs +59 -0
  393. package/dist/utils/writable-async-write.mjs.map +1 -0
  394. package/package.json +40 -26
  395. package/dist/engine/diagnostic.d.ts.map +0 -1
@@ -0,0 +1,183 @@
1
+ import { Readable } from 'stream';
2
+ import { chain } from 'stream-chain';
3
+ import { createEntitiesStream, createEntitiesTransformStream } from './entities.mjs';
4
+ import { createLinksStream } from './links.mjs';
5
+ import { createConfigurationStream } from './configuration.mjs';
6
+ import { createAssetsStream } from './assets.mjs';
7
+ import { estimateAssetTotals } from './estimate-asset-totals.mjs';
8
+ import 'crypto';
9
+ import 'node:events';
10
+ import 'node:stream/promises';
11
+ import 'lodash/fp';
12
+ import { schemasToValidJSON, mapSchemasValues } from '../../../utils/schema.mjs';
13
+ import 'events';
14
+ import { assertValidStrapi } from '../../../utils/providers.mjs';
15
+
16
+ function _class_private_field_loose_base(receiver, privateKey) {
17
+ if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
18
+ throw new TypeError("attempted to use private field on non-instance");
19
+ }
20
+ return receiver;
21
+ }
22
+ var id = 0;
23
+ function _class_private_field_loose_key(name) {
24
+ return "__private_" + id++ + "_" + name;
25
+ }
26
+ const createLocalStrapiSourceProvider = (options)=>{
27
+ return new LocalStrapiSourceProvider(options);
28
+ };
29
+ var _diagnostics = /*#__PURE__*/ _class_private_field_loose_key("_diagnostics"), _reportInfo = /*#__PURE__*/ _class_private_field_loose_key("_reportInfo"), _reportWarning = /*#__PURE__*/ _class_private_field_loose_key("_reportWarning"), /**
30
+ * Reports an error to the diagnostic reporter.
31
+ */ _reportError = /*#__PURE__*/ _class_private_field_loose_key("_reportError"), /**
32
+ * Handles errors that occur in read streams.
33
+ */ _handleStreamError = /*#__PURE__*/ _class_private_field_loose_key("_handleStreamError");
34
+ class LocalStrapiSourceProvider {
35
+ async bootstrap(diagnostics) {
36
+ _class_private_field_loose_base(this, _diagnostics)[_diagnostics] = diagnostics;
37
+ this.strapi = await this.options.getStrapi();
38
+ this.strapi.db.lifecycles.disable();
39
+ }
40
+ async close() {
41
+ const { autoDestroy } = this.options;
42
+ assertValidStrapi(this.strapi);
43
+ this.strapi.db.lifecycles.enable();
44
+ // Basically `!== false` but more deterministic
45
+ if (autoDestroy === undefined || autoDestroy === true) {
46
+ await this.strapi?.destroy();
47
+ }
48
+ }
49
+ getMetadata() {
50
+ _class_private_field_loose_base(this, _reportInfo)[_reportInfo]('getting metadata');
51
+ assertValidStrapi(this.strapi);
52
+ const strapiVersion = this.strapi.config.get('info.strapi');
53
+ const createdAt = new Date().toISOString();
54
+ return {
55
+ createdAt,
56
+ strapi: {
57
+ version: strapiVersion
58
+ }
59
+ };
60
+ }
61
+ async createEntitiesReadStream() {
62
+ assertValidStrapi(this.strapi, 'Not able to stream entities');
63
+ _class_private_field_loose_base(this, _reportInfo)[_reportInfo]('creating entities read stream');
64
+ return chain([
65
+ // Entities stream
66
+ createEntitiesStream(this.strapi, {
67
+ onWarning: (message)=>{
68
+ this.strapi?.log.warn(message);
69
+ _class_private_field_loose_base(this, _reportWarning)[_reportWarning](message);
70
+ }
71
+ }),
72
+ // Transform stream
73
+ createEntitiesTransformStream()
74
+ ]);
75
+ }
76
+ createLinksReadStream() {
77
+ assertValidStrapi(this.strapi, 'Not able to stream links');
78
+ _class_private_field_loose_base(this, _reportInfo)[_reportInfo]('creating links read stream');
79
+ return createLinksStream(this.strapi);
80
+ }
81
+ createConfigurationReadStream() {
82
+ assertValidStrapi(this.strapi, 'Not able to stream configuration');
83
+ _class_private_field_loose_base(this, _reportInfo)[_reportInfo]('creating configuration read stream');
84
+ return createConfigurationStream(this.strapi);
85
+ }
86
+ getSchemas() {
87
+ assertValidStrapi(this.strapi, 'Not able to get Schemas');
88
+ _class_private_field_loose_base(this, _reportInfo)[_reportInfo]('getting schemas');
89
+ const schemas = schemasToValidJSON({
90
+ ...this.strapi.contentTypes,
91
+ ...this.strapi.components
92
+ });
93
+ return mapSchemasValues(schemas);
94
+ }
95
+ createSchemasReadStream() {
96
+ return Readable.from(Object.values(this.getSchemas()));
97
+ }
98
+ createAssetsReadStream() {
99
+ assertValidStrapi(this.strapi, 'Not able to stream assets');
100
+ _class_private_field_loose_base(this, _reportInfo)[_reportInfo]('creating assets read stream');
101
+ const stream = createAssetsStream(this.strapi, {
102
+ onWarning: (message)=>_class_private_field_loose_base(this, _reportWarning)[_reportWarning](message)
103
+ });
104
+ stream.on('error', (err)=>{
105
+ _class_private_field_loose_base(this, _handleStreamError)[_handleStreamError]('assets', err);
106
+ });
107
+ return stream;
108
+ }
109
+ async getStageTotals(stage) {
110
+ if (stage !== 'assets') {
111
+ return null;
112
+ }
113
+ assertValidStrapi(this.strapi, 'Not able to estimate asset totals');
114
+ return estimateAssetTotals(this.strapi);
115
+ }
116
+ constructor(options){
117
+ Object.defineProperty(this, _reportInfo, {
118
+ value: reportInfo
119
+ });
120
+ Object.defineProperty(this, _reportWarning, {
121
+ value: reportWarning
122
+ });
123
+ Object.defineProperty(this, _reportError, {
124
+ value: reportError
125
+ });
126
+ Object.defineProperty(this, _handleStreamError, {
127
+ value: handleStreamError
128
+ });
129
+ Object.defineProperty(this, _diagnostics, {
130
+ writable: true,
131
+ value: void 0
132
+ });
133
+ this.name = 'source::local-strapi';
134
+ this.type = 'source';
135
+ this.options = options;
136
+ }
137
+ }
138
+ function reportInfo(message) {
139
+ _class_private_field_loose_base(this, _diagnostics)[_diagnostics]?.report({
140
+ details: {
141
+ createdAt: new Date(),
142
+ message,
143
+ origin: 'local-source-provider'
144
+ },
145
+ kind: 'info'
146
+ });
147
+ }
148
+ function reportWarning(message) {
149
+ _class_private_field_loose_base(this, _diagnostics)[_diagnostics]?.report({
150
+ details: {
151
+ createdAt: new Date(),
152
+ message,
153
+ origin: 'local-source-provider'
154
+ },
155
+ kind: 'warning'
156
+ });
157
+ }
158
+ function reportError(message, error) {
159
+ _class_private_field_loose_base(this, _diagnostics)[_diagnostics]?.report({
160
+ details: {
161
+ createdAt: new Date(),
162
+ message,
163
+ error,
164
+ severity: 'fatal',
165
+ name: error.name
166
+ },
167
+ kind: 'error'
168
+ });
169
+ }
170
+ function handleStreamError(streamType, err) {
171
+ const { message, stack } = err;
172
+ const errorMessage = `[Data transfer] Error in ${streamType} read stream: ${message}`;
173
+ const formattedError = {
174
+ message: errorMessage,
175
+ stack,
176
+ timestamp: new Date().toISOString()
177
+ };
178
+ this.strapi?.log.error(formattedError);
179
+ _class_private_field_loose_base(this, _reportError)[_reportError](formattedError.message, err);
180
+ }
181
+
182
+ export { createLocalStrapiSourceProvider, estimateAssetTotals };
183
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":["../../../../src/strapi/providers/local-source/index.ts"],"sourcesContent":["import { Readable } from 'stream';\nimport { chain } from 'stream-chain';\nimport type { Core, Struct } from '@strapi/types';\n\nimport type { IMetadata, ISourceProvider, ProviderType, TransferStage } from '../../../types';\nimport type { IDiagnosticReporter } from '../../../utils/diagnostic';\nimport { createEntitiesStream, createEntitiesTransformStream } from './entities';\nimport { createLinksStream } from './links';\nimport { createConfigurationStream } from './configuration';\nimport { createAssetsStream } from './assets';\nimport { estimateAssetTotals } from './estimate-asset-totals';\nimport * as utils from '../../../utils';\nimport { assertValidStrapi } from '../../../utils/providers';\n\nexport interface ILocalStrapiSourceProviderOptions {\n getStrapi(): Core.Strapi | Promise<Core.Strapi>; // return an initialized instance of Strapi\n\n autoDestroy?: boolean; // shut down the instance returned by getStrapi() at the end of the transfer\n}\n\nexport const createLocalStrapiSourceProvider = (options: ILocalStrapiSourceProviderOptions) => {\n return new LocalStrapiSourceProvider(options);\n};\n\nclass LocalStrapiSourceProvider implements ISourceProvider {\n name = 'source::local-strapi';\n\n type: ProviderType = 'source';\n\n options: ILocalStrapiSourceProviderOptions;\n\n strapi?: Core.Strapi;\n\n #diagnostics?: IDiagnosticReporter;\n\n constructor(options: ILocalStrapiSourceProviderOptions) {\n this.options = options;\n }\n\n async bootstrap(diagnostics?: IDiagnosticReporter): Promise<void> {\n this.#diagnostics = diagnostics;\n this.strapi = await this.options.getStrapi();\n this.strapi.db.lifecycles.disable();\n }\n\n #reportInfo(message: string) {\n this.#diagnostics?.report({\n details: {\n createdAt: new Date(),\n message,\n origin: 'local-source-provider',\n },\n kind: 'info',\n });\n }\n\n #reportWarning(message: string) {\n this.#diagnostics?.report({\n details: {\n createdAt: new Date(),\n message,\n origin: 'local-source-provider',\n },\n kind: 'warning',\n });\n }\n\n /**\n * Reports an error to the diagnostic reporter.\n */\n #reportError(message: string, error: Error) {\n this.#diagnostics?.report({\n details: {\n createdAt: new Date(),\n message,\n error,\n severity: 'fatal',\n name: error.name,\n },\n kind: 'error',\n });\n }\n\n /**\n * Handles errors that occur in read streams.\n */\n #handleStreamError(streamType: string, err: Error) {\n const { message, stack } = err;\n const errorMessage = `[Data transfer] Error in ${streamType} read stream: ${message}`;\n const formattedError = {\n message: errorMessage,\n stack,\n timestamp: new Date().toISOString(),\n };\n\n this.strapi?.log.error(formattedError);\n this.#reportError(formattedError.message, err);\n }\n\n async close(): Promise<void> {\n const { autoDestroy } = this.options;\n assertValidStrapi(this.strapi);\n this.strapi.db.lifecycles.enable();\n // Basically `!== false` but more deterministic\n if (autoDestroy === undefined || autoDestroy === true) {\n await this.strapi?.destroy();\n }\n }\n\n getMetadata(): IMetadata {\n this.#reportInfo('getting metadata');\n assertValidStrapi(this.strapi);\n const strapiVersion = this.strapi.config.get<string>('info.strapi');\n const createdAt = new Date().toISOString();\n\n return {\n createdAt,\n strapi: {\n version: strapiVersion,\n },\n };\n }\n\n async createEntitiesReadStream(): Promise<Readable> {\n assertValidStrapi(this.strapi, 'Not able to stream entities');\n this.#reportInfo('creating entities read stream');\n return chain([\n // Entities stream\n createEntitiesStream(this.strapi, {\n onWarning: (message) => {\n this.strapi?.log.warn(message);\n this.#reportWarning(message);\n },\n }),\n\n // Transform stream\n createEntitiesTransformStream(),\n ]);\n }\n\n createLinksReadStream(): Readable {\n assertValidStrapi(this.strapi, 'Not able to stream links');\n this.#reportInfo('creating links read stream');\n\n return createLinksStream(this.strapi);\n }\n\n createConfigurationReadStream(): Readable {\n assertValidStrapi(this.strapi, 'Not able to stream configuration');\n this.#reportInfo('creating configuration read stream');\n return createConfigurationStream(this.strapi);\n }\n\n getSchemas(): Record<string, Struct.Schema> {\n assertValidStrapi(this.strapi, 'Not able to get Schemas');\n this.#reportInfo('getting schemas');\n const schemas = utils.schema.schemasToValidJSON({\n ...this.strapi.contentTypes,\n ...this.strapi.components,\n });\n\n return utils.schema.mapSchemasValues(schemas);\n }\n\n createSchemasReadStream(): Readable {\n return Readable.from(Object.values(this.getSchemas()));\n }\n\n createAssetsReadStream(): Readable {\n assertValidStrapi(this.strapi, 'Not able to stream assets');\n this.#reportInfo('creating assets read stream');\n\n const stream = createAssetsStream(this.strapi, {\n onWarning: (message) => this.#reportWarning(message),\n });\n stream.on('error', (err) => {\n this.#handleStreamError('assets', err);\n });\n\n return stream;\n }\n\n async getStageTotals(stage: TransferStage) {\n if (stage !== 'assets') {\n return null;\n }\n assertValidStrapi(this.strapi, 'Not able to estimate asset totals');\n return estimateAssetTotals(this.strapi);\n }\n}\n\nexport type ILocalStrapiSourceProvider = InstanceType<typeof LocalStrapiSourceProvider>;\n\nexport { estimateAssetTotals } from './estimate-asset-totals';\n"],"names":["createLocalStrapiSourceProvider","options","LocalStrapiSourceProvider","bootstrap","diagnostics","strapi","getStrapi","db","lifecycles","disable","close","autoDestroy","assertValidStrapi","enable","undefined","destroy","getMetadata","strapiVersion","config","get","createdAt","Date","toISOString","version","createEntitiesReadStream","chain","createEntitiesStream","onWarning","message","log","warn","createEntitiesTransformStream","createLinksReadStream","createLinksStream","createConfigurationReadStream","createConfigurationStream","getSchemas","schemas","utils","contentTypes","components","createSchemasReadStream","Readable","from","Object","values","createAssetsReadStream","stream","createAssetsStream","on","err","getStageTotals","stage","estimateAssetTotals","name","type","report","details","origin","kind","error","severity","streamType","stack","errorMessage","formattedError","timestamp"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAoBO,MAAMA,kCAAkC,CAACC,OAAAA,GAAAA;AAC9C,IAAA,OAAO,IAAIC,yBAAAA,CAA0BD,OAAAA,CAAAA;AACvC;AAWE,IAAA,YAAA,iBAAA,8BAAA,CAAA,cAAA,CAAA,EAYA,2EAWA,cAAA,iBAAA,8BAAA,CAAA,gBAAA,CAAA;;AAaC,MACD,YAAA,iBAAA,8BAAA,CAAA,cAAA,CAAA;;MAgBA,kBAAA,iBAAA,8BAAA,CAAA,oBAAA,CAAA;AA9DF,MAAMC,yBAAAA,CAAAA;IAeJ,MAAMC,SAAAA,CAAUC,WAAiC,EAAiB;QAChE,+BAAA,CAAA,IAAI,EAAC,YAAA,CAAA,CAAA,YAAA,CAAA,GAAeA,WAAAA;QACpB,IAAI,CAACC,MAAM,GAAG,MAAM,IAAI,CAACJ,OAAO,CAACK,SAAS,EAAA;AAC1C,QAAA,IAAI,CAACD,MAAM,CAACE,EAAE,CAACC,UAAU,CAACC,OAAO,EAAA;AACnC,IAAA;AAwDA,IAAA,MAAMC,KAAAA,GAAuB;AAC3B,QAAA,MAAM,EAAEC,WAAW,EAAE,GAAG,IAAI,CAACV,OAAO;QACpCW,iBAAAA,CAAkB,IAAI,CAACP,MAAM,CAAA;AAC7B,QAAA,IAAI,CAACA,MAAM,CAACE,EAAE,CAACC,UAAU,CAACK,MAAM,EAAA;;QAEhC,IAAIF,WAAAA,KAAgBG,SAAAA,IAAaH,WAAAA,KAAgB,IAAA,EAAM;YACrD,MAAM,IAAI,CAACN,MAAM,EAAEU,OAAAA,EAAAA;AACrB,QAAA;AACF,IAAA;IAEAC,WAAAA,GAAyB;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 -1 +1 @@
1
- {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/links.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAK1C;;GAEG;AACH,eAAO,MAAM,iBAAiB,WAAY,KAAK,MAAM,KAAG,QAiBvD,CAAC"}
1
+ {"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/local-source/links.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAK1C;;GAEG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,IAAI,CAAC,MAAM,KAAG,QAiBvD,CAAC"}
@@ -0,0 +1,26 @@
1
+ 'use strict';
2
+
3
+ var stream = require('stream');
4
+ var link = require('../../queries/link.js');
5
+
6
+ /**
7
+ * Create a Readable which will stream all the links from a Strapi instance
8
+ */ const createLinksStream = (strapi)=>{
9
+ const uids = [
10
+ ...Object.keys(strapi.contentTypes),
11
+ ...Object.keys(strapi.components)
12
+ ];
13
+ // Async generator stream that returns every link from a Strapi instance
14
+ return stream.Readable.from(async function* linkGenerator() {
15
+ const query = link.createLinkQuery(strapi);
16
+ for (const uid of uids){
17
+ const generator = query().generateAll(uid);
18
+ for await (const link of generator){
19
+ yield link;
20
+ }
21
+ }
22
+ }());
23
+ };
24
+
25
+ exports.createLinksStream = createLinksStream;
26
+ //# sourceMappingURL=links.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"links.js","sources":["../../../../src/strapi/providers/local-source/links.ts"],"sourcesContent":["import { Readable } from 'stream';\nimport type { Core } from '@strapi/types';\n\nimport type { ILink } from '../../../types';\nimport { createLinkQuery } from '../../queries/link';\n\n/**\n * Create a Readable which will stream all the links from a Strapi instance\n */\nexport const createLinksStream = (strapi: Core.Strapi): Readable => {\n const uids = [...Object.keys(strapi.contentTypes), ...Object.keys(strapi.components)] as string[];\n\n // Async generator stream that returns every link from a Strapi instance\n return Readable.from(\n (async function* linkGenerator(): AsyncGenerator<ILink> {\n const query = createLinkQuery(strapi);\n\n for (const uid of uids) {\n const generator = query().generateAll(uid);\n\n for await (const link of generator) {\n yield link;\n }\n }\n })()\n );\n};\n"],"names":["createLinksStream","strapi","uids","Object","keys","contentTypes","components","Readable","from","linkGenerator","query","createLinkQuery","uid","generator","generateAll","link"],"mappings":";;;;;AAMA;;IAGO,MAAMA,iBAAAA,GAAoB,CAACC,MAAAA,GAAAA;AAChC,IAAA,MAAMC,IAAAA,GAAO;WAAIC,MAAAA,CAAOC,IAAI,CAACH,MAAAA,CAAOI,YAAY,CAAA;WAAMF,MAAAA,CAAOC,IAAI,CAACH,MAAAA,CAAOK,UAAU;AAAE,KAAA;;AAGrF,IAAA,OAAOC,eAAAA,CAASC,IAAI,CACjB,gBAAgBC,aAAAA,GAAAA;AACf,QAAA,MAAMC,QAAQC,oBAAAA,CAAgBV,MAAAA,CAAAA;QAE9B,KAAK,MAAMW,OAAOV,IAAAA,CAAM;YACtB,MAAMW,SAAAA,GAAYH,KAAAA,EAAAA,CAAQI,WAAW,CAACF,GAAAA,CAAAA;YAEtC,WAAW,MAAMG,QAAQF,SAAAA,CAAW;gBAClC,MAAME,IAAAA;AACR,YAAA;AACF,QAAA;AACF,IAAA,CAAA,EAAA,CAAA;AAEJ;;;;"}
@@ -0,0 +1,24 @@
1
+ import { Readable } from 'stream';
2
+ import { createLinkQuery } from '../../queries/link.mjs';
3
+
4
+ /**
5
+ * Create a Readable which will stream all the links from a Strapi instance
6
+ */ const createLinksStream = (strapi)=>{
7
+ const uids = [
8
+ ...Object.keys(strapi.contentTypes),
9
+ ...Object.keys(strapi.components)
10
+ ];
11
+ // Async generator stream that returns every link from a Strapi instance
12
+ return Readable.from(async function* linkGenerator() {
13
+ const query = createLinkQuery(strapi);
14
+ for (const uid of uids){
15
+ const generator = query().generateAll(uid);
16
+ for await (const link of generator){
17
+ yield link;
18
+ }
19
+ }
20
+ }());
21
+ };
22
+
23
+ export { createLinksStream };
24
+ //# sourceMappingURL=links.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"links.mjs","sources":["../../../../src/strapi/providers/local-source/links.ts"],"sourcesContent":["import { Readable } from 'stream';\nimport type { Core } from '@strapi/types';\n\nimport type { ILink } from '../../../types';\nimport { createLinkQuery } from '../../queries/link';\n\n/**\n * Create a Readable which will stream all the links from a Strapi instance\n */\nexport const createLinksStream = (strapi: Core.Strapi): Readable => {\n const uids = [...Object.keys(strapi.contentTypes), ...Object.keys(strapi.components)] as string[];\n\n // Async generator stream that returns every link from a Strapi instance\n return Readable.from(\n (async function* linkGenerator(): AsyncGenerator<ILink> {\n const query = createLinkQuery(strapi);\n\n for (const uid of uids) {\n const generator = query().generateAll(uid);\n\n for await (const link of generator) {\n yield link;\n }\n }\n })()\n );\n};\n"],"names":["createLinksStream","strapi","uids","Object","keys","contentTypes","components","Readable","from","linkGenerator","query","createLinkQuery","uid","generator","generateAll","link"],"mappings":";;;AAMA;;IAGO,MAAMA,iBAAAA,GAAoB,CAACC,MAAAA,GAAAA;AAChC,IAAA,MAAMC,IAAAA,GAAO;WAAIC,MAAAA,CAAOC,IAAI,CAACH,MAAAA,CAAOI,YAAY,CAAA;WAAMF,MAAAA,CAAOC,IAAI,CAACH,MAAAA,CAAOK,UAAU;AAAE,KAAA;;AAGrF,IAAA,OAAOC,QAAAA,CAASC,IAAI,CACjB,gBAAgBC,aAAAA,GAAAA;AACf,QAAA,MAAMC,QAAQC,eAAAA,CAAgBV,MAAAA,CAAAA;QAE9B,KAAK,MAAMW,OAAOV,IAAAA,CAAM;YACtB,MAAMW,SAAAA,GAAYH,KAAAA,EAAAA,CAAQI,WAAW,CAACF,GAAAA,CAAAA;YAEtC,WAAW,MAAMG,QAAQF,SAAAA,CAAW;gBAClC,MAAME,IAAAA;AACR,YAAA;AACF,QAAA;AACF,IAAA,CAAA,EAAA,CAAA;AAEJ;;;;"}
@@ -1,18 +1,20 @@
1
- /// <reference types="node" />
2
1
  import { Writable } from 'stream';
3
2
  import { WebSocket } from 'ws';
4
3
  import type { Struct, Utils } from '@strapi/types';
5
4
  import { createDispatcher } from '../utils';
6
- import type { IDestinationProvider, IMetadata, ProviderType } from '../../../../types';
7
- import type { Auth } from '../../../../types/remote/protocol';
5
+ import type { IDestinationProvider, IMetadata, ProviderType, TransferStage } from '../../../types';
6
+ import type { IDiagnosticReporter } from '../../../utils/diagnostic';
7
+ import type { Auth } from '../../../types/remote/protocol';
8
8
  import type { ILocalStrapiDestinationProviderOptions } from '../local-destination';
9
- export interface IRemoteStrapiDestinationProviderOptions extends Pick<ILocalStrapiDestinationProviderOptions, 'restore' | 'strategy'> {
9
+ export interface IRemoteStrapiDestinationProviderOptions extends Pick<ILocalStrapiDestinationProviderOptions, 'restore' | 'strategy' | 'onTransferPhase'> {
10
10
  url: URL;
11
11
  auth?: Auth.ITransferTokenAuth;
12
12
  retryMessageOptions?: {
13
13
  retryMessageTimeout: number;
14
14
  retryMessageMaxRetries: number;
15
15
  };
16
+ /** Include per-asset stream checksums and require peers to validate on receive. */
17
+ verifyChecksums?: boolean;
16
18
  }
17
19
  declare class RemoteStrapiDestinationProvider implements IDestinationProvider {
18
20
  #private;
@@ -22,9 +24,15 @@ declare class RemoteStrapiDestinationProvider implements IDestinationProvider {
22
24
  ws: WebSocket | null;
23
25
  dispatcher: ReturnType<typeof createDispatcher> | null;
24
26
  transferID: string | null;
27
+ stats: {
28
+ [TStage in Exclude<TransferStage, 'schemas'>]: {
29
+ count: number;
30
+ };
31
+ };
25
32
  constructor(options: IRemoteStrapiDestinationProviderOptions);
33
+ private resetStats;
26
34
  initTransfer(): Promise<string>;
27
- bootstrap(): Promise<void>;
35
+ bootstrap(diagnostics?: IDiagnosticReporter): Promise<void>;
28
36
  close(): Promise<void>;
29
37
  getMetadata(): Promise<IMetadata | null> | null;
30
38
  beforeTransfer(): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/strapi/providers/remote-destination/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE/B,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAAE,gBAAgB,EAAyC,MAAM,UAAU,CAAC;AAEnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,YAAY,EAAU,MAAM,mBAAmB,CAAC;AAC/F,OAAO,KAAK,EAAkB,IAAI,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,KAAK,EAAE,sCAAsC,EAAE,MAAM,sBAAsB,CAAC;AAInF,MAAM,WAAW,uCACf,SAAQ,IAAI,CAAC,sCAAsC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC5E,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,CAAC,EAAE,IAAI,CAAC,kBAAkB,CAAC;IAC/B,mBAAmB,CAAC,EAAE;QACpB,mBAAmB,EAAE,MAAM,CAAC;QAC5B,sBAAsB,EAAE,MAAM,CAAC;KAChC,CAAC;CACH;AAID,cAAM,+BAAgC,YAAW,oBAAoB;;IACnE,IAAI,SAAgC;IAEpC,IAAI,EAAE,YAAY,CAAiB;IAEnC,OAAO,EAAE,uCAAuC,CAAC;IAEjD,EAAE,EAAE,SAAS,GAAG,IAAI,CAAC;IAErB,UAAU,EAAE,UAAU,CAAC,OAAO,gBAAgB,CAAC,GAAG,IAAI,CAAC;IAEvD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;gBAEd,OAAO,EAAE,uCAAuC;IAOtD,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC;IA+H/B,SAAS,IAAI,OAAO,CAAC,IAAI,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