@ohos-ports/layer0-prefetch 4.20.0-beta.0 → 4.20.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 (281) hide show
  1. package/node_modules/@layer0/core/README.md +50 -0
  2. package/node_modules/@layer0/core/build.d.ts +5 -0
  3. package/node_modules/@layer0/core/build.js +17 -0
  4. package/node_modules/@layer0/core/cache/Cache.d.ts +56 -0
  5. package/node_modules/@layer0/core/cache/Cache.js +138 -0
  6. package/node_modules/@layer0/core/cache/CacheKey.d.ts +52 -0
  7. package/node_modules/@layer0/core/cache/CacheKey.js +95 -0
  8. package/node_modules/@layer0/core/config.d.ts +53 -0
  9. package/node_modules/@layer0/core/config.js +113 -0
  10. package/node_modules/@layer0/core/constants.d.ts +214 -0
  11. package/node_modules/@layer0/core/constants.js +216 -0
  12. package/node_modules/@layer0/core/context.d.ts +38 -0
  13. package/node_modules/@layer0/core/context.js +98 -0
  14. package/node_modules/@layer0/core/default-app/all/layer0.config.js +60 -0
  15. package/node_modules/@layer0/core/default-app/js/routes.js +27 -0
  16. package/node_modules/@layer0/core/default-app/ts/routes.ts +27 -0
  17. package/node_modules/@layer0/core/deploy/DeploymentBuilder.d.ts +177 -0
  18. package/node_modules/@layer0/core/deploy/DeploymentBuilder.js +543 -0
  19. package/node_modules/@layer0/core/deploy/bundle-esbuild.d.ts +11 -0
  20. package/node_modules/@layer0/core/deploy/bundle-esbuild.js +67 -0
  21. package/node_modules/@layer0/core/deploy/bundle-ncc.d.ts +8 -0
  22. package/node_modules/@layer0/core/deploy/bundle-ncc.js +30 -0
  23. package/node_modules/@layer0/core/deploy/bundle-nft.d.ts +7 -0
  24. package/node_modules/@layer0/core/deploy/bundle-nft.js +41 -0
  25. package/node_modules/@layer0/core/deploy/bundle-webpack.d.ts +11 -0
  26. package/node_modules/@layer0/core/deploy/bundle-webpack.js +127 -0
  27. package/node_modules/@layer0/core/deploy/index.d.ts +19 -0
  28. package/node_modules/@layer0/core/deploy/index.js +6 -0
  29. package/node_modules/@layer0/core/deploy/listSources.d.ts +11 -0
  30. package/node_modules/@layer0/core/deploy/listSources.js +18 -0
  31. package/node_modules/@layer0/core/deploy/paths.d.ts +27 -0
  32. package/node_modules/@layer0/core/deploy/paths.js +33 -0
  33. package/node_modules/@layer0/core/deploy/resolveInPackage.d.ts +7 -0
  34. package/node_modules/@layer0/core/deploy/resolveInPackage.js +21 -0
  35. package/node_modules/@layer0/core/deploy/routeToFiles.d.ts +14 -0
  36. package/node_modules/@layer0/core/deploy/routeToFiles.js +24 -0
  37. package/node_modules/@layer0/core/dev/DevServerOptions.d.ts +33 -0
  38. package/node_modules/@layer0/core/dev/DevServerOptions.js +2 -0
  39. package/node_modules/@layer0/core/dev/createDevServer.d.ts +8 -0
  40. package/node_modules/@layer0/core/dev/createDevServer.js +114 -0
  41. package/node_modules/@layer0/core/dev/index.d.ts +3 -0
  42. package/node_modules/@layer0/core/dev/index.js +6 -0
  43. package/node_modules/@layer0/core/dev/runLocalApp.d.ts +8 -0
  44. package/node_modules/@layer0/core/dev/runLocalApp.js +73 -0
  45. package/node_modules/@layer0/core/dev/serverlessCompatibilityMiddleware.d.ts +11 -0
  46. package/node_modules/@layer0/core/dev/serverlessCompatibilityMiddleware.js +30 -0
  47. package/node_modules/@layer0/core/edge/EdgeErrorPageResponseWriter.d.ts +12 -0
  48. package/node_modules/@layer0/core/edge/EdgeErrorPageResponseWriter.js +22 -0
  49. package/node_modules/@layer0/core/edge/EdgeResponseWriter.d.ts +122 -0
  50. package/node_modules/@layer0/core/edge/EdgeResponseWriter.js +451 -0
  51. package/node_modules/@layer0/core/edge/createEdgeConfig.d.ts +16 -0
  52. package/node_modules/@layer0/core/edge/createEdgeConfig.js +284 -0
  53. package/node_modules/@layer0/core/environment.d.ts +24 -0
  54. package/node_modules/@layer0/core/environment.js +42 -0
  55. package/node_modules/@layer0/core/errors/BackendFetchError.d.ts +11 -0
  56. package/node_modules/@layer0/core/errors/BackendFetchError.js +17 -0
  57. package/node_modules/@layer0/core/errors/FrameworkBuildError.d.ts +7 -0
  58. package/node_modules/@layer0/core/errors/FrameworkBuildError.js +26 -0
  59. package/node_modules/@layer0/core/index.d.ts +3 -0
  60. package/node_modules/@layer0/core/index.js +9 -0
  61. package/node_modules/@layer0/core/init/addToPackageJson.d.ts +7 -0
  62. package/node_modules/@layer0/core/init/addToPackageJson.js +22 -0
  63. package/node_modules/@layer0/core/init/index.d.ts +2 -0
  64. package/node_modules/@layer0/core/init/index.js +6 -0
  65. package/node_modules/@layer0/core/init/init.d.ts +5 -0
  66. package/node_modules/@layer0/core/init/init.js +17 -0
  67. package/node_modules/@layer0/core/lambda/JSBackend.d.ts +30 -0
  68. package/node_modules/@layer0/core/lambda/JSBackend.js +51 -0
  69. package/node_modules/@layer0/core/lambda/RequestListenerJSBackend.d.ts +8 -0
  70. package/node_modules/@layer0/core/lambda/RequestListenerJSBackend.js +19 -0
  71. package/node_modules/@layer0/core/lambda/adaptResponseEncodingToDownstream.d.ts +17 -0
  72. package/node_modules/@layer0/core/lambda/adaptResponseEncodingToDownstream.js +132 -0
  73. package/node_modules/@layer0/core/lambda/consoleWrapper.d.ts +16 -0
  74. package/node_modules/@layer0/core/lambda/consoleWrapper.js +127 -0
  75. package/node_modules/@layer0/core/lambda/getBodyLoggingData.d.ts +10 -0
  76. package/node_modules/@layer0/core/lambda/getBodyLoggingData.js +108 -0
  77. package/node_modules/@layer0/core/lambda/handler.d.ts +1 -0
  78. package/node_modules/@layer0/core/lambda/handler.js +91 -0
  79. package/node_modules/@layer0/core/lambda/handler.js.map +7 -0
  80. package/node_modules/@layer0/core/lambda/innerHandler.d.ts +7 -0
  81. package/node_modules/@layer0/core/lambda/innerHandler.js +181 -0
  82. package/node_modules/@layer0/core/lambda/lambdaInstance.d.ts +29 -0
  83. package/node_modules/@layer0/core/lambda/lambdaInstance.js +71 -0
  84. package/node_modules/@layer0/core/lambda/reqResMapper.d.ts +24 -0
  85. package/node_modules/@layer0/core/lambda/reqResMapper.js +286 -0
  86. package/node_modules/@layer0/core/lambda/stdStreamsWrapper.d.ts +31 -0
  87. package/node_modules/@layer0/core/lambda/stdStreamsWrapper.js +196 -0
  88. package/node_modules/@layer0/core/lambda/toJSBackend.d.ts +10 -0
  89. package/node_modules/@layer0/core/lambda/toJSBackend.js +23 -0
  90. package/node_modules/@layer0/core/node_modules/esbuild/LICENSE.md +21 -0
  91. package/node_modules/@layer0/core/node_modules/esbuild/README.md +3 -0
  92. package/node_modules/@layer0/core/node_modules/esbuild/bin/esbuild +223 -0
  93. package/node_modules/@layer0/core/node_modules/esbuild/install.js +301 -0
  94. package/node_modules/@layer0/core/node_modules/esbuild/lib/main.d.ts +716 -0
  95. package/node_modules/@layer0/core/node_modules/esbuild/lib/main.js +2532 -0
  96. package/node_modules/@layer0/core/node_modules/esbuild/node_modules/@ohos-ports/esbuild-openharmony-arm64/README.md +3 -0
  97. package/node_modules/@layer0/core/node_modules/esbuild/node_modules/@ohos-ports/esbuild-openharmony-arm64/bin/esbuild +0 -0
  98. package/node_modules/@layer0/core/node_modules/esbuild/node_modules/@ohos-ports/esbuild-openharmony-arm64/esbuild.wasm +0 -0
  99. package/node_modules/@layer0/core/node_modules/esbuild/node_modules/@ohos-ports/esbuild-openharmony-arm64/package.json +28 -0
  100. package/node_modules/@layer0/core/node_modules/esbuild/node_modules/@ohos-ports/esbuild-openharmony-arm64/wasm_exec.js +575 -0
  101. package/node_modules/@layer0/core/node_modules/esbuild/node_modules/@ohos-ports/esbuild-openharmony-arm64/wasm_exec_node.js +40 -0
  102. package/node_modules/@layer0/core/node_modules/esbuild/package.json +78 -0
  103. package/node_modules/@layer0/core/package.json +132 -0
  104. package/node_modules/@layer0/core/parser/parseRouter.d.ts +13 -0
  105. package/node_modules/@layer0/core/parser/parseRouter.js +77 -0
  106. package/node_modules/@layer0/core/plugins/PluginBase.d.ts +18 -0
  107. package/node_modules/@layer0/core/plugins/PluginBase.js +19 -0
  108. package/node_modules/@layer0/core/router/Backend.d.ts +69 -0
  109. package/node_modules/@layer0/core/router/Backend.js +176 -0
  110. package/node_modules/@layer0/core/router/BackendOptions.d.ts +11 -0
  111. package/node_modules/@layer0/core/router/BackendOptions.js +2 -0
  112. package/node_modules/@layer0/core/router/BaseResponseWriter.d.ts +65 -0
  113. package/node_modules/@layer0/core/router/BaseResponseWriter.js +81 -0
  114. package/node_modules/@layer0/core/router/BehindEdgeResponseWriterProxy.d.ts +4 -0
  115. package/node_modules/@layer0/core/router/BehindEdgeResponseWriterProxy.js +89 -0
  116. package/node_modules/@layer0/core/router/CacheManifest.d.ts +80 -0
  117. package/node_modules/@layer0/core/router/CacheManifest.js +83 -0
  118. package/node_modules/@layer0/core/router/CacheOptions.d.ts +171 -0
  119. package/node_modules/@layer0/core/router/CacheOptions.js +2 -0
  120. package/node_modules/@layer0/core/router/CustomCacheKey.d.ts +140 -0
  121. package/node_modules/@layer0/core/router/CustomCacheKey.js +272 -0
  122. package/node_modules/@layer0/core/router/GroupConfig.d.ts +7 -0
  123. package/node_modules/@layer0/core/router/GroupConfig.js +20 -0
  124. package/node_modules/@layer0/core/router/Groups.d.ts +7 -0
  125. package/node_modules/@layer0/core/router/Groups.js +21 -0
  126. package/node_modules/@layer0/core/router/Headers.d.ts +3 -0
  127. package/node_modules/@layer0/core/router/Headers.js +2 -0
  128. package/node_modules/@layer0/core/router/PathMatcher.d.ts +51 -0
  129. package/node_modules/@layer0/core/router/PathMatcher.js +73 -0
  130. package/node_modules/@layer0/core/router/Preload.d.ts +16 -0
  131. package/node_modules/@layer0/core/router/Preload.js +2 -0
  132. package/node_modules/@layer0/core/router/PreloadRequests.d.ts +23 -0
  133. package/node_modules/@layer0/core/router/PreloadRequests.js +66 -0
  134. package/node_modules/@layer0/core/router/Request.d.ts +74 -0
  135. package/node_modules/@layer0/core/router/Request.js +2 -0
  136. package/node_modules/@layer0/core/router/RequestContext.d.ts +12 -0
  137. package/node_modules/@layer0/core/router/RequestContext.js +11 -0
  138. package/node_modules/@layer0/core/router/Response.d.ts +55 -0
  139. package/node_modules/@layer0/core/router/Response.js +2 -0
  140. package/node_modules/@layer0/core/router/ResponseWriter.d.ts +1011 -0
  141. package/node_modules/@layer0/core/router/ResponseWriter.js +1341 -0
  142. package/node_modules/@layer0/core/router/Route.d.ts +124 -0
  143. package/node_modules/@layer0/core/router/Route.js +280 -0
  144. package/node_modules/@layer0/core/router/RouteCriteria.d.ts +68 -0
  145. package/node_modules/@layer0/core/router/RouteCriteria.js +2 -0
  146. package/node_modules/@layer0/core/router/RouteGroup.d.ts +157 -0
  147. package/node_modules/@layer0/core/router/RouteGroup.js +223 -0
  148. package/node_modules/@layer0/core/router/RouteGroupList.d.ts +45 -0
  149. package/node_modules/@layer0/core/router/RouteGroupList.js +73 -0
  150. package/node_modules/@layer0/core/router/Router.d.ts +439 -0
  151. package/node_modules/@layer0/core/router/Router.js +907 -0
  152. package/node_modules/@layer0/core/router/addBuiltInRoutes.d.ts +2 -0
  153. package/node_modules/@layer0/core/router/addBuiltInRoutes.js +58 -0
  154. package/node_modules/@layer0/core/router/addPreloadHeaders.d.ts +7 -0
  155. package/node_modules/@layer0/core/router/addPreloadHeaders.js +57 -0
  156. package/node_modules/@layer0/core/router/cacheManifestFromRouter.d.ts +6 -0
  157. package/node_modules/@layer0/core/router/cacheManifestFromRouter.js +85 -0
  158. package/node_modules/@layer0/core/router/createCustomCacheKey.d.ts +27 -0
  159. package/node_modules/@layer0/core/router/createCustomCacheKey.js +35 -0
  160. package/node_modules/@layer0/core/router/deriveSurrogateKeysFromJson.d.ts +36 -0
  161. package/node_modules/@layer0/core/router/deriveSurrogateKeysFromJson.js +70 -0
  162. package/node_modules/@layer0/core/router/index.d.ts +11 -0
  163. package/node_modules/@layer0/core/router/index.js +17 -0
  164. package/node_modules/@layer0/core/router/interpolateParams.d.ts +21 -0
  165. package/node_modules/@layer0/core/router/interpolateParams.js +150 -0
  166. package/node_modules/@layer0/core/router/loadRouter.d.ts +13 -0
  167. package/node_modules/@layer0/core/router/loadRouter.js +29 -0
  168. package/node_modules/@layer0/core/router/mergeQueryString.d.ts +1 -0
  169. package/node_modules/@layer0/core/router/mergeQueryString.js +23 -0
  170. package/node_modules/@layer0/core/router/normalizeCriteria.d.ts +6 -0
  171. package/node_modules/@layer0/core/router/normalizeCriteria.js +20 -0
  172. package/node_modules/@layer0/core/router/stream.d.ts +12 -0
  173. package/node_modules/@layer0/core/router/stream.js +30 -0
  174. package/node_modules/@layer0/core/router/universalRouteUtils.d.ts +55 -0
  175. package/node_modules/@layer0/core/router/universalRouteUtils.js +114 -0
  176. package/node_modules/@layer0/core/router/validateWriter.d.ts +41 -0
  177. package/node_modules/@layer0/core/router/validateWriter.js +120 -0
  178. package/node_modules/@layer0/core/serverless.yml +30 -0
  179. package/node_modules/@layer0/core/source.d.ts +9 -0
  180. package/node_modules/@layer0/core/source.js +17 -0
  181. package/node_modules/@layer0/core/test-utils/MockRequest.d.ts +15 -0
  182. package/node_modules/@layer0/core/test-utils/MockRequest.js +36 -0
  183. package/node_modules/@layer0/core/test-utils/MockResponse.d.ts +7 -0
  184. package/node_modules/@layer0/core/test-utils/MockResponse.js +24 -0
  185. package/node_modules/@layer0/core/test-utils/expect-extend.d.ts +1 -0
  186. package/node_modules/@layer0/core/test-utils/expect-extend.js +11 -0
  187. package/node_modules/@layer0/core/test-utils/index.d.ts +4 -0
  188. package/node_modules/@layer0/core/test-utils/index.js +11 -0
  189. package/node_modules/@layer0/core/test-utils/matchers/toBeCachedByTheBrowser.d.ts +19 -0
  190. package/node_modules/@layer0/core/test-utils/matchers/toBeCachedByTheBrowser.js +45 -0
  191. package/node_modules/@layer0/core/test-utils/matchers/toBeCachedByTheEdge.d.ts +19 -0
  192. package/node_modules/@layer0/core/test-utils/matchers/toBeCachedByTheEdge.js +38 -0
  193. package/node_modules/@layer0/core/test-utils/matchers/toBeCachedByTheServiceWorker.d.ts +19 -0
  194. package/node_modules/@layer0/core/test-utils/matchers/toBeCachedByTheServiceWorker.js +45 -0
  195. package/node_modules/@layer0/core/test-utils/matchers/toBeServedStale.d.ts +20 -0
  196. package/node_modules/@layer0/core/test-utils/matchers/toBeServedStale.js +50 -0
  197. package/node_modules/@layer0/core/test-utils/matchers/toHaveBody.d.ts +18 -0
  198. package/node_modules/@layer0/core/test-utils/matchers/toHaveBody.js +40 -0
  199. package/node_modules/@layer0/core/test-utils/matchers/toHaveHeader.d.ts +19 -0
  200. package/node_modules/@layer0/core/test-utils/matchers/toHaveHeader.js +43 -0
  201. package/node_modules/@layer0/core/test-utils/matchers.d.ts +6 -0
  202. package/node_modules/@layer0/core/test-utils/matchers.js +18 -0
  203. package/node_modules/@layer0/core/test-utils/utils/createRouteMock.d.ts +21 -0
  204. package/node_modules/@layer0/core/test-utils/utils/createRouteMock.js +27 -0
  205. package/node_modules/@layer0/core/test-utils/utils/getBackend.d.ts +13 -0
  206. package/node_modules/@layer0/core/test-utils/utils/getBackend.js +30 -0
  207. package/node_modules/@layer0/core/test-utils/utils/getMessage.d.ts +1 -0
  208. package/node_modules/@layer0/core/test-utils/utils/getMessage.js +16 -0
  209. package/node_modules/@layer0/core/test-utils/utils/runRoute.d.ts +10 -0
  210. package/node_modules/@layer0/core/test-utils/utils/runRoute.js +39 -0
  211. package/node_modules/@layer0/core/timing.d.ts +115 -0
  212. package/node_modules/@layer0/core/timing.js +200 -0
  213. package/node_modules/@layer0/core/transform/index.d.ts +1 -0
  214. package/node_modules/@layer0/core/transform/index.js +4 -0
  215. package/node_modules/@layer0/core/transform/transformMethod.d.ts +40 -0
  216. package/node_modules/@layer0/core/transform/transformMethod.js +58 -0
  217. package/node_modules/@layer0/core/types.d.ts +102 -0
  218. package/node_modules/@layer0/core/types.js +30 -0
  219. package/node_modules/@layer0/core/utils/Tasks.d.ts +32 -0
  220. package/node_modules/@layer0/core/utils/Tasks.js +80 -0
  221. package/node_modules/@layer0/core/utils/Validator.d.ts +18 -0
  222. package/node_modules/@layer0/core/utils/Validator.js +178 -0
  223. package/node_modules/@layer0/core/utils/bindParamsToPath.d.ts +15 -0
  224. package/node_modules/@layer0/core/utils/bindParamsToPath.js +49 -0
  225. package/node_modules/@layer0/core/utils/convertParamsToBackReferences.d.ts +16 -0
  226. package/node_modules/@layer0/core/utils/convertParamsToBackReferences.js +45 -0
  227. package/node_modules/@layer0/core/utils/convertStringMatcherToRegex.d.ts +7 -0
  228. package/node_modules/@layer0/core/utils/convertStringMatcherToRegex.js +26 -0
  229. package/node_modules/@layer0/core/utils/decode.d.ts +9 -0
  230. package/node_modules/@layer0/core/utils/decode.js +44 -0
  231. package/node_modules/@layer0/core/utils/esImport.d.ts +1 -0
  232. package/node_modules/@layer0/core/utils/esImport.js +9 -0
  233. package/node_modules/@layer0/core/utils/fs.d.ts +1 -0
  234. package/node_modules/@layer0/core/utils/fs.js +7 -0
  235. package/node_modules/@layer0/core/utils/get.d.ts +6 -0
  236. package/node_modules/@layer0/core/utils/get.js +19 -0
  237. package/node_modules/@layer0/core/utils/getPackageVersion.d.ts +7 -0
  238. package/node_modules/@layer0/core/utils/getPackageVersion.js +19 -0
  239. package/node_modules/@layer0/core/utils/has.d.ts +6 -0
  240. package/node_modules/@layer0/core/utils/has.js +15 -0
  241. package/node_modules/@layer0/core/utils/identity.d.ts +7 -0
  242. package/node_modules/@layer0/core/utils/identity.js +12 -0
  243. package/node_modules/@layer0/core/utils/index.d.ts +1 -0
  244. package/node_modules/@layer0/core/utils/index.js +4 -0
  245. package/node_modules/@layer0/core/utils/isEmpty.d.ts +6 -0
  246. package/node_modules/@layer0/core/utils/isEmpty.js +20 -0
  247. package/node_modules/@layer0/core/utils/isString.d.ts +1 -0
  248. package/node_modules/@layer0/core/utils/isString.js +6 -0
  249. package/node_modules/@layer0/core/utils/logo.d.ts +5 -0
  250. package/node_modules/@layer0/core/utils/logo.js +27 -0
  251. package/node_modules/@layer0/core/utils/mapValues.d.ts +7 -0
  252. package/node_modules/@layer0/core/utils/mapValues.js +16 -0
  253. package/node_modules/@layer0/core/utils/minBy.d.ts +8 -0
  254. package/node_modules/@layer0/core/utils/minBy.js +41 -0
  255. package/node_modules/@layer0/core/utils/nonWebpackRequire.d.ts +11 -0
  256. package/node_modules/@layer0/core/utils/nonWebpackRequire.js +28 -0
  257. package/node_modules/@layer0/core/utils/packageUtils.d.ts +12 -0
  258. package/node_modules/@layer0/core/utils/packageUtils.js +22 -0
  259. package/node_modules/@layer0/core/utils/ports.d.ts +5 -0
  260. package/node_modules/@layer0/core/utils/ports.js +7 -0
  261. package/node_modules/@layer0/core/utils/readBody.d.ts +7 -0
  262. package/node_modules/@layer0/core/utils/readBody.js +15 -0
  263. package/node_modules/@layer0/core/utils/readRawBody.d.ts +9 -0
  264. package/node_modules/@layer0/core/utils/readRawBody.js +21 -0
  265. package/node_modules/@layer0/core/utils/regExpEscape.d.ts +12 -0
  266. package/node_modules/@layer0/core/utils/regExpEscape.js +20 -0
  267. package/node_modules/@layer0/core/utils/requireInternal.d.ts +7 -0
  268. package/node_modules/@layer0/core/utils/requireInternal.js +24 -0
  269. package/node_modules/@layer0/core/utils/set.d.ts +10 -0
  270. package/node_modules/@layer0/core/utils/set.js +21 -0
  271. package/node_modules/@layer0/core/utils/toEdgeRegex.d.ts +11 -0
  272. package/node_modules/@layer0/core/utils/toEdgeRegex.js +23 -0
  273. package/node_modules/@layer0/core/utils/toHttpMethodMatchRegex.d.ts +12 -0
  274. package/node_modules/@layer0/core/utils/toHttpMethodMatchRegex.js +17 -0
  275. package/node_modules/@layer0/core/utils/toLower.d.ts +1 -0
  276. package/node_modules/@layer0/core/utils/toLower.js +9 -0
  277. package/node_modules/@layer0/core/utils/validateBackends.d.ts +5 -0
  278. package/node_modules/@layer0/core/utils/validateBackends.js +30 -0
  279. package/node_modules/@layer0/core/utils/watch.d.ts +10 -0
  280. package/node_modules/@layer0/core/utils/watch.js +17 -0
  281. package/package.json +47 -3
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const url_1 = __importDefault(require("url"));
7
+ const querystring_1 = __importDefault(require("querystring"));
8
+ /**
9
+ * @private
10
+ * Having a no-op BaseResponseWriter makes it easy for us to stub out the writer
11
+ * when introspecing the router. This is needed to implement Router.getPrefetchableRoutes
12
+ */
13
+ class BaseResponseWriter {
14
+ constructor(req, res, route) { }
15
+ cache(options) { }
16
+ redirect(to, options) { }
17
+ /**
18
+ * Translates redirect params into normalized version that solves backward compatibility
19
+ * issues and also takes into account query parameters that may be included in the query
20
+ * string itself.
21
+ *
22
+ * @param to string to where we are redirecting the request; may have query string
23
+ * @param options options with which we are redirecting the request
24
+ */
25
+ _readRedirectParams(to, options) {
26
+ const { statusCode = 302, query = {} } =
27
+ // Retro-compatibility, second argument used to be statusCode
28
+ typeof options === 'number' ? { statusCode: options } : options;
29
+ // Parse `to` param to extract query strings from it.
30
+ let toQuery = {};
31
+ const parsedTo = url_1.default.parse(to);
32
+ // istanbul ignore next - ?. gives istanbul indigestion
33
+ if (parsedTo === null || parsedTo === void 0 ? void 0 : parsedTo.search) {
34
+ to = to.substr(0, to.length - parsedTo.search.length);
35
+ // @ts-ignore: whenever search is truthy query is at least an empty string
36
+ toQuery = querystring_1.default.parse(parsedTo.query);
37
+ }
38
+ return {
39
+ to,
40
+ statusCode,
41
+ query: {
42
+ ...toQuery,
43
+ ...query,
44
+ },
45
+ };
46
+ }
47
+ proxy(backend, options) { }
48
+ render(cb) { }
49
+ stream(backend) { }
50
+ serveStatic(path, options) { }
51
+ updatePath(destination) { }
52
+ rewrite(destination, pattern) { }
53
+ setRequestHeader(name, value) { }
54
+ updateRequestHeader(name, match, replace) { }
55
+ removeRequestHeader(name) { }
56
+ setUpstreamResponseHeader(name, value) { }
57
+ updateUpstreamResponseHeader(name, match, replace) { }
58
+ removeUpstreamResponseHeader(name) { }
59
+ /*
60
+ * JWTs are only verified on the edge, not locally or on the user lambda
61
+ * implementation here is empty in ResponseWriter as here, and overwritten
62
+ * with some bejaviour in EdgeResponseWriter
63
+ */
64
+ verifyJwt(options) { }
65
+ setResponseHeader(name, value) { }
66
+ updateResponseHeader(name, match, replace) { }
67
+ removeResponseHeader(name) { }
68
+ addResponseCookie(name, value, options) { }
69
+ updateResponseCookie(name, match, replace) { }
70
+ removeResponseCookie(name) { }
71
+ addUpstreamResponseCookie(name, value, options) { }
72
+ updateUpstreamResponseCookie(name, match, replace) { }
73
+ removeUpstreamResponseCookie(name) { }
74
+ send(content, statusCode, statusMessage) { }
75
+ compute(callback) { }
76
+ serviceWorker(path) { }
77
+ allowCors(options) { }
78
+ appShell(indexHtmlPath) { }
79
+ renderWithApp(options) { }
80
+ }
81
+ exports.BaseResponseWriter = BaseResponseWriter;
@@ -0,0 +1,4 @@
1
+ declare const _default: {
2
+ create: (writer: any) => any;
3
+ };
4
+ export default _default;
@@ -0,0 +1,89 @@
1
+ 'use strict';
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ /**
4
+ * Set of methods that are to be intercepted and made noop
5
+ * outside of the immediate mode (which is in effect only
6
+ * during compute on serverless)
7
+ *
8
+ * @private
9
+ */
10
+ const conditionallyExecutedMethods = new Set([
11
+ 'cache',
12
+ 'setRequestHeader',
13
+ 'updateRequestHeader',
14
+ 'removeRequestHeader',
15
+ 'setResponseHeader',
16
+ 'updateResponseHeader',
17
+ 'removeResponseHeader',
18
+ 'setUpstreamResponseHeader',
19
+ 'updateUpstreamResponseHeader',
20
+ 'removeUpstreamResponseHeader',
21
+ 'addResponseCookie',
22
+ 'updateResponseCookie',
23
+ 'removeResponseCookie',
24
+ 'addUpstreamResponseCookie',
25
+ 'updateUpstreamResponseCookie',
26
+ 'removeUpstreamResponseCookie',
27
+ ]);
28
+ /**
29
+ * Response writer proxy used then core router is not on the edge.
30
+ *
31
+ * Notes:
32
+ * - We need this to avoid running header and other transformations on
33
+ * both edge and in the cloud. We do this by overriding the ResponseWriter
34
+ * header transformation methods so that they are either a noop when
35
+ * running outside of immediate mode or immediately executing them.
36
+ *
37
+ * @param writer ResponseWriter to which we are proxying the requests
38
+ *
39
+ * @private
40
+ */
41
+ const create = (writer) => {
42
+ const wrapComputeConditionedFunction = (target, property) => {
43
+ // We cannot use closures but rather functions so that we can bind them.
44
+ return async function (...args) {
45
+ if (!target.runningImmediately) {
46
+ return;
47
+ }
48
+ return await target[property](...args);
49
+ }.bind(target);
50
+ };
51
+ return new Proxy(writer, {
52
+ get: (target, property) => {
53
+ if (property === 'serveStatic') {
54
+ return wrapServeStatic(target, target.serveStatic);
55
+ }
56
+ else if (conditionallyExecutedMethods.has(property.toString())) {
57
+ return wrapComputeConditionedFunction(target, property);
58
+ }
59
+ else {
60
+ return target[property];
61
+ }
62
+ },
63
+ });
64
+ };
65
+ exports.default = {
66
+ create,
67
+ };
68
+ /**
69
+ * Overrides the default behavior of serveStatic when running behind the edge to
70
+ * skip trying to pull the file from S3 and just running the onNotFound function
71
+ * because the edge has already tried and failed to pull the file from S3.
72
+ * @param _path
73
+ * @param options
74
+ */
75
+ function wrapServeStatic(res, originalMethod) {
76
+ return async (path, options = {}) => {
77
+ // @ts-ignore We want to leave runningImmediately private
78
+ if (res.runningImmediately) {
79
+ return originalMethod.call(res, path, options);
80
+ }
81
+ else if (options.onNotFound) {
82
+ // @ts-ignore We want to leave runImmediately private
83
+ res.setCreateResponseAction(() => res.runImmediately(() => options.onNotFound(res)));
84
+ }
85
+ else {
86
+ throw new Error('Should not get to serveStatic without onNotFound when running behind the edge.');
87
+ }
88
+ };
89
+ }
@@ -0,0 +1,80 @@
1
+ import { CacheOptions } from './CacheOptions';
2
+ /**
3
+ * A representation of a route to be passed to the browser.
4
+ * @private
5
+ */
6
+ export interface CacheManifestEntry {
7
+ /**
8
+ * Criteria path as expressed in User's routes
9
+ */
10
+ criteriaPath: string | undefined;
11
+ /**
12
+ * The criteria path turned into a regexp string
13
+ */
14
+ route: string;
15
+ /**
16
+ * Key/value pairs for the route's query params to match
17
+ */
18
+ query?: {
19
+ [key: string]: string | null;
20
+ };
21
+ /**
22
+ * Caching options for the route
23
+ */
24
+ cacheOptions: CacheOptions;
25
+ /**
26
+ * Optional http method to match for the route
27
+ */
28
+ method?: string;
29
+ /**
30
+ * Optional protocol to match for the route
31
+ */
32
+ protocol?: string;
33
+ /**
34
+ * Set to true if the route returns a response (e.g. proxy, send, compute) in which
35
+ * case the router/prefetcher should stop searching for other route matches.
36
+ */
37
+ returnsResponse: boolean;
38
+ }
39
+ /**
40
+ * A serializable array of route descriptors to be passed to the browser.
41
+ * @private
42
+ */
43
+ export default class CacheManifest {
44
+ entries: CacheManifestEntry[];
45
+ constructor(entries?: CacheManifestEntry[]);
46
+ /**
47
+ * Returns a list of entries in this CacheManifest where both the browser and
48
+ * edge cache times are defined, and greater than 0
49
+ */
50
+ get cacheableEntries(): CacheManifestEntry[];
51
+ /**
52
+ * Returns a list of routes (as RegExp) that are cacheable SPA routes
53
+ */
54
+ get spaRoutes(): RegExp[];
55
+ /**
56
+ * Returns true if the URL should be prefetched, based on the matched route's `cacheOptions`
57
+ * @param url The URL to test
58
+ */
59
+ shouldPrefetch(url: URL): boolean;
60
+ /**
61
+ * Returns true if the entry matches the URL's path, query params, and/or protocol
62
+ * @param entry The entry to test
63
+ * @param url URL to check against the entry
64
+ */
65
+ static entryMatches(entry: CacheManifestEntry, url: URL): boolean;
66
+ /**
67
+ * Returns true if the given entry has its `cacheOptions` set so that the route
68
+ * is cacheable by the edge and the browser.
69
+ * @param entry The entry to test
70
+ */
71
+ static isEntryCacheable({ cacheOptions }: CacheManifestEntry): boolean;
72
+ /**
73
+ * Creates a new `CacheManifest` object from the provided serialized entries
74
+ */
75
+ static fromEntries(entries: CacheManifestEntry[]): CacheManifest;
76
+ /**
77
+ * Serializes the list so that it can be passed to the browser
78
+ */
79
+ toJSON(): string;
80
+ }
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const universalRouteUtils_1 = require("./universalRouteUtils");
7
+ const mapValues_1 = __importDefault(require("../utils/mapValues"));
8
+ /**
9
+ * A serializable array of route descriptors to be passed to the browser.
10
+ * @private
11
+ */
12
+ class CacheManifest {
13
+ constructor(entries) {
14
+ this.entries = entries || [];
15
+ }
16
+ /**
17
+ * Returns a list of entries in this CacheManifest where both the browser and
18
+ * edge cache times are defined, and greater than 0
19
+ */
20
+ get cacheableEntries() {
21
+ return this.entries.filter(CacheManifest.isEntryCacheable);
22
+ }
23
+ /**
24
+ * Returns a list of routes (as RegExp) that are cacheable SPA routes
25
+ */
26
+ get spaRoutes() {
27
+ return this.cacheableEntries
28
+ .filter(({ cacheOptions }) => cacheOptions.browser && cacheOptions.browser.spa)
29
+ .map(({ route }) => new RegExp(route, 'i'));
30
+ }
31
+ /**
32
+ * Returns true if the URL should be prefetched, based on the matched route's `cacheOptions`
33
+ * @param url The URL to test
34
+ */
35
+ shouldPrefetch(url) {
36
+ let doPrefetch = false;
37
+ this.entries.some(entry => {
38
+ const matches = CacheManifest.entryMatches(entry, url);
39
+ if (matches) {
40
+ doPrefetch =
41
+ CacheManifest.isEntryCacheable(entry) || !!entry.cacheOptions.prefetchUpstreamRequests;
42
+ // if it's prefetchable, or if it matches a stop route, then no need to continue checking:
43
+ return doPrefetch || entry.returnsResponse;
44
+ }
45
+ return false;
46
+ });
47
+ return doPrefetch;
48
+ }
49
+ /**
50
+ * Returns true if the entry matches the URL's path, query params, and/or protocol
51
+ * @param entry The entry to test
52
+ * @param url URL to check against the entry
53
+ */
54
+ static entryMatches(entry, url) {
55
+ return (new RegExp(entry.route, 'i').test(url.pathname) &&
56
+ universalRouteUtils_1.matchCriteriaRegexObjectWithRequestObject(mapValues_1.default(entry.query || {}, value => (value ? new RegExp(value, 'i') : null)), Object.fromEntries(Array.from(url.searchParams.entries()))) &&
57
+ (entry.protocol ? new RegExp(entry.protocol, 'i').test(url.protocol) : true));
58
+ }
59
+ /**
60
+ * Returns true if the given entry has its `cacheOptions` set so that the route
61
+ * is cacheable by the edge and the browser.
62
+ * @param entry The entry to test
63
+ */
64
+ static isEntryCacheable({ cacheOptions }) {
65
+ return !!(cacheOptions.browser &&
66
+ (cacheOptions.browser.serviceWorkerSeconds || 0) > 0 &&
67
+ cacheOptions.edge &&
68
+ (cacheOptions.edge.maxAgeSeconds || 0) > 0);
69
+ }
70
+ /**
71
+ * Creates a new `CacheManifest` object from the provided serialized entries
72
+ */
73
+ static fromEntries(entries) {
74
+ return new CacheManifest(entries);
75
+ }
76
+ /**
77
+ * Serializes the list so that it can be passed to the browser
78
+ */
79
+ toJSON() {
80
+ return JSON.stringify(this.entries);
81
+ }
82
+ }
83
+ exports.default = CacheManifest;
@@ -0,0 +1,171 @@
1
+ import CustomCacheKey from './CustomCacheKey';
2
+ import { HTTP_METHODS } from '../constants';
3
+ export declare type HTTPMethod = keyof typeof HTTP_METHODS;
4
+ /**
5
+ * Options for controlling caching behavior in the browser and at the network edge.
6
+ */
7
+ export interface CacheOptions {
8
+ /**
9
+ * Sets the caching behavior at edge. When set to `false` the caching in the edge is turned
10
+ * off. This also turns off queueing of potentially cacheable requests that platform performs
11
+ * automatically.
12
+ *
13
+ * Note: if know for sure that a specific `GET` route will never cache then you should
14
+ * always set `edge` caching to `false` for it as it will disable `GET` request coalescing
15
+ * making your application faster.
16
+ */
17
+ edge?: EdgeCacheOptions | false;
18
+ /**
19
+ * Sets the caching behavior in the browser. When set to `false` the caching in the browser
20
+ * is turned off.
21
+ */
22
+ browser?: BrowserCacheOptions | false;
23
+ /**
24
+ * Allows you to split or normalize the cache space for a given route. Common use cases include:
25
+ *
26
+ * - serving multiple variants of the same URL based on a currency and/or language cookie.
27
+ * - caching different responses based on device type
28
+ * - ignoring all but a specific set of query parameters when looking up a response from the cache.
29
+ *
30
+ * **Example**
31
+ *
32
+ * ```js
33
+ * import { Router, CustomCacheKey } from '@layer0/core/router'
34
+ *
35
+ * new Router()
36
+ * .match('/some-path', ({ cache }) => {
37
+ * cache({
38
+ * key: new CustomCacheKey()
39
+ * .excludeAllQueryParametersExcept('color', 'size')
40
+ * .addCookie('currency')
41
+ * .addCookie('location', cookie => {
42
+ * cookie.group('na').byPattern('us|ca')
43
+ * cookie.group('eur').byPattern('de|fr|ee')
44
+ * }),
45
+ * edge: {
46
+ * maxAgeSeconds: 60 * 60
47
+ * }
48
+ * })
49
+ * })
50
+ * ```
51
+ */
52
+ key?: CustomCacheKey;
53
+ /**
54
+ * If true, prefetch requests that match the route pattern will not be cached directly,
55
+ * but will instead force the Prefetcher to prefetch paths listed in the response's
56
+ * `x-0-upstream-requests` header.
57
+ */
58
+ prefetchUpstreamRequests?: boolean;
59
+ }
60
+ /**
61
+ * Options for controlling caching behavior at edge
62
+ */
63
+ export interface EdgeCacheOptions {
64
+ /**
65
+ * The maximum number of seconds that a response is served from the cache until it is
66
+ * considered stale. Unless `staleWhileRevalidate` is specified, stale responses will
67
+ * not be returned to the browser.
68
+ */
69
+ maxAgeSeconds?: number;
70
+ /**
71
+ * Extends the duration that a response will be served from the cache after it has become stale.
72
+ * When using staleWhileRevalidate, if Layer0 receives a request for a stale asset, the cached
73
+ * response will be served and a fresh response will be concurrently fetch so that it can be served
74
+ * for future requests. The stale response will continue to be served until the fresh fetched.
75
+ */
76
+ staleWhileRevalidateSeconds?: number;
77
+ /**
78
+ * Allows you to force caching of responses marked as `private` in their `cache-control` header.
79
+ * This option must be used with utmost care to avoid leaking private information.
80
+ *
81
+ * **Example**
82
+ *
83
+ * ```js
84
+ * import { Router, CustomCacheKey } from '@layer0/core/router'
85
+ *
86
+ * new Router()
87
+ * .match('/private/path', ({ cache }) => {
88
+ * cache({
89
+ * edge: {
90
+ * maxAgeSeconds: 60 * 60,
91
+ * key: new CustomCacheKey()
92
+ * .addCookie('session'),
93
+ * forcePrivateCaching: true,
94
+ * }
95
+ * })
96
+ * })
97
+ * ```
98
+ */
99
+ forcePrivateCaching?: boolean;
100
+ }
101
+ /**
102
+ * Options for controlling caching behavior in the browser
103
+ */
104
+ export interface BrowserCacheOptions {
105
+ /**
106
+ * Sets the `max-age` value of the `cache-control` header sent to the browser. This controls the duration
107
+ * that the response is held in the browser's http cache.
108
+ */
109
+ maxAgeSeconds?: number;
110
+ /**
111
+ * Sends an `x-sw-cache-control` header with a value of `max-age={serviceWorkerSeconds}`. This is not a standard
112
+ * header that service workers understand by default. You'll need to implement logic to handle this in your service worker.
113
+ */
114
+ serviceWorkerSeconds?: number;
115
+ /**
116
+ * Set to `true` to convert all requests to GETs using the service worker. Doing so
117
+ * allows you to prefetch and cache non-GET requests. Since all prefetch requests are GETs,
118
+ * setting this config to `true` will ensure that the actual, non-prefetch requests use
119
+ * GET as well and thus have the same cache key as their prefetch counterparts.
120
+ *
121
+ * When `true`, the service worker will add the request body as the `pref_layer0_body` parameter.
122
+ * You can then use a `.get()` route with `transformRequest` to convert the `get` to the original method (`post`, for example)
123
+ * when fetching from the backend.
124
+ *
125
+ * Note that you must specify two routes when using this method: one for the `get` and one for the original method,
126
+ * This is because do not guarantee that the service worker is installed and running by the time requests are sent, so some
127
+ * requests will inevitably sent using their original method and body.
128
+ *
129
+ * **Example**
130
+ *
131
+ * ```js
132
+ * import { Router } from '@layer0/core/router'
133
+ * import { transformMethod } from '@layer0/core/transform'
134
+ *
135
+ * const cacheConfig = {
136
+ * edge: {
137
+ * maxAgeSeconds: 60 * 60 * 24,
138
+ * staleWhileRevalidateSeconds: 60 * 60
139
+ * },
140
+ * browser: {
141
+ * serviceWorkerSeconds: 60 * 60 * 24,
142
+ * convertToGet: true // convert POSTs to GETs so we can prefetch and cache them
143
+ * }
144
+ * }
145
+ *
146
+ * export default new Router()
147
+ * // When the request is a GET, convert it to post using serverless compute and cache the result
148
+ * .get('/some-post-path', (res) => {
149
+ * cache(cacheConfig)
150
+ * res.proxy('origin', {
151
+ * transformRequest: transformMethod('post')
152
+ * })
153
+ * })
154
+ * // When the request is a POST, forward it to origin from the edge without using serverless compute
155
+ * .post('/some-post-path', ({ cache, proxy }) => {
156
+ * cache(cacheConfig)
157
+ * proxy('origin')
158
+ * })
159
+ * ```
160
+ *
161
+ * @param toMethod The method to to set
162
+ */
163
+ convertToGet?: boolean;
164
+ /**
165
+ * Set to true if the request is for a SPA and there will be prefetch requests made
166
+ * based on the headers of another request
167
+ *
168
+ * @private - Until we ensure that the layer0_head requests are viable
169
+ */
170
+ spa?: boolean;
171
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,140 @@
1
+ import Groups from './Groups';
2
+ import Request from './Request';
3
+ import CacheKey from '../cache/CacheKey';
4
+ export interface CustomCacheKeyConfig {
5
+ action: string;
6
+ names?: string[];
7
+ groups?: any;
8
+ }
9
+ export declare const CUSTOM_CACHE_KEY_ACTIONS: {
10
+ blacklistAll: string;
11
+ blacklistSome: string;
12
+ whitelistSome: string;
13
+ addValue: string;
14
+ removeMethod: string;
15
+ removeBody: string;
16
+ };
17
+ declare type GroupCreator = (groups: Groups) => void;
18
+ /**
19
+ * Allows you to split or normalize the cache space for a given route. Common use cases include:
20
+ *
21
+ * - serving multiple variants of the same URL based on a currency and/or language cookie.
22
+ * - caching different responses based on device type
23
+ * - ignoring all but a specific set of query parameters when looking up a response from the cache.
24
+ *
25
+ * **Example**
26
+ *
27
+ * ```js
28
+ * import { Router, CustomCacheKey } from '@layer0/core/router'
29
+ *
30
+ * new Router()
31
+ * .match('/some-path', ({ cache }) => {
32
+ * cache({
33
+ * key: new CustomCacheKey()
34
+ * .excludeAllQueryParametersExcept('color', 'size')
35
+ * .addCookie('currency')
36
+ * .addCookie('location', cookie => {
37
+ * cookie.group('na').byPattern('us|ca')
38
+ * cookie.group('eur').byPattern('de|fr|ee')
39
+ * }),
40
+ * edge: {
41
+ * maxAgeSeconds: 60 * 60
42
+ * }
43
+ * })
44
+ * })
45
+ * ```
46
+ */
47
+ export default class CustomCacheKey {
48
+ private config;
49
+ private actions;
50
+ /**
51
+ * Creates a copy of the cache key.
52
+ */
53
+ clone(): CustomCacheKey;
54
+ /**
55
+ * Excludes the entire query string from the cache key.
56
+ * @return {CustomCacheKey} A self-reference, suitable for chaining.
57
+ */
58
+ excludeAllQueryParameters(): this;
59
+ /**
60
+ * Excludes the provided query parameters from the cache key. All other parameters
61
+ * will still be part of the cache key. We also refer to this as "blacklisting" query parameters.
62
+ * @param names The names of the query parameters to blacklist
63
+ * @return {CustomCacheKey} A self-reference, suitable for chaining.
64
+ */
65
+ excludeQueryParameters(...names: string[]): this;
66
+ /**
67
+ * Excludes all query parameters except those provided from the cache key. We also refer to
68
+ * this as "whitelisting" query parameters. We recommend using this method over `excludeQueryParameters`
69
+ * as it's difficult to know all of the query parameters your application might receive and unexpected
70
+ * query parameters can lead to significantly lower cache hit rates.
71
+ * @param names The names of the query parameters to whitelist
72
+ * @return {CustomCacheKey} A self-reference, suitable for chaining.
73
+ */
74
+ excludeAllQueryParametersExcept(...names: string[]): this;
75
+ /**
76
+ * Adds a request header to the cache key.
77
+ * This will have no effect on service worker cache.
78
+ * @param name The name of the request header
79
+ * @param createGroups A function that accepts a `Groups` instance and calls `groups.group(name)` to group multiple values into a single cache key component
80
+ * @return {CustomCacheKey} A self-reference, suitable for chaining.
81
+ */
82
+ addHeader(name: string, createGroups?: GroupCreator): this;
83
+ /**
84
+ * Removes the HTTP method from the cache key.
85
+ * @return A self-reference, suitable for chaining.
86
+ */
87
+ removeMethod(): this;
88
+ /**
89
+ * Removes the HTTP body from the cache key.
90
+ * @return A self-reference, suitable for chaining.
91
+ */
92
+ removeBody(): this;
93
+ /**
94
+ * Creates a key value for a header or cookie based on the specified group creator
95
+ * @param createGroups the GroupCreator
96
+ * @param srcValues The values of the header or cookie in the request
97
+ */
98
+ private createGroupedValue;
99
+ private findMatchingGroup;
100
+ /**
101
+ * Specifies that requests should be cached on a per-device basis.
102
+ * This will have no effect on service worker cache.
103
+ * @return {CustomCacheKey} A self-reference, suitable for chaining.
104
+ */
105
+ addDevice(): this;
106
+ /**
107
+ * Specifies that requests should be cached on a per-vendor basis.
108
+ * This will have no effect on service worker cache.
109
+ * @return {CustomCacheKey} A self-reference, suitable for chaining.
110
+ */
111
+ addVendor(): this;
112
+ /**
113
+ * Specifies that requests should be cached differently for bots.
114
+ * This will have no effect on service worker cache.
115
+ * @return {CustomCacheKey} A self-reference, suitable for chaining.
116
+ */
117
+ addIsBot(): this;
118
+ /**
119
+ * Specifies that requests should be cached on a per-browser basis.
120
+ * This will have no effect on service worker cache.
121
+ * @return {CustomCacheKey} A self-reference, suitable for chaining.
122
+ */
123
+ addBrowser(): this;
124
+ /**
125
+ * Adds a cookie to the cache key.
126
+ * This will have no effect on service worker cache.
127
+ * @param name The name of the cookie
128
+ * @param createGroups An function that accepts a `Groups` instance and calls `groups.group(name)` to group multiple values into a single cache key component
129
+ * @return {CustomCacheKey} A self-reference, suitable for chaining.
130
+ */
131
+ addCookie(name: string, createGroups?: GroupCreator): this;
132
+ /**
133
+ * @private
134
+ * @return {CustomCacheKey} A self-reference, suitable for chaining.
135
+ */
136
+ private addValue;
137
+ getActions(): ((key: CacheKey, srcRequest: Request) => void)[];
138
+ toJSON(): CustomCacheKeyConfig[];
139
+ }
140
+ export {};