@tachybase/plugin-wechat-official-account 1.3.16 → 1.3.18

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 +1 @@
1
- (function(e,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("@tachybase/client"),require("@tachybase/module-auth/client"),require("react/jsx-runtime"),require("react"),require("@ant-design/icons"),require("antd"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/module-auth/client","react/jsx-runtime","react","@ant-design/icons","antd","react-router-dom"],o):(e=typeof globalThis!="undefined"?globalThis:e||self,o(e["@tachybase/plugin-wechat-official-account"]={},e["@tachybase/client"],e["@tachybase/module-auth"],e.jsxRuntime,e.react,e["@ant-design/icons"],e.antd,e["react-router-dom"]))})(this,function(e,o,c,t,a,h,r,d){"use strict";var g=(e,o,c)=>new Promise((t,a)=>{var h=n=>{try{d(c.next(n))}catch(l){a(l)}},r=n=>{try{d(c.throw(n))}catch(l){a(l)}},d=n=>n.done?t(n.value):Promise.resolve(n.value).then(h,r);d((c=c.apply(e,o)).next())});const n="微信公众号",l="微信公众号";function C(){return o.useTranslation([l,"core"],{nsMode:"fallback"})}const v=()=>{const{t:s}=C();o.useApp();const i="https://lu.dev.daoyoucloud.com/api/wechat@handleOAuthCallback",b=m=>{navigator.clipboard.writeText(m),r.message.success(s("Copied"))};return t.jsxs("div",{children:[t.jsx(o.SchemaComponent,{scope:{t:s},schema:{type:"object",properties:{public:{type:"object",properties:{autoSignup:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Sign up automatically when the user does not exist")}}',"x-component":"Checkbox",default:!0}}},wechat:{type:"object",properties:{appId:{"x-decorator":"FormItem","x-component":"Input",type:"string",required:!0,title:'{{t("WeChat AppID")}}'},appSecret:{"x-decorator":"FormItem","x-component":"Input",type:"string",required:!0,title:'{{t("WeChat AppSecret")}}'}}}}}}),t.jsxs("div",{children:[t.jsxs(r.Typography.Title,{level:5,style:{fontSize:"14px"},children:[s("Redirect URL"),":"]}),t.jsx(r.Input,{value:i,disabled:!0,addonBefore:t.jsx(h.CopyOutlined,{onClick:()=>b(i)})})]})]})},A=({authenticator:s})=>{const[i,b]=a.useState(),[m,x]=a.useState(!1),[I,T]=a.useState(""),[q,w]=a.useState(!1),{t:y}=C(),j=o.useAPIClient(),L=d.useLocation(),f=new URLSearchParams(L.search),P=f.get("redirect");a.useEffect(()=>{i&&(window.location.href=i)},[i]),a.useEffect(()=>{const u=f.get("authenticator"),p=f.get("error");u===s.name&&p&&r.message.error(y(p))},[s.name,y,f]);const k=()=>g(this,null,function*(){w(!0);try{const{data:u}=yield j.request({method:"post",url:"https://lu.dev.daoyoucloud.com/api/wechat@generateQrCode",headers:{"X-Authenticator":s.name},data:{redirect:P}});console.log("data.data.data.url:",u.data.data.url);const p=u.data.data.url;p?(T(p),x(!0)):console.error("未能生成二维码URL")}catch(u){r.message.error(y("Failed to generate QR code")),console.error("二维码生成失败:",u)}finally{w(!1)}});return t.jsxs(t.Fragment,{children:[t.jsx(r.Button,{block:!0,icon:t.jsx(h.LoginOutlined,{}),shape:"round",onClick:k,loading:q,children:s.title||"WeChat 公众号登录"}),t.jsx(r.Modal,{title:"Scan QR Code to Login",style:{textAlign:"center"},visible:m,footer:null,onCancel:()=>x(!1),children:q?t.jsx(r.Spin,{}):t.jsx("img",{src:I,alt:"QR Code",style:{width:"100%"}})})]})};class S extends o.Plugin{load(){return g(this,null,function*(){this.app.pm.get(c).registerType(n,{components:{SignInButton:A,AdminSettingsForm:v}})})}}e.PluginWeCahtOfficialAccount=S,e.default=S,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(e,o){typeof exports=="object"&&typeof module!="undefined"?o(exports,require("@tachybase/client"),require("@tachybase/module-auth/client"),require("react/jsx-runtime"),require("react"),require("@ant-design/icons"),require("antd"),require("react-router-dom")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","@tachybase/module-auth/client","react/jsx-runtime","react","@ant-design/icons","antd","react-router-dom"],o):(e=typeof globalThis!="undefined"?globalThis:e||self,o(e["@tachybase/plugin-wechat-official-account"]={},e["@tachybase/client"],e["@tachybase/module-auth"],e.jsxRuntime,e.react,e["@ant-design/icons"],e.antd,e["react-router-dom"]))})(this,function(e,o,c,t,a,h,r,d){"use strict";var g=(e,o,c)=>new Promise((t,a)=>{var h=n=>{try{d(c.next(n))}catch(l){a(l)}},r=n=>{try{d(c.throw(n))}catch(l){a(l)}},d=n=>n.done?t(n.value):Promise.resolve(n.value).then(h,r);d((c=c.apply(e,o)).next())});const n="微信公众号",l="微信公众号";function C(){return o.useTranslation([l,"core"],{nsMode:"fallback"})}const v=()=>{const{t:s}=C();o.useApp();const i="https://lu.dev.daoyoucloud.com/api/wechat@handleOAuthCallback",b=m=>{navigator.clipboard.writeText(m),r.message.success(s("Copied"))};return t.jsxs("div",{children:[t.jsx(o.SchemaComponent,{scope:{t:s},schema:{type:"object",properties:{public:{type:"object",properties:{autoSignup:{"x-decorator":"FormItem",type:"boolean",title:'{{t("Sign up automatically when the user does not exist")}}',"x-component":"Checkbox",default:!0}}},wechat:{type:"object",properties:{appId:{"x-decorator":"FormItem","x-component":"Input",type:"string",required:!0,title:'{{t("WeChat AppID")}}'},appSecret:{"x-decorator":"FormItem","x-component":"Input",type:"string",required:!0,title:'{{t("WeChat AppSecret")}}'}}}}}}),t.jsxs("div",{children:[t.jsxs(r.Typography.Title,{level:5,style:{fontSize:"14px"},children:[s("Redirect URL"),":"]}),t.jsx(r.Input,{value:i,disabled:!0,addonBefore:t.jsx(h.CopyOutlined,{onClick:()=>b(i)})})]})]})},A=({authenticator:s})=>{const[i,b]=a.useState(),[m,x]=a.useState(!1),[I,T]=a.useState(""),[q,w]=a.useState(!1),{t:y}=C(),j=o.useAPIClient(),L=d.useLocation(),f=new URLSearchParams(L.search),P=f.get("redirect");a.useEffect(()=>{i&&(window.location.href=i)},[i]),a.useEffect(()=>{const u=f.get("authenticator"),p=f.get("error");u===s.name&&p&&r.message.error(y(p))},[s.name,y,f]);const k=()=>g(null,null,function*(){w(!0);try{const{data:u}=yield j.request({method:"post",url:"https://lu.dev.daoyoucloud.com/api/wechat@generateQrCode",headers:{"X-Authenticator":s.name},data:{redirect:P}});console.log("data.data.data.url:",u.data.data.url);const p=u.data.data.url;p?(T(p),x(!0)):console.error("未能生成二维码URL")}catch(u){r.message.error(y("Failed to generate QR code")),console.error("二维码生成失败:",u)}finally{w(!1)}});return t.jsxs(t.Fragment,{children:[t.jsx(r.Button,{block:!0,icon:t.jsx(h.LoginOutlined,{}),shape:"round",onClick:k,loading:q,children:s.title||"WeChat 公众号登录"}),t.jsx(r.Modal,{title:"Scan QR Code to Login",style:{textAlign:"center"},visible:m,footer:null,onCancel:()=>x(!1),children:q?t.jsx(r.Spin,{}):t.jsx("img",{src:I,alt:"QR Code",style:{width:"100%"}})})]})};class S extends o.Plugin{load(){return g(this,null,function*(){this.app.pm.get(c).registerType(n,{components:{SignInButton:A,AdminSettingsForm:v}})})}}e.PluginWeCahtOfficialAccount=S,e.default=S,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,12 +1,12 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.3.16",
3
+ "@tachybase/client": "1.3.18",
4
4
  "@ant-design/icons": "5.5.2",
5
5
  "antd": "5.22.5",
6
6
  "react-router-dom": "6.28.1",
7
- "@tachybase/module-auth": "1.3.16",
8
- "@tachybase/server": "1.3.16",
7
+ "@tachybase/module-auth": "1.3.18",
8
+ "@tachybase/server": "1.3.18",
9
9
  "axios": "1.7.7",
10
10
  "sequelize": "6.37.5",
11
- "@tachybase/actions": "1.3.16"
11
+ "@tachybase/actions": "1.3.18"
12
12
  };
package/dist/index.js CHANGED
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var src_exports = {};
30
- __export(src_exports, {
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
31
  default: () => import_server.default
32
32
  });
33
- module.exports = __toCommonJS(src_exports);
34
- __reExport(src_exports, require("./server"), module.exports);
33
+ module.exports = __toCommonJS(index_exports);
34
+ __reExport(index_exports, require("./server"), module.exports);
35
35
  var import_server = __toESM(require("./server"));
36
36
  // Annotate the CommonJS export names for ESM import in node:
37
37
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"name":"xml2js","description":"Simple XML to JavaScript object converter.","keywords":["xml","json"],"homepage":"https://github.com/Leonidas-from-XIV/node-xml2js","version":"0.6.2","author":"Marek Kubica <marek@xivilization.net> (https://xivilization.net)","contributors":["maqr <maqr.lollerskates@gmail.com> (https://github.com/maqr)","Ben Weaver (http://benweaver.com/)","Jae Kwon (https://github.com/jaekwon)","Jim Robert","Ștefan Rusu (http://www.saltwaterc.eu/)","Carter Cole <carter.cole@cartercole.com> (http://cartercole.com/)","Kurt Raschke <kurt@kurtraschke.com> (http://www.kurtraschke.com/)","Contra <contra@australia.edu> (https://github.com/Contra)","Marcelo Diniz <marudiniz@gmail.com> (https://github.com/mdiniz)","Michael Hart (https://github.com/mhart)","Zachary Scott <zachary@zacharyscott.net> (http://zacharyscott.net/)","Raoul Millais (https://github.com/raoulmillais)","Salsita Software (http://www.salsitasoft.com/)","Mike Schilling <mike@emotive.com> (http://www.emotive.com/)","Jackson Tian <shyvo1987@gmail.com> (http://weibo.com/shyvo)","Mikhail Zyatin <mikhail.zyatin@gmail.com> (https://github.com/Sitin)","Chris Tavares <ctavares@microsoft.com> (https://github.com/christav)","Frank Xu <yyfrankyy@gmail.com> (http://f2e.us/)","Guido D'Albore <guido@bitstorm.it> (http://www.bitstorm.it/)","Jack Senechal (http://jacksenechal.com/)","Matthias Hölzl <tc@xantira.com> (https://github.com/hoelzl)","Camille Reynders <info@creynders.be> (http://www.creynders.be/)","Taylor Gautier (https://github.com/tsgautier)","Todd Bryan (https://github.com/toddrbryan)","Leore Avidar <leore.avidar@gmail.com> (http://leoreavidar.com/)","Dave Aitken <dave.aitken@gmail.com> (http://www.actionshrimp.com/)","Shaney Orrowe <shaney.orrowe@practiceweb.co.uk>","Candle <candle@candle.me.uk>","Jess Telford <hi@jes.st> (http://jes.st)","Tom Hughes <<tom@compton.nu> (http://compton.nu/)","Piotr Rochala (http://rocha.la/)","Michael Avila (https://github.com/michaelavila)","Ryan Gahl (https://github.com/ryedin)","Eric Laberge <e.laberge@gmail.com> (https://github.com/elaberge)","Benjamin E. Coe <ben@npmjs.com> (https://twitter.com/benjamincoe)","Stephen Cresswell (https://github.com/cressie176)","Pascal Ehlert <pascal@hacksrus.net> (http://www.hacksrus.net/)","Tom Spencer <fiznool@gmail.com> (http://fiznool.com/)","Tristian Flanagan <tflanagan@datacollaborative.com> (https://github.com/tflanagan)","Tim Johns <timjohns@yahoo.com> (https://github.com/TimJohns)","Bogdan Chadkin <trysound@yandex.ru> (https://github.com/TrySound)","David Wood <david.p.wood@gmail.com> (http://codesleuth.co.uk/)","Nicolas Maquet (https://github.com/nmaquet)","Lovell Fuller (http://lovell.info/)","d3adc0d3 (https://github.com/d3adc0d3)","James Crosby (https://github.com/autopulated)"],"main":"./lib/xml2js","files":["lib"],"directories":{"lib":"./lib"},"scripts":{"build":"cake build","test":"zap","coverage":"nyc npm test && nyc report","coveralls":"nyc npm test && nyc report --reporter=text-lcov | coveralls","doc":"cake doc"},"repository":{"type":"git","url":"https://github.com/Leonidas-from-XIV/node-xml2js.git"},"dependencies":{"sax":">=0.6.0","xmlbuilder":"~11.0.0"},"devDependencies":{"coffeescript":">=1.10.0 <2","coveralls":"^3.0.1","diff":">=1.0.8","docco":">=0.6.2","nyc":">=2.2.1","zap":">=0.2.9 <1"},"engines":{"node":">=4.0.0"},"license":"MIT","_lastModified":"2025-07-02T03:55:33.650Z"}
1
+ {"name":"xml2js","description":"Simple XML to JavaScript object converter.","keywords":["xml","json"],"homepage":"https://github.com/Leonidas-from-XIV/node-xml2js","version":"0.6.2","author":"Marek Kubica <marek@xivilization.net> (https://xivilization.net)","contributors":["maqr <maqr.lollerskates@gmail.com> (https://github.com/maqr)","Ben Weaver (http://benweaver.com/)","Jae Kwon (https://github.com/jaekwon)","Jim Robert","Ștefan Rusu (http://www.saltwaterc.eu/)","Carter Cole <carter.cole@cartercole.com> (http://cartercole.com/)","Kurt Raschke <kurt@kurtraschke.com> (http://www.kurtraschke.com/)","Contra <contra@australia.edu> (https://github.com/Contra)","Marcelo Diniz <marudiniz@gmail.com> (https://github.com/mdiniz)","Michael Hart (https://github.com/mhart)","Zachary Scott <zachary@zacharyscott.net> (http://zacharyscott.net/)","Raoul Millais (https://github.com/raoulmillais)","Salsita Software (http://www.salsitasoft.com/)","Mike Schilling <mike@emotive.com> (http://www.emotive.com/)","Jackson Tian <shyvo1987@gmail.com> (http://weibo.com/shyvo)","Mikhail Zyatin <mikhail.zyatin@gmail.com> (https://github.com/Sitin)","Chris Tavares <ctavares@microsoft.com> (https://github.com/christav)","Frank Xu <yyfrankyy@gmail.com> (http://f2e.us/)","Guido D'Albore <guido@bitstorm.it> (http://www.bitstorm.it/)","Jack Senechal (http://jacksenechal.com/)","Matthias Hölzl <tc@xantira.com> (https://github.com/hoelzl)","Camille Reynders <info@creynders.be> (http://www.creynders.be/)","Taylor Gautier (https://github.com/tsgautier)","Todd Bryan (https://github.com/toddrbryan)","Leore Avidar <leore.avidar@gmail.com> (http://leoreavidar.com/)","Dave Aitken <dave.aitken@gmail.com> (http://www.actionshrimp.com/)","Shaney Orrowe <shaney.orrowe@practiceweb.co.uk>","Candle <candle@candle.me.uk>","Jess Telford <hi@jes.st> (http://jes.st)","Tom Hughes <<tom@compton.nu> (http://compton.nu/)","Piotr Rochala (http://rocha.la/)","Michael Avila (https://github.com/michaelavila)","Ryan Gahl (https://github.com/ryedin)","Eric Laberge <e.laberge@gmail.com> (https://github.com/elaberge)","Benjamin E. Coe <ben@npmjs.com> (https://twitter.com/benjamincoe)","Stephen Cresswell (https://github.com/cressie176)","Pascal Ehlert <pascal@hacksrus.net> (http://www.hacksrus.net/)","Tom Spencer <fiznool@gmail.com> (http://fiznool.com/)","Tristian Flanagan <tflanagan@datacollaborative.com> (https://github.com/tflanagan)","Tim Johns <timjohns@yahoo.com> (https://github.com/TimJohns)","Bogdan Chadkin <trysound@yandex.ru> (https://github.com/TrySound)","David Wood <david.p.wood@gmail.com> (http://codesleuth.co.uk/)","Nicolas Maquet (https://github.com/nmaquet)","Lovell Fuller (http://lovell.info/)","d3adc0d3 (https://github.com/d3adc0d3)","James Crosby (https://github.com/autopulated)"],"main":"./lib/xml2js","files":["lib"],"directories":{"lib":"./lib"},"scripts":{"build":"cake build","test":"zap","coverage":"nyc npm test && nyc report","coveralls":"nyc npm test && nyc report --reporter=text-lcov | coveralls","doc":"cake doc"},"repository":{"type":"git","url":"https://github.com/Leonidas-from-XIV/node-xml2js.git"},"dependencies":{"sax":">=0.6.0","xmlbuilder":"~11.0.0"},"devDependencies":{"coffeescript":">=1.10.0 <2","coveralls":"^3.0.1","diff":">=1.0.8","docco":">=0.6.2","nyc":">=2.2.1","zap":">=0.2.9 <1"},"engines":{"node":">=4.0.0"},"license":"MIT","_lastModified":"2025-07-17T07:51:53.548Z"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-wechat-official-account",
3
- "version": "1.3.16",
3
+ "version": "1.3.18",
4
4
  "keywords": [
5
5
  "Authentication"
6
6
  ],
@@ -20,11 +20,11 @@
20
20
  "xml2js": "^0.6.2"
21
21
  },
22
22
  "peerDependencies": {
23
- "@tachybase/actions": "1.3.16",
24
- "@tachybase/client": "1.3.16",
25
- "@tachybase/module-auth": "1.3.16",
26
- "@tachybase/server": "1.3.16",
27
- "@tachybase/test": "1.3.16"
23
+ "@tachybase/actions": "1.3.18",
24
+ "@tachybase/module-auth": "1.3.18",
25
+ "@tachybase/server": "1.3.18",
26
+ "@tachybase/client": "1.3.18",
27
+ "@tachybase/test": "1.3.18"
28
28
  },
29
29
  "scripts": {
30
30
  "build": "tachybase-build --no-dts @tachybase/plugin-wechat-official-account"