@_linked/server 2.0.1 → 2.0.3
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/CHANGELOG.md +12 -0
- package/lib/cjs/backend.d.ts +6 -0
- package/lib/cjs/backend.js +58 -0
- package/lib/cjs/backend.js.map +1 -0
- package/lib/cjs/data/lincd-server.json +47 -0
- package/lib/cjs/index.d.ts +9 -0
- package/lib/cjs/index.js +13 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/cjs/ontologies/lincd-server.d.ts +31 -0
- package/lib/cjs/ontologies/lincd-server.js +86 -0
- package/lib/cjs/ontologies/lincd-server.js.map +1 -0
- package/lib/cjs/package.d.ts +4 -0
- package/lib/cjs/package.js +7 -0
- package/lib/cjs/package.js.map +1 -0
- package/lib/cjs/package.json +90 -0
- package/lib/cjs/shapes/LincdAPI.d.ts +41 -0
- package/lib/cjs/shapes/LincdAPI.js +124 -0
- package/lib/cjs/shapes/LincdAPI.js.map +1 -0
- package/lib/cjs/shapes/LincdServer.d.ts +79 -0
- package/lib/cjs/shapes/LincdServer.js +1339 -0
- package/lib/cjs/shapes/LincdServer.js.map +1 -0
- package/lib/cjs/shapes/LincdWebApp.d.ts +7 -0
- package/lib/cjs/shapes/LincdWebApp.js +43 -0
- package/lib/cjs/shapes/LincdWebApp.js.map +1 -0
- package/lib/cjs/shapes/filestores/LocalFileStore.d.ts +42 -0
- package/lib/cjs/shapes/filestores/LocalFileStore.js +146 -0
- package/lib/cjs/shapes/filestores/LocalFileStore.js.map +1 -0
- package/lib/cjs/shapes/quadstores/BackendAPIStore.d.ts +33 -0
- package/lib/cjs/shapes/quadstores/BackendAPIStore.js +79 -0
- package/lib/cjs/shapes/quadstores/BackendAPIStore.js.map +1 -0
- package/lib/cjs/shapes/quadstores/BackendAPIStoreProvider.d.ts +13 -0
- package/lib/cjs/shapes/quadstores/BackendAPIStoreProvider.js +30 -0
- package/lib/cjs/shapes/quadstores/BackendAPIStoreProvider.js.map +1 -0
- package/lib/cjs/types/RouteConfig.d.ts +56 -0
- package/lib/cjs/types/RouteConfig.js +3 -0
- package/lib/cjs/types/RouteConfig.js.map +1 -0
- package/lib/cjs/types.d.ts +12 -0
- package/lib/cjs/types.js +1 -0
- package/lib/cjs/types.js.map +1 -0
- package/lib/cjs/utils/Shapes.d.ts +7 -0
- package/lib/cjs/utils/Shapes.js +76 -0
- package/lib/cjs/utils/Shapes.js.map +1 -0
- package/lib/cjs/utils/accessUrl.d.ts +6 -0
- package/lib/cjs/utils/accessUrl.js +13 -0
- package/lib/cjs/utils/accessUrl.js.map +1 -0
- package/lib/esm/backend.d.ts +6 -0
- package/lib/esm/backend.js +27 -0
- package/lib/esm/backend.js.map +1 -0
- package/lib/esm/data/lincd-server.json +47 -0
- package/lib/esm/index.d.ts +9 -0
- package/lib/esm/index.js +11 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/esm/ontologies/lincd-server.d.ts +31 -0
- package/lib/esm/ontologies/lincd-server.js +42 -0
- package/lib/esm/ontologies/lincd-server.js.map +1 -0
- package/lib/esm/package.d.ts +4 -0
- package/lib/esm/package.js +3 -0
- package/lib/esm/package.js.map +1 -0
- package/lib/esm/package.json +90 -0
- package/lib/esm/shapes/LincdAPI.d.ts +41 -0
- package/lib/esm/shapes/LincdAPI.js +113 -0
- package/lib/esm/shapes/LincdAPI.js.map +1 -0
- package/lib/esm/shapes/LincdServer.d.ts +79 -0
- package/lib/esm/shapes/LincdServer.js +1257 -0
- package/lib/esm/shapes/LincdServer.js.map +1 -0
- package/lib/esm/shapes/LincdWebApp.d.ts +7 -0
- package/lib/esm/shapes/LincdWebApp.js +40 -0
- package/lib/esm/shapes/LincdWebApp.js.map +1 -0
- package/lib/esm/shapes/filestores/LocalFileStore.d.ts +42 -0
- package/lib/esm/shapes/filestores/LocalFileStore.js +93 -0
- package/lib/esm/shapes/filestores/LocalFileStore.js.map +1 -0
- package/lib/esm/shapes/quadstores/BackendAPIStore.d.ts +33 -0
- package/lib/esm/shapes/quadstores/BackendAPIStore.js +65 -0
- package/lib/esm/shapes/quadstores/BackendAPIStore.js.map +1 -0
- package/lib/esm/shapes/quadstores/BackendAPIStoreProvider.d.ts +13 -0
- package/lib/esm/shapes/quadstores/BackendAPIStoreProvider.js +26 -0
- package/lib/esm/shapes/quadstores/BackendAPIStoreProvider.js.map +1 -0
- package/lib/esm/types/RouteConfig.d.ts +56 -0
- package/lib/esm/types/RouteConfig.js +2 -0
- package/lib/esm/types/RouteConfig.js.map +1 -0
- package/lib/esm/types.d.ts +12 -0
- package/lib/esm/types.js +1 -0
- package/lib/esm/types.js.map +1 -0
- package/lib/esm/utils/Shapes.d.ts +7 -0
- package/lib/esm/utils/Shapes.js +59 -0
- package/lib/esm/utils/Shapes.js.map +1 -0
- package/lib/esm/utils/accessUrl.d.ts +6 -0
- package/lib/esm/utils/accessUrl.js +9 -0
- package/lib/esm/utils/accessUrl.js.map +1 -0
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @\_linked/server
|
|
2
2
|
|
|
3
|
+
## 2.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#10](https://github.com/linked-cm/server/pull/10) [`5619ddf`](https://github.com/linked-cm/server/commit/5619ddf9268469eea566e110ce5c3c4fd68b407d) Thanks [@flyon](https://github.com/flyon)! - Switch to explicit per-step build pipeline (mirrors `@_linked/cli`'s and `@_linked/server-utils`'s). The previous `yarn linked build` wrapper was failing silently in CI and shipping incomplete tarballs.
|
|
8
|
+
|
|
9
|
+
## 2.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#8](https://github.com/linked-cm/server/pull/8) [`17e6771`](https://github.com/linked-cm/server/commit/17e6771ba1c2eae2daf24b97dcb9e934827f4396) Thanks [@flyon](https://github.com/flyon)! - Rebuild against `@_linked/server-utils@1.0.5`. The lockfile previously pinned `1.0.4` whose published tarball was empty, so server's build couldn't resolve `BackendProvider`/`JSONParser`/`JSONWriter`/`RouteConfig`. Lockfile now points at `1.0.5` which ships its `lib/` correctly.
|
|
14
|
+
|
|
3
15
|
## 2.0.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BackendProvider } from '@_linked/server-utils/utils/BackendProvider';
|
|
2
|
+
export * from './shapes/quadstores/BackendAPIStoreProvider.js';
|
|
3
|
+
export default class LincdServerBackendProvider extends BackendProvider {
|
|
4
|
+
setupBeforeControllers(): Promise<void>;
|
|
5
|
+
getShapes(): Record<string, import("@_linked/server-utils/types/ShapeDetails.js").ShapeDetails>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
18
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
19
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
20
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
21
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
22
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
const BackendProvider_1 = require("@_linked/server-utils/utils/BackendProvider");
|
|
30
|
+
const LinkedFileStorage_1 = require("@_linked/core/utils/LinkedFileStorage");
|
|
31
|
+
const LocalFileStore_js_1 = require("./shapes/filestores/LocalFileStore.js");
|
|
32
|
+
const Shapes_js_1 = require("./utils/Shapes.js");
|
|
33
|
+
const path_1 = __importDefault(require("path"));
|
|
34
|
+
const promises_1 = __importDefault(require("fs/promises"));
|
|
35
|
+
__exportStar(require("./shapes/quadstores/BackendAPIStoreProvider.js"), exports);
|
|
36
|
+
class LincdServerBackendProvider extends BackendProvider_1.BackendProvider {
|
|
37
|
+
setupBeforeControllers() {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
if (!LinkedFileStorage_1.LinkedFileStorage.getDefaultDataset()) {
|
|
40
|
+
LinkedFileStorage_1.LinkedFileStorage.setDefaultDataset(new LocalFileStore_js_1.LocalFileStore(process.env.NODE_ENV + '-filestore'));
|
|
41
|
+
}
|
|
42
|
+
let fileSystemUploadPath = path_1.default.join('data', 'filestores');
|
|
43
|
+
try {
|
|
44
|
+
yield promises_1.default.access(fileSystemUploadPath);
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
yield promises_1.default.mkdir(path_1.default.join(fileSystemUploadPath, 'filestores'), {
|
|
48
|
+
recursive: true,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
getShapes() {
|
|
54
|
+
return (0, Shapes_js_1.getShapeIndex)();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.default = LincdServerBackendProvider;
|
|
58
|
+
//# sourceMappingURL=backend.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"backend.js","sourceRoot":"","sources":["../../src/backend.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iFAA8E;AAC9E,6EAA0E;AAC1E,6EAAuE;AACvE,iDAAkD;AAClD,gDAAwB;AACxB,2DAA6B;AAE7B,iFAA+D;AAE/D,MAAqB,0BAA2B,SAAQ,iCAAe;IAC/D,sBAAsB;;YAC1B,IAAI,CAAC,qCAAiB,CAAC,iBAAiB,EAAE,EAAE,CAAC;gBAC3C,qCAAiB,CAAC,iBAAiB,CACjC,IAAI,kCAAc,CAAC,OAAO,CAAC,GAAG,CAAC,QAAQ,GAAG,YAAY,CAAC,CACxD,CAAC;YACJ,CAAC;YACD,IAAI,oBAAoB,GAAG,cAAI,CAAC,IAAI,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YAC3D,IAAI,CAAC;gBACH,MAAM,kBAAE,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC;YACxC,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,MAAM,kBAAE,CAAC,KAAK,CAAC,cAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,YAAY,CAAC,EAAE;oBAC5D,SAAS,EAAE,IAAI;iBAChB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;KAAA;IAED,SAAS;QACP,OAAO,IAAA,yBAAa,GAAE,CAAC;IACzB,CAAC;CACF;AApBD,6CAoBC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": {
|
|
3
|
+
"dc": "http://purl.org/dc/elements/1.1/",
|
|
4
|
+
"owl": "http://www.w3.org/2002/07/owl#",
|
|
5
|
+
"rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
|
|
6
|
+
"rdfs": "http://www.w3.org/2000/01/rdf-schema#",
|
|
7
|
+
"lincd-server": "http://lincd.org/ont/lincd-server/"
|
|
8
|
+
},
|
|
9
|
+
"@graph": [
|
|
10
|
+
{
|
|
11
|
+
"@id": "lincd-server:LincdServer",
|
|
12
|
+
"@type": "rdfs:Class",
|
|
13
|
+
"rdfs:comment": "A HTTP server for LINCD applications, running on node.js.",
|
|
14
|
+
"rdfs:isDefinedBy": {
|
|
15
|
+
"@id": "lincd-server:"
|
|
16
|
+
},
|
|
17
|
+
"rdfs:label": "LINCD Server"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"@id": "lincd-server:NodeFileStore",
|
|
21
|
+
"@type": "rdfs:Class",
|
|
22
|
+
"rdfs:comment": "Stores quads in a file in JSONLD format. Made for node.js environments.",
|
|
23
|
+
"rdfs:isDefinedBy": {
|
|
24
|
+
"@id": "lincd-server:"
|
|
25
|
+
},
|
|
26
|
+
"rdfs:label": "Node file store"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"@id": "lincd-server:BackendFileStore",
|
|
30
|
+
"@type": "rdfs:Class",
|
|
31
|
+
"rdfs:comment": "A simple quad store for frontends that are served by a LINCD Nodejs Server. Quads get loaded and updated through API calls to the backend. All quads are loaded into local memory in the frontend upon initiation of the app.",
|
|
32
|
+
"rdfs:isDefinedBy": {
|
|
33
|
+
"@id": "lincd-server:"
|
|
34
|
+
},
|
|
35
|
+
"rdfs:label": "Backend file store"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"@id": "lincd-server:BackendStore",
|
|
39
|
+
"@type": "rdfs:Class",
|
|
40
|
+
"rdfs:comment": "A base class for backend quad stores. These are quad stores for frontends that are served by a LINCD Nodejs Server. Quads get loaded and updated through API calls to the backend. All quads are loaded into local memory in the frontend upon initiation of the app.",
|
|
41
|
+
"rdfs:isDefinedBy": {
|
|
42
|
+
"@id": "lincd-server:"
|
|
43
|
+
},
|
|
44
|
+
"rdfs:label": "Backend store"
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import './types.js';
|
|
2
|
+
import './ontologies/lincd-server.js';
|
|
3
|
+
import './shapes/LincdServer.js';
|
|
4
|
+
import './shapes/LincdAPI.js';
|
|
5
|
+
import './shapes/quadstores/BackendAPIStore.js';
|
|
6
|
+
import './shapes/filestores/LocalFileStore.js';
|
|
7
|
+
import './shapes/LincdWebApp.js';
|
|
8
|
+
import './utils/accessUrl.js';
|
|
9
|
+
export type { RouteConfig, RoutesConfig, RoutesModule, } from '@_linked/server-utils/types/RouteConfig';
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
require("./types.js");
|
|
4
|
+
require("./ontologies/lincd-server.js");
|
|
5
|
+
//SHAPES FIRST
|
|
6
|
+
require("./shapes/LincdServer.js");
|
|
7
|
+
require("./shapes/LincdAPI.js");
|
|
8
|
+
require("./shapes/quadstores/BackendAPIStore.js");
|
|
9
|
+
require("./shapes/filestores/LocalFileStore.js");
|
|
10
|
+
require("./shapes/LincdWebApp.js");
|
|
11
|
+
//THEN COMPONENTS
|
|
12
|
+
require("./utils/accessUrl.js");
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;AAAA,sBAAoB;AACpB,wCAAsC;AAEtC,cAAc;AACd,mCAAiC;AACjC,gCAA8B;AAC9B,kDAAgD;AAChD,iDAA+C;AAC/C,mCAAiC;AAEjC,iBAAiB;AACjB,gCAA8B"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Load the data of this ontology.
|
|
3
|
+
* In @_linked/core, loadData returns the raw JSON import — no JSONLD.parse() needed.
|
|
4
|
+
*/
|
|
5
|
+
export declare var loadData: () => Promise<any>;
|
|
6
|
+
export declare var ns: (term: string) => import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
7
|
+
export declare var _self: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
8
|
+
export declare var LincdServer: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
9
|
+
export declare var BackendFileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
10
|
+
export declare var NodeFileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
11
|
+
export declare var BackendStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
12
|
+
export declare var BackendAPIStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
13
|
+
export declare var LincdWebApp: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
14
|
+
export declare var ownPackage: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
15
|
+
export declare var maintainsPackage: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
16
|
+
export declare var N3FileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
17
|
+
export declare var LincdAPI: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
18
|
+
export declare var hasAPI: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
19
|
+
export declare const lincdServer: {
|
|
20
|
+
LincdServer: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
21
|
+
BackendFileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
22
|
+
NodeFileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
23
|
+
BackendStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
24
|
+
N3FileStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
25
|
+
BackendAPIStore: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
26
|
+
LincdWebApp: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
27
|
+
ownPackage: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
28
|
+
maintainsPackage: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
29
|
+
LincdAPI: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
30
|
+
hasAPI: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
31
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
36
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
37
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
38
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
39
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
40
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
41
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.lincdServer = exports.hasAPI = exports.LincdAPI = exports.N3FileStore = exports.maintainsPackage = exports.ownPackage = exports.LincdWebApp = exports.BackendAPIStore = exports.BackendStore = exports.NodeFileStore = exports.BackendFileStore = exports.LincdServer = exports._self = exports.ns = exports.loadData = void 0;
|
|
46
|
+
const NameSpace_1 = require("@_linked/core/utils/NameSpace");
|
|
47
|
+
const package_js_1 = require("../package.js");
|
|
48
|
+
const _this = __importStar(require("./lincd-server.js"));
|
|
49
|
+
/**
|
|
50
|
+
* Load the data of this ontology.
|
|
51
|
+
* In @_linked/core, loadData returns the raw JSON import — no JSONLD.parse() needed.
|
|
52
|
+
*/
|
|
53
|
+
var loadData = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
54
|
+
//@ts-ignore
|
|
55
|
+
const data = yield Promise.resolve().then(() => __importStar(require('../data/lincd-server.json')));
|
|
56
|
+
return data.default || data;
|
|
57
|
+
});
|
|
58
|
+
exports.loadData = loadData;
|
|
59
|
+
exports.ns = (0, NameSpace_1.createNameSpace)('http://lincd.org/ont/lincd-server/');
|
|
60
|
+
exports._self = (0, exports.ns)('');
|
|
61
|
+
exports.LincdServer = (0, exports.ns)('LincdServer');
|
|
62
|
+
exports.BackendFileStore = (0, exports.ns)('BackendFileStore');
|
|
63
|
+
exports.NodeFileStore = (0, exports.ns)('NodeFileStore');
|
|
64
|
+
exports.BackendStore = (0, exports.ns)('BackendStore');
|
|
65
|
+
exports.BackendAPIStore = (0, exports.ns)('BackendAPIStore');
|
|
66
|
+
exports.LincdWebApp = (0, exports.ns)('LincdWebApp');
|
|
67
|
+
exports.ownPackage = (0, exports.ns)('ownPackage');
|
|
68
|
+
exports.maintainsPackage = (0, exports.ns)('maintainsPackage');
|
|
69
|
+
exports.N3FileStore = (0, exports.ns)('N3FileStore');
|
|
70
|
+
exports.LincdAPI = (0, exports.ns)('LincdAPI');
|
|
71
|
+
exports.hasAPI = (0, exports.ns)('hasAPI');
|
|
72
|
+
exports.lincdServer = {
|
|
73
|
+
LincdServer: exports.LincdServer,
|
|
74
|
+
BackendFileStore: exports.BackendFileStore,
|
|
75
|
+
NodeFileStore: exports.NodeFileStore,
|
|
76
|
+
BackendStore: exports.BackendStore,
|
|
77
|
+
N3FileStore: exports.N3FileStore,
|
|
78
|
+
BackendAPIStore: exports.BackendAPIStore,
|
|
79
|
+
LincdWebApp: exports.LincdWebApp,
|
|
80
|
+
ownPackage: exports.ownPackage,
|
|
81
|
+
maintainsPackage: exports.maintainsPackage,
|
|
82
|
+
LincdAPI: exports.LincdAPI,
|
|
83
|
+
hasAPI: exports.hasAPI,
|
|
84
|
+
};
|
|
85
|
+
(0, package_js_1.linkedOntology)(_this, exports.ns, 'lincd-server', exports.loadData, '../data/lincd-server.json');
|
|
86
|
+
//# sourceMappingURL=lincd-server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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,mBAAW;IACX,gBAAgB,EAAhB,wBAAgB;IAChB,aAAa,EAAb,qBAAa;IACb,YAAY,EAAZ,oBAAY;IACZ,WAAW,EAAX,mBAAW;IACX,eAAe,EAAf,uBAAe;IACf,WAAW,EAAX,mBAAW;IACX,UAAU,EAAV,kBAAU;IACV,gBAAgB,EAAhB,wBAAgB;IAChB,QAAQ,EAAR,gBAAQ;IACR,MAAM,EAAN,cAAM;CACP,CAAC;AAEF,IAAA,2BAAc,EACZ,KAAK,EACL,UAAE,EACF,cAAc,EACd,gBAAQ,EACR,2BAA2B,CAC5B,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const linkedShape: {
|
|
2
|
+
<T extends typeof import("@_linked/core/shapes/Shape").Shape>(constructor: T): void;
|
|
3
|
+
<T extends typeof import("@_linked/core/shapes/Shape").Shape>(config?: import("@_linked/core/utils/Package").ShapeConfig): (constructor: T) => void;
|
|
4
|
+
}, linkedUtil: (constructor: any) => any, linkedOntology: (allFileExports: any, nameSpace: (term: string) => import("@_linked/core/utils/NodeReference").NodeReferenceValue, suggestedPrefixAndFileName: string, loadDataFunction?: () => Promise<any>, dataSource?: string | string[]) => void, packageExports: any, packageName: string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.packageName = exports.packageExports = exports.linkedOntology = exports.linkedUtil = exports.linkedShape = void 0;
|
|
5
|
+
const Package_1 = require("@_linked/core/utils/Package");
|
|
6
|
+
_a = (0, Package_1.linkedPackage)('@_linked/server'), exports.linkedShape = _a.linkedShape, exports.linkedUtil = _a.linkedUtil, exports.linkedOntology = _a.linkedOntology, exports.packageExports = _a.packageExports, exports.packageName = _a.packageName;
|
|
7
|
+
//# sourceMappingURL=package.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package.js","sourceRoot":"","sources":["../../src/package.ts"],"names":[],"mappings":";;;;AAAA,yDAA4D;AAE/C,KAMT,IAAA,uBAAa,EAAC,iBAAiB,CAAC,EALlC,mBAAW,mBACX,kBAAU,kBACV,sBAAc,sBACd,sBAAc,sBACd,mBAAW,kBACwB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@_linked/server",
|
|
3
|
+
"description": "HTTP server & utilities for LINCD applications, running on node.js.",
|
|
4
|
+
"author": {
|
|
5
|
+
"name": "René Verheij",
|
|
6
|
+
"url": "https://github.com/flyon",
|
|
7
|
+
"email": "rpwverheij@gmail.com"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": ""
|
|
12
|
+
},
|
|
13
|
+
"version": "2.0.3",
|
|
14
|
+
"linkedPackage": true,
|
|
15
|
+
"license": "ISC",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"start": "npm exec linked dev",
|
|
18
|
+
"build": "rimraf ./lib && yarn build-esm && yarn build-cjs && yarn copy-to-lib && yarn dual-package",
|
|
19
|
+
"build-esm": "echo \"compiling ESM\" && rimraf ./lib/esm && yarn tsc -p tsconfig-esm.json",
|
|
20
|
+
"build-cjs": "echo \"compiling CJS\" && rimraf ./lib/cjs && yarn tsc -p tsconfig-cjs.json",
|
|
21
|
+
"copy-to-lib": "echo 'copying CSS + JSON assets to lib folder' && yarn copyfiles -u 1 'src/**/*.css' 'src/**/*.json' lib/esm && yarn copyfiles -u 1 'src/**/*.css' 'src/**/*.json' lib/cjs",
|
|
22
|
+
"dual-package": "echo 'adding package.json to each lib folder for dual output support' && yarn tsconfig-to-dual-package ./tsconfig-cjs.json ./tsconfig-esm.json"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"lincd",
|
|
26
|
+
"server",
|
|
27
|
+
"nodejs",
|
|
28
|
+
"express",
|
|
29
|
+
"linked data",
|
|
30
|
+
"interoperable",
|
|
31
|
+
"semantic web",
|
|
32
|
+
"web3"
|
|
33
|
+
],
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@_linked/cli": "^1.2",
|
|
36
|
+
"@_linked/core": "^2.2.1",
|
|
37
|
+
"@_linked/server-utils": "~1.0",
|
|
38
|
+
"adm-zip": "^0.5.16",
|
|
39
|
+
"archiver": "^7.0.1",
|
|
40
|
+
"autoprefixer": "^10.4.18",
|
|
41
|
+
"body-parser": "^1.20.2",
|
|
42
|
+
"chalk": "4.1.2",
|
|
43
|
+
"compression": "^1.7.4",
|
|
44
|
+
"cors": "^2.8.5",
|
|
45
|
+
"cron": "^4.3.4",
|
|
46
|
+
"express": "^4.18.3",
|
|
47
|
+
"fetch-cookie": "^3.1.0",
|
|
48
|
+
"is-object": "^1.0.2",
|
|
49
|
+
"lincd-sioc": "~1.0",
|
|
50
|
+
"n3": "^1.17.2",
|
|
51
|
+
"node-addon-api": "^8.2.2",
|
|
52
|
+
"node-hook": "^1.0.0",
|
|
53
|
+
"open": "^8.4.0",
|
|
54
|
+
"proper-lockfile": "^4.1.2",
|
|
55
|
+
"react": "^18.2",
|
|
56
|
+
"react-dom": "^18.2",
|
|
57
|
+
"react-error-boundary": "^4.0.13",
|
|
58
|
+
"react-router-dom": "^6.22.3",
|
|
59
|
+
"rimraf": "^5.0.5",
|
|
60
|
+
"sharp": "^0.34.4",
|
|
61
|
+
"tough-cookie": "^6.0.0",
|
|
62
|
+
"tsconfig-to-dual-package": "^1.2.0",
|
|
63
|
+
"typescript": "^5.7.3",
|
|
64
|
+
"webpack": "^5.90.3",
|
|
65
|
+
"webpack-dev-middleware": "^7.0.0",
|
|
66
|
+
"webpack-hot-middleware": "^2.26.1",
|
|
67
|
+
"zip-a-folder": "^3.1.8"
|
|
68
|
+
},
|
|
69
|
+
"devDependencies": {
|
|
70
|
+
"@changesets/changelog-github": "^0.5.2",
|
|
71
|
+
"@changesets/cli": "^2.29.8",
|
|
72
|
+
"@types/node": "^20.12.7",
|
|
73
|
+
"@types/react-dom": "^18.0.6",
|
|
74
|
+
"copyfiles": "^2.4.1",
|
|
75
|
+
"cross-env": "^7.0.3",
|
|
76
|
+
"prettier": "3.2.5",
|
|
77
|
+
"typescript-plugin-css-modules": "^5.1.0"
|
|
78
|
+
},
|
|
79
|
+
"typesVersions": {
|
|
80
|
+
"*": {
|
|
81
|
+
"*": [
|
|
82
|
+
"lib/esm/*"
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
"publishConfig": {
|
|
87
|
+
"access": "public"
|
|
88
|
+
},
|
|
89
|
+
"type": "commonjs"
|
|
90
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Shape } from '@_linked/core/shapes/Shape';
|
|
2
|
+
import { ShapeDetails } from '../utils/Shapes.js';
|
|
3
|
+
export type ShapeSummary = {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description: string;
|
|
7
|
+
target: {
|
|
8
|
+
id: string;
|
|
9
|
+
};
|
|
10
|
+
extends?: {
|
|
11
|
+
id: string;
|
|
12
|
+
};
|
|
13
|
+
numInstances: number;
|
|
14
|
+
};
|
|
15
|
+
export declare class LincdAPI extends Shape {
|
|
16
|
+
static targetClass: import("@_linked/core/utils/NodeReference.js").NodeReferenceValue;
|
|
17
|
+
process(request: any, response: any, httpMethod: 'get' | 'post' | 'put' | 'delete'): Promise<void>;
|
|
18
|
+
get_shape_details({ shapes, }: {
|
|
19
|
+
shapes: string[];
|
|
20
|
+
}): Record<string, ShapeDetails>;
|
|
21
|
+
get_all_shapes(): Promise<{
|
|
22
|
+
shapes: Record<string, ShapeDetails>;
|
|
23
|
+
defaultGraph: string;
|
|
24
|
+
}>;
|
|
25
|
+
post_select({ query }: {
|
|
26
|
+
query: any;
|
|
27
|
+
}): Promise<unknown>;
|
|
28
|
+
post_create({ query }: {
|
|
29
|
+
query: any;
|
|
30
|
+
}): Promise<unknown>;
|
|
31
|
+
post_update({ query }: {
|
|
32
|
+
query: any;
|
|
33
|
+
}): Promise<unknown>;
|
|
34
|
+
post_delete({ query }: {
|
|
35
|
+
query: any;
|
|
36
|
+
}): Promise<import("@_linked/core/queries/DeleteQuery.js").DeleteResponse>;
|
|
37
|
+
post_select_raw({ query }: {
|
|
38
|
+
query: any;
|
|
39
|
+
}): Promise<void | import("@_linked/core/sparql/resultMapping.js").SparqlJsonResults>;
|
|
40
|
+
private checkRawQuerySupport;
|
|
41
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
9
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
10
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
11
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
12
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
13
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
14
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.LincdAPI = void 0;
|
|
19
|
+
const Shape_1 = require("@_linked/core/shapes/Shape");
|
|
20
|
+
const package_js_1 = require("../package.js");
|
|
21
|
+
const lincd_server_js_1 = require("../ontologies/lincd-server.js");
|
|
22
|
+
const JSONParser_1 = require("@_linked/server-utils/utils/JSONParser");
|
|
23
|
+
const LinkedStorage_1 = require("@_linked/core/utils/LinkedStorage");
|
|
24
|
+
const JSONWriter_1 = require("@_linked/server-utils/utils/JSONWriter");
|
|
25
|
+
const cached_1 = require("@_linked/core/utils/cached");
|
|
26
|
+
const Shapes_js_1 = require("../utils/Shapes.js");
|
|
27
|
+
const cacheTime = process.env.NODE_ENV === 'development' ? 0 : Infinity;
|
|
28
|
+
let LincdAPI = class LincdAPI extends Shape_1.Shape {
|
|
29
|
+
process(request, response, httpMethod) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
let { method, action } = request.params;
|
|
32
|
+
const body = JSONParser_1.JSONParser.parseObject(request.body);
|
|
33
|
+
//replace - with _ in action names
|
|
34
|
+
let localMethod = httpMethod + '_' + method.replace(/-/g, '_');
|
|
35
|
+
if (typeof this[localMethod] !== 'function') {
|
|
36
|
+
throw new Error('Unknown method: ' + localMethod);
|
|
37
|
+
}
|
|
38
|
+
//TODO: access rights, check if the current user is allowed to execute this method
|
|
39
|
+
try {
|
|
40
|
+
const result = yield this[localMethod](body, request, response);
|
|
41
|
+
if (typeof result !== 'undefined' || !response.headersSent) {
|
|
42
|
+
const jsonObject = JSONWriter_1.JSONWriter.toJsObject(result);
|
|
43
|
+
response.json(jsonObject);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
console.error(`Error while processing ${localMethod}:`, error);
|
|
48
|
+
if (!response.headersSent) {
|
|
49
|
+
const message = error instanceof Error ? error.message : 'Unknown server error';
|
|
50
|
+
response.status(500).json({ error: message });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
get_shape_details({ shapes, }) {
|
|
56
|
+
return (0, cached_1.cached)(() => {
|
|
57
|
+
const shapeIndex = (0, Shapes_js_1.getShapeIndex)();
|
|
58
|
+
const filteredShapeIndex = {};
|
|
59
|
+
for (const shapeId of shapes) {
|
|
60
|
+
if (shapeIndex[shapeId]) {
|
|
61
|
+
filteredShapeIndex[shapeId] = shapeIndex[shapeId];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
return filteredShapeIndex;
|
|
65
|
+
}, [shapes], cacheTime);
|
|
66
|
+
}
|
|
67
|
+
get_all_shapes() {
|
|
68
|
+
return (0, cached_1.cached)(() => __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
var _a;
|
|
70
|
+
const shapeIndex = (0, Shapes_js_1.getShapeIndex)();
|
|
71
|
+
const typesWithInstances = new Map();
|
|
72
|
+
this.checkRawQuerySupport();
|
|
73
|
+
yield LinkedStorage_1.LinkedStorage.getDefaultDataset()
|
|
74
|
+
.rawQuery(`SELECT (COUNT(?s) AS ?count) ?type WHERE { ?s a ?type } GROUP BY ?type`)
|
|
75
|
+
.then((results) => {
|
|
76
|
+
if (!results)
|
|
77
|
+
return;
|
|
78
|
+
results.results.bindings.forEach((binding) => {
|
|
79
|
+
if (binding.type && binding.type.value) {
|
|
80
|
+
typesWithInstances.set(binding.type.value, parseInt(binding.count.value));
|
|
81
|
+
}
|
|
82
|
+
});
|
|
83
|
+
})
|
|
84
|
+
.catch(console.error);
|
|
85
|
+
const shapesWithInstances = {};
|
|
86
|
+
for (const shapeId in shapeIndex) {
|
|
87
|
+
const shape = shapeIndex[shapeId];
|
|
88
|
+
shapesWithInstances[shapeId] = Object.assign(Object.assign({}, shape), { numInstances: typesWithInstances.get((_a = shape.targetClass) === null || _a === void 0 ? void 0 : _a.id) || 0 });
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
shapes: shapesWithInstances,
|
|
92
|
+
defaultGraph: process.env.DATA_ROOT,
|
|
93
|
+
};
|
|
94
|
+
}), [], cacheTime);
|
|
95
|
+
}
|
|
96
|
+
post_select({ query }) {
|
|
97
|
+
return LinkedStorage_1.LinkedStorage.selectQuery(query);
|
|
98
|
+
}
|
|
99
|
+
post_create({ query }) {
|
|
100
|
+
return LinkedStorage_1.LinkedStorage.createQuery(query);
|
|
101
|
+
}
|
|
102
|
+
post_update({ query }) {
|
|
103
|
+
return LinkedStorage_1.LinkedStorage.updateQuery(query);
|
|
104
|
+
}
|
|
105
|
+
post_delete({ query }) {
|
|
106
|
+
return LinkedStorage_1.LinkedStorage.deleteQuery(query);
|
|
107
|
+
}
|
|
108
|
+
post_select_raw({ query }) {
|
|
109
|
+
this.checkRawQuerySupport();
|
|
110
|
+
return LinkedStorage_1.LinkedStorage.getDefaultDataset().rawQuery(query);
|
|
111
|
+
}
|
|
112
|
+
checkRawQuerySupport() {
|
|
113
|
+
if (!LinkedStorage_1.LinkedStorage.getDefaultDataset().rawQuery) {
|
|
114
|
+
throw new Error(`Default store (${Object.getPrototypeOf(LinkedStorage_1.LinkedStorage.getDefaultDataset()).constructor
|
|
115
|
+
.name}) does not support raw SPARQL queries`);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
exports.LincdAPI = LincdAPI;
|
|
120
|
+
LincdAPI.targetClass = lincd_server_js_1.lincdServer.LincdAPI;
|
|
121
|
+
exports.LincdAPI = LincdAPI = __decorate([
|
|
122
|
+
package_js_1.linkedShape
|
|
123
|
+
], LincdAPI);
|
|
124
|
+
//# sourceMappingURL=LincdAPI.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LincdAPI.js","sourceRoot":"","sources":["../../../src/shapes/LincdAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,sDAAmD;AACnD,8CAA4C;AAC5C,mEAA4D;AAC5D,uEAAoE;AACpE,qEAAkE;AAClE,uEAAoE;AACpE,uDAAoD;AACpD,kDAAiE;AAGjE,MAAM,SAAS,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QA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