@wix/auto_sdk_cache_cache 1.0.8 → 1.0.10

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 (123) hide show
  1. package/build/cjs/index.d.ts +43 -1
  2. package/build/cjs/index.js +168 -15
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +69 -1
  5. package/build/cjs/index.typings.js +148 -15
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +47 -1
  8. package/build/cjs/meta.js +134 -15
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/{src/ssr-v1-invalidate-cache-request-cache.public.d.ts → index.d.mts} +11 -8
  11. package/build/es/index.mjs +143 -0
  12. package/build/es/index.mjs.map +1 -0
  13. package/build/es/{src/ssr-v1-invalidate-cache-request-cache.universal.d.ts → index.typings.d.mts} +10 -8
  14. package/build/es/index.typings.mjs +123 -0
  15. package/build/es/index.typings.mjs.map +1 -0
  16. package/build/es/meta.d.mts +47 -0
  17. package/build/es/meta.mjs +109 -0
  18. package/build/es/meta.mjs.map +1 -0
  19. package/build/internal/cjs/index.d.ts +43 -1
  20. package/build/internal/cjs/index.js +168 -15
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +69 -1
  23. package/build/internal/cjs/index.typings.js +148 -15
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +47 -1
  26. package/build/internal/cjs/meta.js +134 -15
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/{cjs/src/ssr-v1-invalidate-cache-request-cache.public.d.ts → es/index.d.mts} +11 -8
  29. package/build/internal/es/index.mjs +143 -0
  30. package/build/internal/es/index.mjs.map +1 -0
  31. package/build/internal/es/{src/ssr-v1-invalidate-cache-request-cache.universal.d.ts → index.typings.d.mts} +10 -8
  32. package/build/internal/es/index.typings.mjs +123 -0
  33. package/build/internal/es/index.typings.mjs.map +1 -0
  34. package/build/internal/es/meta.d.mts +47 -0
  35. package/build/internal/es/meta.mjs +109 -0
  36. package/build/internal/es/meta.mjs.map +1 -0
  37. package/package.json +12 -10
  38. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.context.d.ts +0 -5
  39. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.context.js +0 -8
  40. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.context.js.map +0 -1
  41. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.http.d.ts +0 -28
  42. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.http.js +0 -86
  43. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.http.js.map +0 -1
  44. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.d.ts +0 -14
  45. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.js +0 -66
  46. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.js.map +0 -1
  47. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.public.d.ts +0 -40
  48. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.public.js +0 -18
  49. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.public.js.map +0 -1
  50. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.types.d.ts +0 -30
  51. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.types.js +0 -3
  52. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.types.js.map +0 -1
  53. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.d.ts +0 -67
  54. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.js +0 -109
  55. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.js.map +0 -1
  56. package/build/es/index.d.ts +0 -1
  57. package/build/es/index.js +0 -2
  58. package/build/es/index.js.map +0 -1
  59. package/build/es/index.typings.d.ts +0 -1
  60. package/build/es/index.typings.js +0 -2
  61. package/build/es/index.typings.js.map +0 -1
  62. package/build/es/meta.d.ts +0 -1
  63. package/build/es/meta.js +0 -2
  64. package/build/es/meta.js.map +0 -1
  65. package/build/es/src/ssr-v1-invalidate-cache-request-cache.context.d.ts +0 -5
  66. package/build/es/src/ssr-v1-invalidate-cache-request-cache.context.js +0 -5
  67. package/build/es/src/ssr-v1-invalidate-cache-request-cache.context.js.map +0 -1
  68. package/build/es/src/ssr-v1-invalidate-cache-request-cache.http.d.ts +0 -28
  69. package/build/es/src/ssr-v1-invalidate-cache-request-cache.http.js +0 -81
  70. package/build/es/src/ssr-v1-invalidate-cache-request-cache.http.js.map +0 -1
  71. package/build/es/src/ssr-v1-invalidate-cache-request-cache.meta.d.ts +0 -14
  72. package/build/es/src/ssr-v1-invalidate-cache-request-cache.meta.js +0 -38
  73. package/build/es/src/ssr-v1-invalidate-cache-request-cache.meta.js.map +0 -1
  74. package/build/es/src/ssr-v1-invalidate-cache-request-cache.public.js +0 -13
  75. package/build/es/src/ssr-v1-invalidate-cache-request-cache.public.js.map +0 -1
  76. package/build/es/src/ssr-v1-invalidate-cache-request-cache.types.d.ts +0 -30
  77. package/build/es/src/ssr-v1-invalidate-cache-request-cache.types.js +0 -2
  78. package/build/es/src/ssr-v1-invalidate-cache-request-cache.types.js.map +0 -1
  79. package/build/es/src/ssr-v1-invalidate-cache-request-cache.universal.js +0 -81
  80. package/build/es/src/ssr-v1-invalidate-cache-request-cache.universal.js.map +0 -1
  81. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.context.d.ts +0 -5
  82. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.context.js +0 -8
  83. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.context.js.map +0 -1
  84. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.http.d.ts +0 -28
  85. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.http.js +0 -86
  86. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.http.js.map +0 -1
  87. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.d.ts +0 -14
  88. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.js +0 -66
  89. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.js.map +0 -1
  90. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.public.js +0 -18
  91. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.public.js.map +0 -1
  92. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.types.d.ts +0 -30
  93. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.types.js +0 -3
  94. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.types.js.map +0 -1
  95. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.d.ts +0 -67
  96. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.js +0 -109
  97. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.js.map +0 -1
  98. package/build/internal/es/index.d.ts +0 -1
  99. package/build/internal/es/index.js +0 -2
  100. package/build/internal/es/index.js.map +0 -1
  101. package/build/internal/es/index.typings.d.ts +0 -1
  102. package/build/internal/es/index.typings.js +0 -2
  103. package/build/internal/es/index.typings.js.map +0 -1
  104. package/build/internal/es/meta.d.ts +0 -1
  105. package/build/internal/es/meta.js +0 -2
  106. package/build/internal/es/meta.js.map +0 -1
  107. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.context.d.ts +0 -5
  108. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.context.js +0 -5
  109. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.context.js.map +0 -1
  110. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.http.d.ts +0 -28
  111. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.http.js +0 -81
  112. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.http.js.map +0 -1
  113. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.meta.d.ts +0 -14
  114. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.meta.js +0 -38
  115. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.meta.js.map +0 -1
  116. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.public.d.ts +0 -40
  117. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.public.js +0 -13
  118. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.public.js.map +0 -1
  119. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.types.d.ts +0 -30
  120. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.types.js +0 -2
  121. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.types.js.map +0 -1
  122. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.universal.js +0 -81
  123. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.universal.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/ssr-v1-invalidate-cache-request-cache.universal.ts","../../../src/ssr-v1-invalidate-cache-request-cache.http.ts"],"sourcesContent":["import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';\nimport { renameKeysFromSDKRequestToRESTRequest } from '@wix/sdk-runtime/rename-all-nested-keys';\nimport { HttpClient } from '@wix/sdk-types';\nimport * as ambassadorWixSsrV1InvalidateCacheRequest from './ssr-v1-invalidate-cache-request-cache.http.js';\n\nexport interface InvalidateCacheRequest {\n /**\n * An array of objects containing a `tag` field used to identify the cache to invalidate. All cached return values with any listed tags are invalidated. If no tags are specified, nothing is invalidated.\n * @maxSize 100\n */\n invalidationMethods?: InvalidationMethods[];\n}\n\nexport interface InvalidationMethods\n extends InvalidationMethodsInvalidateByOneOf {\n /**\n * *Required.** Identifier of the caches to invalidate.\n * @maxLength 500\n * @minLength 1\n */\n tag?: string;\n}\n\n/** @oneof */\nexport interface InvalidationMethodsInvalidateByOneOf {\n /**\n * *Required.** Identifier of the caches to invalidate.\n * @maxLength 500\n * @minLength 1\n */\n tag?: string;\n}\n\nexport interface InvalidateCacheResponse {}\n\nexport interface PurgeSiteCacheRequest {}\n\nexport interface PurgeSiteCacheResponse {}\n\n/**\n * <blockquote class=\"important\">\n *\n * __Important:__\n * This API is only supported for developing sites and works only when used together with the Web Methods or Router APIs.\n *\n * </blockquote>\n *\n * Invalidates or clears previously cached return values based on specified tags.\n *\n * The `invalidationMethods` parameter accepts an array of objects, each containing a `tag` field. These tags are defined when caching return values of site [web methods](https://dev.wix.com/docs/sdk/core-modules/web-methods/introduction) and [routers](https://dev.wix.com/docs/velo/events-service-plugins/routers/service-plugins/wix-router/introduction#events-service-plugins_routers_service-plugins_wix-router_router-caching).\n *\n * For example, an array such as `[{ tag: \"contacts\" }, { tag: \"labels\" }]` will clear any cached return values tagged with \"contacts\" or \"labels.\"\n *\n * Any cache containing at least one tag specified in the `invalidationMethods` parameter will be cleared.\n *\n * >**Notes:**\n * >- If you don't specify any tags in the `invalidationMethods` parameter, no caches are invalidated.\n * >- If you don't call Invalidate Cache, caches are only invalidated when the Time to Live (TTL) expires or when the site is republished with a code change.\n * >- This method does not invalidate the Server Side Rendering (SSR) cache for your site. To invalidate that cache, use the Invalidate Cache method from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.\n * @param invalidationMethods - An array of objects containing a `tag` field used to identify the cache to invalidate. All cached return values with any listed tags are invalidated. If no tags are specified, nothing is invalidated.\n * @public\n * @documentationMaturity preview\n * @requiredField invalidationMethods\n * @permissionId SSR.INVALIDATE_CACHE\n * @fqn com.wixpress.html.cache.invalidate.InvalidateCacheService.invalidateCache\n */\nexport async function invalidateCache(\n invalidationMethods: InvalidationMethods[]\n): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[1] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({\n invalidationMethods: invalidationMethods,\n });\n\n const reqOpts =\n ambassadorWixSsrV1InvalidateCacheRequest.invalidateCache(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: { invalidationMethods: '$[0]' },\n singleArgumentUnchanged: false,\n },\n ['invalidationMethods']\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n\n/**\n * Invalidates or clears previously cached return values based on metaSiteID.\n * Takes the metaSiteID from the context and performs a hard purge.\n * @public\n * @documentationMaturity preview\n * @permissionId SSR.PURGE_SITE_CACHE\n * @fqn com.wixpress.html.cache.invalidate.InvalidateCacheService.PurgeSiteCache\n */\nexport async function purgeSiteCache(): Promise<void> {\n // @ts-ignore\n const { httpClient, sideEffects } = arguments[0] as {\n httpClient: HttpClient;\n sideEffects?: any;\n };\n\n const payload = renameKeysFromSDKRequestToRESTRequest({});\n\n const reqOpts =\n ambassadorWixSsrV1InvalidateCacheRequest.purgeSiteCache(payload);\n\n sideEffects?.onSiteCall?.();\n try {\n const result = await httpClient.request(reqOpts);\n sideEffects?.onSuccess?.(result);\n } catch (err: any) {\n const transformedError = sdkTransformError(\n err,\n {\n spreadPathsToArguments: {},\n explicitPathsToArguments: {},\n singleArgumentUnchanged: false,\n },\n []\n );\n sideEffects?.onError?.(err);\n\n throw transformedError;\n }\n}\n","import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-public-html-cache-invalidate-webapp',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath:\n '/_api/wix-public-html-cache-invalidate-webapp/v1/purge-site-cache',\n destPath: '/v1/purge-site-cache',\n },\n {\n srcPath:\n '/_api/wix-public-html-cache-invalidate-webapp/invalidate-cache',\n destPath: '/v1/invalidate-cache',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/ssr/v1/invalidate-cache',\n destPath: '/v1/invalidate-cache',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_cache_cache';\n\n/**\n * <blockquote class=\"important\">\n *\n * __Important:__\n * This API is only supported for developing sites and works only when used together with the Web Methods or Router APIs.\n *\n * </blockquote>\n *\n * Invalidates or clears previously cached return values based on specified tags.\n *\n * The `invalidationMethods` parameter accepts an array of objects, each containing a `tag` field. These tags are defined when caching return values of site [web methods](https://dev.wix.com/docs/sdk/core-modules/web-methods/introduction) and [routers](https://dev.wix.com/docs/velo/events-service-plugins/routers/service-plugins/wix-router/introduction#events-service-plugins_routers_service-plugins_wix-router_router-caching).\n *\n * For example, an array such as `[{ tag: \"contacts\" }, { tag: \"labels\" }]` will clear any cached return values tagged with \"contacts\" or \"labels.\"\n *\n * Any cache containing at least one tag specified in the `invalidationMethods` parameter will be cleared.\n *\n * >**Notes:**\n * >- If you don't specify any tags in the `invalidationMethods` parameter, no caches are invalidated.\n * >- If you don't call Invalidate Cache, caches are only invalidated when the Time to Live (TTL) expires or when the site is republished with a code change.\n * >- This method does not invalidate the Server Side Rendering (SSR) cache for your site. To invalidate that cache, use the Invalidate Cache method from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.\n */\nexport function invalidateCache(payload: object): RequestOptionsFactory<any> {\n function __invalidateCache({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ssr.v1.invalidate_cache_request',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.html.cache.invalidate.InvalidateCacheService.invalidateCache',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl({\n protoPath: '/v1/invalidate-cache',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __invalidateCache;\n}\n\n/**\n * Invalidates or clears previously cached return values based on metaSiteID.\n * Takes the metaSiteID from the context and performs a hard purge.\n */\nexport function purgeSiteCache(payload: object): RequestOptionsFactory<any> {\n function __purgeSiteCache({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ssr.v1.invalidate_cache_request',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.html.cache.invalidate.InvalidateCacheService.PurgeSiteCache',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl({\n protoPath: '/v1/purge-site-cache',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __purgeSiteCache;\n}\n"],"mappings":";AAAA,SAAS,kBAAkB,yBAAyB;AACpD,SAAS,6CAA6C;;;ACDtD,SAAS,kBAAkB;AAI3B,SAAS,+DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE,SACE;AAAA,QACF,UAAU;AAAA,MACZ;AAAA,MACA;AAAA,QACE,SACE;AAAA,QACF,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,mBAAmB;AAAA,MACjB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF;AAEA,SAAO,WAAW,OAAO,OAAO,MAAM,EAAE,iBAAiB,CAAC,CAAC;AAC7D;AAEA,IAAM,eAAe;AAuBd,SAAS,gBAAgB,SAA6C;AAC3E,WAAS,kBAAkB,EAAE,KAAK,GAAQ;AACxC,UAAM,WAAW;AAAA,MACf,YAAY;AAAA,MACZ,QAAQ;AAAA,MACR,WACE;AAAA,MACF,aAAa;AAAA,MACb,KAAK,+DAA+D;AAAA,QAClE,WAAW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;AAAA,MACvB;AAAA,MACA;AAAA,QACE,wBAAwB,CAAC;AAAA,QACzB,0BAA0B,CAAC;AAAA,QAC3B,yBAAyB;AAAA,MAC3B;AAAA,MACA,CAAC;AAAA,IACH;AACA,iBAAa,UAAU,GAAG;AAE1B,UAAM;AAAA,EACR;AACF;","names":["invalidateCache","purgeSiteCache"]}
@@ -0,0 +1,47 @@
1
+ import { InvalidateCacheRequest as InvalidateCacheRequest$1, InvalidateCacheResponse as InvalidateCacheResponse$1, PurgeSiteCacheRequest as PurgeSiteCacheRequest$1, PurgeSiteCacheResponse as PurgeSiteCacheResponse$1 } from './index.typings.mjs';
2
+
3
+ interface InvalidateCacheRequest {
4
+ /**
5
+ * An array of objects containing a `tag` field used to identify the cache to invalidate. All cached return values with any listed tags are invalidated. If no tags are specified, nothing is invalidated.
6
+ * @maxSize 100
7
+ */
8
+ invalidationMethods?: InvalidationMethods[];
9
+ }
10
+ interface InvalidationMethods extends InvalidationMethodsInvalidateByOneOf {
11
+ /**
12
+ * *Required.** Identifier of the caches to invalidate.
13
+ * @maxLength 500
14
+ * @minLength 1
15
+ */
16
+ tag?: string;
17
+ }
18
+ /** @oneof */
19
+ interface InvalidationMethodsInvalidateByOneOf {
20
+ /**
21
+ * *Required.** Identifier of the caches to invalidate.
22
+ * @maxLength 500
23
+ * @minLength 1
24
+ */
25
+ tag?: string;
26
+ }
27
+ interface InvalidateCacheResponse {
28
+ }
29
+ interface PurgeSiteCacheRequest {
30
+ }
31
+ interface PurgeSiteCacheResponse {
32
+ }
33
+
34
+ type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
35
+ getUrl: (context: any) => string;
36
+ httpMethod: K;
37
+ path: string;
38
+ pathParams: M;
39
+ __requestType: T;
40
+ __originalRequestType: S;
41
+ __responseType: Q;
42
+ __originalResponseType: R;
43
+ };
44
+ declare function invalidateCache(): __PublicMethodMetaInfo<'POST', {}, InvalidateCacheRequest$1, InvalidateCacheRequest, InvalidateCacheResponse$1, InvalidateCacheResponse>;
45
+ declare function purgeSiteCache(): __PublicMethodMetaInfo<'POST', {}, PurgeSiteCacheRequest$1, PurgeSiteCacheRequest, PurgeSiteCacheResponse$1, PurgeSiteCacheResponse>;
46
+
47
+ export { type __PublicMethodMetaInfo, invalidateCache, purgeSiteCache };
@@ -0,0 +1,109 @@
1
+ // src/ssr-v1-invalidate-cache-request-cache.http.ts
2
+ import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
3
+ function resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl(opts) {
4
+ const domainToMappings = {
5
+ "api._api_base_domain_": [
6
+ {
7
+ srcPath: "/wix-public-html-cache-invalidate-webapp",
8
+ destPath: ""
9
+ }
10
+ ],
11
+ "manage._base_domain_": [
12
+ {
13
+ srcPath: "/_api/wix-public-html-cache-invalidate-webapp/v1/purge-site-cache",
14
+ destPath: "/v1/purge-site-cache"
15
+ },
16
+ {
17
+ srcPath: "/_api/wix-public-html-cache-invalidate-webapp/invalidate-cache",
18
+ destPath: "/v1/invalidate-cache"
19
+ }
20
+ ],
21
+ "www.wixapis.com": [
22
+ {
23
+ srcPath: "/ssr/v1/invalidate-cache",
24
+ destPath: "/v1/invalidate-cache"
25
+ }
26
+ ]
27
+ };
28
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
29
+ }
30
+ var PACKAGE_NAME = "@wix/auto_sdk_cache_cache";
31
+ function invalidateCache(payload) {
32
+ function __invalidateCache({ host }) {
33
+ const metadata = {
34
+ entityFqdn: "wix.ssr.v1.invalidate_cache_request",
35
+ method: "POST",
36
+ methodFqn: "com.wixpress.html.cache.invalidate.InvalidateCacheService.invalidateCache",
37
+ packageName: PACKAGE_NAME,
38
+ url: resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl({
39
+ protoPath: "/v1/invalidate-cache",
40
+ data: payload,
41
+ host
42
+ }),
43
+ data: payload
44
+ };
45
+ return metadata;
46
+ }
47
+ return __invalidateCache;
48
+ }
49
+ function purgeSiteCache(payload) {
50
+ function __purgeSiteCache({ host }) {
51
+ const metadata = {
52
+ entityFqdn: "wix.ssr.v1.invalidate_cache_request",
53
+ method: "POST",
54
+ methodFqn: "com.wixpress.html.cache.invalidate.InvalidateCacheService.PurgeSiteCache",
55
+ packageName: PACKAGE_NAME,
56
+ url: resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl({
57
+ protoPath: "/v1/purge-site-cache",
58
+ data: payload,
59
+ host
60
+ }),
61
+ data: payload
62
+ };
63
+ return metadata;
64
+ }
65
+ return __purgeSiteCache;
66
+ }
67
+
68
+ // src/ssr-v1-invalidate-cache-request-cache.meta.ts
69
+ function invalidateCache2() {
70
+ const payload = {};
71
+ const getRequestOptions = invalidateCache(payload);
72
+ const getUrl = (context) => {
73
+ const { url } = getRequestOptions(context);
74
+ return url;
75
+ };
76
+ return {
77
+ getUrl,
78
+ httpMethod: "POST",
79
+ path: "/v1/invalidate-cache",
80
+ pathParams: {},
81
+ __requestType: null,
82
+ __originalRequestType: null,
83
+ __responseType: null,
84
+ __originalResponseType: null
85
+ };
86
+ }
87
+ function purgeSiteCache2() {
88
+ const payload = {};
89
+ const getRequestOptions = purgeSiteCache(payload);
90
+ const getUrl = (context) => {
91
+ const { url } = getRequestOptions(context);
92
+ return url;
93
+ };
94
+ return {
95
+ getUrl,
96
+ httpMethod: "POST",
97
+ path: "/v1/purge-site-cache",
98
+ pathParams: {},
99
+ __requestType: null,
100
+ __originalRequestType: null,
101
+ __responseType: null,
102
+ __originalResponseType: null
103
+ };
104
+ }
105
+ export {
106
+ invalidateCache2 as invalidateCache,
107
+ purgeSiteCache2 as purgeSiteCache
108
+ };
109
+ //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/ssr-v1-invalidate-cache-request-cache.http.ts","../../../src/ssr-v1-invalidate-cache-request-cache.meta.ts"],"sourcesContent":["import { resolveUrl } from '@wix/sdk-runtime/rest-modules';\nimport { ResolveUrlOpts } from '@wix/sdk-runtime/rest-modules';\nimport { RequestOptionsFactory } from '@wix/sdk-types';\n\nfunction resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl(\n opts: Omit<ResolveUrlOpts, 'domainToMappings'>\n) {\n const domainToMappings = {\n 'api._api_base_domain_': [\n {\n srcPath: '/wix-public-html-cache-invalidate-webapp',\n destPath: '',\n },\n ],\n 'manage._base_domain_': [\n {\n srcPath:\n '/_api/wix-public-html-cache-invalidate-webapp/v1/purge-site-cache',\n destPath: '/v1/purge-site-cache',\n },\n {\n srcPath:\n '/_api/wix-public-html-cache-invalidate-webapp/invalidate-cache',\n destPath: '/v1/invalidate-cache',\n },\n ],\n 'www.wixapis.com': [\n {\n srcPath: '/ssr/v1/invalidate-cache',\n destPath: '/v1/invalidate-cache',\n },\n ],\n };\n\n return resolveUrl(Object.assign(opts, { domainToMappings }));\n}\n\nconst PACKAGE_NAME = '@wix/auto_sdk_cache_cache';\n\n/**\n * <blockquote class=\"important\">\n *\n * __Important:__\n * This API is only supported for developing sites and works only when used together with the Web Methods or Router APIs.\n *\n * </blockquote>\n *\n * Invalidates or clears previously cached return values based on specified tags.\n *\n * The `invalidationMethods` parameter accepts an array of objects, each containing a `tag` field. These tags are defined when caching return values of site [web methods](https://dev.wix.com/docs/sdk/core-modules/web-methods/introduction) and [routers](https://dev.wix.com/docs/velo/events-service-plugins/routers/service-plugins/wix-router/introduction#events-service-plugins_routers_service-plugins_wix-router_router-caching).\n *\n * For example, an array such as `[{ tag: \"contacts\" }, { tag: \"labels\" }]` will clear any cached return values tagged with \"contacts\" or \"labels.\"\n *\n * Any cache containing at least one tag specified in the `invalidationMethods` parameter will be cleared.\n *\n * >**Notes:**\n * >- If you don't specify any tags in the `invalidationMethods` parameter, no caches are invalidated.\n * >- If you don't call Invalidate Cache, caches are only invalidated when the Time to Live (TTL) expires or when the site is republished with a code change.\n * >- This method does not invalidate the Server Side Rendering (SSR) cache for your site. To invalidate that cache, use the Invalidate Cache method from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.\n */\nexport function invalidateCache(payload: object): RequestOptionsFactory<any> {\n function __invalidateCache({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ssr.v1.invalidate_cache_request',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.html.cache.invalidate.InvalidateCacheService.invalidateCache',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl({\n protoPath: '/v1/invalidate-cache',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __invalidateCache;\n}\n\n/**\n * Invalidates or clears previously cached return values based on metaSiteID.\n * Takes the metaSiteID from the context and performs a hard purge.\n */\nexport function purgeSiteCache(payload: object): RequestOptionsFactory<any> {\n function __purgeSiteCache({ host }: any) {\n const metadata = {\n entityFqdn: 'wix.ssr.v1.invalidate_cache_request',\n method: 'POST' as any,\n methodFqn:\n 'com.wixpress.html.cache.invalidate.InvalidateCacheService.PurgeSiteCache',\n packageName: PACKAGE_NAME,\n url: resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl({\n protoPath: '/v1/purge-site-cache',\n data: payload,\n host,\n }),\n data: payload,\n };\n\n return metadata;\n }\n\n return __purgeSiteCache;\n}\n","import * as ambassadorWixSsrV1InvalidateCacheRequest from './ssr-v1-invalidate-cache-request-cache.http.js';\nimport * as ambassadorWixSsrV1InvalidateCacheRequestTypes from './ssr-v1-invalidate-cache-request-cache.types.js';\nimport * as ambassadorWixSsrV1InvalidateCacheRequestUniversalTypes from './ssr-v1-invalidate-cache-request-cache.universal.js';\n\nexport type __PublicMethodMetaInfo<\n K = string,\n M = unknown,\n T = unknown,\n S = unknown,\n Q = unknown,\n R = unknown\n> = {\n getUrl: (context: any) => string;\n httpMethod: K;\n path: string;\n pathParams: M;\n __requestType: T;\n __originalRequestType: S;\n __responseType: Q;\n __originalResponseType: R;\n};\n\nexport function invalidateCache(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixSsrV1InvalidateCacheRequestUniversalTypes.InvalidateCacheRequest,\n ambassadorWixSsrV1InvalidateCacheRequestTypes.InvalidateCacheRequest,\n ambassadorWixSsrV1InvalidateCacheRequestUniversalTypes.InvalidateCacheResponse,\n ambassadorWixSsrV1InvalidateCacheRequestTypes.InvalidateCacheResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixSsrV1InvalidateCacheRequest.invalidateCache(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/invalidate-cache',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n\nexport function purgeSiteCache(): __PublicMethodMetaInfo<\n 'POST',\n {},\n ambassadorWixSsrV1InvalidateCacheRequestUniversalTypes.PurgeSiteCacheRequest,\n ambassadorWixSsrV1InvalidateCacheRequestTypes.PurgeSiteCacheRequest,\n ambassadorWixSsrV1InvalidateCacheRequestUniversalTypes.PurgeSiteCacheResponse,\n ambassadorWixSsrV1InvalidateCacheRequestTypes.PurgeSiteCacheResponse\n> {\n const payload = {} as any;\n\n const getRequestOptions =\n ambassadorWixSsrV1InvalidateCacheRequest.purgeSiteCache(payload);\n\n const getUrl = (context: any): string => {\n const { url } = getRequestOptions(context);\n return url!;\n };\n\n return {\n getUrl,\n httpMethod: 'POST',\n path: '/v1/purge-site-cache',\n pathParams: {},\n __requestType: null as any,\n __originalRequestType: null as any,\n __responseType: null as any,\n __originalResponseType: null as any,\n };\n}\n"],"mappings":";AAAA,SAAS,kBAAkB;AAI3B,SAAS,+DACP,MACA;AACA,QAAM,mBAAmB;AAAA,IACvB,yBAAyB;AAAA,MACvB;AAAA,QACE,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,IACA,wBAAwB;AAAA,MACtB;AAAA,QACE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ChB,wBAAwB;AAAA,EAC1B;AACF;AAEO,SAASC,kBAOd;AACA,QAAM,UAAU,CAAC;AAEjB,QAAM,oBACqC,eAAe,OAAO;AAEjE,QAAM,SAAS,CAAC,YAAyB;AACvC,UAAM,EAAE,IAAI,IAAI,kBAAkB,OAAO;AACzC,WAAO;AAAA,EACT;AAEA,SAAO;AAAA,IACL;AAAA,IACA,YAAY;AAAA,IACZ,MAAM;AAAA,IACN,YAAY,CAAC;AAAA,IACb,eAAe;AAAA,IACf,uBAAuB;AAAA,IACvB,gBAAgB;AAAA,IAChB,wBAAwB;AAAA,EAC1B;AACF;","names":["invalidateCache","purgeSiteCache"]}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@wix/auto_sdk_cache_cache",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
+ "license": "MIT",
4
5
  "publishConfig": {
5
6
  "registry": "https://registry.npmjs.org/",
6
7
  "access": "public"
@@ -8,18 +9,18 @@
8
9
  "keywords": [],
9
10
  "sideEffects": false,
10
11
  "main": "./build/cjs/index.js",
11
- "types": "./build/es/index.d.ts",
12
+ "types": "./build/cjs/index.d.ts",
12
13
  "exports": {
13
14
  ".": {
14
- "import": "./build/es/index.js",
15
+ "import": "./build/es/index.mjs",
15
16
  "require": "./build/cjs/index.js",
16
- "types": "./build/es/index.d.ts"
17
+ "types": "./build/es/index.d.mts"
17
18
  },
18
19
  "./package.json": "./package.json",
19
20
  "./meta": {
20
- "import": "./build/es/meta.js",
21
+ "import": "./build/es/meta.mjs",
21
22
  "require": "./build/cjs/meta.js",
22
- "types": "./build/es/meta.d.ts"
23
+ "types": "./build/es/meta.d.mts"
23
24
  }
24
25
  },
25
26
  "files": [
@@ -28,14 +29,15 @@
28
29
  "service-plugins"
29
30
  ],
30
31
  "dependencies": {
31
- "@wix/sdk-runtime": "^0.3.49",
32
- "@wix/sdk-types": "^1.13.23"
32
+ "@wix/sdk-runtime": "^0.3.55",
33
+ "@wix/sdk-types": "^1.13.35"
33
34
  },
34
35
  "devDependencies": {
36
+ "tsup": "^8.4.0",
35
37
  "typescript": "^5.3.2"
36
38
  },
37
39
  "scripts": {
38
- "build": "tsc -b tsconfig.json tsconfig.esm.json tsconfig.internal.json tsconfig.internal.esm.json",
40
+ "build": "tsup",
39
41
  "test": ":"
40
42
  },
41
43
  "wix": {
@@ -48,5 +50,5 @@
48
50
  "fqdn": "wix.ssr.v1.invalidate_cache_request"
49
51
  }
50
52
  },
51
- "falconPackageHash": "735d8832dd0d0a995d62317e93ab2c7741c292b51bdc0bb3311d5c87"
53
+ "falconPackageHash": "81dac15277f60f48809aacceef4dedad13e5a39f81178bf2f39b5c8d"
52
54
  }
@@ -1,5 +0,0 @@
1
- import { invalidateCache as publicInvalidateCache, purgeSiteCache as publicPurgeSiteCache } from './ssr-v1-invalidate-cache-request-cache.public.js';
2
- import { BuildRESTFunction, MaybeContext } from '@wix/sdk-types';
3
- export declare const invalidateCache: MaybeContext<BuildRESTFunction<typeof publicInvalidateCache> & typeof publicInvalidateCache>;
4
- export declare const purgeSiteCache: MaybeContext<BuildRESTFunction<typeof publicPurgeSiteCache> & typeof publicPurgeSiteCache>;
5
- export { InvalidateCacheRequest, InvalidationMethods, InvalidationMethodsInvalidateByOneOf, InvalidateCacheResponse, PurgeSiteCacheRequest, PurgeSiteCacheResponse, } from './ssr-v1-invalidate-cache-request-cache.universal.js';
@@ -1,8 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.purgeSiteCache = exports.invalidateCache = void 0;
4
- const ssr_v1_invalidate_cache_request_cache_public_js_1 = require("./ssr-v1-invalidate-cache-request-cache.public.js");
5
- const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
6
- exports.invalidateCache = (0, rest_modules_1.createRESTModule)(ssr_v1_invalidate_cache_request_cache_public_js_1.invalidateCache);
7
- exports.purgeSiteCache = (0, rest_modules_1.createRESTModule)(ssr_v1_invalidate_cache_request_cache_public_js_1.purgeSiteCache);
8
- //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssr-v1-invalidate-cache-request-cache.context.js","sourceRoot":"","sources":["../../../src/ssr-v1-invalidate-cache-request-cache.context.ts"],"names":[],"mappings":";;;AAAA,uHAG2D;AAC3D,gEAAiE;AAGpD,QAAA,eAAe,GAEV,IAAA,+BAAgB,EAAC,iEAAqB,CAAC,CAAC;AAC7C,QAAA,cAAc,GAET,IAAA,+BAAgB,EAAC,gEAAoB,CAAC,CAAC"}
@@ -1,28 +0,0 @@
1
- import { RequestOptionsFactory } from '@wix/sdk-types';
2
- /**
3
- * <blockquote class="important">
4
- *
5
- * __Important:__
6
- * This API is only supported for developing sites and works only when used together with the Web Methods or Router APIs.
7
- *
8
- * </blockquote>
9
- *
10
- * Invalidates or clears previously cached return values based on specified tags.
11
- *
12
- * The `invalidationMethods` parameter accepts an array of objects, each containing a `tag` field. These tags are defined when caching return values of site [web methods](https://dev.wix.com/docs/sdk/core-modules/web-methods/introduction) and [routers](https://dev.wix.com/docs/velo/events-service-plugins/routers/service-plugins/wix-router/introduction#events-service-plugins_routers_service-plugins_wix-router_router-caching).
13
- *
14
- * For example, an array such as `[{ tag: "contacts" }, { tag: "labels" }]` will clear any cached return values tagged with "contacts" or "labels."
15
- *
16
- * Any cache containing at least one tag specified in the `invalidationMethods` parameter will be cleared.
17
- *
18
- * >**Notes:**
19
- * >- If you don't specify any tags in the `invalidationMethods` parameter, no caches are invalidated.
20
- * >- If you don't call Invalidate Cache, caches are only invalidated when the Time to Live (TTL) expires or when the site is republished with a code change.
21
- * >- This method does not invalidate the Server Side Rendering (SSR) cache for your site. To invalidate that cache, use the Invalidate Cache method from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.
22
- */
23
- export declare function invalidateCache(payload: object): RequestOptionsFactory<any>;
24
- /**
25
- * Invalidates or clears previously cached return values based on metaSiteID.
26
- * Takes the metaSiteID from the context and performs a hard purge.
27
- */
28
- export declare function purgeSiteCache(payload: object): RequestOptionsFactory<any>;
@@ -1,86 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.purgeSiteCache = exports.invalidateCache = void 0;
4
- const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
5
- function resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl(opts) {
6
- const domainToMappings = {
7
- 'api._api_base_domain_': [
8
- {
9
- srcPath: '/wix-public-html-cache-invalidate-webapp',
10
- destPath: '',
11
- },
12
- ],
13
- 'manage._base_domain_': [
14
- {
15
- srcPath: '/_api/wix-public-html-cache-invalidate-webapp/v1/purge-site-cache',
16
- destPath: '/v1/purge-site-cache',
17
- },
18
- ],
19
- };
20
- return (0, rest_modules_1.resolveUrl)(Object.assign(opts, { domainToMappings }));
21
- }
22
- const PACKAGE_NAME = '@wix/auto_sdk_cache_cache';
23
- /**
24
- * <blockquote class="important">
25
- *
26
- * __Important:__
27
- * This API is only supported for developing sites and works only when used together with the Web Methods or Router APIs.
28
- *
29
- * </blockquote>
30
- *
31
- * Invalidates or clears previously cached return values based on specified tags.
32
- *
33
- * The `invalidationMethods` parameter accepts an array of objects, each containing a `tag` field. These tags are defined when caching return values of site [web methods](https://dev.wix.com/docs/sdk/core-modules/web-methods/introduction) and [routers](https://dev.wix.com/docs/velo/events-service-plugins/routers/service-plugins/wix-router/introduction#events-service-plugins_routers_service-plugins_wix-router_router-caching).
34
- *
35
- * For example, an array such as `[{ tag: "contacts" }, { tag: "labels" }]` will clear any cached return values tagged with "contacts" or "labels."
36
- *
37
- * Any cache containing at least one tag specified in the `invalidationMethods` parameter will be cleared.
38
- *
39
- * >**Notes:**
40
- * >- If you don't specify any tags in the `invalidationMethods` parameter, no caches are invalidated.
41
- * >- If you don't call Invalidate Cache, caches are only invalidated when the Time to Live (TTL) expires or when the site is republished with a code change.
42
- * >- This method does not invalidate the Server Side Rendering (SSR) cache for your site. To invalidate that cache, use the Invalidate Cache method from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.
43
- */
44
- function invalidateCache(payload) {
45
- function __invalidateCache({ host }) {
46
- const metadata = {
47
- entityFqdn: 'wix.ssr.v1.invalidate_cache_request',
48
- method: 'POST',
49
- methodFqn: 'com.wixpress.html.cache.invalidate.InvalidateCacheService.invalidateCache',
50
- packageName: PACKAGE_NAME,
51
- url: resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl({
52
- protoPath: '/v1/invalidate-cache',
53
- data: payload,
54
- host,
55
- }),
56
- data: payload,
57
- };
58
- return metadata;
59
- }
60
- return __invalidateCache;
61
- }
62
- exports.invalidateCache = invalidateCache;
63
- /**
64
- * Invalidates or clears previously cached return values based on metaSiteID.
65
- * Takes the metaSiteID from the context and performs a hard purge.
66
- */
67
- function purgeSiteCache(payload) {
68
- function __purgeSiteCache({ host }) {
69
- const metadata = {
70
- entityFqdn: 'wix.ssr.v1.invalidate_cache_request',
71
- method: 'POST',
72
- methodFqn: 'com.wixpress.html.cache.invalidate.InvalidateCacheService.PurgeSiteCache',
73
- packageName: PACKAGE_NAME,
74
- url: resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl({
75
- protoPath: '/v1/purge-site-cache',
76
- data: payload,
77
- host,
78
- }),
79
- data: payload,
80
- };
81
- return metadata;
82
- }
83
- return __purgeSiteCache;
84
- }
85
- exports.purgeSiteCache = purgeSiteCache;
86
- //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssr-v1-invalidate-cache-request-cache.http.js","sourceRoot":"","sources":["../../../src/ssr-v1-invalidate-cache-request-cache.http.ts"],"names":[],"mappings":";;;AAAA,gEAA2D;AAI3D,SAAS,8DAA8D,CACrE,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,uBAAuB,EAAE;YACvB;gBACE,OAAO,EAAE,0CAA0C;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1
- import * as ambassadorWixSsrV1InvalidateCacheRequestTypes from './ssr-v1-invalidate-cache-request-cache.types.js';
2
- import * as ambassadorWixSsrV1InvalidateCacheRequestUniversalTypes from './ssr-v1-invalidate-cache-request-cache.universal.js';
3
- export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
- getUrl: (context: any) => string;
5
- httpMethod: K;
6
- path: string;
7
- pathParams: M;
8
- __requestType: T;
9
- __originalRequestType: S;
10
- __responseType: Q;
11
- __originalResponseType: R;
12
- };
13
- export declare function invalidateCache(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixSsrV1InvalidateCacheRequestUniversalTypes.InvalidateCacheRequest, ambassadorWixSsrV1InvalidateCacheRequestTypes.InvalidateCacheRequest, ambassadorWixSsrV1InvalidateCacheRequestUniversalTypes.InvalidateCacheResponse, ambassadorWixSsrV1InvalidateCacheRequestTypes.InvalidateCacheResponse>;
14
- export declare function purgeSiteCache(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixSsrV1InvalidateCacheRequestUniversalTypes.PurgeSiteCacheRequest, ambassadorWixSsrV1InvalidateCacheRequestTypes.PurgeSiteCacheRequest, ambassadorWixSsrV1InvalidateCacheRequestUniversalTypes.PurgeSiteCacheResponse, ambassadorWixSsrV1InvalidateCacheRequestTypes.PurgeSiteCacheResponse>;
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.purgeSiteCache = exports.invalidateCache = void 0;
27
- const ambassadorWixSsrV1InvalidateCacheRequest = __importStar(require("./ssr-v1-invalidate-cache-request-cache.http.js"));
28
- function invalidateCache() {
29
- const payload = {};
30
- const getRequestOptions = ambassadorWixSsrV1InvalidateCacheRequest.invalidateCache(payload);
31
- const getUrl = (context) => {
32
- const { url } = getRequestOptions(context);
33
- return url;
34
- };
35
- return {
36
- getUrl,
37
- httpMethod: 'POST',
38
- path: '/v1/invalidate-cache',
39
- pathParams: {},
40
- __requestType: null,
41
- __originalRequestType: null,
42
- __responseType: null,
43
- __originalResponseType: null,
44
- };
45
- }
46
- exports.invalidateCache = invalidateCache;
47
- function purgeSiteCache() {
48
- const payload = {};
49
- const getRequestOptions = ambassadorWixSsrV1InvalidateCacheRequest.purgeSiteCache(payload);
50
- const getUrl = (context) => {
51
- const { url } = getRequestOptions(context);
52
- return url;
53
- };
54
- return {
55
- getUrl,
56
- httpMethod: 'POST',
57
- path: '/v1/purge-site-cache',
58
- pathParams: {},
59
- __requestType: null,
60
- __originalRequestType: null,
61
- __responseType: null,
62
- __originalResponseType: null,
63
- };
64
- }
65
- exports.purgeSiteCache = purgeSiteCache;
66
- //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.meta.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssr-v1-invalidate-cache-request-cache.meta.js","sourceRoot":"","sources":["../../../src/ssr-v1-invalidate-cache-request-cache.meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0HAA4G;AAsB5G,SAAgB,eAAe;IAQ7B,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,wCAAwC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAEpE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,sBAAsB;QAC5B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA5BD,0CA4BC;AAED,SAAgB,cAAc;IAQ5B,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,wCAAwC,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAEnE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,sBAAsB;QAC5B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA5BD,wCA4BC"}
@@ -1,40 +0,0 @@
1
- import { HttpClient } from '@wix/sdk-types';
2
- import { InvalidationMethods } from './ssr-v1-invalidate-cache-request-cache.universal.js';
3
- export declare const __metadata: {
4
- PACKAGE_NAME: string;
5
- };
6
- export declare function invalidateCache(httpClient: HttpClient): InvalidateCacheSignature;
7
- interface InvalidateCacheSignature {
8
- /**
9
- * <blockquote class="important">
10
- *
11
- * __Important:__
12
- * This API is only supported for developing sites and works only when used together with the Web Methods or Router APIs.
13
- *
14
- * </blockquote>
15
- *
16
- * Invalidates or clears previously cached return values based on specified tags.
17
- *
18
- * The `invalidationMethods` parameter accepts an array of objects, each containing a `tag` field. These tags are defined when caching return values of site [web methods](https://dev.wix.com/docs/sdk/core-modules/web-methods/introduction) and [routers](https://dev.wix.com/docs/velo/events-service-plugins/routers/service-plugins/wix-router/introduction#events-service-plugins_routers_service-plugins_wix-router_router-caching).
19
- *
20
- * For example, an array such as `[{ tag: "contacts" }, { tag: "labels" }]` will clear any cached return values tagged with "contacts" or "labels."
21
- *
22
- * Any cache containing at least one tag specified in the `invalidationMethods` parameter will be cleared.
23
- *
24
- * >**Notes:**
25
- * >- If you don't specify any tags in the `invalidationMethods` parameter, no caches are invalidated.
26
- * >- If you don't call Invalidate Cache, caches are only invalidated when the Time to Live (TTL) expires or when the site is republished with a code change.
27
- * >- This method does not invalidate the Server Side Rendering (SSR) cache for your site. To invalidate that cache, use the Invalidate Cache method from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.
28
- * @param - An array of objects containing a `tag` field used to identify the cache to invalidate. All cached return values with any listed tags are invalidated. If no tags are specified, nothing is invalidated.
29
- */
30
- (invalidationMethods: InvalidationMethods[]): Promise<void>;
31
- }
32
- export declare function purgeSiteCache(httpClient: HttpClient): PurgeSiteCacheSignature;
33
- interface PurgeSiteCacheSignature {
34
- /**
35
- * Invalidates or clears previously cached return values based on metaSiteID.
36
- * Takes the metaSiteID from the context and performs a hard purge.
37
- */
38
- (): Promise<void>;
39
- }
40
- export { InvalidateCacheRequest, InvalidateCacheResponse, InvalidationMethods, InvalidationMethodsInvalidateByOneOf, PurgeSiteCacheRequest, PurgeSiteCacheResponse, } from './ssr-v1-invalidate-cache-request-cache.universal.js';
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.purgeSiteCache = exports.invalidateCache = exports.__metadata = void 0;
4
- const ssr_v1_invalidate_cache_request_cache_universal_js_1 = require("./ssr-v1-invalidate-cache-request-cache.universal.js");
5
- exports.__metadata = { PACKAGE_NAME: '@wix/cache' };
6
- function invalidateCache(httpClient) {
7
- return (invalidationMethods) => (0, ssr_v1_invalidate_cache_request_cache_universal_js_1.invalidateCache)(invalidationMethods,
8
- // @ts-ignore
9
- { httpClient });
10
- }
11
- exports.invalidateCache = invalidateCache;
12
- function purgeSiteCache(httpClient) {
13
- return () => (0, ssr_v1_invalidate_cache_request_cache_universal_js_1.purgeSiteCache)(
14
- // @ts-ignore
15
- { httpClient });
16
- }
17
- exports.purgeSiteCache = purgeSiteCache;
18
- //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.public.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssr-v1-invalidate-cache-request-cache.public.js","sourceRoot":"","sources":["../../../src/ssr-v1-invalidate-cache-request-cache.public.ts"],"names":[],"mappings":";;;AACA,6HAI8D;AAEjD,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,CAAC;AAEzD,SAAgB,eAAe,CAC7B,UAAsB;IAEtB,OAAO,CAAC,mBAA0C,EAAE,EAAE,CACpD,IAAA,oEAAwB,EACtB,mBAAmB;IACnB,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AATD,0CASC;AA4BD,SAAgB,cAAc,CAC5B,UAAsB;IAEtB,OAAO,GAAG,EAAE,CACV,IAAA,mEAAuB;IACrB,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,wCAQC"}
@@ -1,30 +0,0 @@
1
- export interface InvalidateCacheRequest {
2
- /**
3
- * An array of objects containing a `tag` field used to identify the cache to invalidate. All cached return values with any listed tags are invalidated. If no tags are specified, nothing is invalidated.
4
- * @maxSize 100
5
- */
6
- invalidationMethods?: InvalidationMethods[];
7
- }
8
- export interface InvalidationMethods extends InvalidationMethodsInvalidateByOneOf {
9
- /**
10
- * *Required.** Identifier of the caches to invalidate.
11
- * @maxLength 500
12
- * @minLength 1
13
- */
14
- tag?: string;
15
- }
16
- /** @oneof */
17
- export interface InvalidationMethodsInvalidateByOneOf {
18
- /**
19
- * *Required.** Identifier of the caches to invalidate.
20
- * @maxLength 500
21
- * @minLength 1
22
- */
23
- tag?: string;
24
- }
25
- export interface InvalidateCacheResponse {
26
- }
27
- export interface PurgeSiteCacheRequest {
28
- }
29
- export interface PurgeSiteCacheResponse {
30
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ssr-v1-invalidate-cache-request-cache.types.js","sourceRoot":"","sources":["../../../src/ssr-v1-invalidate-cache-request-cache.types.ts"],"names":[],"mappings":""}