@fastly/compute-js-static-publish 7.0.2 → 8.0.0-beta.1

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 (256) hide show
  1. package/README.md +13 -4
  2. package/README.short.md +13 -4
  3. package/build/cli/cli/commands/manage/clean.d.ts.map +1 -0
  4. package/build/cli/{commands → cli/commands}/manage/clean.js +62 -108
  5. package/build/cli/cli/commands/manage/collections/delete.d.ts.map +1 -0
  6. package/build/cli/{commands → cli/commands}/manage/collections/delete.js +50 -72
  7. package/build/cli/cli/commands/manage/collections/index.d.ts.map +1 -0
  8. package/build/cli/{commands → cli/commands}/manage/collections/index.js +15 -1
  9. package/build/cli/cli/commands/manage/collections/list.d.ts.map +1 -0
  10. package/build/cli/{commands → cli/commands}/manage/collections/list.js +45 -73
  11. package/build/cli/cli/commands/manage/collections/promote.d.ts.map +1 -0
  12. package/build/cli/{commands → cli/commands}/manage/collections/promote.js +56 -93
  13. package/build/cli/cli/commands/manage/collections/update-expiration.d.ts.map +1 -0
  14. package/build/cli/{commands → cli/commands}/manage/collections/update-expiration.js +48 -77
  15. package/build/cli/cli/commands/manage/index.d.ts.map +1 -0
  16. package/build/cli/{commands → cli/commands}/manage/index.js +15 -1
  17. package/build/cli/cli/commands/manage/publish-content.d.ts.map +1 -0
  18. package/build/cli/{commands → cli/commands}/manage/publish-content.js +90 -187
  19. package/build/cli/{commands → cli/commands}/scaffold/index.d.ts +4 -0
  20. package/build/cli/cli/commands/scaffold/index.d.ts.map +1 -0
  21. package/build/cli/{commands → cli/commands}/scaffold/index.js +262 -38
  22. package/build/cli/cli/compression/brotli.d.ts.map +1 -0
  23. package/build/cli/cli/compression/gzip.d.ts.map +1 -0
  24. package/build/cli/cli/compression/index.d.ts.map +1 -0
  25. package/build/cli/{index.d.ts.map → cli/index.d.ts.map} +1 -1
  26. package/build/cli/{index.js → cli/index.js} +8 -0
  27. package/build/cli/cli/storage/kv-store-local-provider.d.ts +20 -0
  28. package/build/cli/cli/storage/kv-store-local-provider.d.ts.map +1 -0
  29. package/build/cli/cli/storage/kv-store-local-provider.js +86 -0
  30. package/build/cli/cli/storage/kv-store-provider.d.ts +24 -0
  31. package/build/cli/cli/storage/kv-store-provider.d.ts.map +1 -0
  32. package/build/cli/cli/storage/kv-store-provider.js +182 -0
  33. package/build/cli/cli/storage/s3-storage-provider.d.ts +30 -0
  34. package/build/cli/cli/storage/s3-storage-provider.d.ts.map +1 -0
  35. package/build/cli/cli/storage/s3-storage-provider.js +201 -0
  36. package/build/cli/cli/storage/storage-provider.d.ts +44 -0
  37. package/build/cli/cli/storage/storage-provider.d.ts.map +1 -0
  38. package/build/cli/cli/storage/storage-provider.js +26 -0
  39. package/build/cli/cli/util/api-token.d.ts.map +1 -0
  40. package/build/cli/cli/util/args.d.ts.map +1 -0
  41. package/build/cli/cli/util/aws-credentials.d.ts +12 -0
  42. package/build/cli/cli/util/aws-credentials.d.ts.map +1 -0
  43. package/build/cli/cli/util/aws-credentials.js +67 -0
  44. package/build/cli/{util → cli/util}/config.d.ts +1 -1
  45. package/build/cli/cli/util/config.d.ts.map +1 -0
  46. package/build/cli/{util → cli/util}/config.js +36 -20
  47. package/build/cli/cli/util/content-types.d.ts.map +1 -0
  48. package/build/cli/cli/util/data.d.ts.map +1 -0
  49. package/build/cli/cli/util/fastly-toml.d.ts.map +1 -0
  50. package/build/cli/cli/util/files.d.ts.map +1 -0
  51. package/build/cli/cli/util/kv-store-items.d.ts +5 -0
  52. package/build/cli/cli/util/kv-store-items.d.ts.map +1 -0
  53. package/build/cli/{util → cli/util}/kv-store-items.js +3 -42
  54. package/build/cli/{util → cli/util}/kv-store-local-server.d.ts +4 -7
  55. package/build/cli/cli/util/kv-store-local-server.d.ts.map +1 -0
  56. package/build/cli/{util → cli/util}/kv-store.d.ts +7 -10
  57. package/build/cli/cli/util/kv-store.d.ts.map +1 -0
  58. package/build/cli/cli/util/node.d.ts.map +1 -0
  59. package/build/cli/cli/util/package.d.ts.map +1 -0
  60. package/build/cli/{util → cli/util}/package.js +1 -1
  61. package/build/cli/{util → cli/util}/retryable.d.ts +3 -0
  62. package/build/cli/cli/util/retryable.d.ts.map +1 -0
  63. package/build/cli/cli/util/retryable.js +76 -0
  64. package/build/cli/cli/util/s3.d.ts +7 -0
  65. package/build/cli/cli/util/s3.d.ts.map +1 -0
  66. package/build/cli/cli/util/s3.js +43 -0
  67. package/build/cli/cli/util/variants.d.ts.map +1 -0
  68. package/build/{models/assets/kvstore-assets.d.ts → cli/models/assets/index.d.ts} +5 -5
  69. package/build/cli/models/assets/index.d.ts.map +1 -0
  70. package/build/cli/models/assets/index.js +33 -0
  71. package/build/cli/models/compression/index.d.ts.map +1 -0
  72. package/build/cli/models/config/kv-store-config.d.ts +6 -0
  73. package/build/cli/models/config/kv-store-config.d.ts.map +1 -0
  74. package/build/cli/models/config/kv-store-config.js +15 -0
  75. package/build/{models → cli/models}/config/publish-content-config.d.ts +4 -3
  76. package/build/cli/models/config/publish-content-config.d.ts.map +1 -0
  77. package/build/cli/models/config/publisher-server-config.d.ts.map +1 -0
  78. package/build/cli/models/config/s3-storage-config.d.ts +8 -0
  79. package/build/cli/models/config/s3-storage-config.d.ts.map +1 -0
  80. package/build/cli/models/config/s3-storage-config.js +11 -0
  81. package/build/cli/models/config/static-publish-rc.d.ts +31 -0
  82. package/build/cli/models/config/static-publish-rc.d.ts.map +1 -0
  83. package/build/cli/models/config/static-publish-rc.js +39 -0
  84. package/build/cli/models/metadata/index.d.ts +2 -0
  85. package/build/cli/models/metadata/index.d.ts.map +1 -0
  86. package/build/cli/models/metadata/index.js +8 -0
  87. package/build/cli/models/server/index.d.ts +7 -0
  88. package/build/cli/models/server/index.d.ts.map +1 -0
  89. package/build/cli/models/server/index.js +26 -0
  90. package/build/cli/models/time/index.d.ts.map +1 -0
  91. package/build/{models → cli/models}/time/index.js +5 -5
  92. package/build/server/models/assets/index.d.ts +17 -0
  93. package/build/server/models/assets/index.d.ts.map +1 -0
  94. package/build/server/models/assets/index.js +33 -0
  95. package/build/server/models/compression/index.d.ts +4 -0
  96. package/build/server/models/compression/index.d.ts.map +1 -0
  97. package/build/server/models/compression/index.js +11 -0
  98. package/build/server/models/config/kv-store-config.d.ts +6 -0
  99. package/build/server/models/config/kv-store-config.d.ts.map +1 -0
  100. package/build/server/models/config/kv-store-config.js +15 -0
  101. package/build/server/models/config/publish-content-config.d.ts +40 -0
  102. package/build/server/models/config/publish-content-config.d.ts.map +1 -0
  103. package/build/server/models/config/publisher-server-config.d.ts +20 -0
  104. package/build/server/models/config/publisher-server-config.d.ts.map +1 -0
  105. package/build/server/models/config/s3-storage-config.d.ts +8 -0
  106. package/build/server/models/config/s3-storage-config.d.ts.map +1 -0
  107. package/build/server/models/config/s3-storage-config.js +11 -0
  108. package/build/server/models/config/static-publish-rc.d.ts +31 -0
  109. package/build/server/models/config/static-publish-rc.d.ts.map +1 -0
  110. package/build/server/models/config/static-publish-rc.js +39 -0
  111. package/build/server/models/metadata/index.d.ts +2 -0
  112. package/build/server/models/metadata/index.d.ts.map +1 -0
  113. package/build/server/models/metadata/index.js +8 -0
  114. package/build/server/models/server/index.d.ts +7 -0
  115. package/build/server/models/server/index.d.ts.map +1 -0
  116. package/build/server/models/server/index.js +26 -0
  117. package/build/server/models/time/index.d.ts +8 -0
  118. package/build/server/models/time/index.d.ts.map +1 -0
  119. package/build/server/models/time/index.js +54 -0
  120. package/build/server/server/collection-selector/from-config-store.d.ts.map +1 -0
  121. package/build/server/server/collection-selector/from-cookie.d.ts.map +1 -0
  122. package/build/server/server/collection-selector/from-request.d.ts.map +1 -0
  123. package/build/server/server/collection-selector/index.d.ts.map +1 -0
  124. package/build/server/server/collection-selector/request-collection-selector.d.ts.map +1 -0
  125. package/build/server/server/collection-selector/request-collection-selector.js +5 -0
  126. package/build/server/server/index.d.ts +8 -0
  127. package/build/server/server/index.d.ts.map +1 -0
  128. package/build/server/server/index.js +15 -0
  129. package/build/server/{publisher-server → server/publisher-server}/index.d.ts +14 -14
  130. package/build/server/server/publisher-server/index.d.ts.map +1 -0
  131. package/build/server/{publisher-server → server/publisher-server}/index.js +60 -61
  132. package/build/server/server/publisher-server/serve-preconditions/if-modified-since.d.ts.map +1 -0
  133. package/build/server/server/publisher-server/serve-preconditions/if-none-match.d.ts.map +1 -0
  134. package/build/server/server/storage/kv-store-provider.d.ts +8 -0
  135. package/build/server/server/storage/kv-store-provider.d.ts.map +1 -0
  136. package/build/server/server/storage/kv-store-provider.js +24 -0
  137. package/build/server/server/storage/s3-storage-provider.d.ts +26 -0
  138. package/build/server/server/storage/s3-storage-provider.d.ts.map +1 -0
  139. package/build/server/server/storage/s3-storage-provider.js +110 -0
  140. package/build/server/server/storage/storage-provider.d.ts +48 -0
  141. package/build/server/server/storage/storage-provider.d.ts.map +1 -0
  142. package/build/server/{util/kv-store.js → server/storage/storage-provider.js} +17 -39
  143. package/build/server/server/util/cookies.d.ts.map +1 -0
  144. package/build/server/server/util/kv-store.d.ts.map +1 -0
  145. package/build/server/server/util/kv-store.js +40 -0
  146. package/package.json +9 -5
  147. package/build/cli/commands/manage/clean.d.ts.map +0 -1
  148. package/build/cli/commands/manage/collections/delete.d.ts.map +0 -1
  149. package/build/cli/commands/manage/collections/index.d.ts.map +0 -1
  150. package/build/cli/commands/manage/collections/list.d.ts.map +0 -1
  151. package/build/cli/commands/manage/collections/promote.d.ts.map +0 -1
  152. package/build/cli/commands/manage/collections/update-expiration.d.ts.map +0 -1
  153. package/build/cli/commands/manage/index.d.ts.map +0 -1
  154. package/build/cli/commands/manage/publish-content.d.ts.map +0 -1
  155. package/build/cli/commands/scaffold/index.d.ts.map +0 -1
  156. package/build/cli/compression/brotli.d.ts.map +0 -1
  157. package/build/cli/compression/gzip.d.ts.map +0 -1
  158. package/build/cli/compression/index.d.ts.map +0 -1
  159. package/build/cli/util/api-token.d.ts.map +0 -1
  160. package/build/cli/util/args.d.ts.map +0 -1
  161. package/build/cli/util/config.d.ts.map +0 -1
  162. package/build/cli/util/content-types.d.ts.map +0 -1
  163. package/build/cli/util/data.d.ts.map +0 -1
  164. package/build/cli/util/fastly-toml.d.ts.map +0 -1
  165. package/build/cli/util/files.d.ts.map +0 -1
  166. package/build/cli/util/kv-store-items.d.ts +0 -13
  167. package/build/cli/util/kv-store-items.d.ts.map +0 -1
  168. package/build/cli/util/kv-store-local-server.d.ts.map +0 -1
  169. package/build/cli/util/kv-store.d.ts.map +0 -1
  170. package/build/cli/util/node.d.ts.map +0 -1
  171. package/build/cli/util/package.d.ts.map +0 -1
  172. package/build/cli/util/retryable.d.ts.map +0 -1
  173. package/build/cli/util/retryable.js +0 -43
  174. package/build/cli/util/variants.d.ts.map +0 -1
  175. package/build/index.d.ts +0 -6
  176. package/build/index.d.ts.map +0 -1
  177. package/build/index.js +0 -7
  178. package/build/models/assets/kvstore-assets.d.ts.map +0 -1
  179. package/build/models/assets/kvstore-assets.js +0 -28
  180. package/build/models/compression/index.d.ts.map +0 -1
  181. package/build/models/config/publish-content-config.d.ts.map +0 -1
  182. package/build/models/config/publisher-server-config.d.ts.map +0 -1
  183. package/build/models/config/static-publish-rc.d.ts +0 -7
  184. package/build/models/config/static-publish-rc.d.ts.map +0 -1
  185. package/build/models/server/index.d.ts +0 -5
  186. package/build/models/server/index.d.ts.map +0 -1
  187. package/build/models/server/index.js +0 -1
  188. package/build/models/time/index.d.ts.map +0 -1
  189. package/build/server/collection-selector/from-config-store.d.ts.map +0 -1
  190. package/build/server/collection-selector/from-cookie.d.ts.map +0 -1
  191. package/build/server/collection-selector/from-request.d.ts.map +0 -1
  192. package/build/server/collection-selector/index.d.ts.map +0 -1
  193. package/build/server/collection-selector/request-collection-selector.d.ts.map +0 -1
  194. package/build/server/publisher-server/index.d.ts.map +0 -1
  195. package/build/server/publisher-server/serve-preconditions/if-modified-since.d.ts.map +0 -1
  196. package/build/server/publisher-server/serve-preconditions/if-none-match.d.ts.map +0 -1
  197. package/build/server/util/cookies.d.ts.map +0 -1
  198. package/build/server/util/kv-store.d.ts.map +0 -1
  199. /package/build/cli/{commands → cli/commands}/manage/clean.d.ts +0 -0
  200. /package/build/cli/{commands → cli/commands}/manage/collections/delete.d.ts +0 -0
  201. /package/build/cli/{commands → cli/commands}/manage/collections/index.d.ts +0 -0
  202. /package/build/cli/{commands → cli/commands}/manage/collections/list.d.ts +0 -0
  203. /package/build/cli/{commands → cli/commands}/manage/collections/promote.d.ts +0 -0
  204. /package/build/cli/{commands → cli/commands}/manage/collections/update-expiration.d.ts +0 -0
  205. /package/build/cli/{commands → cli/commands}/manage/index.d.ts +0 -0
  206. /package/build/cli/{commands → cli/commands}/manage/publish-content.d.ts +0 -0
  207. /package/build/cli/{compression → cli/compression}/brotli.d.ts +0 -0
  208. /package/build/cli/{compression → cli/compression}/brotli.js +0 -0
  209. /package/build/cli/{compression → cli/compression}/gzip.d.ts +0 -0
  210. /package/build/cli/{compression → cli/compression}/gzip.js +0 -0
  211. /package/build/cli/{compression → cli/compression}/index.d.ts +0 -0
  212. /package/build/cli/{compression → cli/compression}/index.js +0 -0
  213. /package/build/cli/{index.d.ts → cli/index.d.ts} +0 -0
  214. /package/build/cli/{util → cli/util}/api-token.d.ts +0 -0
  215. /package/build/cli/{util → cli/util}/api-token.js +0 -0
  216. /package/build/cli/{util → cli/util}/args.d.ts +0 -0
  217. /package/build/cli/{util → cli/util}/args.js +0 -0
  218. /package/build/cli/{util → cli/util}/content-types.d.ts +0 -0
  219. /package/build/cli/{util → cli/util}/content-types.js +0 -0
  220. /package/build/cli/{util → cli/util}/data.d.ts +0 -0
  221. /package/build/cli/{util → cli/util}/data.js +0 -0
  222. /package/build/cli/{util → cli/util}/fastly-toml.d.ts +0 -0
  223. /package/build/cli/{util → cli/util}/fastly-toml.js +0 -0
  224. /package/build/cli/{util → cli/util}/files.d.ts +0 -0
  225. /package/build/cli/{util → cli/util}/files.js +0 -0
  226. /package/build/cli/{util → cli/util}/kv-store-local-server.js +0 -0
  227. /package/build/cli/{util → cli/util}/kv-store.js +0 -0
  228. /package/build/cli/{util → cli/util}/node.d.ts +0 -0
  229. /package/build/cli/{util → cli/util}/node.js +0 -0
  230. /package/build/cli/{util → cli/util}/package.d.ts +0 -0
  231. /package/build/cli/{util → cli/util}/variants.d.ts +0 -0
  232. /package/build/cli/{util → cli/util}/variants.js +0 -0
  233. /package/build/{models → cli/models}/compression/index.d.ts +0 -0
  234. /package/build/{models → cli/models}/compression/index.js +0 -0
  235. /package/build/{models → cli/models}/config/publish-content-config.js +0 -0
  236. /package/build/{models → cli/models}/config/publisher-server-config.d.ts +0 -0
  237. /package/build/{models → cli/models}/config/publisher-server-config.js +0 -0
  238. /package/build/{models → cli/models}/time/index.d.ts +0 -0
  239. /package/build/{models/config/static-publish-rc.js → server/models/config/publish-content-config.js} +0 -0
  240. /package/build/server/{collection-selector/request-collection-selector.js → models/config/publisher-server-config.js} +0 -0
  241. /package/build/server/{collection-selector → server/collection-selector}/from-config-store.d.ts +0 -0
  242. /package/build/server/{collection-selector → server/collection-selector}/from-config-store.js +0 -0
  243. /package/build/server/{collection-selector → server/collection-selector}/from-cookie.d.ts +0 -0
  244. /package/build/server/{collection-selector → server/collection-selector}/from-cookie.js +0 -0
  245. /package/build/server/{collection-selector → server/collection-selector}/from-request.d.ts +0 -0
  246. /package/build/server/{collection-selector → server/collection-selector}/from-request.js +0 -0
  247. /package/build/server/{collection-selector → server/collection-selector}/index.d.ts +0 -0
  248. /package/build/server/{collection-selector → server/collection-selector}/index.js +0 -0
  249. /package/build/server/{collection-selector → server/collection-selector}/request-collection-selector.d.ts +0 -0
  250. /package/build/server/{publisher-server → server/publisher-server}/serve-preconditions/if-modified-since.d.ts +0 -0
  251. /package/build/server/{publisher-server → server/publisher-server}/serve-preconditions/if-modified-since.js +0 -0
  252. /package/build/server/{publisher-server → server/publisher-server}/serve-preconditions/if-none-match.d.ts +0 -0
  253. /package/build/server/{publisher-server → server/publisher-server}/serve-preconditions/if-none-match.js +0 -0
  254. /package/build/server/{util → server/util}/cookies.d.ts +0 -0
  255. /package/build/server/{util → server/util}/cookies.js +0 -0
  256. /package/build/server/{util → server/util}/kv-store.d.ts +0 -0
