@nocobase/plugin-notification-manager 2.1.0-alpha.13 → 2.1.0-alpha.15
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/dist/client/index.js +1 -1
- package/dist/externalVersion.js +8 -7
- package/dist/server/base-notification-channel.d.ts +3 -1
- package/dist/server/manager.d.ts +35 -4
- package/dist/server/manager.js +117 -14
- package/dist/server/plugin.d.ts +36 -2
- package/dist/server/plugin.js +65 -2
- package/dist/server/types.d.ts +6 -3
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@formily/core"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-notification-manager",["react-i18next","@formily/antd-v5","@formily/react","@ant-design/icons","@nocobase/flow-engine","@formily/core","@formily/shared","react","antd","@nocobase/client","@nocobase/utils/client"],t):"object"==typeof exports?exports["@nocobase/plugin-notification-manager"]=t(require("react-i18next"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("@formily/core"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/utils/client")):e["@nocobase/plugin-notification-manager"]=t(e["react-i18next"],e["@formily/antd-v5"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e["@formily/core"],e["@formily/shared"],e.react,e.antd,e["@nocobase/client"],e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,i,a,u,l,c,s){return function(){"use strict";var f,p,y,b={265:function(e,t,n){n.r(t),n.d(t,{UserAddition:function(){return E},PluginNotificationManagerClient:function(){return U},NotificationVariableContext:function(){return b},ContentConfigForm:function(){return C},default:function(){return $},useNotificationVariableOptions:function(){return m},UserSelect:function(){return P},MessageConfigForm:function(){return w},NotificationVariableProvider:function(){return v}});var r=n(342),o=n(872),i=n(803),a=n(768),u=function(){var e;function t(){var e,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");e="channelTypes",n=new a.Registry,e in this?Object.defineProperty(this,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[e]=n}return e=[{key:"registerChannelType",value:function(e){this.channelTypes.register(e.type,e)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}();n(452);var l=n(230),c=n(59),s=n(155),f=n.n(s);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,s.createContext)({typeMap:{}}).displayName="ChannelTypesContext";var y=function(){var e=(0,o.yr)().t,t=(0,r.usePlugin)($),n={},i=!0,a=!1,u=void 0;try{for(var c,s=t.channelTypes.getEntities()[Symbol.iterator]();!(i=(c=s.next()).done);i=!0){var f,y=(f=c.value,function(e){if(Array.isArray(e))return e}(f)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(f)||function(e){if(e){if("string"==typeof e)return p(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,2)}}(f)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=(y[0],y[1]),m=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},b),{title:l.Schema.compile(b.title,{t:e})});n[b.type]=m}}catch(e){a=!0,u=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw u}}return n},b=(0,s.createContext)([]),m=function(){return{scope:(0,s.useContext)(b)}},v=function(e){var t=e.value,n=e.children;return f().createElement(b.Provider,{value:t},n)},d=n(418),h=n(553);function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}var w=(0,l.observer)(function(e){var t,n=e.variableOptions,i=(0,l.useField)().form.values.channelName,a=function(e){if(Array.isArray(e))return e}(t=(0,s.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return g(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=a[0],c=a[1],p=(0,o.yr)().t,b=(0,r.useAPIClient)();(0,s.useEffect)(function(){var e;(e=function(){var e,t;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:if(!i)return c(null),[2];return[4,b.request({url:"/".concat(h.L.channels,":get"),method:"get",params:{filterByTk:i}})];case 1:return c(null==(t=n.sent().data)||null==(e=t.data)?void 0:e.notificationType),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){O(i,r,o,a,u,"next",e)}function u(e){O(i,r,o,a,u,"throw",e)}a(void 0)})})()},[i,b]);var m=y(),v=((u?m[u]:{}).components||{}).MessageConfigForm,w={type:"void",properties:{channelName:{type:"string",title:'{{t("Channel")}}',required:!0,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{multiple:!1,manual:!1,fieldNames:{label:"title",value:"name"},service:{resource:h.L.channels,action:"list"},style:{width:"100%"}}},message:{type:"void","x-component":"MessageConfigForm","x-component-props":{variableOptions:n}}}};return f().createElement(r.SchemaComponent,{schema:w,components:{MessageConfigForm:void 0===v?function(){return null}:v,ArrayItems:d.ArrayItems},scope:{t:p}})},{displayName:"MessageConfigForm"}),S=n(694),C=(0,r.withDynamicSchemaProps)((0,S.observer)(function(e){var t,n=e.variableOptions,r=e.channelType,o=y(),i=((null==(t=r?o[r]:{})?void 0:t.components)||{}).ContentConfigForm;return f().createElement(void 0===i?function(){return null}:i,{variableOptions:n})},{displayName:"ContentConfigForm"}));function j(e){var t=e.value,n=e.onChange,o=e.variableOptions;return f().createElement(r.Variable.Input,{scope:o,value:t,onChange:n},f().createElement(r.RemoteSelect,{fieldNames:{label:"nickname",value:"id"},service:{resource:"users",defaultParams:t?{filter:{id:t}}:void 0},manual:!1,value:t,onChange:n}))}function x(e){var t=(0,l.useField)(),n=(0,r.useCollectionFilterOptions)("users"),o=(0,r.useToken)().token,i=(0,s.useCallback)(function(t){var n=t.value,o=t.onChange,i=t.renderSchemaComponent;return f().createElement(r.Variable.Input,{value:n,onChange:o,scope:e.variableOptions},i())},[e.variableOptions]);return f().createElement("div",{style:{border:"1px dashed ".concat(o.colorBorder),padding:o.paddingSM}},f().createElement(r.SchemaComponent,{basePath:t.address,schema:{type:"void",properties:{filter:{type:"object","x-component":"Filter","x-component-props":{options:n,dynamicComponent:i}}}}}))}function P(e){var t;return"object"==((t=e.value)&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)&&e.value?f().createElement(x,e):f().createElement(j,e)}var k=n(375);function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function E(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,s.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return A(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],r=t[1],i=(0,o.yr)().t,a=d.ArrayItems.useArray(),u=(0,l.useForm)(),p=(null==u?void 0:u.disabled)===!0,y=(0,s.useCallback)(function(){a.field.push(""),r(!1)},[a.field]),b=(0,s.useCallback)(function(){a.field.push({filter:{}}),r(!1)},[a.field]),m=f().createElement(c.Button,{icon:f().createElement(k.PlusOutlined,null),type:"dashed",block:!0,disabled:p,className:"ant-formily-array-base-addition"},i("Add user"));return p?m:f().createElement(c.Popover,{open:n,onOpenChange:r,content:f().createElement(c.Space,{direction:"vertical",size:"small"},f().createElement(c.Button,{type:"text",onClick:y},i("Select users")),f().createElement(c.Button,{type:"text",onClick:b},i("Query users")))},m)}function T(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function I(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){T(i,r,o,a,u,"next",e)}function u(e){T(i,r,o,a,u,"throw",e)}a(void 0)})}}function M(e,t,n){return(M=B()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&q(o,n.prototype),o}).apply(null,arguments)}function N(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _(e){return(_=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e){var t="function"==typeof Map?new Map:void 0;return(F=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return M(e,arguments,_(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),q(n,e)})(e)}function B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(B=function(){return!!e})()}function D(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var R=(0,r.lazy)(function(){return n.e("89").then(n.bind(n,840))},"ChannelManager").ChannelManager,V=(0,r.lazy)(function(){return n.e("507").then(n.bind(n,894))},"LogManager").LogManager,L="notification-manager",U=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=_(t),N(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,B()?Reflect.construct(t,r||[],_(this).constructor):t.apply(this,r)),"manager",void 0),N(e,"useNotificationTypes",i.aO),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&q(n,e),t=[{key:"channelTypes",get:function(){return this.manager.channelTypes}},{key:"registerChannelType",value:function(e){this.manager.registerChannelType(e)}},{key:"afterAdd",value:function(){return I(function(){return D(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return I(function(){return D(this,function(e){return this.manager=new u,[2]})}).call(this)}},{key:"load",value:function(){return I(function(){return D(this,function(e){return this.app.pluginSettingsManager.add(L,{title:(0,o.vV)("Notification manager"),icon:"NotificationOutlined",aclSnippet:"pm.notification"}),this.app.pluginSettingsManager.add("".concat(L,".channels"),{title:(0,o.vV)("Channels"),Component:R,aclSnippet:"pm.notification.channels",sort:1}),this.app.pluginSettingsManager.add("".concat(L,".logs"),{title:(0,o.vV)("Logs"),Component:V,aclSnippet:"pm.notification.logs",sort:3}),[2]})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(F(r.Plugin)),$=U},842:function(e,t,n){n.d(t,{CW:function(){return l},Ox:function(){return u},Uz:function(){return a},nB:function(){return c}});var r=n(155),o=n.n(r);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var a=(0,r.createContext)({name:"",setName:function(){}});a.displayName="ChannelTypeContext";var u=(0,r.createContext)({channelTypes:[]});u.displayName="ChannelTypesContext";var l=function(){return(0,r.useContext)(u).channelTypes};function c(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,r.useState)(""))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return i(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],u=t[1];return{name:n,setName:u,NotificationTypeNameProvider:function(e){var t=e.children;return o().createElement(a.Provider,{value:{name:n,setName:u}},t)}}}},803:function(e,t,n){n.d(t,{Gu:function(){return j},W2:function(){return O},Y1:function(){return g},Y2:function(){return S},aO:function(){return x},cJ:function(){return C},ru:function(){return w},wx:function(){return h}});var r=n(452),o=n(230),i=n(166),a=n(342),u=n(59),l=n(155),c=n(265),s=n(872),f=n(842);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){y(i,r,o,a,u,"next",e)}function u(e){y(i,r,o,a,u,"throw",e)}a(void 0)})}}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function d(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var h=function(){var e=(0,a.useActionContext)(),t=e.setVisible,n=e.setSubmitted;u.App.useApp().message;var r=(0,o.useForm)(),i=(0,a.useDataBlockResource)(),l=(0,a.useBlockRequestContext)().service;return{type:"primary",onClick:function(e,o){return b(function(){var e,a,u,c,s,f,p,y,b;return d(this,function(d){switch(d.label){case 0:return[4,r.submit()];case 1:return d.sent(),a=r.values,[4,i.create({values:a})];case 2:return d.sent(),s=void 0===(c=(u=(null==l||null==(e=l.data)?void 0:e.meta)||{}).count)?0:c,p=void 0===(f=u.page)?0:f,s%(void 0===(y=u.pageSize)?0:y)==1&&1!==p&&l.run(v(m({},null==l||null==(b=l.params)?void 0:b[0]),{page:p-1})),o&&(null==o||o()),null==n||n(!0),null==t||t(!1),[2]}})})()}}},g=function(){var e=(0,a.useActionContext)(),t=e.setVisible,n=e.setSubmitted;u.App.useApp().message;var r=(0,o.useForm)(),i=(0,a.useDataBlockResource)(),l=(0,a.useBlockRequestContext)().service,c=(0,a.useCollection)();return{type:"primary",onClick:function(e,o){return b(function(){var e,a,u,s,f,p,y,b,h;return d(this,function(d){switch(d.label){case 0:return[4,r.submit()];case 1:return d.sent(),a=r.values,[4,i.update({values:a,filterByTk:a[c.filterTargetKey]})];case 2:return d.sent(),f=void 0===(s=(u=(null==l||null==(e=l.data)?void 0:e.meta)||{}).count)?0:s,y=void 0===(p=u.page)?0:p,f%(void 0===(b=u.pageSize)?0:b)==1&&1!==y&&l.run(v(m({},null==l||null==(h=l.params)?void 0:h[0]),{page:y-1})),o&&(null==o||o()),null==n||n(!0),null==t||t(!1),[2]}})})()}}},O=function(){var e=(0,a.useCollectionRecordData)();return{form:(0,l.useMemo)(function(){return(0,r.createForm)({initialValues:e})},[])}},w=function(){var e,t=(0,a.useCollectionRecordData)(),n=null==t||null==(e=t.meta)?void 0:e.editable,r={};return!1===n&&(r.display="none"),{style:r}},S=function(){var e,t=(0,a.useCollectionRecordData)(),n=null==t||null==(e=t.meta)?void 0:e.deletable,r={},o=(0,a.useDestroyActionProps)();return!1===n&&(r.display="none"),v(m({},o),{style:r})},C=function(){(0,a.useActionContext)();var e=(0,l.useContext)(f.Uz).name;return{form:(0,l.useMemo)(function(){return(0,r.createForm)({values:{name:"s_".concat((0,i.uid)()),notificationType:e}})},[e])}},j=function(){var e=(0,a.useActionContext)().setVisible;return{type:"default",onClick:function(){e(!1)}}},x=function(){var e=(0,s.yr)().t,t=(0,a.usePlugin)(c.PluginNotificationManagerClient),n=[],r=!0,i=!1,u=void 0;try{for(var l,f=t.channelTypes.getEntities()[Symbol.iterator]();!(r=(l=f.next()).done);r=!0){var y,b=(y=l.value,function(e){if(Array.isArray(e))return e}(y)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(y)||function(e){if(e){if("string"==typeof e)return p(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,2)}}(y)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=(b[0],b[1]),h=o.Schema.compile(d.title,{t:e}),g=v(m({},d),{name:d.type,key:d.type,value:d.type,title:h,label:h});n.push(g)}}catch(e){i=!0,u=e}finally{try{r||null==f.return||f.return()}finally{if(i)throw u}}return n}},872:function(e,t,n){n.d(t,{vV:function(){return a},yr:function(){return u}});var r=n(342),o=n(953),i="notification-manager";function a(e){return r.i18n.t(e,{ns:i})}function u(){return(0,o.useTranslation)([i,"client","data-source-manager"],{nsMode:"fallback"})}},553:function(e,t,n){n.d(t,{L:function(){return o}});var r,o=((r={}).templates="templates",r.channels="notificationChannels",r.messages="messages",r.logs="notificationSendLogs",r)},375:function(e){e.exports=r},418:function(e){e.exports=t},452:function(e){e.exports=i},230:function(e){e.exports=n},166:function(e){e.exports=a},342:function(e){e.exports=c},694:function(e){e.exports=o},768:function(e){e.exports=s},59:function(e){e.exports=l},155:function(e){e.exports=u},953:function(t){t.exports=e},0:function(e,t,n){var r=window.__nocobase_public_path__||"";if(!r&&window.location&&window.location.pathname){var o=window.location.pathname||"/",i=o.indexOf("/v2/");r=i>=0?o.slice(0,i+1):"/"}r&&(r=r.replace(/\/v2\/?$/,"/")),r||(r="/"),"/"!==r.charAt(r.length-1)&&(r+="/"),n.p=r+"static/plugins/@nocobase/plugin-notification-manager/dist/client/"}},m={};function v(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return b[e](n,n.exports,v),n.exports}v.m=b,v.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(t,{a:t}),t},v.d=function(e,t){for(var n in t)v.o(t,n)&&!v.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},v.f={},v.e=function(e){return Promise.all(Object.keys(v.f).reduce(function(t,n){return v.f[n](e,t),t},[]))},v.u=function(e){return""+({507:"20cb970c942de0b9",89:"26913f9f8472d82e"})[e]+".js"},v.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),v.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d={},v.l=function(e,t,n,r){if(d[e])return void d[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-notification-manager:"+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,v.nc&&o.setAttribute("nonce",v.nc),o.setAttribute("data-rspack","@nocobase/plugin-notification-manager:"+n),o.src=e),d[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=d[e];if(delete d[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},v.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},v.g.importScripts&&(h=v.g.location+"");var d,h,g=v.g.document;if(!h&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(h=g.currentScript.src),!h)){var O=g.getElementsByTagName("script");if(O.length)for(var w=O.length-1;w>-1&&(!h||!/^http(s?):/.test(h));)h=O[w--].src}if(!h)throw Error("Automatic publicPath is not supported in this browser");return v.p=h.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},v.f.j=function(e,t){var n=v.o(f,e)?f[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=v.p+v.u(e),i=Error();v.l(o,function(t){if(v.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},p=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==f[e]})){for(n in i)v.o(i,n)&&(v.m[n]=i[n]);a&&a(v)}for(e&&e(t);u<o.length;u++)r=o[u],v.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(y=self.webpackChunk_nocobase_plugin_notification_manager=self.webpackChunk_nocobase_plugin_notification_manager||[]).forEach(p.bind(null,0)),y.push=p.bind(null,y.push.bind(y)),v(0),v(265)}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@formily/core"),require("@formily/shared"),require("react"),require("antd"),require("@formily/antd-v5"),require("@nocobase/client"),require("@formily/react"),require("@nocobase/flow-engine"),require("@nocobase/utils/client"),require("@ant-design/icons")):"function"==typeof define&&define.amd?define("@nocobase/plugin-notification-manager",["react-i18next","@formily/core","@formily/shared","react","antd","@formily/antd-v5","@nocobase/client","@formily/react","@nocobase/flow-engine","@nocobase/utils/client","@ant-design/icons"],t):"object"==typeof exports?exports["@nocobase/plugin-notification-manager"]=t(require("react-i18next"),require("@formily/core"),require("@formily/shared"),require("react"),require("antd"),require("@formily/antd-v5"),require("@nocobase/client"),require("@formily/react"),require("@nocobase/flow-engine"),require("@nocobase/utils/client"),require("@ant-design/icons")):e["@nocobase/plugin-notification-manager"]=t(e["react-i18next"],e["@formily/core"],e["@formily/shared"],e.react,e.antd,e["@formily/antd-v5"],e["@nocobase/client"],e["@formily/react"],e["@nocobase/flow-engine"],e["@nocobase/utils/client"],e["@ant-design/icons"])}(self,function(e,t,n,r,o,i,a,u,l,c,s){return function(){"use strict";var f,p,y,b={265:function(e,t,n){n.r(t),n.d(t,{UserAddition:function(){return E},PluginNotificationManagerClient:function(){return L},NotificationVariableContext:function(){return b},ContentConfigForm:function(){return C},default:function(){return U},useNotificationVariableOptions:function(){return m},UserSelect:function(){return P},MessageConfigForm:function(){return w},NotificationVariableProvider:function(){return v}});var r=n(342),o=n(872),i=n(803),a=n(768),u=function(){var e;function t(){var e,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");e="channelTypes",n=new a.Registry,e in this?Object.defineProperty(this,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):this[e]=n}return e=[{key:"registerChannelType",value:function(e){this.channelTypes.register(e.type,e)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(t.prototype,e),t}();n(452);var l=n(230),c=n(59),s=n(155),f=n.n(s);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}(0,s.createContext)({typeMap:{}}).displayName="ChannelTypesContext";var y=function(){var e=(0,o.yr)().t,t=(0,r.usePlugin)(U),n={},i=!0,a=!1,u=void 0;try{for(var c,s=t.channelTypes.getEntities()[Symbol.iterator]();!(i=(c=s.next()).done);i=!0){var f,y=(f=c.value,function(e){if(Array.isArray(e))return e}(f)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(f)||function(e){if(e){if("string"==typeof e)return p(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,2)}}(f)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),b=(y[0],y[1]),m=function(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},b),{title:l.Schema.compile(b.title,{t:e})});n[b.type]=m}}catch(e){a=!0,u=e}finally{try{i||null==s.return||s.return()}finally{if(a)throw u}}return n},b=(0,s.createContext)([]),m=function(){return{scope:(0,s.useContext)(b)}},v=function(e){var t=e.value,n=e.children;return f().createElement(b.Provider,{value:t},n)},d=n(418),h=n(553);function g(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function O(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}var w=(0,l.observer)(function(e){var t,n=e.variableOptions,i=(0,l.useField)().form.values.channelName,a=function(e){if(Array.isArray(e))return e}(t=(0,s.useState)(null))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return g(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return g(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),u=a[0],c=a[1],p=(0,o.yr)().t,b=(0,r.useAPIClient)();(0,s.useEffect)(function(){var e;(e=function(){var e,t;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:if(!i)return c(null),[2];return[4,b.request({url:"/".concat(h.L.channels,":get"),method:"get",params:{filterByTk:i}})];case 1:return c(null==(t=n.sent().data)||null==(e=t.data)?void 0:e.notificationType),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){O(i,r,o,a,u,"next",e)}function u(e){O(i,r,o,a,u,"throw",e)}a(void 0)})})()},[i,b]);var m=y(),v=((u?m[u]:{}).components||{}).MessageConfigForm,w={type:"void",properties:{channelName:{type:"string",title:'{{t("Channel")}}',required:!0,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{multiple:!1,manual:!1,fieldNames:{label:"title",value:"name"},service:{resource:h.L.channels,action:"list"},style:{width:"100%"}}},message:{type:"void","x-component":"MessageConfigForm","x-component-props":{variableOptions:n}}}};return f().createElement(r.SchemaComponent,{schema:w,components:{MessageConfigForm:void 0===v?function(){return null}:v,ArrayItems:d.ArrayItems},scope:{t:p}})},{displayName:"MessageConfigForm"}),S=n(694),C=(0,r.withDynamicSchemaProps)((0,S.observer)(function(e){var t,n=e.variableOptions,r=e.channelType,o=y(),i=((null==(t=r?o[r]:{})?void 0:t.components)||{}).ContentConfigForm;return f().createElement(void 0===i?function(){return null}:i,{variableOptions:n})},{displayName:"ContentConfigForm"}));function j(e){var t=e.value,n=e.onChange,o=e.variableOptions;return f().createElement(r.Variable.Input,{scope:o,value:t,onChange:n},f().createElement(r.RemoteSelect,{fieldNames:{label:"nickname",value:"id"},service:{resource:"users",defaultParams:t?{filter:{id:t}}:void 0},manual:!1,value:t,onChange:n}))}function x(e){var t=(0,l.useField)(),n=(0,r.useCollectionFilterOptions)("users"),o=(0,r.useToken)().token,i=(0,s.useCallback)(function(t){var n=t.value,o=t.onChange,i=t.renderSchemaComponent;return f().createElement(r.Variable.Input,{value:n,onChange:o,scope:e.variableOptions},i())},[e.variableOptions]);return f().createElement("div",{style:{border:"1px dashed ".concat(o.colorBorder),padding:o.paddingSM}},f().createElement(r.SchemaComponent,{basePath:t.address,schema:{type:"void",properties:{filter:{type:"object","x-component":"Filter","x-component-props":{options:n,dynamicComponent:i}}}}}))}function P(e){var t;return"object"==((t=e.value)&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)&&e.value?f().createElement(x,e):f().createElement(j,e)}var k=n(375);function A(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function E(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,s.useState)(!1))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return A(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],r=t[1],i=(0,o.yr)().t,a=d.ArrayItems.useArray(),u=(0,l.useForm)(),p=(null==u?void 0:u.disabled)===!0,y=(0,s.useCallback)(function(){a.field.push(""),r(!1)},[a.field]),b=(0,s.useCallback)(function(){a.field.push({filter:{}}),r(!1)},[a.field]),m=f().createElement(c.Button,{icon:f().createElement(k.PlusOutlined,null),type:"dashed",block:!0,disabled:p,className:"ant-formily-array-base-addition"},i("Add user"));return p?m:f().createElement(c.Popover,{open:n,onOpenChange:r,content:f().createElement(c.Space,{direction:"vertical",size:"small"},f().createElement(c.Button,{type:"text",onClick:y},i("Select users")),f().createElement(c.Button,{type:"text",onClick:b},i("Query users")))},m)}function T(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function _(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){T(i,r,o,a,u,"next",e)}function u(e){T(i,r,o,a,u,"throw",e)}a(void 0)})}}function I(e,t,n){return(I=B()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&q(o,n.prototype),o}).apply(null,arguments)}function M(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function N(e){return(N=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e){var t="function"==typeof Map?new Map:void 0;return(F=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return I(e,arguments,N(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),q(n,e)})(e)}function B(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(B=function(){return!!e})()}function D(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var R=(0,r.lazy)(function(){return n.e("89").then(n.bind(n,840))},"ChannelManager").ChannelManager,V=(0,r.lazy)(function(){return n.e("507").then(n.bind(n,894))},"LogManager").LogManager,$="notification-manager",L=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=N(t),M(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,B()?Reflect.construct(t,r||[],N(this).constructor):t.apply(this,r)),"manager",void 0),M(e,"useNotificationTypes",i.aO),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&q(n,e),t=[{key:"channelTypes",get:function(){return this.manager.channelTypes}},{key:"registerChannelType",value:function(e){this.manager.registerChannelType(e)}},{key:"afterAdd",value:function(){return _(function(){return D(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return _(function(){return D(this,function(e){return this.manager=new u,[2]})}).call(this)}},{key:"load",value:function(){return _(function(){return D(this,function(e){return this.app.pluginSettingsManager.add($,{title:(0,o.vV)("Notification manager"),icon:"NotificationOutlined",aclSnippet:"pm.notification"}),this.app.pluginSettingsManager.add("".concat($,".channels"),{title:(0,o.vV)("Channels"),Component:R,aclSnippet:"pm.notification.channels",sort:1}),this.app.pluginSettingsManager.add("".concat($,".logs"),{title:(0,o.vV)("Logs"),Component:V,aclSnippet:"pm.notification.logs",sort:3}),[2]})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(F(r.Plugin)),U=L},842:function(e,t,n){n.d(t,{CW:function(){return l},Ox:function(){return u},Uz:function(){return a},nB:function(){return c}});var r=n(155),o=n.n(r);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var a=(0,r.createContext)({name:"",setName:function(){}});a.displayName="ChannelTypeContext";var u=(0,r.createContext)({channelTypes:[]});u.displayName="ChannelTypesContext";var l=function(){return(0,r.useContext)(u).channelTypes};function c(){var e,t=function(e){if(Array.isArray(e))return e}(e=(0,r.useState)(""))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return i(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,2)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),n=t[0],u=t[1];return{name:n,setName:u,NotificationTypeNameProvider:function(e){var t=e.children;return o().createElement(a.Provider,{value:{name:n,setName:u}},t)}}}},803:function(e,t,n){n.d(t,{Gu:function(){return j},W2:function(){return O},Y1:function(){return g},Y2:function(){return S},aO:function(){return x},cJ:function(){return C},ru:function(){return w},wx:function(){return h}});var r=n(452),o=n(230),i=n(166),a=n(342),u=n(59),l=n(155),c=n(265),s=n(872),f=n(842);function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function y(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function b(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){y(i,r,o,a,u,"next",e)}function u(e){y(i,r,o,a,u,"throw",e)}a(void 0)})}}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function v(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function d(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var h=function(){var e=(0,a.useActionContext)(),t=e.setVisible,n=e.setSubmitted;u.App.useApp().message;var r=(0,o.useForm)(),i=(0,a.useDataBlockResource)(),l=(0,a.useBlockRequestContext)().service;return{type:"primary",onClick:function(e,o){return b(function(){var e,a,u,c,s,f,p,y,b;return d(this,function(d){switch(d.label){case 0:return[4,r.submit()];case 1:return d.sent(),a=r.values,[4,i.create({values:a})];case 2:return d.sent(),s=void 0===(c=(u=(null==l||null==(e=l.data)?void 0:e.meta)||{}).count)?0:c,p=void 0===(f=u.page)?0:f,s%(void 0===(y=u.pageSize)?0:y)==1&&1!==p&&l.run(v(m({},null==l||null==(b=l.params)?void 0:b[0]),{page:p-1})),o&&(null==o||o()),null==n||n(!0),null==t||t(!1),[2]}})})()}}},g=function(){var e=(0,a.useActionContext)(),t=e.setVisible,n=e.setSubmitted;u.App.useApp().message;var r=(0,o.useForm)(),i=(0,a.useDataBlockResource)(),l=(0,a.useBlockRequestContext)().service,c=(0,a.useCollection)();return{type:"primary",onClick:function(e,o){return b(function(){var e,a,u,s,f,p,y,b,h;return d(this,function(d){switch(d.label){case 0:return[4,r.submit()];case 1:return d.sent(),a=r.values,[4,i.update({values:a,filterByTk:a[c.filterTargetKey]})];case 2:return d.sent(),f=void 0===(s=(u=(null==l||null==(e=l.data)?void 0:e.meta)||{}).count)?0:s,y=void 0===(p=u.page)?0:p,f%(void 0===(b=u.pageSize)?0:b)==1&&1!==y&&l.run(v(m({},null==l||null==(h=l.params)?void 0:h[0]),{page:y-1})),o&&(null==o||o()),null==n||n(!0),null==t||t(!1),[2]}})})()}}},O=function(){var e=(0,a.useCollectionRecordData)();return{form:(0,l.useMemo)(function(){return(0,r.createForm)({initialValues:e})},[])}},w=function(){var e,t=(0,a.useCollectionRecordData)(),n=null==t||null==(e=t.meta)?void 0:e.editable,r={};return!1===n&&(r.display="none"),{style:r}},S=function(){var e,t=(0,a.useCollectionRecordData)(),n=null==t||null==(e=t.meta)?void 0:e.deletable,r={},o=(0,a.useDestroyActionProps)();return!1===n&&(r.display="none"),v(m({},o),{style:r})},C=function(){(0,a.useActionContext)();var e=(0,l.useContext)(f.Uz).name;return{form:(0,l.useMemo)(function(){return(0,r.createForm)({values:{name:"s_".concat((0,i.uid)()),notificationType:e}})},[e])}},j=function(){var e=(0,a.useActionContext)().setVisible;return{type:"default",onClick:function(){e(!1)}}},x=function(){var e=(0,s.yr)().t,t=(0,a.usePlugin)(c.PluginNotificationManagerClient),n=[],r=!0,i=!1,u=void 0;try{for(var l,f=t.channelTypes.getEntities()[Symbol.iterator]();!(r=(l=f.next()).done);r=!0){var y,b=(y=l.value,function(e){if(Array.isArray(e))return e}(y)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(y)||function(e){if(e){if("string"==typeof e)return p(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,2)}}(y)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),d=(b[0],b[1]),h=o.Schema.compile(d.title,{t:e}),g=v(m({},d),{name:d.type,key:d.type,value:d.type,title:h,label:h});n.push(g)}}catch(e){i=!0,u=e}finally{try{r||null==f.return||f.return()}finally{if(i)throw u}}return n}},872:function(e,t,n){n.d(t,{vV:function(){return a},yr:function(){return u}});var r=n(342),o=n(953),i="notification-manager";function a(e){return r.i18n.t(e,{ns:i})}function u(){return(0,o.useTranslation)([i,"client","data-source-manager"],{nsMode:"fallback"})}},553:function(e,t,n){n.d(t,{L:function(){return o}});var r,o=((r={}).templates="templates",r.channels="notificationChannels",r.messages="messages",r.logs="notificationSendLogs",r)},375:function(e){e.exports=s},418:function(e){e.exports=i},452:function(e){e.exports=t},230:function(e){e.exports=u},166:function(e){e.exports=n},342:function(e){e.exports=a},694:function(e){e.exports=l},768:function(e){e.exports=c},59:function(e){e.exports=o},155:function(e){e.exports=r},953:function(t){t.exports=e},838:function(e,t,n){var r="",o="u">typeof document?document.currentScript:null;if(o&&o.src&&(r=o.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!r){var i=window.__webpack_public_path__||"";i&&("/"!==i.charAt(i.length-1)&&(i+="/"),r=i+"static/plugins/@nocobase/plugin-notification-manager/dist/client/")}if(!r){if(!(r=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf("/v2/");r=u>=0?a.slice(0,u+1):"/"}r&&(r=r.replace(/\/v2\/?$/,"/")),r||(r="/"),"/"!==r.charAt(r.length-1)&&(r+="/"),r+="static/plugins/@nocobase/plugin-notification-manager/dist/client/"}n.p=r}},m={};function v(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return b[e](n,n.exports,v),n.exports}v.m=b,v.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return v.d(t,{a:t}),t},v.d=function(e,t){for(var n in t)v.o(t,n)&&!v.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},v.f={},v.e=function(e){return Promise.all(Object.keys(v.f).reduce(function(t,n){return v.f[n](e,t),t},[]))},v.u=function(e){return""+({507:"20cb970c942de0b9",89:"26913f9f8472d82e"})[e]+".js"},v.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),v.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},d={},v.l=function(e,t,n,r){if(d[e])return void d[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-notification-manager:"+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,v.nc&&o.setAttribute("nonce",v.nc),o.setAttribute("data-rspack","@nocobase/plugin-notification-manager:"+n),o.src=e),d[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=d[e];if(delete d[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},v.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},v.g.importScripts&&(h=v.g.location+"");var d,h,g=v.g.document;if(!h&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(h=g.currentScript.src),!h)){var O=g.getElementsByTagName("script");if(O.length)for(var w=O.length-1;w>-1&&(!h||!/^http(s?):/.test(h));)h=O[w--].src}if(!h)throw Error("Automatic publicPath is not supported in this browser");return v.p=h.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},v.f.j=function(e,t){var n=v.o(f,e)?f[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=v.p+v.u(e),i=Error();v.l(o,function(t){if(v.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},p=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==f[e]})){for(n in i)v.o(i,n)&&(v.m[n]=i[n]);a&&a(v)}for(e&&e(t);u<o.length;u++)r=o[u],v.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(y=self.webpackChunk_nocobase_plugin_notification_manager=self.webpackChunk_nocobase_plugin_notification_manager||[]).forEach(p.bind(null,0)),y.push=p.bind(null,y.push.bind(y)),v(838),v(265)}()});
|
package/dist/externalVersion.js
CHANGED
|
@@ -10,17 +10,18 @@
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"react": "18.2.0",
|
|
12
12
|
"antd": "5.24.2",
|
|
13
|
-
"@nocobase/client": "2.1.0-alpha.
|
|
14
|
-
"@nocobase/utils": "2.1.0-alpha.
|
|
15
|
-
"@nocobase/
|
|
16
|
-
"@nocobase/
|
|
13
|
+
"@nocobase/client": "2.1.0-alpha.15",
|
|
14
|
+
"@nocobase/utils": "2.1.0-alpha.15",
|
|
15
|
+
"@nocobase/database": "2.1.0-alpha.15",
|
|
16
|
+
"@nocobase/server": "2.1.0-alpha.15",
|
|
17
|
+
"@nocobase/cache": "2.1.0-alpha.15",
|
|
18
|
+
"@nocobase/logger": "2.1.0-alpha.15",
|
|
17
19
|
"@formily/react": "2.3.7",
|
|
18
20
|
"@formily/core": "2.3.7",
|
|
19
21
|
"react-i18next": "11.18.6",
|
|
20
|
-
"@nocobase/database": "2.1.0-alpha.13",
|
|
21
22
|
"@formily/shared": "2.3.7",
|
|
22
23
|
"@ant-design/icons": "5.6.1",
|
|
23
|
-
"@nocobase/flow-engine": "2.1.0-alpha.
|
|
24
|
+
"@nocobase/flow-engine": "2.1.0-alpha.15",
|
|
24
25
|
"@formily/antd-v5": "1.2.3",
|
|
25
|
-
"@nocobase/plugin-workflow": "2.1.0-alpha.
|
|
26
|
+
"@nocobase/plugin-workflow": "2.1.0-alpha.15"
|
|
26
27
|
};
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import { Transactionable } from '@nocobase/database';
|
|
9
10
|
import { Application } from '@nocobase/server';
|
|
10
11
|
import { ChannelOptions, ReceiversOptions } from './types';
|
|
11
12
|
export declare abstract class BaseNotificationChannel<Message = any> {
|
|
@@ -15,9 +16,10 @@ export declare abstract class BaseNotificationChannel<Message = any> {
|
|
|
15
16
|
channel: ChannelOptions;
|
|
16
17
|
message: Message;
|
|
17
18
|
receivers?: ReceiversOptions;
|
|
19
|
+
transaction?: Transactionable['transaction'];
|
|
18
20
|
}): Promise<{
|
|
19
21
|
message: Message;
|
|
20
|
-
status: 'success' | '
|
|
22
|
+
status: 'success' | 'failure';
|
|
21
23
|
reason?: string;
|
|
22
24
|
}>;
|
|
23
25
|
}
|
package/dist/server/manager.d.ts
CHANGED
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import { Registry } from '@nocobase/utils';
|
|
10
10
|
import PluginNotificationManagerServer from './plugin';
|
|
11
|
-
import type { NotificationChannelConstructor, RegisterServerTypeFnParams, SendOptions, SendUserOptions, WriteLogOptions } from './types';
|
|
11
|
+
import type { NotificationQueueMessage, NotificationChannelConstructor, RegisterServerTypeFnParams, ReceiversOptions, SendOptions, SendUserOptions, WriteLogOptions } from './types';
|
|
12
|
+
import { Transactionable } from '@nocobase/database';
|
|
12
13
|
export declare class NotificationManager implements NotificationManager {
|
|
14
|
+
private static readonly SLOW_SEND_THRESHOLD_MS;
|
|
13
15
|
private plugin;
|
|
14
16
|
channelTypes: Registry<{
|
|
15
17
|
Channel: NotificationChannelConstructor;
|
|
@@ -18,9 +20,38 @@ export declare class NotificationManager implements NotificationManager {
|
|
|
18
20
|
plugin: PluginNotificationManagerServer;
|
|
19
21
|
});
|
|
20
22
|
registerType({ type, Channel }: RegisterServerTypeFnParams): void;
|
|
21
|
-
createSendingRecord: (options: WriteLogOptions) => Promise<any>;
|
|
23
|
+
createSendingRecord: (options: WriteLogOptions & Transactionable) => Promise<any>;
|
|
24
|
+
private toQueueMessage;
|
|
25
|
+
private getQueuedResult;
|
|
26
|
+
private enqueue;
|
|
22
27
|
findChannel(name: string): Promise<any>;
|
|
23
|
-
|
|
24
|
-
|
|
28
|
+
private getReceiverMeta;
|
|
29
|
+
send(params: SendOptions): Promise<{
|
|
30
|
+
status: "success";
|
|
31
|
+
triggerFrom: string;
|
|
32
|
+
channelName: string;
|
|
33
|
+
receivers: ReceiversOptions;
|
|
34
|
+
queued: boolean;
|
|
35
|
+
} | {
|
|
36
|
+
status: "failure";
|
|
37
|
+
reason: string;
|
|
38
|
+
triggerFrom: string;
|
|
39
|
+
channelName: string;
|
|
40
|
+
receivers: ReceiversOptions;
|
|
41
|
+
}>;
|
|
42
|
+
sendNow(params: NotificationQueueMessage): Promise<any>;
|
|
43
|
+
sendToUsers(options: SendUserOptions): Promise<({
|
|
44
|
+
status: "success";
|
|
45
|
+
triggerFrom: string;
|
|
46
|
+
channelName: string;
|
|
47
|
+
receivers: ReceiversOptions;
|
|
48
|
+
queued: boolean;
|
|
49
|
+
} | {
|
|
50
|
+
status: "failure";
|
|
51
|
+
reason: string;
|
|
52
|
+
triggerFrom: string;
|
|
53
|
+
channelName: string;
|
|
54
|
+
receivers: ReceiversOptions;
|
|
55
|
+
})[]>;
|
|
25
56
|
}
|
|
26
57
|
export default NotificationManager;
|
package/dist/server/manager.js
CHANGED
|
@@ -34,6 +34,7 @@ var import_utils = require("@nocobase/utils");
|
|
|
34
34
|
var import_constant = require("../constant");
|
|
35
35
|
var import_compile = require("./utils/compile");
|
|
36
36
|
class NotificationManager {
|
|
37
|
+
static SLOW_SEND_THRESHOLD_MS = 500;
|
|
37
38
|
plugin;
|
|
38
39
|
channelTypes = new import_utils.Registry();
|
|
39
40
|
constructor({ plugin }) {
|
|
@@ -44,52 +45,153 @@ class NotificationManager {
|
|
|
44
45
|
}
|
|
45
46
|
createSendingRecord = async (options) => {
|
|
46
47
|
const logsRepo = this.plugin.app.db.getRepository(import_constant.COLLECTION_NAME.logs);
|
|
47
|
-
|
|
48
|
+
const { transaction, ...values } = options;
|
|
49
|
+
return logsRepo.create({ values, transaction });
|
|
48
50
|
};
|
|
51
|
+
toQueueMessage(params) {
|
|
52
|
+
const { transaction, ...message } = params;
|
|
53
|
+
return message;
|
|
54
|
+
}
|
|
55
|
+
getQueuedResult(params) {
|
|
56
|
+
return {
|
|
57
|
+
status: "success",
|
|
58
|
+
triggerFrom: params.triggerFrom,
|
|
59
|
+
channelName: params.channelName,
|
|
60
|
+
receivers: params.receivers,
|
|
61
|
+
queued: true
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async enqueue(message) {
|
|
65
|
+
await this.plugin.app.eventQueue.publish(this.plugin.sendQueueChannel, message);
|
|
66
|
+
}
|
|
49
67
|
async findChannel(name) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
68
|
+
return await this.plugin.getChannel(name);
|
|
69
|
+
}
|
|
70
|
+
getReceiverMeta(receivers) {
|
|
71
|
+
if (!receivers) {
|
|
72
|
+
return {};
|
|
73
|
+
}
|
|
74
|
+
if (receivers.type === "userId") {
|
|
75
|
+
return {
|
|
76
|
+
receiverType: receivers.type,
|
|
77
|
+
receiverCount: receivers.value.length
|
|
78
|
+
};
|
|
54
79
|
}
|
|
55
|
-
return
|
|
80
|
+
return {
|
|
81
|
+
receiverType: receivers.type
|
|
82
|
+
};
|
|
56
83
|
}
|
|
57
84
|
async send(params) {
|
|
58
|
-
this.
|
|
85
|
+
const queueMessage = this.toQueueMessage(params);
|
|
86
|
+
const transaction = params.transaction;
|
|
87
|
+
if (transaction == null ? void 0 : transaction.afterCommit) {
|
|
88
|
+
transaction.afterCommit(() => {
|
|
89
|
+
void this.enqueue(queueMessage).catch((error) => {
|
|
90
|
+
this.plugin.logger.error("notification queue publish failed after transaction committed", {
|
|
91
|
+
channelName: params.channelName,
|
|
92
|
+
triggerFrom: params.triggerFrom,
|
|
93
|
+
reason: error instanceof Error ? `${error.name}: ${error.message}` : JSON.stringify(error)
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
return this.getQueuedResult(params);
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
await this.enqueue(queueMessage);
|
|
101
|
+
return this.getQueuedResult(params);
|
|
102
|
+
} catch (error) {
|
|
103
|
+
const reason = error instanceof Error ? `${error.name}: ${error.message}` : JSON.stringify(error);
|
|
104
|
+
this.plugin.logger.error("notification queue publish failed", {
|
|
105
|
+
channelName: params.channelName,
|
|
106
|
+
triggerFrom: params.triggerFrom,
|
|
107
|
+
reason
|
|
108
|
+
});
|
|
109
|
+
return {
|
|
110
|
+
status: "failure",
|
|
111
|
+
reason,
|
|
112
|
+
triggerFrom: params.triggerFrom,
|
|
113
|
+
channelName: params.channelName,
|
|
114
|
+
receivers: params.receivers
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
async sendNow(params) {
|
|
119
|
+
const startedAt = Date.now();
|
|
120
|
+
const receiverMeta = this.getReceiverMeta(params.receivers);
|
|
121
|
+
const compileStartedAt = Date.now();
|
|
59
122
|
const message = (0, import_compile.compile)(params.message ?? {}, params.data ?? {});
|
|
123
|
+
const compileMs = Date.now() - compileStartedAt;
|
|
60
124
|
const messageData = { ...params.receivers ? { receivers: params.receivers } : {}, ...message };
|
|
61
125
|
const logData = {
|
|
62
126
|
triggerFrom: params.triggerFrom,
|
|
63
127
|
channelName: params.channelName,
|
|
64
128
|
message: messageData
|
|
65
129
|
};
|
|
130
|
+
let findChannelMs = 0;
|
|
131
|
+
let channelSendMs = 0;
|
|
66
132
|
try {
|
|
133
|
+
const findChannelStartedAt = Date.now();
|
|
67
134
|
const channel = await this.findChannel(params.channelName);
|
|
135
|
+
findChannelMs = Date.now() - findChannelStartedAt;
|
|
68
136
|
if (channel) {
|
|
69
137
|
const Channel = this.channelTypes.get(channel.notificationType).Channel;
|
|
70
138
|
const instance = new Channel(this.plugin.app);
|
|
71
139
|
logData.channelTitle = channel.title;
|
|
72
140
|
logData.notificationType = channel.notificationType;
|
|
73
141
|
logData.receivers = params.receivers;
|
|
74
|
-
const
|
|
142
|
+
const channelSendStartedAt = Date.now();
|
|
143
|
+
const result = await instance.send({
|
|
144
|
+
message,
|
|
145
|
+
channel,
|
|
146
|
+
receivers: params.receivers
|
|
147
|
+
});
|
|
148
|
+
channelSendMs = Date.now() - channelSendStartedAt;
|
|
75
149
|
logData.status = result.status;
|
|
76
150
|
logData.reason = result.reason;
|
|
77
151
|
} else {
|
|
78
152
|
logData.status = "failure";
|
|
79
153
|
logData.reason = "channel not found";
|
|
80
154
|
}
|
|
81
|
-
this.createSendingRecord(logData);
|
|
155
|
+
await this.createSendingRecord(logData);
|
|
156
|
+
const totalMs = Date.now() - startedAt;
|
|
157
|
+
if (totalMs >= NotificationManager.SLOW_SEND_THRESHOLD_MS) {
|
|
158
|
+
this.plugin.logger.warn("notification send is slow", {
|
|
159
|
+
channelName: params.channelName,
|
|
160
|
+
triggerFrom: params.triggerFrom,
|
|
161
|
+
status: logData.status,
|
|
162
|
+
notificationType: logData.notificationType,
|
|
163
|
+
compileMs,
|
|
164
|
+
findChannelMs,
|
|
165
|
+
channelSendMs,
|
|
166
|
+
totalMs,
|
|
167
|
+
...receiverMeta
|
|
168
|
+
});
|
|
169
|
+
}
|
|
82
170
|
return logData;
|
|
83
171
|
} catch (error) {
|
|
84
172
|
logData.status = "failure";
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
this.
|
|
173
|
+
const totalMs = Date.now() - startedAt;
|
|
174
|
+
const reason = error instanceof Error ? `${error.name}: ${error.message}` : JSON.stringify(error);
|
|
175
|
+
this.plugin.logger.error("notification send failed", {
|
|
176
|
+
channelName: params.channelName,
|
|
177
|
+
triggerFrom: params.triggerFrom,
|
|
178
|
+
compileMs,
|
|
179
|
+
findChannelMs,
|
|
180
|
+
channelSendMs,
|
|
181
|
+
totalMs,
|
|
182
|
+
reason,
|
|
183
|
+
...receiverMeta
|
|
184
|
+
});
|
|
185
|
+
logData.reason = reason;
|
|
186
|
+
await this.createSendingRecord(logData);
|
|
88
187
|
return logData;
|
|
89
188
|
}
|
|
90
189
|
}
|
|
91
190
|
async sendToUsers(options) {
|
|
92
|
-
this.plugin.logger.
|
|
191
|
+
this.plugin.logger.debug("notificationManager.sendToUsers", {
|
|
192
|
+
channelCount: options.channels.length,
|
|
193
|
+
userCount: options.userIds.length
|
|
194
|
+
});
|
|
93
195
|
const { userIds, channels, message, data = {} } = options;
|
|
94
196
|
return await Promise.all(
|
|
95
197
|
channels.map(
|
|
@@ -98,7 +200,8 @@ class NotificationManager {
|
|
|
98
200
|
message,
|
|
99
201
|
data,
|
|
100
202
|
triggerFrom: "sendToUsers",
|
|
101
|
-
receivers: { value: userIds, type: "userId" }
|
|
203
|
+
receivers: { value: userIds, type: "userId" },
|
|
204
|
+
transaction: options.transaction
|
|
102
205
|
})
|
|
103
206
|
)
|
|
104
207
|
);
|
package/dist/server/plugin.d.ts
CHANGED
|
@@ -6,18 +6,52 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import type { Cache } from '@nocobase/cache';
|
|
9
10
|
import type { Logger } from '@nocobase/logger';
|
|
11
|
+
import { Transactionable } from '@nocobase/database';
|
|
10
12
|
import { Plugin } from '@nocobase/server';
|
|
11
13
|
import { RegisterServerTypeFnParams, SendOptions, SendUserOptions } from './types';
|
|
12
14
|
export declare class PluginNotificationManagerServer extends Plugin {
|
|
15
|
+
private static readonly CHANNELS_CACHE_KEY;
|
|
13
16
|
private manager;
|
|
14
17
|
logger: Logger;
|
|
18
|
+
cache: Cache;
|
|
19
|
+
get sendQueueChannel(): string;
|
|
20
|
+
private ensureCache;
|
|
21
|
+
parseChannel(instance: any): any;
|
|
22
|
+
loadChannels(options?: Transactionable): Promise<void>;
|
|
23
|
+
getChannel(name: string): Promise<any>;
|
|
15
24
|
get channelTypes(): import("@nocobase/utils").Registry<{
|
|
16
25
|
Channel: import("./types").NotificationChannelConstructor;
|
|
17
26
|
}>;
|
|
18
27
|
registerChannelType(params: RegisterServerTypeFnParams): void;
|
|
19
|
-
send(options: SendOptions): Promise<
|
|
20
|
-
|
|
28
|
+
send(options: SendOptions): Promise<{
|
|
29
|
+
status: "success";
|
|
30
|
+
triggerFrom: string;
|
|
31
|
+
channelName: string;
|
|
32
|
+
receivers: import("./types").ReceiversOptions;
|
|
33
|
+
queued: boolean;
|
|
34
|
+
} | {
|
|
35
|
+
status: "failure";
|
|
36
|
+
reason: string;
|
|
37
|
+
triggerFrom: string;
|
|
38
|
+
channelName: string;
|
|
39
|
+
receivers: import("./types").ReceiversOptions;
|
|
40
|
+
}>;
|
|
41
|
+
sendNow(options: SendOptions): Promise<any>;
|
|
42
|
+
sendToUsers(options: SendUserOptions): Promise<({
|
|
43
|
+
status: "success";
|
|
44
|
+
triggerFrom: string;
|
|
45
|
+
channelName: string;
|
|
46
|
+
receivers: import("./types").ReceiversOptions;
|
|
47
|
+
queued: boolean;
|
|
48
|
+
} | {
|
|
49
|
+
status: "failure";
|
|
50
|
+
reason: string;
|
|
51
|
+
triggerFrom: string;
|
|
52
|
+
channelName: string;
|
|
53
|
+
receivers: import("./types").ReceiversOptions;
|
|
54
|
+
})[]>;
|
|
21
55
|
afterAdd(): Promise<void>;
|
|
22
56
|
beforeLoad(): Promise<void>;
|
|
23
57
|
load(): Promise<void>;
|
package/dist/server/plugin.js
CHANGED
|
@@ -41,10 +41,50 @@ __export(plugin_exports, {
|
|
|
41
41
|
});
|
|
42
42
|
module.exports = __toCommonJS(plugin_exports);
|
|
43
43
|
var import_server = require("@nocobase/server");
|
|
44
|
+
var import_constant = require("../constant");
|
|
44
45
|
var import_manager = __toESM(require("./manager"));
|
|
45
46
|
class PluginNotificationManagerServer extends import_server.Plugin {
|
|
47
|
+
static CHANNELS_CACHE_KEY = "channels";
|
|
46
48
|
manager;
|
|
47
49
|
logger;
|
|
50
|
+
cache;
|
|
51
|
+
get sendQueueChannel() {
|
|
52
|
+
return `${this.name}.send`;
|
|
53
|
+
}
|
|
54
|
+
async ensureCache() {
|
|
55
|
+
if (!this.cache) {
|
|
56
|
+
this.cache = await this.app.cacheManager.createCache({
|
|
57
|
+
name: this.name,
|
|
58
|
+
prefix: this.name
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return this.cache;
|
|
62
|
+
}
|
|
63
|
+
parseChannel(instance) {
|
|
64
|
+
return this.app.environment.renderJsonTemplate(instance.toJSON());
|
|
65
|
+
}
|
|
66
|
+
async loadChannels(options) {
|
|
67
|
+
const cache = await this.ensureCache();
|
|
68
|
+
const repository = this.app.db.getRepository(import_constant.COLLECTION_NAME.channels);
|
|
69
|
+
const channels = await repository.find({
|
|
70
|
+
transaction: options == null ? void 0 : options.transaction
|
|
71
|
+
});
|
|
72
|
+
const channelsCache = {};
|
|
73
|
+
for (const channel of channels) {
|
|
74
|
+
channelsCache[channel.get("name")] = this.parseChannel(channel);
|
|
75
|
+
}
|
|
76
|
+
await cache.set(PluginNotificationManagerServer.CHANNELS_CACHE_KEY, channelsCache);
|
|
77
|
+
}
|
|
78
|
+
async getChannel(name) {
|
|
79
|
+
const cache = await this.ensureCache();
|
|
80
|
+
const channels = await cache.get(PluginNotificationManagerServer.CHANNELS_CACHE_KEY) || void 0;
|
|
81
|
+
if (!channels) {
|
|
82
|
+
await this.loadChannels();
|
|
83
|
+
const reloadedChannels = await cache.get(PluginNotificationManagerServer.CHANNELS_CACHE_KEY);
|
|
84
|
+
return (reloadedChannels == null ? void 0 : reloadedChannels[name]) || null;
|
|
85
|
+
}
|
|
86
|
+
return channels[name] || null;
|
|
87
|
+
}
|
|
48
88
|
get channelTypes() {
|
|
49
89
|
return this.manager.channelTypes;
|
|
50
90
|
}
|
|
@@ -54,6 +94,10 @@ class PluginNotificationManagerServer extends import_server.Plugin {
|
|
|
54
94
|
async send(options) {
|
|
55
95
|
return await this.manager.send(options);
|
|
56
96
|
}
|
|
97
|
+
async sendNow(options) {
|
|
98
|
+
const { transaction, ...message } = options;
|
|
99
|
+
return await this.manager.sendNow(message);
|
|
100
|
+
}
|
|
57
101
|
async sendToUsers(options) {
|
|
58
102
|
return await this.manager.sendToUsers(options);
|
|
59
103
|
}
|
|
@@ -69,8 +113,8 @@ class PluginNotificationManagerServer extends import_server.Plugin {
|
|
|
69
113
|
this.app.resourceManager.registerActionHandler("messages:send", async (ctx, next) => {
|
|
70
114
|
var _a, _b;
|
|
71
115
|
const sendOptions = (_b = (_a = ctx.action) == null ? void 0 : _a.params) == null ? void 0 : _b.values;
|
|
72
|
-
this.manager.send(sendOptions);
|
|
73
|
-
next();
|
|
116
|
+
await this.manager.send(sendOptions);
|
|
117
|
+
await next();
|
|
74
118
|
});
|
|
75
119
|
this.app.acl.registerSnippet({
|
|
76
120
|
name: "pm.notification.channels",
|
|
@@ -80,16 +124,35 @@ class PluginNotificationManagerServer extends import_server.Plugin {
|
|
|
80
124
|
name: "pm.notification.logs",
|
|
81
125
|
actions: ["notificationSendLogs:*"]
|
|
82
126
|
});
|
|
127
|
+
this.app.on("afterStart", async () => {
|
|
128
|
+
await this.loadChannels();
|
|
129
|
+
});
|
|
83
130
|
}
|
|
84
131
|
async load() {
|
|
132
|
+
const Channel = this.app.db.getModel(import_constant.COLLECTION_NAME.channels);
|
|
133
|
+
Channel.afterSave(async (_model, { transaction }) => {
|
|
134
|
+
await this.loadChannels({ transaction });
|
|
135
|
+
});
|
|
136
|
+
Channel.afterDestroy(async (_model, { transaction }) => {
|
|
137
|
+
await this.loadChannels({ transaction });
|
|
138
|
+
});
|
|
139
|
+
this.app.eventQueue.subscribe(this.sendQueueChannel, {
|
|
140
|
+
concurrency: 1,
|
|
141
|
+
idle: () => true,
|
|
142
|
+
process: async (message) => {
|
|
143
|
+
await this.manager.sendNow(message);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
85
146
|
}
|
|
86
147
|
async install() {
|
|
87
148
|
}
|
|
88
149
|
async afterEnable() {
|
|
89
150
|
}
|
|
90
151
|
async afterDisable() {
|
|
152
|
+
this.app.eventQueue.unsubscribe(this.sendQueueChannel);
|
|
91
153
|
}
|
|
92
154
|
async remove() {
|
|
155
|
+
this.app.eventQueue.unsubscribe(this.sendQueueChannel);
|
|
93
156
|
}
|
|
94
157
|
}
|
|
95
158
|
var plugin_default = PluginNotificationManagerServer;
|
package/dist/server/types.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
|
+
import { Transactionable } from '@nocobase/database';
|
|
9
10
|
import { Application } from '@nocobase/server';
|
|
10
11
|
import { BaseNotificationChannel } from './base-notification-channel';
|
|
11
12
|
/**
|
|
@@ -33,9 +34,10 @@ export type SendFnType<Message> = (args: {
|
|
|
33
34
|
message: Message;
|
|
34
35
|
channel: ChannelOptions;
|
|
35
36
|
receivers?: ReceiversOptions;
|
|
37
|
+
transaction?: Transactionable['transaction'];
|
|
36
38
|
}) => Promise<{
|
|
37
39
|
message: Message;
|
|
38
|
-
status: 'success' | '
|
|
40
|
+
status: 'success' | 'failure';
|
|
39
41
|
reason?: string;
|
|
40
42
|
}>;
|
|
41
43
|
export type ReceiversOptions = {
|
|
@@ -46,14 +48,15 @@ export type ReceiversOptions = {
|
|
|
46
48
|
type: 'channel-self-defined';
|
|
47
49
|
channelType: string;
|
|
48
50
|
};
|
|
49
|
-
export interface SendOptions {
|
|
51
|
+
export interface SendOptions extends Transactionable {
|
|
50
52
|
channelName: string;
|
|
51
53
|
message: Record<string, any>;
|
|
52
54
|
triggerFrom: string;
|
|
53
55
|
receivers?: ReceiversOptions;
|
|
54
56
|
data?: Record<string, any>;
|
|
55
57
|
}
|
|
56
|
-
export
|
|
58
|
+
export type NotificationQueueMessage = Omit<SendOptions, 'transaction'>;
|
|
59
|
+
export interface SendUserOptions extends Transactionable {
|
|
57
60
|
userIds: number[];
|
|
58
61
|
channels: string[];
|
|
59
62
|
message: Record<string, any>;
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"description.ru-RU": "Предоставляет единый сервис управления, включающий конфигурирование каналов, логирование и другие функции, поддерживает настройку различных каналов уведомлений, включая внутренние сообщения и электронную почту.",
|
|
7
7
|
"displayName.zh-CN": "通知管理",
|
|
8
8
|
"description.zh-CN": "提供统一的管理服务,涵盖渠道配置、日志记录等功能,支持多种通知渠道的配置,包括站内信和电子邮件等。",
|
|
9
|
-
"version": "2.1.0-alpha.
|
|
9
|
+
"version": "2.1.0-alpha.15",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/notification-manager",
|
|
11
11
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/notification-manager",
|
|
12
12
|
"homepage.zh-CN": "https://docs-cn.nocobase.com/handbook/notification-manager",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"Notification"
|
|
36
36
|
],
|
|
37
37
|
"license": "Apache-2.0",
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "7c86e75b0af4b9f532c8ebf5ef96a7423b0ab60e"
|
|
39
39
|
}
|