@dmptool/utils 1.0.0 → 1.0.1
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/README.md +5 -5
- package/dist/dynamo.js +3 -1
- package/package.json +11 -9
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# dmptool-
|
|
1
|
+
# dmptool-utils
|
|
2
2
|
|
|
3
|
-
Functions that provide
|
|
3
|
+
Functions that provide helper functions for the following DMPTool projects:
|
|
4
4
|
- Lambda Functions in [dmptool-infrastructure](https://github.com/CDLUC3/dmptool-infrastructure)
|
|
5
5
|
- Apollo Server in [dmsp_backend_prototype](https://github.com/CDLUC3/dmsp_backend_prototype)
|
|
6
6
|
- Narrative Generator Service in [dmptool-narrative-generator](https://github.com/CDLUC3/dmptool-narrative-generator)
|
|
@@ -66,7 +66,7 @@ Environment variable requirements:
|
|
|
66
66
|
|
|
67
67
|
### Example usage
|
|
68
68
|
```typescript
|
|
69
|
-
import { getExport } from '@dmptool/
|
|
69
|
+
import { getExport } from '@dmptool/utils';
|
|
70
70
|
|
|
71
71
|
const tableName = await getExport('DynamoTableNames');
|
|
72
72
|
console.log(tableName);
|
|
@@ -114,7 +114,7 @@ import {
|
|
|
114
114
|
getDMPVersions,
|
|
115
115
|
tombstoneDMP,
|
|
116
116
|
updateDMP
|
|
117
|
-
} from 'dmptool
|
|
117
|
+
} from '@dmptool/utils';
|
|
118
118
|
|
|
119
119
|
process.env.AWS_REGION = 'eu-west-1';
|
|
120
120
|
process.env.DOMAIN_NAME = 'my-application.org';
|
|
@@ -265,7 +265,7 @@ import {
|
|
|
265
265
|
normaliseHttpProtocol,
|
|
266
266
|
randomHex,
|
|
267
267
|
removeNullAndUndefinedFromObject,
|
|
268
|
-
} from "dmptool
|
|
268
|
+
} from "@dmptool/utils";
|
|
269
269
|
|
|
270
270
|
console.log(areEqual("foo", "foo")); // Returns true
|
|
271
271
|
console.log(areEqual(123, "123")); // Returns false
|
package/dist/dynamo.js
CHANGED
|
@@ -373,7 +373,9 @@ const updateDMP = async (dmp, includeExtensions = true) => {
|
|
|
373
373
|
}
|
|
374
374
|
const lastModified = new Date((_f = latest.dmp) === null || _f === void 0 ? void 0 : _f.modified).getTime();
|
|
375
375
|
const now = Date.now();
|
|
376
|
-
const gracePeriod = process.env.VERSION_GRACE_PERIOD
|
|
376
|
+
const gracePeriod = process.env.VERSION_GRACE_PERIOD
|
|
377
|
+
? Number(process.env.VERSION_GRACE_PERIOD)
|
|
378
|
+
: 7200000; // 2 hours in milliseconds
|
|
377
379
|
// We need to version the DMP if the provenance doesn't match or the modified
|
|
378
380
|
// timestamp is older than 2 hours ago
|
|
379
381
|
const needToVersion = dmptoolExtension.provenance !== latest.dmp.provenance
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dmptool/utils",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Helper/Utility functions for use in the DMP Tool services. Particularly AWS tooling and maDMP serialization",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,14 +32,6 @@
|
|
|
32
32
|
"trivy-med": "./scripts/trivy-med.sh"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@aws-sdk/client-cloudformation": "^3.966.0",
|
|
36
|
-
"@aws-sdk/client-dynamodb": "^3.966.0",
|
|
37
|
-
"@aws-sdk/client-eventbridge": "^3.968.0",
|
|
38
|
-
"@aws-sdk/client-s3": "^3.966.0",
|
|
39
|
-
"@aws-sdk/client-sns": "^3.967.0",
|
|
40
|
-
"@aws-sdk/client-ssm": "^3.966.0",
|
|
41
|
-
"@aws-sdk/s3-request-presigner": "^3.966.0",
|
|
42
|
-
"@aws-sdk/util-dynamodb": "^3.966.0",
|
|
43
35
|
"@dmptool/types": "2.3.0",
|
|
44
36
|
"@elastic/ecs-pino-format": "^1.5.0",
|
|
45
37
|
"date-fns": "^4.1.0",
|
|
@@ -48,6 +40,16 @@
|
|
|
48
40
|
"pino": "^10.1.1",
|
|
49
41
|
"pino-lambda": "^4.4.1"
|
|
50
42
|
},
|
|
43
|
+
"peerDependencies": {
|
|
44
|
+
"@aws-sdk/client-cloudformation": "^3.966.0",
|
|
45
|
+
"@aws-sdk/client-dynamodb": "^3.966.0",
|
|
46
|
+
"@aws-sdk/client-eventbridge": "^3.968.0",
|
|
47
|
+
"@aws-sdk/client-s3": "^3.966.0",
|
|
48
|
+
"@aws-sdk/client-sns": "^3.967.0",
|
|
49
|
+
"@aws-sdk/client-ssm": "^3.966.0",
|
|
50
|
+
"@aws-sdk/s3-request-presigner": "^3.966.0",
|
|
51
|
+
"@aws-sdk/util-dynamodb": "^3.966.0"
|
|
52
|
+
},
|
|
51
53
|
"devDependencies": {
|
|
52
54
|
"@eslint/js": "^9.26.0",
|
|
53
55
|
"@types/jest": "^29.5.14",
|