From 99d05931b3bc931b356e8e74cc5fb203c96be049 Mon Sep 17 00:00:00 2001 From: Mike Lohmeier Date: Fri, 7 May 2021 12:20:32 -0500 Subject: [PATCH] feat: Resource Archive Support (#64) Co-authored-by: Mike Lohmeier Co-authored-by: Tim Nguyen --- package.json | 3 ++- src/bundle.ts | 1 + src/persistence.ts | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index d857108..4cbad95 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "local": "node .", "prepublish": "tsc" }, - "dependencies": {}, + "dependencies": { + }, "devDependencies": { "@types/jest": "^26.0.19", "@types/node": "^12", diff --git a/src/bundle.ts b/src/bundle.ts index 76b0648..b9b47b0 100644 --- a/src/bundle.ts +++ b/src/bundle.ts @@ -21,6 +21,7 @@ export interface BatchReadWriteRequest { id: string; vid?: string; resource: any; + ttlInSeconds?: number; // archive timestamp in Unix epoch time format in seconds // GET requests, only contains the URL of the resource fullUrl?: string; references?: Reference[]; diff --git a/src/persistence.ts b/src/persistence.ts index b131526..13a32de 100644 --- a/src/persistence.ts +++ b/src/persistence.ts @@ -9,6 +9,7 @@ export interface CreateResourceRequest { resourceType: string; resource: any; id?: string; + ttlInSeconds?: number; // archive timestamp in Unix epoch time format in seconds } export interface UpdateResourceRequest { @@ -16,6 +17,7 @@ export interface UpdateResourceRequest { resourceType: string; resource: any; vid?: string; // used in version aware update + ttlInSeconds?: number; // archive timestamp in Unix epoch time format in seconds } export interface PatchResourceRequest { @@ -23,6 +25,7 @@ export interface PatchResourceRequest { resourceType: string; resource: any; vid?: string; // used in version aware patch + ttlInSeconds?: number; // archive timestamp in Unix epoch time format in seconds } export interface ReadResourceRequest {