@wix/auto_sdk_cache_cache 1.0.0

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 (111) hide show
  1. package/build/cjs/index.d.ts +1 -0
  2. package/build/cjs/index.js +18 -0
  3. package/build/cjs/index.js.map +1 -0
  4. package/build/cjs/index.typings.d.ts +1 -0
  5. package/build/cjs/index.typings.js +18 -0
  6. package/build/cjs/index.typings.js.map +1 -0
  7. package/build/cjs/meta.d.ts +1 -0
  8. package/build/cjs/meta.js +18 -0
  9. package/build/cjs/meta.js.map +1 -0
  10. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.context.d.ts +4 -0
  11. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.context.js +7 -0
  12. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.context.js.map +1 -0
  13. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.http.d.ts +24 -0
  14. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.http.js +58 -0
  15. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.http.js.map +1 -0
  16. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.d.ts +13 -0
  17. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.js +47 -0
  18. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.js.map +1 -0
  19. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.public.d.ts +33 -0
  20. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.public.js +12 -0
  21. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.public.js.map +1 -0
  22. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.types.d.ts +15 -0
  23. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.types.js +3 -0
  24. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.types.js.map +1 -0
  25. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.d.ts +44 -0
  26. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.js +81 -0
  27. package/build/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.js.map +1 -0
  28. package/build/es/index.d.ts +1 -0
  29. package/build/es/index.js +2 -0
  30. package/build/es/index.js.map +1 -0
  31. package/build/es/index.typings.d.ts +1 -0
  32. package/build/es/index.typings.js +2 -0
  33. package/build/es/index.typings.js.map +1 -0
  34. package/build/es/meta.d.ts +1 -0
  35. package/build/es/meta.js +2 -0
  36. package/build/es/meta.js.map +1 -0
  37. package/build/es/package.json +3 -0
  38. package/build/es/src/ssr-v1-invalidate-cache-request-cache.context.d.ts +4 -0
  39. package/build/es/src/ssr-v1-invalidate-cache-request-cache.context.js +4 -0
  40. package/build/es/src/ssr-v1-invalidate-cache-request-cache.context.js.map +1 -0
  41. package/build/es/src/ssr-v1-invalidate-cache-request-cache.http.d.ts +24 -0
  42. package/build/es/src/ssr-v1-invalidate-cache-request-cache.http.js +54 -0
  43. package/build/es/src/ssr-v1-invalidate-cache-request-cache.http.js.map +1 -0
  44. package/build/es/src/ssr-v1-invalidate-cache-request-cache.meta.d.ts +13 -0
  45. package/build/es/src/ssr-v1-invalidate-cache-request-cache.meta.js +20 -0
  46. package/build/es/src/ssr-v1-invalidate-cache-request-cache.meta.js.map +1 -0
  47. package/build/es/src/ssr-v1-invalidate-cache-request-cache.public.d.ts +33 -0
  48. package/build/es/src/ssr-v1-invalidate-cache-request-cache.public.js +8 -0
  49. package/build/es/src/ssr-v1-invalidate-cache-request-cache.public.js.map +1 -0
  50. package/build/es/src/ssr-v1-invalidate-cache-request-cache.types.d.ts +15 -0
  51. package/build/es/src/ssr-v1-invalidate-cache-request-cache.types.js +2 -0
  52. package/build/es/src/ssr-v1-invalidate-cache-request-cache.types.js.map +1 -0
  53. package/build/es/src/ssr-v1-invalidate-cache-request-cache.universal.d.ts +44 -0
  54. package/build/es/src/ssr-v1-invalidate-cache-request-cache.universal.js +54 -0
  55. package/build/es/src/ssr-v1-invalidate-cache-request-cache.universal.js.map +1 -0
  56. package/build/internal/cjs/index.d.ts +1 -0
  57. package/build/internal/cjs/index.js +18 -0
  58. package/build/internal/cjs/index.js.map +1 -0
  59. package/build/internal/cjs/index.typings.d.ts +1 -0
  60. package/build/internal/cjs/index.typings.js +18 -0
  61. package/build/internal/cjs/index.typings.js.map +1 -0
  62. package/build/internal/cjs/meta.d.ts +1 -0
  63. package/build/internal/cjs/meta.js +18 -0
  64. package/build/internal/cjs/meta.js.map +1 -0
  65. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.context.d.ts +4 -0
  66. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.context.js +7 -0
  67. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.context.js.map +1 -0
  68. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.http.d.ts +24 -0
  69. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.http.js +58 -0
  70. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.http.js.map +1 -0
  71. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.d.ts +13 -0
  72. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.js +47 -0
  73. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.meta.js.map +1 -0
  74. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.public.d.ts +33 -0
  75. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.public.js +12 -0
  76. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.public.js.map +1 -0
  77. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.types.d.ts +15 -0
  78. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.types.js +3 -0
  79. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.types.js.map +1 -0
  80. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.d.ts +44 -0
  81. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.js +81 -0
  82. package/build/internal/cjs/src/ssr-v1-invalidate-cache-request-cache.universal.js.map +1 -0
  83. package/build/internal/es/index.d.ts +1 -0
  84. package/build/internal/es/index.js +2 -0
  85. package/build/internal/es/index.js.map +1 -0
  86. package/build/internal/es/index.typings.d.ts +1 -0
  87. package/build/internal/es/index.typings.js +2 -0
  88. package/build/internal/es/index.typings.js.map +1 -0
  89. package/build/internal/es/meta.d.ts +1 -0
  90. package/build/internal/es/meta.js +2 -0
  91. package/build/internal/es/meta.js.map +1 -0
  92. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.context.d.ts +4 -0
  93. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.context.js +4 -0
  94. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.context.js.map +1 -0
  95. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.http.d.ts +24 -0
  96. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.http.js +54 -0
  97. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.http.js.map +1 -0
  98. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.meta.d.ts +13 -0
  99. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.meta.js +20 -0
  100. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.meta.js.map +1 -0
  101. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.public.d.ts +33 -0
  102. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.public.js +8 -0
  103. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.public.js.map +1 -0
  104. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.types.d.ts +15 -0
  105. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.types.js +2 -0
  106. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.types.js.map +1 -0
  107. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.universal.d.ts +44 -0
  108. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.universal.js +54 -0
  109. package/build/internal/es/src/ssr-v1-invalidate-cache-request-cache.universal.js.map +1 -0
  110. package/meta/package.json +3 -0
  111. package/package.json +52 -0
