@toolproof-npm/shared 0.1.80 → 0.1.82
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/_lib/types.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type Role = {
|
|
|
8
8
|
identity: ResourceRoleIdentityJson;
|
|
9
9
|
} & ResourceRoleValueJson;
|
|
10
10
|
export type ResourceMap = Record<ResourceTypeIdentityJson, ResourceJson[]>;
|
|
11
|
-
export type PartialResourceMeta = Omit<ResourceJson, 'kind' | 'timestamp' | 'path'> & {
|
|
11
|
+
export type PartialResourceMeta = Omit<ResourceJson, 'kind' | 'timestamp' | 'path' | 'extractedData'> & {
|
|
12
12
|
/** Optional timestamp (for replacing existing resources with same timestamp) */
|
|
13
13
|
timestamp?: string;
|
|
14
14
|
};
|
|
@@ -35,8 +35,8 @@ export function generateContentAddressedPath(resourceTypeRef, content) {
|
|
|
35
35
|
* ```
|
|
36
36
|
*/
|
|
37
37
|
export function createMaterializedResourceFromPotentialOutput(potentialOutput, content) {
|
|
38
|
-
// Generate content-addressed path from the content
|
|
39
|
-
const contentString = JSON.stringify(content);
|
|
38
|
+
// Generate content-addressed path from the content (use compact format for hashing)
|
|
39
|
+
const contentString = JSON.stringify(content, null, 2);
|
|
40
40
|
const path = generateContentAddressedPath(potentialOutput.resourceTypeRef, contentString);
|
|
41
41
|
return {
|
|
42
42
|
identity: potentialOutput.identity,
|
|
@@ -75,8 +75,8 @@ export function createMaterializedResourceFromPotentialOutput(potentialOutput, c
|
|
|
75
75
|
*/
|
|
76
76
|
export function createMaterializedResourceFromScratch(partialResourceMeta, content) {
|
|
77
77
|
const { identity, resourceTypeRef, creationContext, timestamp } = partialResourceMeta;
|
|
78
|
-
// Generate content-addressed path from the content
|
|
79
|
-
const contentString = JSON.stringify(content);
|
|
78
|
+
// Generate content-addressed path from the content (use pretty-printed format)
|
|
79
|
+
const contentString = JSON.stringify(content, null, 2);
|
|
80
80
|
const path = generateContentAddressedPath(resourceTypeRef, contentString);
|
|
81
81
|
return {
|
|
82
82
|
identity,
|