package/README.md CHANGED
@@ -6,6 +6,7 @@ This CLI tool helps you:
6
6
 
7
7
  - ✅ Deploy static sites to Fastly Compute with zero backend
8
8
  - 📦 Store files in Fastly KV Store efficiently
9
+ - 🎁 New in v8: Support for S3-compatible storage such as Fastly Object Storage (Beta)
9
10
  - 🗂 Publish to named collections (`live`, `preview-42`, etc.)
10
11
  - 🔄 Switch between collections at runtime
11
12
  - 🧹 Clean up old or expired assets
@@ -17,19 +18,27 @@ This CLI tool helps you:
17
18
  Create a directory for your project, place your static files in `./public`, then type:
18
19
 
19
20
  ```sh
20
- npx @fastly/compute-js-static-publish@latest --root-dir=./public --kv-store-name=site-content
21
+ npx @fastly/compute-js-static-publish@latest --root-dir=./public --storage-mode=kv-store --kv-store-name=site-content
21
22
  ```
22
23
 
24
+ **New in v8:** S3-compatible storage (such as Fastly Object Storage) is also supported (Beta). To use this mode, type:
25
+
26
+ ```sh
27
+ npx @fastly/compute-js-static-publish@latest --root-dir=./public --storage-mode=s3 --s3-region=<region> --s3-bucket-<bucket-name>
28
+ ```
29
+
30
+ For more details, see the [S3-compatible storage](https://github.com/fastly/compute-js-static-publish/blob/main/README.md#s3-compatible-storage) section in the full documentation.
31
+
23
32
  ### 🔧 Local Preview
24
33
 
25
34
  ```sh
26
35
  cd compute-js
27
36
  npm install
28
- npm run dev:publish # 'publish' your files to the simulated local KV Store
29
- npm run dev:start # preview locally
37
+ npm run dev:publish # 'publish' your files to the simulated local KV Store or to the S3 bucket
38
+ npm run dev:start # preview locally
30
39
  ```
31
40
 
32
- Serves your app at `http://127.0.0.1:7676`, powered by a simulated KV Store.
41
+ Serves your app at `http://127.0.0.1:7676`. If the app is using the KV Store, your content is served from a simulated KV Store managed by the development server.
33
42
 
34
43
  ### 🚀 Deploy to Production
35
44
 
package/README.short.md CHANGED
@@ -6,6 +6,7 @@ This CLI tool helps you:
6
6
 
7
7
  - ✅ Deploy static sites to Fastly Compute with zero backend
8
8
  - 📦 Store files in Fastly KV Store efficiently
9
+ - 🎁 New in v8: Support for S3-compatible storage such as Fastly Object Storage (Beta)
9
10
  - 🗂 Publish to named collections (`live`, `preview-42`, etc.)
10
11
  - 🔄 Switch between collections at runtime
11
12
  - 🧹 Clean up old or expired assets
@@ -17,19 +18,27 @@ This CLI tool helps you:
17
18
  Create a directory for your project, place your static files in `./public`, then type:
18
19
 
19
20
  ```sh
20
- npx @fastly/compute-js-static-publish@latest --root-dir=./public --kv-store-name=site-content
21
+ npx @fastly/compute-js-static-publish@latest --root-dir=./public --storage-mode=kv-store --kv-store-name=site-content
21
22
  ```
22
23
 
24
+ **New in v8:** S3-compatible storage (such as Fastly Object Storage) is also supported (Beta). To use this mode, type:
25
+
26
+ ```sh
27
+ npx @fastly/compute-js-static-publish@latest --root-dir=./public --storage-mode=s3 --s3-region=<region> --s3-bucket-<bucket-name>
28
+ ```
29
+
30
+ For more details, see the [S3-compatible storage](https://github.com/fastly/compute-js-static-publish/blob/main/README.md#s3-compatible-storage) section in the full documentation.
31
+
23
32
  ### 🔧 Local Preview
24
33
 
25
34
  ```sh
26
35
  cd compute-js
27
36
  npm install
28
- npm run dev:publish # 'publish' your files to the simulated local KV Store
29
- npm run dev:start # preview locally
37
+ npm run dev:publish # 'publish' your files to the simulated local KV Store or to the S3 bucket
38
+ npm run dev:start # preview locally
30
39
  ```
31
40
 
32
- Serves your app at `http://127.0.0.1:7676`, powered by a simulated KV Store.
41
+ Serves your app at `http://127.0.0.1:7676`. If the app is using the KV Store, your content is served from a simulated KV Store managed by the development server.
33
42
 
34
43
  ### 🚀 Deploy to Production
35
44
 
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clean.d.ts","sourceRoot":"","sources":["../../../../../src/cli/commands/manage/clean.ts"],"names":[],"mappings":"AA2DA,wBAAsB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,iBAuNhD"}
@@ -3,15 +3,11 @@
3
3
  * Licensed under the MIT license. See LICENSE file for details.
4
4
  */
5
5
  import path from 'node:path';
6
+ import { decodeIndexMetadata } from '../../../models/server/index.js';
6
7
  import { isExpired } from '../../../models/time/index.js';
7
- import { loadApiToken } from '../../util/api-token.js';
8
8
  import { parseCommandLine } from '../../util/args.js';
9
9
  import { LoadConfigError, loadStaticPublisherRcFile } from '../../util/config.js';
10
- import { readServiceId } from '../../util/fastly-toml.js';
11
- import { getKvStoreEntry, getKVStoreKeys, kvStoreDeleteEntry, } from '../../util/kv-store.js';
12
- import { doKvStoreItemsOperation } from '../../util/kv-store-items.js';
13
- import { getLocalKvStoreEntry, getLocalKVStoreKeys, localKvStoreDeleteEntry, } from '../../util/kv-store-local-server.js';
14
- import { isNodeError } from '../../util/node.js';
10
+ import { loadStorageProviderFromStaticPublishRc } from '../../storage/storage-provider.js';
15
11
  function help() {
16
12
  console.log(`\
17
13
 
@@ -19,7 +15,7 @@ Usage:
19
15
  npx @fastly/compute-js-static-publish clean [options]
20
16
 
21
17
  Description:
22
- Cleans up expired or unreferenced items in the Fastly KV Store.
18
+ Cleans up expired or unreferenced items in storage.
23
19
  This can include expired collection indexes and orphaned content assets.
24
20
 
25
21
  Options:
@@ -27,7 +23,7 @@ Options:
27
23
 
28
24
  --dry-run Show what would be deleted without performing any deletions.
29
25
 
30
- Global Options:
26
+ KV Store Options:
31
27
  --local Instead of working with the Fastly KV Store, operate on
32
28
  local files that will be used to simulate the KV Store
33
29
  with the local development environment.
@@ -37,6 +33,20 @@ Global Options:
37
33
  1. FASTLY_API_TOKEN environment variable
38
34
  2. Logged-in Fastly CLI profile
39
35
 
36
+ S3 Storage Options:
37
+ --aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
38
+ --aws-secret-access-key=<key> interface with S3.
39
+ If not set, the tool will check:
40
+ 1. AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
41
+ environment variables
42
+ 2. The aws credentials file, see below
43
+
44
+ --aws-profile=<profile> Profile within the aws credentials file.
45
+ If not set, the tool will check:
46
+ 1. AWS_PROFILE environment variable
47
+ 2. The default profile, if set
48
+
49
+ Global Options:
40
50
  -h, --help Show this help message and exit.
41
51
  `);
42
52
  }
@@ -47,6 +57,9 @@ export async function action(actionArgs) {
47
57
  { name: 'dry-run', type: Boolean },
48
58
  { name: 'local', type: Boolean },
49
59
  { name: 'fastly-api-token', type: String, },
60
+ { name: 'aws-profile', type: String, },
61
+ { name: 'aws-access-key-id', type: String, },
62
+ { name: 'aws-secret-access-key', type: String, },
50
63
  ];
51
64
  const parsed = parseCommandLine(actionArgs, optionDefinitions);
52
65
  if (parsed.needHelp) {
@@ -58,49 +71,11 @@ export async function action(actionArgs) {
58
71
  help();
59
72
  return;
60
73
  }
61
- const { verbose, ['delete-expired-collections']: deleteExpiredCollections, ['dry-run']: dryRun, local: localMode, ['fastly-api-token']: fastlyApiToken, } = parsed.commandLineOptions;
74
+ const { verbose, ['delete-expired-collections']: deleteExpiredCollections, ['dry-run']: dryRun, local: localMode, ['fastly-api-token']: fastlyApiToken, ['aws-profile']: awsProfile, ['aws-access-key-id']: awsAccessKeyId, ['aws-secret-access-key']: awsSecretAccessKey, } = parsed.commandLineOptions;
62
75
  // compute-js-static-publisher cli is always run from the Compute application directory
63
76
  // in other words, the directory that contains `fastly.toml`.
64
77
  const computeAppDir = path.resolve();
65
- // Check to see if we have a service ID listed in `fastly.toml`.
66
- // If we do NOT, then we do not use the KV Store.
67
- let serviceId;
68
- try {
69
- serviceId = readServiceId(path.resolve(computeAppDir, './fastly.toml'));
70
- }
71
- catch (err) {
72
- if (isNodeError(err) && err.code === 'ENOENT') {
73
- console.warn(`❌ ERROR: can't find 'fastly.toml'.`);
74
- process.exitCode = 1;
75
- return;
76
- }
77
- console.warn(`❌ ERROR: can't read or parse 'fastly.toml'.`);
78
- process.exitCode = 1;
79
- return;
80
- }
81
- console.log(`🧹 Cleaning KV Store entries...`);
82
- // Verify targets
83
- let fastlyApiContext = undefined;
84
- if (localMode) {
85
- console.log(` Working on local simulated KV Store...`);
86
- }
87
- else {
88
- if (serviceId === null) {
89
- console.log(`❌️ 'service_id' not set in 'fastly.toml' - Deploy your Compute app to Fastly before publishing.`);
90
- process.exitCode = 1;
91
- return;
92
- }
93
- const apiTokenResult = loadApiToken({ commandLine: fastlyApiToken });
94
- if (apiTokenResult == null) {
95
- console.error("❌ Fastly API Token not provided.");
96
- console.error("Set the FASTLY_API_TOKEN environment variable to an API token that has write access to the KV Store.");
97
- process.exitCode = 1;
98
- return;
99
- }
100
- fastlyApiContext = { apiToken: apiTokenResult.apiToken };
101
- console.log(`✔️ Fastly API Token: ${fastlyApiContext.apiToken.slice(0, 4)}${'*'.repeat(fastlyApiContext.apiToken.length - 4)} from '${apiTokenResult.source}'`);
102
- console.log(` Working on the Fastly KV Store...`);
103
- }
78
+ console.log(`🧹 Cleaning storage entries...`);
104
79
  // #### load config
105
80
  let staticPublisherRc;
106
81
  try {
@@ -119,26 +94,35 @@ export async function action(actionArgs) {
119
94
  }
120
95
  const publishId = staticPublisherRc.publishId;
121
96
  console.log(` | Publish ID: ${publishId}`);
122
- const kvStoreName = staticPublisherRc.kvStoreName;
123
- console.log(` | Using KV Store: ${kvStoreName}`);
124
97
  const defaultCollectionName = staticPublisherRc.defaultCollectionName;
125
98
  console.log(` | Default Collection Name: ${defaultCollectionName}`);
126
99
  const staticPublisherWorkingDir = staticPublisherRc.staticPublisherWorkingDir;
127
100
  console.log(` | Static publisher working directory: ${staticPublisherWorkingDir}`);
128
- const storeFile = path.resolve(staticPublisherWorkingDir, `./kvstore.json`);
129
- // ### KVStore Keys to delete
130
- const kvKeysToDelete = new Set();
131
- // ### List all indexes ###
132
- const indexesPrefix = publishId + '_index_';
133
- let indexKeys;
134
- if (localMode) {
135
- indexKeys = await getLocalKVStoreKeys(storeFile, indexesPrefix);
101
+ // Storage Provider
102
+ let storageProvider;
103
+ try {
104
+ storageProvider = await loadStorageProviderFromStaticPublishRc(staticPublisherRc, {
105
+ computeAppDir,
106
+ localMode,
107
+ fastlyApiToken,
108
+ awsProfile,
109
+ awsAccessKeyId,
110
+ awsSecretAccessKey,
111
+ });
136
112
  }
137
- else {
138
- indexKeys = await getKVStoreKeys(fastlyApiContext, kvStoreName, indexesPrefix);
113
+ catch (err) {
114
+ console.error(`❌ Could not instantiate store provider`);
115
+ console.error(String(err));
116
+ process.exitCode = 1;
117
+ return;
139
118
  }
119
+ // ### Asset keys to delete
120
+ const assetKeysToDelete = new Set();
121
+ // ### List all indexes ###
122
+ const indexesPrefix = publishId + '_index_';
123
+ const indexKeys = await storageProvider.getStorageKeys(indexesPrefix);
140
124
  if (indexKeys == null) {
141
- throw new Error(`Can't query indexes in KV Store`);
125
+ throw new Error(`Can't query indexes in storage`);
142
126
  }
143
127
  // ### Go through the index files, make lists
144
128
  const foundCollections = indexKeys.map(x => x.slice(indexesPrefix.length));
@@ -147,29 +131,16 @@ export async function action(actionArgs) {
147
131
  // All asset keys (hashes) that we are keeping
148
132
  const assetsIdsInUse = new Set();
149
133
  console.log('Processing collections:');
150
- await doKvStoreItemsOperation(foundCollections.map(collection => ({
134
+ await storageProvider.doConcurrentParallel(foundCollections.map(collection => ({
151
135
  key: indexesPrefix + collection,
152
136
  collection,
153
137
  })), async ({ collection }, indexKey) => {
154
138
  console.log(`Collection: ${collection}`);
155
- let kvAssetsIndexResponse;
156
- if (localMode) {
157
- kvAssetsIndexResponse = await getLocalKvStoreEntry(storeFile, indexKey);
158
- }
159
- else {
160
- kvAssetsIndexResponse = await getKvStoreEntry(fastlyApiContext, kvStoreName, indexKey);
161
- }
162
- if (!kvAssetsIndexResponse) {
163
- throw new Error(`Can't load KV Store entry ${indexesPrefix + collection}`);
164
- }
165
- let indexMetadata = {};
166
- if (kvAssetsIndexResponse.metadata != null) {
167
- try {
168
- indexMetadata = JSON.parse(kvAssetsIndexResponse.metadata);
169
- }
170
- catch {
171
- }
139
+ const indexEntryInfo = await storageProvider.getStorageEntry(indexKey);
140
+ if (!indexEntryInfo) {
141
+ throw new Error(`Can't load storage entry ${indexesPrefix + collection}`);
172
142
  }
143
+ let indexMetadata = decodeIndexMetadata(indexEntryInfo.metadata) ?? {};
173
144
  let isLive = true;
174
145
  if (indexMetadata.expirationTime == null) {
175
146
  console.log(' Collection has no expiration time set');
@@ -185,7 +156,7 @@ export async function action(actionArgs) {
185
156
  }
186
157
  else {
187
158
  console.log(` 🗑️ Marking expired collection for deletion.`);
188
- kvKeysToDelete.add(indexKey);
159
+ assetKeysToDelete.add(indexKey);
189
160
  isLive = false;
190
161
  }
191
162
  }
@@ -194,7 +165,7 @@ export async function action(actionArgs) {
194
165
  return;
195
166
  }
196
167
  liveCollections.add(collection);
197
- const kvAssetsIndex = (await kvAssetsIndexResponse.response.json());
168
+ const kvAssetsIndex = (await new Response(indexEntryInfo.data).json());
198
169
  for (const [_assetKey, assetEntry] of Object.entries(kvAssetsIndex)) {
199
170
  if (assetEntry.key.startsWith('sha256:')) {
200
171
  assetsIdsInUse.add(`sha256_${assetEntry.key.slice('sha256:'.length)}`);
@@ -205,15 +176,9 @@ export async function action(actionArgs) {
205
176
  // ### List all settings ###
206
177
  console.log('Enumerating settings:');
207
178
  const settingsPrefix = publishId + '_settings_';
208
- let settingsKeys;
209
- if (localMode) {
210
- settingsKeys = await getLocalKVStoreKeys(storeFile, settingsPrefix);
211
- }
212
- else {
213
- settingsKeys = await getKVStoreKeys(fastlyApiContext, kvStoreName, settingsPrefix);
214
- }
179
+ const settingsKeys = await storageProvider.getStorageKeys(settingsPrefix);
215
180
  if (settingsKeys == null) {
216
- throw new Error(`Can't query settings in KV Store`);
181
+ throw new Error(`Can't query settings in storage`);
217
182
  }
218
183
  // If a settings object is found that doesn't match a live collection name then
219
184
  // mark it for deletion
@@ -222,20 +187,14 @@ export async function action(actionArgs) {
222
187
  console.log(`Settings: ${foundSettings.name}`);
223
188
  if (!liveCollections.has(foundSettings.name)) {
224
189
  console.log(` 🗑️ Does not match a live index, marking for deletion.`);
225
- kvKeysToDelete.add(foundSettings.key);
190
+ assetKeysToDelete.add(foundSettings.key);
226
191
  }
227
192
  }
228
193
  console.log('');
229
- // ### Obtain the assets in the KV Store and find the ones that are not in use
194
+ // ### Obtain the assets in storage and find the ones that are not in use
230
195
  console.log('Enumerating assets:');
231
196
  const assetPrefix = publishId + '_files_';
232
- let assetKeys;
233
- if (localMode) {
234
- assetKeys = await getLocalKVStoreKeys(storeFile, assetPrefix);
235
- }
236
- else {
237
- assetKeys = await getKVStoreKeys(fastlyApiContext, kvStoreName, assetPrefix);
238
- }
197
+ const assetKeys = await storageProvider.getStorageKeys(assetPrefix);
239
198
  if (assetKeys == null) {
240
199
  throw new Error(`Can't query assets in KV Store`);
241
200
  }
@@ -252,25 +211,20 @@ export async function action(actionArgs) {
252
211
  console.log(` ${assetId}: in use`);
253
212
  }
254
213
  else {
255
- kvKeysToDelete.add(assetKey);
214
+ assetKeysToDelete.add(assetKey);
256
215
  console.log(` ${assetId}: not in use - ✅ marking for deletion`);
257
216
  }
258
217
  }
259
218
  console.log('');
260
219
  // ### Delete items that have been flagged
261
- const items = [...kvKeysToDelete].map(key => ({ key }));
262
- await doKvStoreItemsOperation(items, async (_, key) => {
220
+ const items = [...assetKeysToDelete].map(key => ({ key }));
221
+ await storageProvider.doConcurrentParallel(items, async (_, key) => {
263
222
  if (dryRun) {
264
223
  console.log(`[DRY RUN] Deleting item: ${key}`);
265
224
  }
266
225
  else {
267
- console.log(`Deleting item from KV Store: ${key}`);
268
- if (localMode) {
269
- await localKvStoreDeleteEntry(storeFile, key);
270
- }
271
- else {
272
- await kvStoreDeleteEntry(fastlyApiContext, kvStoreName, key);
273
- }
226
+ console.log(`Deleting key from storage: ${key}`);
227
+ await storageProvider.deleteStorageEntry(key);
274
228
  }
275
229
  });
276
230
  console.log('✅ Completed.');
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/manage/collections/delete.ts"],"names":[],"mappings":"AAyDA,wBAAsB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,iBAwIhD"}
@@ -3,14 +3,9 @@
3
3
  * Licensed under the MIT license. See LICENSE file for details.
4
4
  */
5
5
  import path from 'node:path';
6
- import { loadApiToken } from '../../../util/api-token.js';
7
- import { parseCommandLine } from "../../../util/args.js";
6
+ import { parseCommandLine } from '../../../util/args.js';
8
7
  import { LoadConfigError, loadStaticPublisherRcFile } from '../../../util/config.js';
9
- import { readServiceId } from '../../../util/fastly-toml.js';
10
- import { getKVStoreKeys, kvStoreDeleteEntry } from '../../../util/kv-store.js';
11
- import { doKvStoreItemsOperation } from '../../../util/kv-store-items.js';
12
- import { getLocalKVStoreKeys, localKvStoreDeleteEntry } from '../../../util/kv-store-local-server.js';
13
- import { isNodeError } from '../../../util/node.js';
8
+ import { loadStorageProviderFromStaticPublishRc } from '../../../storage/storage-provider.js';
14
9
  function help() {
15
10
  console.log(`\
16
11
 
@@ -18,7 +13,7 @@ Usage:
18
13
  npx @fastly/compute-js-static-publish collections delete --collection-name=<name> [options]
19
14
 
20
15
  Description:
21
- Deletes a collection index from the KV Store. The content files will remain as they may still
16
+ Deletes a collection index from storage. The content files will remain as they may still
22
17
  be referenced by other collection indexes.
23
18
 
24
19
  Use the 'npx @fastly/compute-js-static-publish clean' command afterward to remove content
@@ -27,7 +22,7 @@ Description:
27
22
  Required:
28
23
  --collection-name=<name> The name of the collection to delete
29
24
 
30
- Global Options:
25
+ KV Store Options:
31
26
  --local Instead of working with the Fastly KV Store, operate on
32
27
  local files that will be used to simulate the KV Store
33
28
  with the local development environment.
@@ -37,6 +32,20 @@ Global Options:
37
32
  1. FASTLY_API_TOKEN environment variable
38
33
  2. Logged-in Fastly CLI profile
39
34
 
35
+ S3 Storage Options:
36
+ --aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
37
+ --aws-secret-access-key=<key> interface with S3.
38
+ If not set, the tool will check:
39
+ 1. AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
40
+ environment variables
41
+ 2. The aws credentials file, see below
42
+
43
+ --aws-profile=<profile> Profile within the aws credentials file.
44
+ If not set, the tool will check:
45
+ 1. AWS_PROFILE environment variable
46
+ 2. The default profile, if set
47
+
48
+ Global Options:
40
49
  -h, --help Show this help message and exit.
41
50
  `);
42
51
  }
@@ -46,6 +55,9 @@ export async function action(actionArgs) {
46
55
  { name: 'collection-name', type: String },
47
56
  { name: 'local', type: Boolean },
48
57
  { name: 'fastly-api-token', type: String, },
58
+ { name: 'aws-profile', type: String, },
59
+ { name: 'aws-access-key-id', type: String, },
60
+ { name: 'aws-secret-access-key', type: String, },
49
61
  ];
50
62
  const parsed = parseCommandLine(actionArgs, optionDefinitions);
51
63
  if (parsed.needHelp) {
@@ -57,7 +69,7 @@ export async function action(actionArgs) {
57
69
  help();
58
70
  return;
59
71
  }
60
- const { verbose, ['collection-name']: collectionNameValue, ['fastly-api-token']: fastlyApiToken, local: localMode, } = parsed.commandLineOptions;
72
+ const { verbose, ['collection-name']: collectionNameValue, ['fastly-api-token']: fastlyApiToken, local: localMode, ['aws-profile']: awsProfile, ['aws-access-key-id']: awsAccessKeyId, ['aws-secret-access-key']: awsSecretAccessKey, } = parsed.commandLineOptions;
61
73
  // compute-js-static-publisher cli is always run from the Compute application directory
62
74
  // in other words, the directory that contains `fastly.toml`.
63
75
  const computeAppDir = path.resolve();
@@ -66,45 +78,7 @@ export async function action(actionArgs) {
66
78
  process.exitCode = 1;
67
79
  return;
68
80
  }
69
- // Check to see if we have a service ID listed in `fastly.toml`.
70
- // If we do NOT, then we do not use the KV Store.
71
- let serviceId;
72
- try {
73
- serviceId = readServiceId(path.resolve(computeAppDir, './fastly.toml'));
74
- }
75
- catch (err) {
76
- if (isNodeError(err) && err.code === 'ENOENT') {
77
- console.warn(`❌ ERROR: can't find 'fastly.toml'.`);
78
- process.exitCode = 1;
79
- return;
80
- }
81
- console.warn(`❌ ERROR: can't read or parse 'fastly.toml'.`);
82
- process.exitCode = 1;
83
- return;
84
- }
85
- console.log(`🧹 Cleaning KV Store entries...`);
86
- // Verify targets
87
- let fastlyApiContext = undefined;
88
- if (localMode) {
89
- console.log(` Working on local simulated KV Store...`);
90
- }
91
- else {
92
- if (serviceId === null) {
93
- console.log(`❌️ 'service_id' not set in 'fastly.toml' - Deploy your Compute app to Fastly before publishing.`);
94
- process.exitCode = 1;
95
- return;
96
- }
97
- const apiTokenResult = loadApiToken({ commandLine: fastlyApiToken });
98
- if (apiTokenResult == null) {
99
- console.error("❌ Fastly API Token not provided.");
100
- console.error("Set the FASTLY_API_TOKEN environment variable to an API token that has write access to the KV Store.");
101
- process.exitCode = 1;
102
- return;
103
- }
104
- fastlyApiContext = { apiToken: apiTokenResult.apiToken };
105
- console.log(`✔️ Fastly API Token: ${fastlyApiContext.apiToken.slice(0, 4)}${'*'.repeat(fastlyApiContext.apiToken.length - 4)} from '${apiTokenResult.source}'`);
106
- console.log(` Working on the Fastly KV Store...`);
107
- }
81
+ console.log(`🧹 Deleting storage collection...`);
108
82
  // #### load config
109
83
  let staticPublisherRc;
110
84
  try {
@@ -123,13 +97,28 @@ export async function action(actionArgs) {
123
97
  }
124
98
  const publishId = staticPublisherRc.publishId;
125
99
  console.log(` | Publish ID: ${publishId}`);
126
- const kvStoreName = staticPublisherRc.kvStoreName;
127
- console.log(` | Using KV Store: ${kvStoreName}`);
128
100
  const defaultCollectionName = staticPublisherRc.defaultCollectionName;
129
101
  console.log(` | Default Collection Name: ${defaultCollectionName}`);
130
102
  const staticPublisherWorkingDir = staticPublisherRc.staticPublisherWorkingDir;
131
103
  console.log(` | Static publisher working directory: ${staticPublisherWorkingDir}`);
132
- const storeFile = path.resolve(staticPublisherWorkingDir, `./kvstore.json`);
104
+ // Storage Provider
105
+ let storageProvider;
106
+ try {
107
+ storageProvider = await loadStorageProviderFromStaticPublishRc(staticPublisherRc, {
108
+ computeAppDir,
109
+ localMode,
110
+ fastlyApiToken,
111
+ awsProfile,
112
+ awsAccessKeyId,
113
+ awsSecretAccessKey,
114
+ });
115
+ }
116
+ catch (err) {
117
+ console.error(`❌ Could not instantiate store provider`);
118
+ console.error(String(err));
119
+ process.exitCode = 1;
120
+ return;
121
+ }
133
122
  const collectionName = collectionNameValue;
134
123
  if (collectionName === defaultCollectionName) {
135
124
  console.error(`❌ Cannot delete default collection: ${collectionName}`);
@@ -137,19 +126,13 @@ export async function action(actionArgs) {
137
126
  return;
138
127
  }
139
128
  console.log(`✔️ Collection to delete: ${collectionName}`);
140
- // ### KVStore Keys to delete
141
- const kvKeysToDelete = new Set();
129
+ // ### Asset Keys to delete
130
+ const assetKeysToDelete = new Set();
142
131
  // ### List all indexes ###
143
132
  const indexesPrefix = publishId + '_index_';
144
- let indexKeys;
145
- if (localMode) {
146
- indexKeys = await getLocalKVStoreKeys(storeFile, indexesPrefix);
147
- }
148
- else {
149
- indexKeys = await getKVStoreKeys(fastlyApiContext, kvStoreName, indexesPrefix);
150
- }
133
+ const indexKeys = await storageProvider.getStorageKeys(indexesPrefix);
151
134
  if (indexKeys == null) {
152
- throw new Error(`Can't query indexes in KV Store`);
135
+ throw new Error(`Can't query indexes in storage`);
153
136
  }
154
137
  // ### Found collections ###
155
138
  const foundCollections = indexKeys.map(key => ({ key, name: key.slice(indexesPrefix.length), }));
@@ -161,20 +144,15 @@ export async function action(actionArgs) {
161
144
  for (const collection of foundCollections) {
162
145
  if (collection.name === collectionName) {
163
146
  console.log(`Flagging collection '${collection.name}' for deletion: ${collection.key}`);
164
- kvKeysToDelete.add(collection.key);
147
+ assetKeysToDelete.add(collection.key);
165
148
  }
166
149
  }
167
150
  }
168
151
  // ### Delete items that have been flagged
169
- const items = [...kvKeysToDelete].map(key => ({ key }));
170
- await doKvStoreItemsOperation(items, async (_, key) => {
171
- console.log(`Deleting key from KV Store: ${key}`);
172
- if (localMode) {
173
- await localKvStoreDeleteEntry(storeFile, key);
174
- }
175
- else {
176
- await kvStoreDeleteEntry(fastlyApiContext, kvStoreName, key);
177
- }
152
+ const items = [...assetKeysToDelete].map(key => ({ key }));
153
+ await storageProvider.doConcurrentParallel(items, async (_, key) => {
154
+ console.log(`Deleting key from storage: ${key}`);
155
+ await storageProvider.deleteStorageEntry(key);
178
156
  });
179
157
  console.log("✅ Completed.");
180
158
  }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/manage/collections/index.ts"],"names":[],"mappings":"AA2DA,wBAAsB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,iBA0BhD"}
@@ -23,7 +23,7 @@ Available Subcommands:
23
23
  to a new collection name
24
24
  update-expiration Modify expiration time for an existing collection
25
25
 
26
- Global Options:
26
+ KV Store Options:
27
27
  --local Instead of working with the Fastly KV Store, operate on
28
28
  local files that will be used to simulate the KV Store
29
29
  with the local development environment.
@@ -33,6 +33,20 @@ Global Options:
33
33
  1. FASTLY_API_TOKEN environment variable
34
34
  2. Logged-in Fastly CLI profile
35
35
 
36
+ S3 Storage Options:
37
+ --aws-access-key-id=<key> AWS Access Key ID and Secret Access Key used to
38
+ --aws-secret-access-key=<key> interface with S3.
39
+ If not set, the tool will check:
40
+ 1. AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
41
+ environment variables
42
+ 2. The aws credentials file, see below
43
+
44
+ --aws-profile=<profile> Profile within the aws credentials file.
45
+ If not set, the tool will check:
46
+ 1. AWS_PROFILE environment variable
47
+ 2. The default profile, if set
48
+
49
+ Global Options:
36
50
  -h, --help Show this help message and exit.
37
51
 
38
52
  Examples:
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../../../../../src/cli/commands/manage/collections/list.ts"],"names":[],"mappings":"AAoDA,wBAAsB,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,iBAsIhD"}