@sanity/debug-preview-url-secret-plugin 2.0.0 → 2.0.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @sanity/debug-preview-url-secret-plugin
2
2
 
3
+ ## 2.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`61bd460`](https://github.com/sanity-io/plugins/commit/61bd46026d73147b9f8a51a82fba186927327c4e) Thanks [@stipsan](https://github.com/stipsan)! - Improve dts output
8
+
9
+ ## 2.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#291](https://github.com/sanity-io/plugins/pull/291) [`0976b5b`](https://github.com/sanity-io/plugins/commit/0976b5b8bfe72a6e19068edfd52f2b9d081ab9ea) Thanks [@renovate](https://github.com/apps/renovate)! - fix(deps): Update dependency @sanity/preview-url-secret to v4
14
+
3
15
  ## 2.0.0
4
16
 
5
17
  ### Major Changes
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as sanity0 from "sanity";
2
- declare const debugSecrets: sanity0.Plugin<void>;
1
+ import { Plugin } from "sanity";
2
+ declare const debugSecrets: Plugin;
3
3
  export { debugSecrets };
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":["debugSecrets","sanity0","Plugin"],"sources":["../src/index.d.ts"],"sourcesContent":["export declare const debugSecrets: import(\"sanity\").Plugin<void>;\n//# sourceMappingURL=index.d.ts.map"],"mappings":";cAAqBA,cAA2CC,OAAAA,CAAZC"}
1
+ {"version":3,"file":"index.d.ts","names":["debugSecrets: Plugin"],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";cAuDaA,cAAc"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["import {CheckmarkCircleIcon, CloseCircleIcon, LockIcon} from '@sanity/icons'\nimport {schemaType, SECRET_TTL} from '@sanity/preview-url-secret/constants'\nimport {definePlugin, defineType} from 'sanity'\n\nconst schema = defineType({\n type: 'document',\n icon: LockIcon,\n name: schemaType,\n title: '@sanity/preview-url-secret',\n readOnly: true,\n fields: [\n {\n type: 'string',\n name: 'secret',\n title: 'Secret',\n },\n {\n type: 'string',\n name: 'source',\n title: 'Source Tool',\n },\n {\n type: 'string',\n name: 'studioUrl',\n title: 'Studio URL',\n },\n {\n type: 'string',\n name: 'userId',\n title: 'Sanity User ID',\n },\n ],\n preview: {\n select: {\n source: 'source',\n studioUrl: 'studioUrl',\n updatedAt: '_updatedAt',\n },\n prepare(data) {\n const url = data.studioUrl ? new URL(data.studioUrl, location.origin) : undefined\n const updatedAt = new Date(data.updatedAt).getTime()\n const expiresAt = new Date(updatedAt + 1000 * SECRET_TTL)\n const expired = expiresAt < new Date()\n const icon = expired ? CloseCircleIcon : CheckmarkCircleIcon\n return {\n title: url ? `${url.host}${url.pathname}` : data.source,\n subtitle: expired\n ? 'Expired'\n : `Expires in ${Math.round((expiresAt.getTime() - Date.now()) / (1000 * 60))} minutes`,\n media: icon,\n }\n },\n },\n})\n\nexport const debugSecrets = definePlugin(() => {\n return {\n name: 'sanity-plugin-debug-secrets',\n schema: {types: [schema]},\n document: {\n actions: (prev, context) => {\n if (context.schemaType !== schemaType) {\n return prev\n }\n return prev.filter(({action}) => action === 'delete')\n },\n inspectors: (prev, context) => {\n if (context.documentType !== schemaType) {\n return prev\n }\n return []\n },\n unstable_fieldActions: (prev, context) => {\n if (context.schemaType.name !== schemaType) {\n return prev\n }\n return []\n },\n },\n }\n})\n"],"names":[],"mappings":";;;AAIA,MAAM,SAAS,WAAW;AAAA,EACxB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QAAQ;AAAA,IACN;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,IAET;AAA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index.ts"],"sourcesContent":["import {CheckmarkCircleIcon, CloseCircleIcon, LockIcon} from '@sanity/icons'\nimport {schemaType, SECRET_TTL} from '@sanity/preview-url-secret/constants'\nimport {definePlugin, defineType, type Plugin} from 'sanity'\n\nconst schema = defineType({\n type: 'document',\n icon: LockIcon,\n name: schemaType,\n title: '@sanity/preview-url-secret',\n readOnly: true,\n fields: [\n {\n type: 'string',\n name: 'secret',\n title: 'Secret',\n },\n {\n type: 'string',\n name: 'source',\n title: 'Source Tool',\n },\n {\n type: 'string',\n name: 'studioUrl',\n title: 'Studio URL',\n },\n {\n type: 'string',\n name: 'userId',\n title: 'Sanity User ID',\n },\n ],\n preview: {\n select: {\n source: 'source',\n studioUrl: 'studioUrl',\n updatedAt: '_updatedAt',\n },\n prepare(data) {\n const url = data.studioUrl ? new URL(data.studioUrl, location.origin) : undefined\n const updatedAt = new Date(data.updatedAt).getTime()\n const expiresAt = new Date(updatedAt + 1000 * SECRET_TTL)\n const expired = expiresAt < new Date()\n const icon = expired ? CloseCircleIcon : CheckmarkCircleIcon\n return {\n title: url ? `${url.host}${url.pathname}` : data.source,\n subtitle: expired\n ? 'Expired'\n : `Expires in ${Math.round((expiresAt.getTime() - Date.now()) / (1000 * 60))} minutes`,\n media: icon,\n }\n },\n },\n})\n\nexport const debugSecrets: Plugin = definePlugin(() => {\n return {\n name: 'sanity-plugin-debug-secrets',\n schema: {types: [schema]},\n document: {\n actions: (prev, context) => {\n if (context.schemaType !== schemaType) {\n return prev\n }\n return prev.filter(({action}) => action === 'delete')\n },\n inspectors: (prev, context) => {\n if (context.documentType !== schemaType) {\n return prev\n }\n return []\n },\n unstable_fieldActions: (prev, context) => {\n if (context.schemaType.name !== schemaType) {\n return prev\n }\n return []\n },\n },\n }\n})\n"],"names":[],"mappings":";;;AAIA,MAAM,SAAS,WAAW;AAAA,EACxB,MAAM;AAAA,EACN,MAAM;AAAA,EACN,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,QA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QAAQ,WAAW,SAAS,aACvB,OAEF,CAAA;AAAA,EAAC;AAGd,EACD;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/debug-preview-url-secret-plugin",
3
- "version": "2.0.0",
3
+ "version": "2.0.2",
4
4
  "keywords": [
5
5
  "sanity",
6
6
  "sanity-plugin",
@@ -29,21 +29,19 @@
29
29
  ],
30
30
  "dependencies": {
31
31
  "@sanity/icons": "^3.7.4",
32
- "@sanity/preview-url-secret": "^3.0.0"
32
+ "@sanity/preview-url-secret": "^4.0.1"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@sanity/pkg-utils": "^10.2.1",
36
36
  "@types/react": "^19.2.7",
37
- "@typescript/native-preview": "7.0.0-dev.20251216.1",
38
37
  "react": "^19.2.3",
39
- "sanity": "^5.0.0",
40
- "typescript": "5.9.3",
41
- "@repo/package.config": "0.0.0",
38
+ "sanity": "^5.0.1",
39
+ "@repo/package.config": "0.0.1",
42
40
  "@repo/tsconfig": "1.0.0"
43
41
  },
44
42
  "peerDependencies": {
45
43
  "react": "^19.2",
46
- "sanity": "^5.0.0-0"
44
+ "sanity": "^5"
47
45
  },
48
46
  "engines": {
49
47
  "node": ">=20.19 <22 || >=22.12"