@sanity/debug-preview-url-secret-plugin 1.0.1 → 1.0.3

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
+ ## 1.0.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7074855`](https://github.com/sanity-io/plugins/commit/7074855ecf139da7d7952963a12589a8f464bd0f) Thanks [@stipsan](https://github.com/stipsan)! - Fix linter issues
8
+
9
+ ## 1.0.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`69a8d2f`](https://github.com/sanity-io/plugins/commit/69a8d2f8ce1e8f5b342e7066dbc79a20b6687abe) Thanks [@stipsan](https://github.com/stipsan)! - Declare support for Studio v5
14
+
3
15
  ## 1.0.1
4
16
 
5
17
  ### Patch Changes
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<void>(() => {\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;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,IAET;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,IAET;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,EACT;AAAA,EAEF,SAAS;AAAA,IACP,QAAQ;AAAA,MACN,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,WAAW;AAAA,IAAA;AAAA,IAEb,QAAQ,MAAM;AACZ,YAAM,MAAM,KAAK,YAAY,IAAI,IAAI,KAAK,WAAW,SAAS,MAAM,IAAI,QAClE,YAAY,IAAI,KAAK,KAAK,SAAS,EAAE,QAAA,GACrC,YAAY,IAAI,KAAK,YAAY,MAAO,UAAU,GAClD,UAAU,YAAY,oBAAI,KAAA,GAC1B,OAAO,UAAU,kBAAkB;AACzC,aAAO;AAAA,QACL,OAAO,MAAM,GAAG,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK,KAAK;AAAA,QACjD,UAAU,UACN,YACA,cAAc,KAAK,OAAO,UAAU,QAAA,IAAY,KAAK,IAAA,MAAU,MAAO,GAAG,CAAC;AAAA,QAC9E,OAAO;AAAA,MAAA;AAAA,IAEX;AAAA,EAAA;AAEJ,CAAC,GAEY,eAAe,aAAmB,OACtC;AAAA,EACL,MAAM;AAAA,EACN,QAAQ,EAAC,OAAO,CAAC,MAAM,EAAA;AAAA,EACvB,UAAU;AAAA,IACR,SAAS,CAAC,MAAM,YACV,QAAQ,eAAe,aAClB,OAEF,KAAK,OAAO,CAAC,EAAC,OAAA,MAAY,WAAW,QAAQ;AAAA,IAEtD,YAAY,CAAC,MAAM,YACb,QAAQ,iBAAiB,aACpB,OAEF,CAAA;AAAA,IAET,uBAAuB,CAAC,MAAM,YACxB,QAAQ,WAAW,SAAS,aACvB,OAEF,CAAA;AAAA,EAAC;AAGd,EACD;"}
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;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,IAET;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,IAET;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,IAAA;AAAA,EACT;AAAA,EAEF,SAAS;AAAA,IACP,QAAQ;AAAA,MACN,QAAQ;AAAA,MACR,WAAW;AAAA,MACX,WAAW;AAAA,IAAA;AAAA,IAEb,QAAQ,MAAM;AACZ,YAAM,MAAM,KAAK,YAAY,IAAI,IAAI,KAAK,WAAW,SAAS,MAAM,IAAI,QAClE,YAAY,IAAI,KAAK,KAAK,SAAS,EAAE,QAAA,GACrC,YAAY,IAAI,KAAK,YAAY,MAAO,UAAU,GAClD,UAAU,YAAY,oBAAI,KAAA,GAC1B,OAAO,UAAU,kBAAkB;AACzC,aAAO;AAAA,QACL,OAAO,MAAM,GAAG,IAAI,IAAI,GAAG,IAAI,QAAQ,KAAK,KAAK;AAAA,QACjD,UAAU,UACN,YACA,cAAc,KAAK,OAAO,UAAU,QAAA,IAAY,KAAK,IAAA,MAAU,MAAO,GAAG,CAAC;AAAA,QAC9E,OAAO;AAAA,MAAA;AAAA,IAEX;AAAA,EAAA;AAEJ,CAAC,GAEY,eAAe,aAAa,OAChC;AAAA,EACL,MAAM;AAAA,EACN,QAAQ,EAAC,OAAO,CAAC,MAAM,EAAA;AAAA,EACvB,UAAU;AAAA,IACR,SAAS,CAAC,MAAM,YACV,QAAQ,eAAe,aAClB,OAEF,KAAK,OAAO,CAAC,EAAC,OAAA,MAAY,WAAW,QAAQ;AAAA,IAEtD,YAAY,CAAC,MAAM,YACb,QAAQ,iBAAiB,aACpB,OAEF,CAAA;AAAA,IAET,uBAAuB,CAAC,MAAM,YACxB,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": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "homepage": "https://github.com/sanity-io/plugins/tree/main/plugins/%40sanity/debug-preview-url-secret-plugin#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/sanity-io/plugins/issues"
@@ -32,24 +32,23 @@
32
32
  "@sanity/preview-url-secret": "^3.0.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@sanity/pkg-utils": "^10.0.0",
35
+ "@sanity/pkg-utils": "^10.1.2",
36
36
  "@types/react": "^19.2.7",
37
- "@typescript/native-preview": "7.0.0-dev.20251129.1",
38
- "react": "^19.2.0",
39
- "sanity": "^4.20.0",
37
+ "@typescript/native-preview": "7.0.0-dev.20251207.1",
38
+ "react": "^19.2.1",
39
+ "sanity": "^4.21.0",
40
40
  "typescript": "5.9.3",
41
41
  "@repo/package.config": "0.0.0",
42
42
  "@repo/tsconfig": "1.0.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": "^18.3 || ^19",
46
- "sanity": "^4"
46
+ "sanity": "^4.0.0-0 || ^5.0.0-0"
47
47
  },
48
48
  "engines": {
49
49
  "node": ">=20.19 <22 || >=22.12"
50
50
  },
51
51
  "scripts": {
52
- "build": "pkg build --strict --check --clean",
53
- "typecheck": "(cd ../../.. && tsgo --project plugins/@sanity/debug-preview-url-secret-plugin/tsconfig.json)"
52
+ "build": "pkg build --strict --check --clean"
54
53
  }
55
54
  }