next-sanity 13.0.0-cache-components.42 → 13.0.0-cache-components.43
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.
- package/dist/live/client-components/index.d.ts +1 -1
- package/dist/live/conditions/default/index.d.ts +223 -4
- package/dist/live/conditions/default/index.d.ts.map +1 -1
- package/dist/live/conditions/default/index.js +0 -4
- package/dist/live/conditions/default/index.js.map +1 -1
- package/dist/live/conditions/next-js/index.d.ts +229 -2
- package/dist/live/conditions/next-js/index.d.ts.map +1 -1
- package/dist/live/conditions/next-js/index.js.map +1 -1
- package/dist/live/conditions/react-server/index.d.ts +229 -2
- package/dist/live/conditions/react-server/index.d.ts.map +1 -1
- package/dist/live/conditions/react-server/index.js.map +1 -1
- package/dist/live/server-actions/{index.default.d.ts → index.d.ts} +1 -1
- package/dist/live/server-actions/index.d.ts.map +1 -0
- package/dist/live/server-actions/{index.next-js.js → index.js} +1 -1
- package/dist/live/server-actions/index.js.map +1 -0
- package/dist/types.d.ts +114 -45
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -5
- package/dist/live/server-actions/index.default.d.ts.map +0 -1
- package/dist/live/server-actions/index.default.js +0 -27
- package/dist/live/server-actions/index.default.js.map +0 -1
- package/dist/live/server-actions/index.next-js.d.ts +0 -11
- package/dist/live/server-actions/index.next-js.d.ts.map +0 -1
- package/dist/live/server-actions/index.next-js.js.map +0 -1
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use server";
|
|
2
|
-
import { t as parseTags } from "../../parseTags.js";
|
|
3
|
-
import { draftMode } from "next/headers";
|
|
4
|
-
import { refresh, revalidateTag } from "next/cache";
|
|
5
|
-
/**
|
|
6
|
-
* @alpha CAUTION: this is an internal action and does not follow semver. Using it directly is at your own risk.
|
|
7
|
-
*/
|
|
8
|
-
async function revalidateSyncTagsAction(unsafeTags) {
|
|
9
|
-
const { tags, prefixType } = parseTags(unsafeTags);
|
|
10
|
-
if ((await draftMode()).isEnabled) {
|
|
11
|
-
console.warn(`<SanityLive ${prefixType === "drafts" ? "includeDrafts " : ""}/> action called in draft mode, cache is bypassed in draft mode so the refresh() function is called instead of updateTag()`, { tags });
|
|
12
|
-
refresh();
|
|
13
|
-
return;
|
|
14
|
-
}
|
|
15
|
-
for (const tag of tags) revalidateTag(tag, "max");
|
|
16
|
-
console.log(`<SanityLive ${prefixType === "drafts" ? "includeDrafts " : ""}/> revalidated tags: ${tags.join(", ")} with cache profile "max" `);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Used by `<SanityLive onReconnect={refreshAction} onRestart={refreshAction} />`
|
|
20
|
-
* @deprecated - refactor `onReconnect` and `onRestart` to support `() => 'refresh'`
|
|
21
|
-
*/
|
|
22
|
-
async function refreshAction() {
|
|
23
|
-
refresh();
|
|
24
|
-
}
|
|
25
|
-
export { refreshAction, revalidateSyncTagsAction };
|
|
26
|
-
|
|
27
|
-
//# sourceMappingURL=index.default.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.default.js","names":[],"sources":["../../../src/live/server-actions/index.default.ts"],"sourcesContent":["'use server'\n\nimport {refresh, revalidateTag} from 'next/cache'\nimport {draftMode} from 'next/headers'\n\nimport {parseTags} from '#live/parseTags'\n\n/**\n * @alpha CAUTION: this is an internal action and does not follow semver. Using it directly is at your own risk.\n */\nexport async function revalidateSyncTagsAction(unsafeTags: unknown): Promise<void> {\n const {tags, prefixType} = parseTags(unsafeTags)\n if ((await draftMode()).isEnabled) {\n console.warn(\n `<SanityLive ${prefixType === 'drafts' ? 'includeDrafts ' : ''}/> action called in draft mode, cache is bypassed in draft mode so the refresh() function is called instead of updateTag()`,\n {tags},\n )\n refresh()\n return undefined\n }\n\n for (const tag of tags) {\n revalidateTag(tag, 'max')\n }\n\n // oxlint-disable-next-line no-console\n console.log(\n `<SanityLive ${prefixType === 'drafts' ? 'includeDrafts ' : ''}/> revalidated tags: ${tags.join(', ')} with cache profile \"max\" `,\n )\n}\n\n/**\n * Used by `<SanityLive onReconnect={refreshAction} onRestart={refreshAction} />`\n * @deprecated - refactor `onReconnect` and `onRestart` to support `() => 'refresh'`\n */\nexport async function refreshAction(): Promise<void> {\n refresh()\n}\n"],"mappings":";;;;;;;AAUA,eAAsB,yBAAyB,YAAoC;CACjF,MAAM,EAAC,MAAM,eAAc,UAAU,WAAW;AAChD,MAAK,MAAM,WAAW,EAAE,WAAW;AACjC,UAAQ,KACN,eAAe,eAAe,WAAW,mBAAmB,GAAG,6HAC/D,EAAC,MAAK,CACP;AACD,WAAS;AACT;;AAGF,MAAK,MAAM,OAAO,KAChB,eAAc,KAAK,MAAM;AAI3B,SAAQ,IACN,eAAe,eAAe,WAAW,mBAAmB,GAAG,uBAAuB,KAAK,KAAK,KAAK,CAAC,4BACvG;;;;;;AAOH,eAAsB,gBAA+B;AACnD,UAAS"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @alpha CAUTION: this is an internal action and does not follow semver. Using it directly is at your own risk.
|
|
3
|
-
*/
|
|
4
|
-
declare function revalidateSyncTagsAction(unsafeTags: unknown): Promise<void>;
|
|
5
|
-
/**
|
|
6
|
-
* Used by `<SanityLive onReconnect={refreshAction} onRestart={refreshAction} />`
|
|
7
|
-
* @deprecated - refactor `onReconnect` and `onRestart` to support `() => 'refresh'`
|
|
8
|
-
*/
|
|
9
|
-
declare function refreshAction(): Promise<void>;
|
|
10
|
-
export { refreshAction, revalidateSyncTagsAction };
|
|
11
|
-
//# sourceMappingURL=index.next-js.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.next-js.d.ts","names":[],"sources":["../../../src/live/server-actions/index.next-js.ts"],"mappings":"AAUA;;;AAAA,iBAAsB,wBAAA,CAAyB,UAAA,YAAsB,OAAA;;AAyBrE;;;iBAAsB,aAAA,CAAA,GAAiB,OAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.next-js.js","names":[],"sources":["../../../src/live/server-actions/index.next-js.ts"],"sourcesContent":["'use server'\n\nimport {refresh, revalidateTag} from 'next/cache'\nimport {draftMode} from 'next/headers'\n\nimport {parseTags} from '#live/parseTags'\n\n/**\n * @alpha CAUTION: this is an internal action and does not follow semver. Using it directly is at your own risk.\n */\nexport async function revalidateSyncTagsAction(unsafeTags: unknown): Promise<void> {\n const {tags, prefixType} = parseTags(unsafeTags)\n if ((await draftMode()).isEnabled) {\n console.warn(\n `<SanityLive ${prefixType === 'drafts' ? 'includeDrafts ' : ''}/> action called in draft mode, cache is bypassed in draft mode so the refresh() function is called instead of updateTag()`,\n {tags},\n )\n refresh()\n return undefined\n }\n\n for (const tag of tags) {\n revalidateTag(tag, 'max')\n }\n\n // oxlint-disable-next-line no-console\n console.log(\n `<SanityLive ${prefixType === 'drafts' ? 'includeDrafts ' : ''}/> revalidated tags: ${tags.join(', ')} with cache profile \"max\" `,\n )\n}\n\n/**\n * Used by `<SanityLive onReconnect={refreshAction} onRestart={refreshAction} />`\n * @deprecated - refactor `onReconnect` and `onRestart` to support `() => 'refresh'`\n */\nexport async function refreshAction(): Promise<void> {\n refresh()\n}\n"],"mappings":";;;;;;;AAUA,eAAsB,yBAAyB,YAAoC;CACjF,MAAM,EAAC,MAAM,eAAc,UAAU,WAAW;AAChD,MAAK,MAAM,WAAW,EAAE,WAAW;AACjC,UAAQ,KACN,eAAe,eAAe,WAAW,mBAAmB,GAAG,6HAC/D,EAAC,MAAK,CACP;AACD,WAAS;AACT;;AAGF,MAAK,MAAM,OAAO,KAChB,eAAc,KAAK,MAAM;AAI3B,SAAQ,IACN,eAAe,eAAe,WAAW,mBAAmB,GAAG,uBAAuB,KAAK,KAAK,KAAK,CAAC,4BACvG;;;;;;AAOH,eAAsB,gBAA+B;AACnD,UAAS"}
|