dbm-graph-api 1.1.11 → 1.1.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dbm-graph-api",
3
- "version": "1.1.11",
3
+ "version": "1.1.12",
4
4
  "main": "index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -13,7 +13,7 @@
13
13
  "dependencies": {
14
14
  "@aws-sdk/client-s3": "^3.741.0",
15
15
  "@aws-sdk/s3-request-presigner": "^3.741.0",
16
- "dbm": "^1.1.7",
16
+ "dbm": "^1.1.8",
17
17
  "mime": "^4.0.6",
18
18
  "sharp": "^0.33.5",
19
19
  "ws": "^8.18.0"
@@ -0,0 +1,27 @@
1
+ import Dbm from "dbm";
2
+
3
+ export default class Breadcrumb extends Dbm.core.BaseObject {
4
+ _construct() {
5
+ super._construct();
6
+ }
7
+
8
+ async getData(aData, aEncodeSession) {
9
+ let returnObject = {};
10
+
11
+ let url = aData["path"];
12
+ if(url[url.length-1] !== "/") {
13
+ url += "/";
14
+ }
15
+
16
+ let database = Dbm.getInstance().repository.getItem("graphDatabase").controller;
17
+ let urlObject = await database.getObjectByUrl(url);
18
+
19
+ if(urlObject) {
20
+
21
+ await aEncodeSession.encodeSingleWithTypes(urlObject.id, ["breadcrumb"]);
22
+ returnObject["id"] = urlObject.id;
23
+ }
24
+
25
+ return returnObject;
26
+ }
27
+ }
@@ -3,6 +3,7 @@ export {default as UploadS3} from "./UploadS3.js";
3
3
  export {default as FreeUrl} from "./FreeUrl.js";
4
4
  export {default as SeoSummary} from "./SeoSummary.js";
5
5
  export {default as AltText} from "./AltText.js";
6
+ export {default as Breadcrumb} from "./Breadcrumb.js";
6
7
 
7
8
  import UploadS3 from "./UploadS3.js";
8
9
 
@@ -181,6 +181,9 @@ export let registerDataFunction = function(aName, aDataFunction) {
181
181
 
182
182
  let fullDataSetup = function() {
183
183
  registerDataFunction("example", new DbmGraphApi.data.Example());
184
+
185
+ registerDataFunction("breadcrumb", new DbmGraphApi.data.Breadcrumb());
186
+
184
187
  registerDataFunction("admin/freeUrl", new DbmGraphApi.data.FreeUrl());
185
188
  registerDataFunction("admin/seoSummary", new DbmGraphApi.data.SeoSummary());
186
189
  registerDataFunction("admin/altText", new DbmGraphApi.data.AltText());