@hestia-earth/api 0.26.23 → 0.26.25
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/esm/models.js +1 -0
- package/esm/source-tracker/model/document.js +1 -0
- package/esm/source-tracker/model/model.js +23 -0
- package/esm/users/model/model.js +4 -0
- package/models.d.ts +1 -0
- package/models.js +1 -0
- package/package.json +1 -1
- package/source-tracker/model/document.d.ts +4 -0
- package/source-tracker/model/document.js +2 -0
- package/source-tracker/model/model.d.ts +52 -0
- package/source-tracker/model/model.js +26 -0
- package/users/model/model.d.ts +4 -0
- package/users/model/model.js +4 -0
package/esm/models.js
CHANGED
|
@@ -10,6 +10,7 @@ export * from './migrations/model/model.js';
|
|
|
10
10
|
export * from './nodes/model/model.js';
|
|
11
11
|
export * from './reconciliations/model/model.js';
|
|
12
12
|
export * from './settings/model/model.js';
|
|
13
|
+
export * from './source-tracker/model/model.js';
|
|
13
14
|
export * from './url-shortener/model/model.js';
|
|
14
15
|
export * from './users/model/model.js';
|
|
15
16
|
export * from './webhooks/model/model.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export var SourceTrackerStatus;
|
|
2
|
+
(function (SourceTrackerStatus) {
|
|
3
|
+
SourceTrackerStatus["Pending"] = "pending";
|
|
4
|
+
SourceTrackerStatus["InReview"] = "in-review";
|
|
5
|
+
SourceTrackerStatus["Confirmed"] = "confirmed";
|
|
6
|
+
SourceTrackerStatus["Indexed"] = "indexed";
|
|
7
|
+
SourceTrackerStatus["Rejected"] = "rejected";
|
|
8
|
+
SourceTrackerStatus["Duplicate"] = "duplicate";
|
|
9
|
+
})(SourceTrackerStatus || (SourceTrackerStatus = {}));
|
|
10
|
+
export var RejectionReason;
|
|
11
|
+
(function (RejectionReason) {
|
|
12
|
+
RejectionReason["BadData"] = "bad-data";
|
|
13
|
+
RejectionReason["NotRelevant"] = "not-relevant";
|
|
14
|
+
RejectionReason["Commercial"] = "commercial";
|
|
15
|
+
RejectionReason["NoLca"] = "no-lca";
|
|
16
|
+
RejectionReason["DuplicateSource"] = "duplicate-source";
|
|
17
|
+
})(RejectionReason || (RejectionReason = {}));
|
|
18
|
+
export var GitlabMatchMethod;
|
|
19
|
+
(function (GitlabMatchMethod) {
|
|
20
|
+
GitlabMatchMethod["Doi"] = "doi";
|
|
21
|
+
GitlabMatchMethod["FuzzyTitle"] = "fuzzy-title";
|
|
22
|
+
GitlabMatchMethod["Manual"] = "manual";
|
|
23
|
+
})(GitlabMatchMethod || (GitlabMatchMethod = {}));
|
package/esm/users/model/model.js
CHANGED
|
@@ -66,6 +66,9 @@ export class User extends BaseModel {
|
|
|
66
66
|
linkedInID;
|
|
67
67
|
gitlabID;
|
|
68
68
|
gitlabUsername;
|
|
69
|
+
gitlabAccessToken;
|
|
70
|
+
gitlabRefreshToken;
|
|
71
|
+
gitlabTokenExpiresAt;
|
|
69
72
|
orcid;
|
|
70
73
|
website;
|
|
71
74
|
city;
|
|
@@ -75,6 +78,7 @@ export class User extends BaseModel {
|
|
|
75
78
|
admin;
|
|
76
79
|
name;
|
|
77
80
|
actorId;
|
|
81
|
+
gitlabConnected;
|
|
78
82
|
}
|
|
79
83
|
export const name = ({ firstName, lastName }) => [firstName, lastName].filter(Boolean).join(' ');
|
|
80
84
|
export const isAdmin = (user) => user?.role === UserRole.Admin;
|
package/models.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ export * from './migrations/model/model';
|
|
|
10
10
|
export * from './nodes/model/model';
|
|
11
11
|
export * from './reconciliations/model/model';
|
|
12
12
|
export * from './settings/model/model';
|
|
13
|
+
export * from './source-tracker/model/model';
|
|
13
14
|
export * from './url-shortener/model/model';
|
|
14
15
|
export * from './users/model/model';
|
|
15
16
|
export * from './webhooks/model/model';
|
package/models.js
CHANGED
|
@@ -26,6 +26,7 @@ __exportStar(require("./migrations/model/model"), exports);
|
|
|
26
26
|
__exportStar(require("./nodes/model/model"), exports);
|
|
27
27
|
__exportStar(require("./reconciliations/model/model"), exports);
|
|
28
28
|
__exportStar(require("./settings/model/model"), exports);
|
|
29
|
+
__exportStar(require("./source-tracker/model/model"), exports);
|
|
29
30
|
__exportStar(require("./url-shortener/model/model"), exports);
|
|
30
31
|
__exportStar(require("./users/model/model"), exports);
|
|
31
32
|
__exportStar(require("./webhooks/model/model"), exports);
|
package/package.json
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { BaseModel } from '../../db/model.base';
|
|
2
|
+
export declare enum SourceTrackerStatus {
|
|
3
|
+
Pending = "pending",
|
|
4
|
+
InReview = "in-review",
|
|
5
|
+
Confirmed = "confirmed",
|
|
6
|
+
Indexed = "indexed",
|
|
7
|
+
Rejected = "rejected",
|
|
8
|
+
Duplicate = "duplicate"
|
|
9
|
+
}
|
|
10
|
+
export declare enum RejectionReason {
|
|
11
|
+
BadData = "bad-data",
|
|
12
|
+
NotRelevant = "not-relevant",
|
|
13
|
+
Commercial = "commercial",
|
|
14
|
+
NoLca = "no-lca",
|
|
15
|
+
DuplicateSource = "duplicate-source"
|
|
16
|
+
}
|
|
17
|
+
export declare enum GitlabMatchMethod {
|
|
18
|
+
Doi = "doi",
|
|
19
|
+
FuzzyTitle = "fuzzy-title",
|
|
20
|
+
Manual = "manual"
|
|
21
|
+
}
|
|
22
|
+
export interface SourceTrackerEnrichment {
|
|
23
|
+
lastSyncedAt?: Date;
|
|
24
|
+
methodClassification?: string;
|
|
25
|
+
cycleCount?: number;
|
|
26
|
+
totalNumberOfCycles?: number;
|
|
27
|
+
products: string[];
|
|
28
|
+
countries: string[];
|
|
29
|
+
}
|
|
30
|
+
export interface SourceTracker extends BaseModel {
|
|
31
|
+
doi?: string;
|
|
32
|
+
sourceId?: string;
|
|
33
|
+
title?: string;
|
|
34
|
+
bibliographyTitle?: string;
|
|
35
|
+
authors?: string;
|
|
36
|
+
year?: number;
|
|
37
|
+
products: string[];
|
|
38
|
+
countries: string[];
|
|
39
|
+
status: SourceTrackerStatus;
|
|
40
|
+
rejectionReason?: RejectionReason;
|
|
41
|
+
rejectedAt?: Date;
|
|
42
|
+
rejectedBy?: string;
|
|
43
|
+
assigneeId?: string;
|
|
44
|
+
gitlabIssueIid?: number;
|
|
45
|
+
gitlabIssueUrl?: string;
|
|
46
|
+
gitlabMatchConfidence?: number;
|
|
47
|
+
gitlabMatchMethod?: GitlabMatchMethod;
|
|
48
|
+
gitlabMatchNeedsReview: boolean;
|
|
49
|
+
hestiaEnrichment?: SourceTrackerEnrichment;
|
|
50
|
+
notes?: string;
|
|
51
|
+
createdBy?: string;
|
|
52
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GitlabMatchMethod = exports.RejectionReason = exports.SourceTrackerStatus = void 0;
|
|
4
|
+
var SourceTrackerStatus;
|
|
5
|
+
(function (SourceTrackerStatus) {
|
|
6
|
+
SourceTrackerStatus["Pending"] = "pending";
|
|
7
|
+
SourceTrackerStatus["InReview"] = "in-review";
|
|
8
|
+
SourceTrackerStatus["Confirmed"] = "confirmed";
|
|
9
|
+
SourceTrackerStatus["Indexed"] = "indexed";
|
|
10
|
+
SourceTrackerStatus["Rejected"] = "rejected";
|
|
11
|
+
SourceTrackerStatus["Duplicate"] = "duplicate";
|
|
12
|
+
})(SourceTrackerStatus || (exports.SourceTrackerStatus = SourceTrackerStatus = {}));
|
|
13
|
+
var RejectionReason;
|
|
14
|
+
(function (RejectionReason) {
|
|
15
|
+
RejectionReason["BadData"] = "bad-data";
|
|
16
|
+
RejectionReason["NotRelevant"] = "not-relevant";
|
|
17
|
+
RejectionReason["Commercial"] = "commercial";
|
|
18
|
+
RejectionReason["NoLca"] = "no-lca";
|
|
19
|
+
RejectionReason["DuplicateSource"] = "duplicate-source";
|
|
20
|
+
})(RejectionReason || (exports.RejectionReason = RejectionReason = {}));
|
|
21
|
+
var GitlabMatchMethod;
|
|
22
|
+
(function (GitlabMatchMethod) {
|
|
23
|
+
GitlabMatchMethod["Doi"] = "doi";
|
|
24
|
+
GitlabMatchMethod["FuzzyTitle"] = "fuzzy-title";
|
|
25
|
+
GitlabMatchMethod["Manual"] = "manual";
|
|
26
|
+
})(GitlabMatchMethod || (exports.GitlabMatchMethod = GitlabMatchMethod = {}));
|
package/users/model/model.d.ts
CHANGED
|
@@ -70,6 +70,9 @@ export declare class User extends BaseModel {
|
|
|
70
70
|
linkedInID?: string;
|
|
71
71
|
gitlabID?: string;
|
|
72
72
|
gitlabUsername?: string;
|
|
73
|
+
gitlabAccessToken?: string;
|
|
74
|
+
gitlabRefreshToken?: string;
|
|
75
|
+
gitlabTokenExpiresAt?: Date;
|
|
73
76
|
orcid?: string;
|
|
74
77
|
website?: string;
|
|
75
78
|
city?: string;
|
|
@@ -79,6 +82,7 @@ export declare class User extends BaseModel {
|
|
|
79
82
|
readonly admin: boolean;
|
|
80
83
|
readonly name?: string;
|
|
81
84
|
readonly actorId?: string;
|
|
85
|
+
readonly gitlabConnected?: boolean;
|
|
82
86
|
}
|
|
83
87
|
export declare const name: ({ firstName, lastName }: Partial<User>) => string;
|
|
84
88
|
export declare const isAdmin: (user?: Pick<User, "role">) => boolean;
|
package/users/model/model.js
CHANGED
|
@@ -69,6 +69,9 @@ class User extends model_base_1.BaseModel {
|
|
|
69
69
|
linkedInID;
|
|
70
70
|
gitlabID;
|
|
71
71
|
gitlabUsername;
|
|
72
|
+
gitlabAccessToken;
|
|
73
|
+
gitlabRefreshToken;
|
|
74
|
+
gitlabTokenExpiresAt;
|
|
72
75
|
orcid;
|
|
73
76
|
website;
|
|
74
77
|
city;
|
|
@@ -78,6 +81,7 @@ class User extends model_base_1.BaseModel {
|
|
|
78
81
|
admin;
|
|
79
82
|
name;
|
|
80
83
|
actorId;
|
|
84
|
+
gitlabConnected;
|
|
81
85
|
}
|
|
82
86
|
exports.User = User;
|
|
83
87
|
const name = ({ firstName, lastName }) => [firstName, lastName].filter(Boolean).join(' ');
|