@blocklet/launcher-util 2.5.12 → 2.5.13

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.
@@ -1,23 +1,23 @@
1
- import n from "@blocklet/sdk/service/notification";
2
- class f {
3
- constructor({ logger: o, auth: i }) {
4
- this.auth = i, this.logger = o || { info: console.info, error: console.error };
1
+ import c from "@blocklet/sdk/service/notification";
2
+ class h {
3
+ constructor({ logger: o, auth: e }) {
4
+ this.auth = e, this.logger = o || { info: console.info, error: console.error };
5
5
  }
6
- async sendNotification({ to: o, title: i, message: e, actions: a, attachments: s = [], assetAddress: r }) {
6
+ async sendNotification({ to: o, title: e, message: i, actions: a, attachments: s = [], assetAddress: r, allowUnsubscribe: n = !1 }) {
7
7
  try {
8
- const t = { title: i, body: e, actions: a || [], attachments: [...s] };
8
+ const t = { title: e, body: i, actions: a || [], attachments: [...s] };
9
9
  typeof r < "u" && t.attachments.push({
10
10
  type: "asset",
11
11
  data: {
12
12
  chainHost: this.auth.chainHost,
13
13
  did: r
14
14
  }
15
- }), await n.sendToUser(o, t), this.logger.info("text message was sent", { to: o, payload: JSON.stringify(t, null, 2) });
15
+ }), await c.sendToUser(o, t, { allowUnsubscribe: n }), this.logger.info("text message was sent", { to: o, payload: JSON.stringify(t, null, 2) });
16
16
  } catch (t) {
17
- throw this.logger.error("send text message failed", { error: t, to: o, message: e, actions: a, attachments: s }), t;
17
+ throw this.logger.error("send text message failed", { error: t, to: o, message: i, actions: a, attachments: s }), t;
18
18
  }
19
19
  }
20
20
  }
21
21
  export {
22
- f as default
22
+ h as default
23
23
  };
@@ -1 +1 @@
1
- "use strict";const n=require("@blocklet/sdk/service/notification");class c{constructor({logger:o,auth:e}){this.auth=e,this.logger=o||{info:console.info,error:console.error}}async sendNotification({to:o,title:e,message:i,actions:s,attachments:r=[],assetAddress:a}){try{const t={title:e,body:i,actions:s||[],attachments:[...r]};typeof a<"u"&&t.attachments.push({type:"asset",data:{chainHost:this.auth.chainHost,did:a}}),await n.sendToUser(o,t),this.logger.info("text message was sent",{to:o,payload:JSON.stringify(t,null,2)})}catch(t){throw this.logger.error("send text message failed",{error:t,to:o,message:i,actions:s,attachments:r}),t}}}module.exports=c;
1
+ "use strict";const c=require("@blocklet/sdk/service/notification");class l{constructor({logger:o,auth:e}){this.auth=e,this.logger=o||{info:console.info,error:console.error}}async sendNotification({to:o,title:e,message:i,actions:s,attachments:a=[],assetAddress:r,allowUnsubscribe:n=!1}){try{const t={title:e,body:i,actions:s||[],attachments:[...a]};typeof r<"u"&&t.attachments.push({type:"asset",data:{chainHost:this.auth.chainHost,did:r}}),await c.sendToUser(o,t,{allowUnsubscribe:n}),this.logger.info("text message was sent",{to:o,payload:JSON.stringify(t,null,2)})}catch(t){throw this.logger.error("send text message failed",{error:t,to:o,message:i,actions:s,attachments:a}),t}}}module.exports=l;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/launcher-util",
3
- "version": "2.5.12",
3
+ "version": "2.5.13",
4
4
  "description": "Common constants",
5
5
  "keywords": [
6
6
  "constant"
@@ -51,5 +51,5 @@
51
51
  "vite-plugin-build": "^0.10.0",
52
52
  "vite-plugin-no-bundle": "^4.0.0"
53
53
  },
54
- "gitHead": "427495f76896e5178e2248d7c6ebdd8a9c3d3d3b"
54
+ "gitHead": "e079d7a16c5f7040b82f282b0474c44b7dbe72d4"
55
55
  }