From aac086c0052d28b7a4e77458132fae942d36dd2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Ciccola?= Date: Mon, 29 Jul 2024 14:12:09 -0300 Subject: [PATCH] add `importDate`, fix tests --- proto/projectSettings/v1.proto | 3 ++- schema/projectSettings/v1.json | 5 +++++ test/fixtures/cached.js | 4 ++++ test/fixtures/good-docs-completed.js | 7 +++++-- test/fixtures/good-docs-minimal.js | 7 +++++-- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/proto/projectSettings/v1.proto b/proto/projectSettings/v1.proto index 056fe96..cab1218 100644 --- a/proto/projectSettings/v1.proto +++ b/proto/projectSettings/v1.proto @@ -23,7 +23,8 @@ message ProjectSettings_1 { message ConfigMetadata { optional string name = 1; optional google.protobuf.Timestamp buildDate = 2; - optional int32 fileVersion = 3; + optional google.protobuf.Timestamp importDate = 3; + optional int32 fileVersion = 4; } optional DefaultPresets defaultPresets = 2; diff --git a/schema/projectSettings/v1.json b/schema/projectSettings/v1.json index bb5c8f6..cf064bd 100644 --- a/schema/projectSettings/v1.json +++ b/schema/projectSettings/v1.json @@ -37,6 +37,11 @@ "format": "date-time", "description": "RFC3339-formatted datetime of when the configuration was built" }, + "importDate": { + "type": "string", + "format": "date-time", + "description": "RFC3339-formatted datetime of when the configuration was imported to the project" + }, "fileVersion": { "type": "number", "minimum": 0, diff --git a/test/fixtures/cached.js b/test/fixtures/cached.js index effc550..fcf2df3 100644 --- a/test/fixtures/cached.js +++ b/test/fixtures/cached.js @@ -30,4 +30,8 @@ export const cachedValues = { fieldIds: [randomBytes(32).toString('hex')], iconId: randomBytes(32).toString('hex'), docIdRef: randomBytes(32).toString('hex'), + configMetadata: { + buildDate: date, + importDate: date, + }, } diff --git a/test/fixtures/good-docs-completed.js b/test/fixtures/good-docs-completed.js index d7c9b6f..9b534e0 100644 --- a/test/fixtures/good-docs-completed.js +++ b/test/fixtures/good-docs-completed.js @@ -88,8 +88,11 @@ export const goodDocsCompleted = [ relation: cachedValues.defaultPresets.point, }, name: 'myProject', - configName: 'mapeo-config', - configVersion: '1.0.0', + configMetadata: { + name: 'mapeo-config-1', + buildDate: cachedValues.configMetadata.buildDate, + importDate: cachedValues.configMetadata.importDate, + }, deleted: false, }, expected: {}, diff --git a/test/fixtures/good-docs-minimal.js b/test/fixtures/good-docs-minimal.js index 82478c0..b21cd87 100644 --- a/test/fixtures/good-docs-minimal.js +++ b/test/fixtures/good-docs-minimal.js @@ -37,8 +37,11 @@ export const goodDocsMinimal = [ createdAt: cachedValues.createdAt, updatedAt: cachedValues.updatedAt, createdBy: cachedValues.createdBy, - configName: 'mapeo-config', - configVersion: '1.0.0', + configMetadata: { + name: 'mapeo-config', + buildDate: cachedValues.configMetadata.buildDate, + importDate: cachedValues.configMetadata.importDate, + }, links: [], deleted: false, },