@hestia-earth/api 0.26.4 → 0.26.6
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 +8 -0
- package/{dist/esm → esm}/aggregations/model/model.js +2 -2
- package/{dist/esm → esm}/analyses/model/model.js +1 -1
- package/{dist/esm → esm}/api-calls/model/model.js +1 -1
- package/{dist/esm → esm}/files/model/model.js +2 -2
- package/{dist/esm → esm}/migrations/model/model.js +1 -1
- package/esm/models.js +15 -0
- package/{dist/esm → esm}/nodes/model/model.js +2 -2
- package/{dist/esm → esm}/reconciliations/model/model.js +2 -2
- package/{dist/esm → esm}/settings/model/model.js +1 -1
- package/{dist/esm → esm}/url-shortener/model/model.js +1 -1
- package/{dist/esm → esm}/users/model/model.js +1 -1
- package/package.json +16 -138
- package/dist/esm/models.js +0 -15
- /package/{dist/aggregations → aggregations}/model/document.d.ts +0 -0
- /package/{dist/aggregations → aggregations}/model/document.js +0 -0
- /package/{dist/aggregations → aggregations}/model/model.d.ts +0 -0
- /package/{dist/aggregations → aggregations}/model/model.js +0 -0
- /package/{dist/analyses → analyses}/model/document.d.ts +0 -0
- /package/{dist/analyses → analyses}/model/document.js +0 -0
- /package/{dist/analyses → analyses}/model/model.d.ts +0 -0
- /package/{dist/analyses → analyses}/model/model.js +0 -0
- /package/{dist/api-calls → api-calls}/model/model.d.ts +0 -0
- /package/{dist/api-calls → api-calls}/model/model.js +0 -0
- /package/{dist/cycles → cycles}/model/model.d.ts +0 -0
- /package/{dist/cycles → cycles}/model/model.js +0 -0
- /package/{dist/db → db}/model.base.d.ts +0 -0
- /package/{dist/db → db}/model.base.js +0 -0
- /package/{dist/db → db}/mongoose.model.d.ts +0 -0
- /package/{dist/db → db}/mongoose.model.js +0 -0
- /package/{dist/earth-engine → earth-engine}/model/model.d.ts +0 -0
- /package/{dist/earth-engine → earth-engine}/model/model.js +0 -0
- /package/{dist/esm → esm}/aggregations/model/document.js +0 -0
- /package/{dist/esm → esm}/analyses/model/document.js +0 -0
- /package/{dist/esm → esm}/cycles/model/model.js +0 -0
- /package/{dist/esm → esm}/db/model.base.js +0 -0
- /package/{dist/esm → esm}/db/mongoose.model.js +0 -0
- /package/{dist/esm → esm}/earth-engine/model/model.js +0 -0
- /package/{dist/esm → esm}/files/model/document.js +0 -0
- /package/{dist/esm → esm}/glossary/model/model.js +0 -0
- /package/{dist/esm → esm}/reconciliations/model/document.js +0 -0
- /package/{dist/esm → esm}/reconciliations/model/validations.js +0 -0
- /package/{dist/esm → esm}/users/model/document.js +0 -0
- /package/{dist/esm → esm}/webhooks/model/document.js +0 -0
- /package/{dist/esm → esm}/webhooks/model/model.js +0 -0
- /package/{dist/esm → esm}/ws.model.js +0 -0
- /package/{dist/files → files}/model/document.d.ts +0 -0
- /package/{dist/files → files}/model/document.js +0 -0
- /package/{dist/files → files}/model/model.d.ts +0 -0
- /package/{dist/files → files}/model/model.js +0 -0
- /package/{dist/glossary → glossary}/model/model.d.ts +0 -0
- /package/{dist/glossary → glossary}/model/model.js +0 -0
- /package/{dist/migrations → migrations}/model/model.d.ts +0 -0
- /package/{dist/migrations → migrations}/model/model.js +0 -0
- /package/{dist/models.d.ts → models.d.ts} +0 -0
- /package/{dist/models.js → models.js} +0 -0
- /package/{dist/nodes → nodes}/model/model.d.ts +0 -0
- /package/{dist/nodes → nodes}/model/model.js +0 -0
- /package/{dist/reconciliations → reconciliations}/model/document.d.ts +0 -0
- /package/{dist/reconciliations → reconciliations}/model/document.js +0 -0
- /package/{dist/reconciliations → reconciliations}/model/model.d.ts +0 -0
- /package/{dist/reconciliations → reconciliations}/model/model.js +0 -0
- /package/{dist/reconciliations → reconciliations}/model/validations.d.ts +0 -0
- /package/{dist/reconciliations → reconciliations}/model/validations.js +0 -0
- /package/{dist/settings → settings}/model/model.d.ts +0 -0
- /package/{dist/settings → settings}/model/model.js +0 -0
- /package/{dist/url-shortener → url-shortener}/model/model.d.ts +0 -0
- /package/{dist/url-shortener → url-shortener}/model/model.js +0 -0
- /package/{dist/users → users}/model/document.d.ts +0 -0
- /package/{dist/users → users}/model/document.js +0 -0
- /package/{dist/users → users}/model/model.d.ts +0 -0
- /package/{dist/users → users}/model/model.js +0 -0
- /package/{dist/webhooks → webhooks}/model/document.d.ts +0 -0
- /package/{dist/webhooks → webhooks}/model/document.js +0 -0
- /package/{dist/webhooks → webhooks}/model/model.d.ts +0 -0
- /package/{dist/webhooks → webhooks}/model/model.js +0 -0
- /package/{dist/ws.model.d.ts → ws.model.d.ts} +0 -0
- /package/{dist/ws.model.js → ws.model.js} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Hestia API
|
|
2
|
+
|
|
3
|
+
[](https://gitlab.com/hestia-earth/hestia-api/commits/master)
|
|
4
|
+
[](https://gitlab.com/hestia-earth/hestia-api/commits/master)
|
|
5
|
+
|
|
6
|
+
## Getting started
|
|
7
|
+
|
|
8
|
+
Check out the [contributing guidelines](./CONTRIBUTING.md).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isNumber } from '@hestia-earth/utils';
|
|
2
|
-
import { BaseModel } from '../../db/model.base';
|
|
3
|
-
import { filenameWithoutExt } from '../../files/model/model';
|
|
2
|
+
import { BaseModel } from '../../db/model.base.js';
|
|
3
|
+
import { filenameWithoutExt } from '../../files/model/model.js';
|
|
4
4
|
export class Aggregation extends BaseModel {
|
|
5
5
|
folder;
|
|
6
6
|
filename;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseModel } from '../../db/model.base';
|
|
2
|
-
import { hasPermission, isAdmin, isReviewer, UserPermission, UserRole } from '../../users/model/model';
|
|
1
|
+
import { BaseModel } from '../../db/model.base.js';
|
|
2
|
+
import { hasPermission, isAdmin, isReviewer, UserPermission, UserRole } from '../../users/model/model.js';
|
|
3
3
|
export const mb = 1048576;
|
|
4
4
|
export const sizeInMb = (size) => Math.round((size / mb) * 1000) / 1000;
|
|
5
5
|
export const maxFileSizeMb = 100;
|
package/esm/models.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export * from './api-calls/model/model.js';
|
|
2
|
+
export * from './aggregations/model/model.js';
|
|
3
|
+
export * from './analyses/model/model.js';
|
|
4
|
+
export * from './cycles/model/model.js';
|
|
5
|
+
export * from './earth-engine/model/model.js';
|
|
6
|
+
export * from './files/model/model.js';
|
|
7
|
+
export * from './glossary/model/model.js';
|
|
8
|
+
export * from './migrations/model/model.js';
|
|
9
|
+
export * from './nodes/model/model.js';
|
|
10
|
+
export * from './reconciliations/model/model.js';
|
|
11
|
+
export * from './settings/model/model.js';
|
|
12
|
+
export * from './url-shortener/model/model.js';
|
|
13
|
+
export * from './users/model/model.js';
|
|
14
|
+
export * from './webhooks/model/model.js';
|
|
15
|
+
export * from './ws.model.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SchemaType, NodeType, TermTermType, jsonldPath, isTypeNode, isExpandable } from '@hestia-earth/schema';
|
|
2
2
|
import { dayMs, reduceUndefinedValues, unique } from '@hestia-earth/utils';
|
|
3
|
-
import { fileToExt, SupportedExtensions } from '../../files/model/model';
|
|
4
|
-
import { hasPermission, UserPermission } from '../../users/model/model';
|
|
3
|
+
import { fileToExt, SupportedExtensions } from '../../files/model/model.js';
|
|
4
|
+
import { hasPermission, UserPermission } from '../../users/model/model.js';
|
|
5
5
|
export const blankNodeTypes = Object.values(SchemaType).filter(t => !isTypeNode(t));
|
|
6
6
|
export var DataState;
|
|
7
7
|
(function (DataState) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BaseModel } from '../../db/model.base';
|
|
2
|
-
export { getMainErrorMessage as reconciliationsGetMainErrorMessage, validateProductCorrespondence as reconciliationsValidateProductCorrespondence, validateImpactAssessmentLinks as reconciliationsValidateImpactAssessmentLinks, validateExpectedNodes as reconciliationsValidateExpectedNodes, validatePrivate as reconciliationsValidatePrivate } from './validations';
|
|
1
|
+
import { BaseModel } from '../../db/model.base.js';
|
|
2
|
+
export { getMainErrorMessage as reconciliationsGetMainErrorMessage, validateProductCorrespondence as reconciliationsValidateProductCorrespondence, validateImpactAssessmentLinks as reconciliationsValidateImpactAssessmentLinks, validateExpectedNodes as reconciliationsValidateExpectedNodes, validatePrivate as reconciliationsValidatePrivate } from './validations.js';
|
|
3
3
|
export var ReconciliationLevel;
|
|
4
4
|
(function (ReconciliationLevel) {
|
|
5
5
|
ReconciliationLevel["success"] = "success";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeType } from '@hestia-earth/schema';
|
|
2
2
|
import { dayMs } from '@hestia-earth/utils';
|
|
3
|
-
import { BaseModel } from '../../db/model.base';
|
|
3
|
+
import { BaseModel } from '../../db/model.base.js';
|
|
4
4
|
export const defaultMaxApiCalls = 100;
|
|
5
5
|
export const userPermissionRequestTimeout = 7 * dayMs;
|
|
6
6
|
export var MaxUploads;
|
package/package.json
CHANGED
|
@@ -1,52 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hestia-earth/api",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.6",
|
|
4
4
|
"description": "Hestia API definitions",
|
|
5
|
-
"main": "
|
|
6
|
-
"module": "
|
|
7
|
-
"
|
|
5
|
+
"main": "models.js",
|
|
6
|
+
"module": "esm/models.js",
|
|
7
|
+
"types": "models.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"types": "./
|
|
11
|
-
"import": "./
|
|
12
|
-
"require": "./
|
|
10
|
+
"types": "./models.d.ts",
|
|
11
|
+
"import": "./esm/models.js",
|
|
12
|
+
"require": "./models.js"
|
|
13
13
|
},
|
|
14
14
|
"./*.js": {
|
|
15
|
-
"types": "
|
|
16
|
-
"import": "./
|
|
17
|
-
"require": "
|
|
15
|
+
"types": "./*.d.ts",
|
|
16
|
+
"import": "./esm/*.js",
|
|
17
|
+
"require": "./*.js"
|
|
18
18
|
},
|
|
19
19
|
"./*": {
|
|
20
|
-
"types": "
|
|
21
|
-
"import": "./
|
|
22
|
-
"require": "
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"typesVersions": {
|
|
26
|
-
"*": {
|
|
27
|
-
"*": [
|
|
28
|
-
"dist/*.d.ts"
|
|
29
|
-
]
|
|
20
|
+
"types": "./*.d.ts",
|
|
21
|
+
"import": "./esm/*.js",
|
|
22
|
+
"require": "./*.js"
|
|
30
23
|
}
|
|
31
24
|
},
|
|
32
25
|
"sideEffects": false,
|
|
33
|
-
"scripts": {
|
|
34
|
-
"build": "rm -rf build && tsc -p tsconfig.build.json",
|
|
35
|
-
"build:module": "rm -rf dist && tsc -p tsconfig.dist.json && tsc -p tsconfig.esm.json",
|
|
36
|
-
"build:lambdas": "rm -rf build && tsc -p tsconfig.lambdas.json",
|
|
37
|
-
"validate:jsonld": "hestia-validate-jsonld test/fixtures/nodes",
|
|
38
|
-
"start": "npm run build && node index.js",
|
|
39
|
-
"dev": "ts-node-dev --respawn --rs dev.ts --files --ignore-watch node_modules",
|
|
40
|
-
"watch": "tsc --watch",
|
|
41
|
-
"webhooks:receive": "ts-node scripts/webhooks-receiver.ts",
|
|
42
|
-
"lint": "eslint \"src/**/*.ts\"",
|
|
43
|
-
"lint:fix": "npm run lint -- --fix",
|
|
44
|
-
"test": "jest --runInBand --coverage --forceExit",
|
|
45
|
-
"test:watch": "jest --watch",
|
|
46
|
-
"pre-release": "standard-version --prerelease && git push origin develop --follow-tags",
|
|
47
|
-
"release": "standard-version",
|
|
48
|
-
"postrelease": "git push origin master --follow-tags"
|
|
49
|
-
},
|
|
50
26
|
"repository": {
|
|
51
27
|
"type": "git",
|
|
52
28
|
"url": "git@gitlab.com:hestia-earth/hestia-api.git"
|
|
@@ -61,106 +37,8 @@
|
|
|
61
37
|
"node": ">=22"
|
|
62
38
|
},
|
|
63
39
|
"dependencies": {
|
|
64
|
-
"@hestia-earth/json-schema": ">=
|
|
65
|
-
"@hestia-earth/schema": ">=
|
|
40
|
+
"@hestia-earth/json-schema": ">=37.0.0",
|
|
41
|
+
"@hestia-earth/schema": ">=37.0.0",
|
|
66
42
|
"@hestia-earth/utils": ">=0.15.0"
|
|
67
|
-
}
|
|
68
|
-
"devDependencies": {
|
|
69
|
-
"@aws-sdk/client-cloudwatch": "^3.0.0",
|
|
70
|
-
"@aws-sdk/client-cloudwatch-logs": "^3.0.0",
|
|
71
|
-
"@aws-sdk/client-cost-explorer": "^3.1014.0",
|
|
72
|
-
"@aws-sdk/client-ec2": "^3.0.0",
|
|
73
|
-
"@aws-sdk/client-lambda": "^3.0.0",
|
|
74
|
-
"@aws-sdk/client-s3": "^3.0.0",
|
|
75
|
-
"@aws-sdk/client-ses": "^3.0.0",
|
|
76
|
-
"@aws-sdk/client-sqs": "^3.0.0",
|
|
77
|
-
"@aws-sdk/client-sustainability": "^3.1042.0",
|
|
78
|
-
"@aws-sdk/lib-storage": "^3.0.0",
|
|
79
|
-
"@aws-sdk/s3-request-presigner": "^3.0.0",
|
|
80
|
-
"@commitlint/cli": "^16.2.4",
|
|
81
|
-
"@commitlint/config-conventional": "^16.2.4",
|
|
82
|
-
"@elastic/elasticsearch": "7.13.0",
|
|
83
|
-
"@hestia-earth/eslint-config": "^0.1.0",
|
|
84
|
-
"@hestia-earth/schema-convert": "^33.7.11",
|
|
85
|
-
"@hestia-earth/schema-validation": "^33.7.11",
|
|
86
|
-
"@sentry/node": "^7.114.0",
|
|
87
|
-
"@sentry/serverless": "^7.114.0",
|
|
88
|
-
"@sentry/tracing": "^7.114.0",
|
|
89
|
-
"@slack/web-api": "^6.7.0",
|
|
90
|
-
"@socket.io/redis-adapter": "^8.3.0",
|
|
91
|
-
"@sokratis/passport-linkedin-oauth2": "^2.1.0",
|
|
92
|
-
"@types/compression": "^1.7.2",
|
|
93
|
-
"@types/cors": "^2.8.12",
|
|
94
|
-
"@types/express": "^4.17.21",
|
|
95
|
-
"@types/express-serve-static-core": "^4.17.41",
|
|
96
|
-
"@types/jest": "^30.0.0",
|
|
97
|
-
"@types/jsonwebtoken": "^9.0.6",
|
|
98
|
-
"@types/lodash.get": "^4.4.6",
|
|
99
|
-
"@types/lodash.orderby": "^4.6.6",
|
|
100
|
-
"@types/lodash.pick": "^4.4.6",
|
|
101
|
-
"@types/mongoose": "^5.11.97",
|
|
102
|
-
"@types/morgan": "^1.9.3",
|
|
103
|
-
"@types/multer": "^1.4.7",
|
|
104
|
-
"@types/node": "^22.0.0",
|
|
105
|
-
"@types/orientjs": "^3.0.12",
|
|
106
|
-
"@types/winston": "^2.4.4",
|
|
107
|
-
"@typescript-eslint/eslint-plugin": "^5.23.0",
|
|
108
|
-
"@typescript-eslint/parser": "^5.23.0",
|
|
109
|
-
"axios": "^1.16.0",
|
|
110
|
-
"body-parser": "^1.19.2",
|
|
111
|
-
"capitalize": "^2.0.4",
|
|
112
|
-
"compression": "^1.7.4",
|
|
113
|
-
"cors": "^2.8.4",
|
|
114
|
-
"dotenv": "^6.0.0",
|
|
115
|
-
"eslint": "^7.32.0",
|
|
116
|
-
"eslint-plugin-jsdoc": "^30.7.13",
|
|
117
|
-
"express": "^4.21.2",
|
|
118
|
-
"express-async-errors": "^3.1.1",
|
|
119
|
-
"express-recaptcha": "^5.1.0",
|
|
120
|
-
"express-redis-cache": "^1.1.3",
|
|
121
|
-
"express-session": "^1.17.2",
|
|
122
|
-
"form-urlencoded": "1.4.1",
|
|
123
|
-
"gitlab": "^14.2.2",
|
|
124
|
-
"http2-express-bridge": "^1.0.7",
|
|
125
|
-
"husky": "^4.3.8",
|
|
126
|
-
"jest": "^30.3.0",
|
|
127
|
-
"js-levenshtein": "^1.1.6",
|
|
128
|
-
"jsonwebtoken": "^9.0.2",
|
|
129
|
-
"lodash.get": "^4.4.2",
|
|
130
|
-
"lodash.orderby": "^4.6.0",
|
|
131
|
-
"lodash.pick": "^4.4.0",
|
|
132
|
-
"mongoose": "^5.13.14",
|
|
133
|
-
"mongoose-bcrypt": "^1.9.0",
|
|
134
|
-
"morgan": "^1.10.0",
|
|
135
|
-
"multer": "^1.4.4",
|
|
136
|
-
"multer-s3": "^3.0.1",
|
|
137
|
-
"orientjs": "^3.0.11",
|
|
138
|
-
"passport": "^0.4.1",
|
|
139
|
-
"passport-gitlab2": "^5.0.0",
|
|
140
|
-
"passport-google-oauth20": "^2.0.0",
|
|
141
|
-
"passport-orcid": "0.0.4",
|
|
142
|
-
"prettier": "^3.0.3",
|
|
143
|
-
"python-shell": "^2.0.3",
|
|
144
|
-
"redis": "^3.1.2",
|
|
145
|
-
"request": "^2.88.2",
|
|
146
|
-
"socket.io": "^4.8.3",
|
|
147
|
-
"source-map-support": "^0.5.21",
|
|
148
|
-
"standard-version": "^9.3.2",
|
|
149
|
-
"supertest": "^3.4.2",
|
|
150
|
-
"swagger-jsdoc": "^4.3.2",
|
|
151
|
-
"swagger-ui-dist": "^4.6.2",
|
|
152
|
-
"swagger-ui-express": "^4.3.0",
|
|
153
|
-
"ts-jest": "^29.4.6",
|
|
154
|
-
"ts-node": "^10.9.1",
|
|
155
|
-
"ts-node-dev": "^2.0.0",
|
|
156
|
-
"typescript": "^5.7.3",
|
|
157
|
-
"uid-generator": "^2.0.0",
|
|
158
|
-
"winston": "^3.6.0"
|
|
159
|
-
},
|
|
160
|
-
"husky": {
|
|
161
|
-
"hooks": {
|
|
162
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
"prettier": "@hestia-earth/eslint-config/prettier.json"
|
|
43
|
+
}
|
|
166
44
|
}
|
package/dist/esm/models.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from './api-calls/model/model';
|
|
2
|
-
export * from './aggregations/model/model';
|
|
3
|
-
export * from './analyses/model/model';
|
|
4
|
-
export * from './cycles/model/model';
|
|
5
|
-
export * from './earth-engine/model/model';
|
|
6
|
-
export * from './files/model/model';
|
|
7
|
-
export * from './glossary/model/model';
|
|
8
|
-
export * from './migrations/model/model';
|
|
9
|
-
export * from './nodes/model/model';
|
|
10
|
-
export * from './reconciliations/model/model';
|
|
11
|
-
export * from './settings/model/model';
|
|
12
|
-
export * from './url-shortener/model/model';
|
|
13
|
-
export * from './users/model/model';
|
|
14
|
-
export * from './webhooks/model/model';
|
|
15
|
-
export * from './ws.model';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|