@@ -0,0 +1 @@
1
+ export * from './src/ssr-v1-invalidate-cache-request-cache.context.js';
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/ssr-v1-invalidate-cache-request-cache.context.js"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yFAAuE"}
@@ -0,0 +1 @@
1
+ export * from './src/ssr-v1-invalidate-cache-request-cache.universal.js';
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/ssr-v1-invalidate-cache-request-cache.universal.js"), exports);
18
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2FAAyE"}
@@ -0,0 +1 @@
1
+ export * from './src/ssr-v1-invalidate-cache-request-cache.meta.js';
@@ -0,0 +1,18 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./src/ssr-v1-invalidate-cache-request-cache.meta.js"), exports);
18
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sFAAoE"}
@@ -0,0 +1,4 @@
1
+ import { invalidateCache as publicInvalidateCache } 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 { InvalidateCacheRequest, InvalidationMethods, InvalidationMethodsInvalidateByOneOf, InvalidateCacheResponse, } from './ssr-v1-invalidate-cache-request-cache.universal.js';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ 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
+ //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.context.js.map
@@ -0,0 +1 @@
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,uHAA6G;AAC7G,gEAAiE;AAGpD,QAAA,eAAe,GAEV,IAAA,+BAAgB,EAAC,iEAAqB,CAAC,CAAC"}
@@ -0,0 +1,24 @@
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 web methods ([SDK](https://dev.wix.com/docs/sdk/core-modules/web-methods/web-method) | [Velo](https://dev.wix.com/docs/velo/api-reference/wix-web-module/web-method)) and routers (currently [Velo](https://dev.wix.com/docs/velo/api-reference/wix-router/ok) only).
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
+ *
22
+ * >- (Velo only) Call Invalidate Cache to invalidate your web method and router caches. To invalidate Server Side Rendering (SSR) caches for your site, use the `invalidateCache()` function from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.
23
+ */
24
+ export declare function invalidateCache(payload: object): RequestOptionsFactory<any>;
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ 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
+ };
14
+ return (0, rest_modules_1.resolveUrl)(Object.assign(opts, { domainToMappings }));
15
+ }
16
+ const PACKAGE_NAME = '@wix/auto_sdk_cache_cache';
17
+ /**
18
+ * <blockquote class="important">
19
+ *
20
+ * __Important:__
21
+ * This API is only supported for developing sites and works only when used together with the Web Methods or Router APIs.
22
+ *
23
+ * </blockquote>
24
+ *
25
+ * Invalidates or clears previously cached return values based on specified tags.
26
+ *
27
+ * The `invalidationMethods` parameter accepts an array of objects, each containing a `tag` field. These tags are defined when caching return values of web methods ([SDK](https://dev.wix.com/docs/sdk/core-modules/web-methods/web-method) | [Velo](https://dev.wix.com/docs/velo/api-reference/wix-web-module/web-method)) and routers (currently [Velo](https://dev.wix.com/docs/velo/api-reference/wix-router/ok) only).
28
+ *
29
+ * For example, an array such as `[{ tag: "contacts" }, { tag: "labels" }]` will clear any cached return values tagged with "contacts" or "labels."
30
+ *
31
+ * Any cache containing at least one tag specified in the `invalidationMethods` parameter will be cleared.
32
+ *
33
+ * >**Notes:**
34
+ * >- If you don't specify any tags in the `invalidationMethods` parameter, no caches are invalidated.
35
+ * >- 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.
36
+ *
37
+ * >- (Velo only) Call Invalidate Cache to invalidate your web method and router caches. To invalidate Server Side Rendering (SSR) caches for your site, use the `invalidateCache()` function from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.
38
+ */
39
+ function invalidateCache(payload) {
40
+ function __invalidateCache({ host }) {
41
+ const metadata = {
42
+ entityFqdn: 'wix.ssr.v1.invalidate_cache_request',
43
+ method: 'POST',
44
+ methodFqn: 'com.wixpress.html.cache.invalidate.InvalidateCacheService.invalidateCache',
45
+ packageName: PACKAGE_NAME,
46
+ url: resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl({
47
+ protoPath: '/v1/invalidate-cache',
48
+ data: payload,
49
+ host,
50
+ }),
51
+ data: payload,
52
+ };
53
+ return metadata;
54
+ }
55
+ return __invalidateCache;
56
+ }
57
+ exports.invalidateCache = invalidateCache;
58
+ //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.http.js.map
@@ -0,0 +1 @@
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;gBACnD,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,IAAA,yBAAU,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,YAAY,GAAG,2BAA2B,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,SAAgB,eAAe,CAAC,OAAe;IAC7C,SAAS,iBAAiB,CAAC,EAAE,IAAI,EAAO;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,qCAAqC;YACjD,MAAM,EAAE,MAAa;YACrB,SAAS,EACP,2EAA2E;YAC7E,WAAW,EAAE,YAAY;YACzB,GAAG,EAAE,8DAA8D,CAAC;gBAClE,SAAS,EAAE,sBAAsB;gBACjC,IAAI,EAAE,OAAO;gBACb,IAAI;aACL,CAAC;YACF,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC;AApBD,0CAoBC"}
@@ -0,0 +1,13 @@
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>;
@@ -0,0 +1,47 @@
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.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
+ //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.meta.js.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,33 @@
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 web methods ([SDK](https://dev.wix.com/docs/sdk/core-modules/web-methods/web-method) | [Velo](https://dev.wix.com/docs/velo/api-reference/wix-web-module/web-method)) and routers (currently [Velo](https://dev.wix.com/docs/velo/api-reference/wix-router/ok) only).
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
+ *
28
+ * >- (Velo only) Call Invalidate Cache to invalidate your web method and router caches. To invalidate Server Side Rendering (SSR) caches for your site, use the `invalidateCache()` function from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.
29
+ * @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.
30
+ */
31
+ (invalidationMethods: InvalidationMethods[]): Promise<void>;
32
+ }
33
+ export { InvalidateCacheRequest, InvalidateCacheResponse, InvalidationMethods, InvalidationMethodsInvalidateByOneOf, } from './ssr-v1-invalidate-cache-request-cache.universal.js';
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ 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
+ //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.public.js.map
@@ -0,0 +1 @@
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,6HAG8D;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"}
@@ -0,0 +1,15 @@
1
+ export interface InvalidateCacheRequest {
2
+ /** 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. */
3
+ invalidationMethods?: InvalidationMethods[];
4
+ }
5
+ export interface InvalidationMethods extends InvalidationMethodsInvalidateByOneOf {
6
+ /** *Required.** Identifier of the caches to invalidate. */
7
+ tag?: string;
8
+ }
9
+ /** @oneof */
10
+ export interface InvalidationMethodsInvalidateByOneOf {
11
+ /** *Required.** Identifier of the caches to invalidate. */
12
+ tag?: string;
13
+ }
14
+ export interface InvalidateCacheResponse {
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.types.js.map
@@ -0,0 +1 @@
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":""}
@@ -0,0 +1,44 @@
1
+ export interface InvalidateCacheRequest {
2
+ /** 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. */
3
+ invalidationMethods?: InvalidationMethods[];
4
+ }
5
+ export interface InvalidationMethods extends InvalidationMethodsInvalidateByOneOf {
6
+ /** *Required.** Identifier of the caches to invalidate. */
7
+ tag?: string;
8
+ }
9
+ /** @oneof */
10
+ export interface InvalidationMethodsInvalidateByOneOf {
11
+ /** *Required.** Identifier of the caches to invalidate. */
12
+ tag?: string;
13
+ }
14
+ export interface InvalidateCacheResponse {
15
+ }
16
+ /**
17
+ * <blockquote class="important">
18
+ *
19
+ * __Important:__
20
+ * This API is only supported for developing sites and works only when used together with the Web Methods or Router APIs.
21
+ *
22
+ * </blockquote>
23
+ *
24
+ * Invalidates or clears previously cached return values based on specified tags.
25
+ *
26
+ * The `invalidationMethods` parameter accepts an array of objects, each containing a `tag` field. These tags are defined when caching return values of web methods ([SDK](https://dev.wix.com/docs/sdk/core-modules/web-methods/web-method) | [Velo](https://dev.wix.com/docs/velo/api-reference/wix-web-module/web-method)) and routers (currently [Velo](https://dev.wix.com/docs/velo/api-reference/wix-router/ok) only).
27
+ *
28
+ * For example, an array such as `[{ tag: "contacts" }, { tag: "labels" }]` will clear any cached return values tagged with "contacts" or "labels."
29
+ *
30
+ * Any cache containing at least one tag specified in the `invalidationMethods` parameter will be cleared.
31
+ *
32
+ * >**Notes:**
33
+ * >- If you don't specify any tags in the `invalidationMethods` parameter, no caches are invalidated.
34
+ * >- 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.
35
+ *
36
+ * >- (Velo only) Call Invalidate Cache to invalidate your web method and router caches. To invalidate Server Side Rendering (SSR) caches for your site, use the `invalidateCache()` function from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.
37
+ * @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.
38
+ * @public
39
+ * @documentationMaturity preview
40
+ * @requiredField invalidationMethods
41
+ * @permissionId SSR.INVALIDATE_CACHE
42
+ * @fqn com.wixpress.html.cache.invalidate.InvalidateCacheService.invalidateCache
43
+ */
44
+ export declare function invalidateCache(invalidationMethods: InvalidationMethods[]): Promise<void>;
@@ -0,0 +1,81 @@
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.invalidateCache = void 0;
27
+ const transform_error_1 = require("@wix/sdk-runtime/transform-error");
28
+ const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
29
+ const ambassadorWixSsrV1InvalidateCacheRequest = __importStar(require("./ssr-v1-invalidate-cache-request-cache.http.js"));
30
+ /**
31
+ * <blockquote class="important">
32
+ *
33
+ * __Important:__
34
+ * This API is only supported for developing sites and works only when used together with the Web Methods or Router APIs.
35
+ *
36
+ * </blockquote>
37
+ *
38
+ * Invalidates or clears previously cached return values based on specified tags.
39
+ *
40
+ * The `invalidationMethods` parameter accepts an array of objects, each containing a `tag` field. These tags are defined when caching return values of web methods ([SDK](https://dev.wix.com/docs/sdk/core-modules/web-methods/web-method) | [Velo](https://dev.wix.com/docs/velo/api-reference/wix-web-module/web-method)) and routers (currently [Velo](https://dev.wix.com/docs/velo/api-reference/wix-router/ok) only).
41
+ *
42
+ * For example, an array such as `[{ tag: "contacts" }, { tag: "labels" }]` will clear any cached return values tagged with "contacts" or "labels."
43
+ *
44
+ * Any cache containing at least one tag specified in the `invalidationMethods` parameter will be cleared.
45
+ *
46
+ * >**Notes:**
47
+ * >- If you don't specify any tags in the `invalidationMethods` parameter, no caches are invalidated.
48
+ * >- 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.
49
+ *
50
+ * >- (Velo only) Call Invalidate Cache to invalidate your web method and router caches. To invalidate Server Side Rendering (SSR) caches for your site, use the `invalidateCache()` function from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.
51
+ * @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.
52
+ * @public
53
+ * @documentationMaturity preview
54
+ * @requiredField invalidationMethods
55
+ * @permissionId SSR.INVALIDATE_CACHE
56
+ * @fqn com.wixpress.html.cache.invalidate.InvalidateCacheService.invalidateCache
57
+ */
58
+ async function invalidateCache(invalidationMethods) {
59
+ // @ts-ignore
60
+ const { httpClient, sideEffects } = arguments[1];
61
+ const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
62
+ invalidationMethods: invalidationMethods,
63
+ });
64
+ const reqOpts = ambassadorWixSsrV1InvalidateCacheRequest.invalidateCache(payload);
65
+ sideEffects?.onSiteCall?.();
66
+ try {
67
+ const result = await httpClient.request(reqOpts);
68
+ sideEffects?.onSuccess?.(result);
69
+ }
70
+ catch (err) {
71
+ const transformedError = (0, transform_error_1.transformError)(err, {
72
+ spreadPathsToArguments: {},
73
+ explicitPathsToArguments: { invalidationMethods: '$[0]' },
74
+ singleArgumentUnchanged: false,
75
+ }, ['invalidationMethods']);
76
+ sideEffects?.onError?.(err);
77
+ throw transformedError;
78
+ }
79
+ }
80
+ exports.invalidateCache = invalidateCache;
81
+ //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.universal.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ssr-v1-invalidate-cache-request-cache.universal.js","sourceRoot":"","sources":["../../../src/ssr-v1-invalidate-cache-request-cache.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuF;AACvF,oFAAgG;AAEhG,0HAA4G;AAqB5G;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,KAAK,UAAU,eAAe,CACnC,mBAA0C;IAE1C,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,8DAAqC,EAAC;QACpD,mBAAmB,EAAE,mBAAmB;KACzC,CAAC,CAAC;IAEH,MAAM,OAAO,GACX,wCAAwC,CAAC,eAAe,CAAC,OAAO,CAAC,CAAC;IAEpE,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;IACnC,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE;YACzD,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,qBAAqB,CAAC,CACxB,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC;AAlCD,0CAkCC"}
@@ -0,0 +1 @@
1
+ export * from './src/ssr-v1-invalidate-cache-request-cache.context.js';
@@ -0,0 +1,2 @@
1
+ export * from './src/ssr-v1-invalidate-cache-request-cache.context.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,wDAAwD,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './src/ssr-v1-invalidate-cache-request-cache.universal.js';
@@ -0,0 +1,2 @@
1
+ export * from './src/ssr-v1-invalidate-cache-request-cache.universal.js';
2
+ //# sourceMappingURL=index.typings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":"AAAA,cAAc,0DAA0D,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './src/ssr-v1-invalidate-cache-request-cache.meta.js';
@@ -0,0 +1,2 @@
1
+ export * from './src/ssr-v1-invalidate-cache-request-cache.meta.js';
2
+ //# sourceMappingURL=meta.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":"AAAA,cAAc,qDAAqD,CAAC"}
@@ -0,0 +1,3 @@
1
+ {
2
+ "type": "module"
3
+ }
@@ -0,0 +1,4 @@
1
+ import { invalidateCache as publicInvalidateCache } 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 { InvalidateCacheRequest, InvalidationMethods, InvalidationMethodsInvalidateByOneOf, InvalidateCacheResponse, } from './ssr-v1-invalidate-cache-request-cache.universal.js';
@@ -0,0 +1,4 @@
1
+ import { invalidateCache as publicInvalidateCache } from './ssr-v1-invalidate-cache-request-cache.public.js';
2
+ import { createRESTModule } from '@wix/sdk-runtime/rest-modules';
3
+ export const invalidateCache = /*#__PURE__*/ createRESTModule(publicInvalidateCache);
4
+ //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.context.js.map
@@ -0,0 +1 @@
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,OAAO,EAAE,eAAe,IAAI,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC7G,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAGjE,MAAM,CAAC,MAAM,eAAe,GAExB,aAAa,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,24 @@
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 web methods ([SDK](https://dev.wix.com/docs/sdk/core-modules/web-methods/web-method) | [Velo](https://dev.wix.com/docs/velo/api-reference/wix-web-module/web-method)) and routers (currently [Velo](https://dev.wix.com/docs/velo/api-reference/wix-router/ok) only).
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
+ *
22
+ * >- (Velo only) Call Invalidate Cache to invalidate your web method and router caches. To invalidate Server Side Rendering (SSR) caches for your site, use the `invalidateCache()` function from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.
23
+ */
24
+ export declare function invalidateCache(payload: object): RequestOptionsFactory<any>;
@@ -0,0 +1,54 @@
1
+ import { resolveUrl } from '@wix/sdk-runtime/rest-modules';
2
+ function resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl(opts) {
3
+ const domainToMappings = {
4
+ 'api._api_base_domain_': [
5
+ {
6
+ srcPath: '/wix-public-html-cache-invalidate-webapp',
7
+ destPath: '',
8
+ },
9
+ ],
10
+ };
11
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
12
+ }
13
+ const PACKAGE_NAME = '@wix/auto_sdk_cache_cache';
14
+ /**
15
+ * <blockquote class="important">
16
+ *
17
+ * __Important:__
18
+ * This API is only supported for developing sites and works only when used together with the Web Methods or Router APIs.
19
+ *
20
+ * </blockquote>
21
+ *
22
+ * Invalidates or clears previously cached return values based on specified tags.
23
+ *
24
+ * The `invalidationMethods` parameter accepts an array of objects, each containing a `tag` field. These tags are defined when caching return values of web methods ([SDK](https://dev.wix.com/docs/sdk/core-modules/web-methods/web-method) | [Velo](https://dev.wix.com/docs/velo/api-reference/wix-web-module/web-method)) and routers (currently [Velo](https://dev.wix.com/docs/velo/api-reference/wix-router/ok) only).
25
+ *
26
+ * For example, an array such as `[{ tag: "contacts" }, { tag: "labels" }]` will clear any cached return values tagged with "contacts" or "labels."
27
+ *
28
+ * Any cache containing at least one tag specified in the `invalidationMethods` parameter will be cleared.
29
+ *
30
+ * >**Notes:**
31
+ * >- If you don't specify any tags in the `invalidationMethods` parameter, no caches are invalidated.
32
+ * >- 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.
33
+ *
34
+ * >- (Velo only) Call Invalidate Cache to invalidate your web method and router caches. To invalidate Server Side Rendering (SSR) caches for your site, use the `invalidateCache()` function from the [`wix-site-backend`](https://dev.wix.com/docs/velo/api-reference/wix-site-backend/invalidate-cache) module.
35
+ */
36
+ export function invalidateCache(payload) {
37
+ function __invalidateCache({ host }) {
38
+ const metadata = {
39
+ entityFqdn: 'wix.ssr.v1.invalidate_cache_request',
40
+ method: 'POST',
41
+ methodFqn: 'com.wixpress.html.cache.invalidate.InvalidateCacheService.invalidateCache',
42
+ packageName: PACKAGE_NAME,
43
+ url: resolveComWixpressHtmlCacheInvalidateInvalidateCacheServiceUrl({
44
+ protoPath: '/v1/invalidate-cache',
45
+ data: payload,
46
+ host,
47
+ }),
48
+ data: payload,
49
+ };
50
+ return metadata;
51
+ }
52
+ return __invalidateCache;
53
+ }
54
+ //# sourceMappingURL=ssr-v1-invalidate-cache-request-cache.http.js.map
@@ -0,0 +1 @@
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,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAI3D,SAAS,8DAA8D,CACrE,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,uBAAuB,EAAE;YACvB;gBACE,OAAO,EAAE,0CAA0C;gBACnD,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,YAAY,GAAG,2BAA2B,CAAC;AAEjD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC7C,SAAS,iBAAiB,CAAC,EAAE,IAAI,EAAO;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,qCAAqC;YACjD,MAAM,EAAE,MAAa;YACrB,SAAS,EACP,2EAA2E;YAC7E,WAAW,EAAE,YAAY;YACzB,GAAG,EAAE,8DAA8D,CAAC;gBAClE,SAAS,EAAE,sBAAsB;gBACjC,IAAI,EAAE,OAAO;gBACb,IAAI;aACL,CAAC;YACF,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
@@ -0,0 +1,13 @@
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>;