dbm-graph-api 1.1.43 → 1.1.45

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.43",
3
+ "version": "1.1.45",
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.4.2",
16
+ "dbm": "^1.4.4",
17
17
  "mime": "^4.0.6",
18
18
  "sharp": "^0.33.5",
19
19
  "ws": "^8.18.0"
@@ -22,12 +22,13 @@ export default class ProcessActions extends Dbm.core.BaseObject {
22
22
  let actionType = await action.getSingleLinkedType("type/actionType");
23
23
 
24
24
  let processActionItem = Dbm.getInstance().repository.getItemIfExists("graphApi/processAction/" + actionType);
25
-
25
+
26
26
  if(processActionItem) {
27
27
  await processActionItem.controller.process(action);
28
28
  await action.changeLinkedType("status/actionStatus", "done");
29
29
  }
30
30
  else {
31
+ console.warn("No action of type", actionType);
31
32
  await action.changeLinkedType("status/actionStatus", "noAction");
32
33
  }
33
34
 
@@ -7,6 +7,6 @@ export default class SetIdentifier extends EditBaseObject {
7
7
  }
8
8
 
9
9
  async performChange(aObject, aData, aRequest) {
10
- await aObject.setIdentifier(aData["value"]);
10
+ await aObject.updateIdentifier(aData["value"]);
11
11
  }
12
12
  }
@@ -0,0 +1,28 @@
1
+ import Dbm from "dbm";
2
+
3
+ export default class SendEmail extends Dbm.core.BaseObject {
4
+ _construct() {
5
+ super._construct();
6
+ }
7
+
8
+ async process(aAction) {
9
+ //console.log("SendEmail:process");
10
+ //console.log(aAction);
11
+
12
+ let fields = await aAction.getFields();
13
+ let data = fields["data"];
14
+
15
+ let message = this.item.client.controller.createMessage();
16
+
17
+ message.setTo(data["to"]);
18
+ if(data["from"]) {
19
+ message.setFrom(data["from"]);
20
+ }
21
+
22
+ message.setSubject(data["subject"]);
23
+ message.setTextContent(data["textContent"]);
24
+ message.setHtmlContent(data["htmlContent"]);
25
+
26
+ await message.send();
27
+ }
28
+ }
@@ -0,0 +1,13 @@
1
+ export {default as SendEmail} from "./SendEmail.js";
2
+ import DbmGraphApi from "../../../../index.js";
3
+
4
+ export const setupEmail = function(aClient) {
5
+ //console.log("setupEmail");
6
+
7
+ let action = new DbmGraphApi.processAction.communication.SendEmail();
8
+ action.item.setValue("client", aClient);
9
+
10
+ DbmGraphApi.registerProcessActionFunction("sendEmail", action);
11
+
12
+ return action;
13
+ }
@@ -1,6 +1,7 @@
1
1
  export * as pageUpdates from "./pageUpdates/index.js";
2
2
  export * as httpRequests from "./httpRequests/index.js";
3
3
  export * as actionGroup from "./actionGroup/index.js";
4
+ export * as communication from "./communication/index.js";
4
5
 
5
6
  export {default as Example} from "./Example.js";
6
7
  export {default as HandleFormSubmission} from "./HandleFormSubmission.js";