@sanity/mutator
Advanced tools
Comparing version 3.57.3 to 3.57.4-memoized-form-state.18
@@ -100,2 +100,3 @@ import {CreateIfNotExistsMutation} from '@sanity/types' | ||
_updatedAt?: string | ||
_createdAt?: string | ||
[attribute: string]: unknown | ||
@@ -102,0 +103,0 @@ } |
{ | ||
"name": "@sanity/mutator", | ||
"version": "3.57.3", | ||
"version": "3.57.4-memoized-form-state.18+199df15e4c", | ||
"description": "A set of models to make it easier to utilize the powerful real time collaborative features of Sanity", | ||
@@ -53,3 +53,3 @@ "keywords": [ | ||
"@sanity/diff-match-patch": "^3.1.1", | ||
"@sanity/types": "3.57.3", | ||
"@sanity/types": "3.57.4-memoized-form-state.18+199df15e4c", | ||
"@sanity/uuid": "^3.0.1", | ||
@@ -66,3 +66,3 @@ "debug": "^4.3.4", | ||
}, | ||
"gitHead": "9be6707fde0096e0afb5f7363b20cd7b90ee84e7" | ||
"gitHead": "199df15e4c7b3887daa1f3a122a44cbd1e4e6fc2" | ||
} |
@@ -109,6 +109,10 @@ import {Patcher} from '../patch' | ||
// creation requires a _createdAt | ||
const getGuaranteedCreatedAt = (doc: Doc): string => | ||
doc?._createdAt || this.params.timestamp || new Date().toISOString() | ||
this.mutations.forEach((mutation) => { | ||
if (mutation.create) { | ||
// TODO: Fail entire patch if document did exist | ||
const create = mutation.create || {} | ||
const create = (mutation.create || {}) as Doc | ||
operations.push((doc): Doc => { | ||
@@ -119,4 +123,4 @@ if (doc) { | ||
return Object.assign(create as Doc, { | ||
_createdAt: create._createdAt || this.params.timestamp, | ||
return Object.assign(create, { | ||
_createdAt: getGuaranteedCreatedAt(create), | ||
}) | ||
@@ -132,3 +136,3 @@ }) | ||
? Object.assign(createIfNotExists, { | ||
_createdAt: createIfNotExists._createdAt || this.params.timestamp, | ||
_createdAt: getGuaranteedCreatedAt(createIfNotExists), | ||
}) | ||
@@ -144,3 +148,3 @@ : doc, | ||
Object.assign(createOrReplace, { | ||
_createdAt: createOrReplace._createdAt || this.params.timestamp, | ||
_createdAt: getGuaranteedCreatedAt(createOrReplace), | ||
}), | ||
@@ -147,0 +151,0 @@ ) |
@@ -19,2 +19,3 @@ import { | ||
_updatedAt?: string | ||
_createdAt?: string | ||
[attribute: string]: unknown | ||
@@ -21,0 +22,0 @@ } |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
785143
9008
1
1
- Removed@sanity/client@6.22.4(transitive)
- Removed@sanity/eventsource@5.0.2(transitive)
- Removed@sanity/types@3.57.3(transitive)
- Removed@types/event-source-polyfill@1.0.5(transitive)
- Removed@types/eventsource@1.1.15(transitive)
- Removed@types/follow-redirects@1.14.4(transitive)
- Removed@types/node@22.9.0(transitive)
- Removed@types/progress-stream@2.0.5(transitive)
- Removed@types/prop-types@15.7.13(transitive)
- Removed@types/react@18.3.12(transitive)
- Removedcore-util-is@1.0.3(transitive)
- Removedcsstype@3.1.3(transitive)
- Removeddecompress-response@7.0.0(transitive)
- Removedevent-source-polyfill@1.0.31(transitive)
- Removedeventsource@2.0.2(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedget-it@8.6.5(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-retry-allowed@2.2.0(transitive)
- Removedisarray@1.0.0(transitive)
- Removedmimic-response@3.1.0(transitive)
- Removedprocess-nextick-args@2.0.1(transitive)
- Removedprogress-stream@2.0.0(transitive)
- Removedreadable-stream@2.3.8(transitive)
- Removedrxjs@7.8.1(transitive)
- Removedsafe-buffer@5.1.2(transitive)
- Removedspeedometer@1.0.0(transitive)
- Removedstring_decoder@1.1.1(transitive)
- Removedthrough2@2.0.5(transitive)
- Removedtslib@2.8.1(transitive)
- Removedtunnel-agent@0.6.0(transitive)
- Removedundici-types@6.19.8(transitive)
- Removedutil-deprecate@1.0.2(transitive)
- Removedxtend@4.0.2(transitive)
Updated@sanity/types@3.57.4-memoized-form-state.18+199df15e4c