node-easywechat 2.9.3 → 3.0.0-alpha.1
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/CHANGELOG.md +8 -0
- package/README.md +20 -281
- package/dist/Core/Cache/FileCache.d.ts +6 -5
- package/dist/Core/Cache/FileCache.js +5 -5
- package/dist/Core/Config.d.ts +66 -0
- package/dist/Core/Config.js +117 -0
- package/dist/Core/Contracts/AccessTokenInterface.d.ts +13 -0
- package/dist/Core/Contracts/AccessTokenInterface.js +28 -0
- package/dist/Core/Contracts/CacheInterface.d.ts +28 -5
- package/dist/Core/Contracts/CacheInterface.js +31 -18
- package/dist/Core/Contracts/ConfigInterface.d.ts +29 -0
- package/dist/Core/Contracts/ConfigInterface.js +34 -0
- package/dist/Core/Contracts/ObjectAccessInterface.d.ts +31 -0
- package/dist/Core/Contracts/ObjectAccessInterface.js +33 -0
- package/dist/Core/Contracts/RefreshableAccessTokenInterface.d.ts +9 -0
- package/dist/{OfficialAccount/Server/Guard.js → Core/Contracts/RefreshableAccessTokenInterface.js} +9 -8
- package/dist/Core/Contracts/ServerInterface.d.ts +8 -0
- package/dist/Core/Contracts/ServerInterface.js +20 -0
- package/dist/Core/Encryptor.d.ts +29 -3
- package/dist/Core/Encryptor.js +37 -12
- package/dist/Core/Http/Contracts/MessageInterface.d.ts +69 -0
- package/dist/Core/Http/Contracts/MessageInterface.js +70 -0
- package/dist/Core/Http/Contracts/RequestInterface.d.ts +37 -0
- package/dist/Core/Http/Contracts/RequestInterface.js +42 -0
- package/dist/Core/Http/Contracts/ResponseInterface.d.ts +21 -0
- package/dist/Core/Http/Contracts/ResponseInterface.js +26 -0
- package/dist/Core/Http/Contracts/ServerRequestInterface.d.ts +78 -0
- package/dist/Core/Http/Contracts/ServerRequestInterface.js +83 -0
- package/dist/Core/Http/Minxins/MessageMixin.d.ts +24 -0
- package/dist/Core/Http/Minxins/MessageMixin.js +93 -0
- package/dist/Core/Http/Minxins/RequestMixin.d.ts +12 -0
- package/dist/Core/Http/Minxins/RequestMixin.js +30 -0
- package/dist/Core/Http/Request.d.ts +8 -25
- package/dist/Core/Http/Request.js +12 -177
- package/dist/Core/Http/Response.d.ts +11 -12
- package/dist/Core/Http/Response.js +30 -26
- package/dist/Core/Http/ServerRequest.d.ts +47 -0
- package/dist/Core/Http/ServerRequest.js +136 -0
- package/dist/Core/HttpClient/AccessTokenAwareClient.d.ts +19 -0
- package/dist/Core/HttpClient/AccessTokenAwareClient.js +47 -0
- package/dist/Core/HttpClient/Contracts/AccessTokenAwareHttpClientInterface.d.ts +9 -0
- package/dist/Core/HttpClient/Contracts/AccessTokenAwareHttpClientInterface.js +13 -0
- package/dist/Core/HttpClient/Contracts/HttpClientInterface.d.ts +18 -0
- package/dist/Core/HttpClient/Contracts/HttpClientInterface.js +29 -0
- package/dist/Core/HttpClient/Contracts/HttpClientResponseInterface.d.ts +35 -0
- package/dist/Core/HttpClient/Contracts/HttpClientResponseInterface.js +37 -0
- package/dist/Core/HttpClient/HttpClient.d.ts +20 -0
- package/dist/Core/HttpClient/HttpClient.js +92 -0
- package/dist/Core/HttpClient/HttpClientResponse.d.ts +76 -0
- package/dist/Core/HttpClient/HttpClientResponse.js +171 -0
- package/dist/Core/HttpClient/Mixins/HttpClientMethodsMixin.d.ts +48 -0
- package/dist/Core/HttpClient/Mixins/HttpClientMethodsMixin.js +88 -0
- package/dist/Core/Message.d.ts +144 -0
- package/dist/Core/Message.js +74 -0
- package/dist/Core/Mixins/CacheMixin.d.ts +40 -0
- package/dist/Core/Mixins/CacheMixin.js +63 -0
- package/dist/Core/Mixins/ClientMixin.d.ts +16 -0
- package/dist/Core/Mixins/ClientMixin.js +21 -0
- package/dist/Core/Mixins/ConfigMixin.d.ts +16 -0
- package/dist/Core/Mixins/ConfigMixin.js +21 -0
- package/dist/Core/Mixins/DecryptXmlMessageMixin.d.ts +11 -0
- package/dist/Core/Mixins/DecryptXmlMessageMixin.js +38 -0
- package/dist/Core/Mixins/HandlersMixin.d.ts +79 -0
- package/dist/Core/Mixins/HandlersMixin.js +163 -0
- package/dist/Core/Mixins/HasAttributesMixin.d.ts +46 -0
- package/dist/Core/Mixins/HasAttributesMixin.js +75 -0
- package/dist/Core/Mixins/HttpClientMixin.d.ts +26 -0
- package/dist/Core/Mixins/HttpClientMixin.js +45 -0
- package/dist/Core/Mixins/ResponseXmlMessageMixin.d.ts +13 -0
- package/dist/Core/Mixins/ResponseXmlMessageMixin.js +63 -0
- package/dist/Core/Mixins/ServerRequestMixin.d.ts +16 -0
- package/dist/Core/Mixins/ServerRequestMixin.js +21 -0
- package/dist/Core/{AES.d.ts → Support/AES.d.ts} +0 -0
- package/dist/Core/{AES.js → Support/AES.js} +0 -0
- package/dist/Core/Support/Obj.d.ts +62 -0
- package/dist/Core/Support/Obj.js +136 -0
- package/dist/Core/{PKCS.d.ts → Support/PKCS.d.ts} +2 -1
- package/dist/Core/{PKCS.js → Support/PKCS.js} +1 -3
- package/dist/Core/{RSA.d.ts → Support/RSA.d.ts} +2 -1
- package/dist/Core/{RSA.js → Support/RSA.js} +1 -2
- package/dist/Core/Support/Utils.d.ts +89 -0
- package/dist/Core/{Utils.js → Support/Utils.js} +84 -40
- package/dist/OfficialAccount/AccessToken.d.ts +26 -0
- package/dist/OfficialAccount/AccessToken.js +83 -0
- package/dist/OfficialAccount/Account.d.ts +13 -0
- package/dist/OfficialAccount/Account.js +29 -0
- package/dist/OfficialAccount/Application.d.ts +70 -66
- package/dist/OfficialAccount/Application.js +146 -222
- package/dist/OfficialAccount/Config.d.ts +5 -0
- package/dist/OfficialAccount/Config.js +14 -0
- package/dist/OfficialAccount/Contracts/AccountInterface.d.ts +23 -0
- package/dist/OfficialAccount/Contracts/AccountInterface.js +25 -0
- package/dist/OfficialAccount/Contracts/ApplicationInterface.d.ts +87 -0
- package/dist/OfficialAccount/Contracts/ApplicationInterface.js +76 -0
- package/dist/OfficialAccount/JsApiTicket.d.ts +23 -0
- package/dist/OfficialAccount/JsApiTicket.js +76 -0
- package/dist/OfficialAccount/Message.d.ts +4 -0
- package/dist/OfficialAccount/Message.js +8 -0
- package/dist/OfficialAccount/Server.d.ts +43 -0
- package/dist/OfficialAccount/Server.js +96 -0
- package/dist/OfficialAccount/Utils.d.ts +7 -0
- package/dist/{Work/MiniProgram/Auth/AuthClient.js → OfficialAccount/Utils.js} +14 -13
- package/dist/Types/global.d.ts +343 -0
- package/official_account.access_token.mock-access_token-appid.cache +1 -0
- package/official_account.jsapi_ticket.mock-ticket-appid.cache +1 -0
- package/package.json +13 -10
- package/dist/BaseService/Application.d.ts +0 -17
- package/dist/BaseService/Application.js +0 -46
- package/dist/BaseService/ContentSecurity/ContentSecurityClient.d.ts +0 -16
- package/dist/BaseService/ContentSecurity/ContentSecurityClient.js +0 -47
- package/dist/BaseService/Jssdk/JssdkClient.d.ts +0 -52
- package/dist/BaseService/Jssdk/JssdkClient.js +0 -128
- package/dist/BaseService/Media/MediaClient.d.ts +0 -57
- package/dist/BaseService/Media/MediaClient.js +0 -151
- package/dist/BaseService/Qrcode/QrcodeClient.d.ts +0 -28
- package/dist/BaseService/Qrcode/QrcodeClient.js +0 -79
- package/dist/BaseService/Url/UrlClient.d.ts +0 -9
- package/dist/BaseService/Url/UrlClient.js +0 -24
- package/dist/Core/BaseAccessToken.d.ts +0 -89
- package/dist/Core/BaseAccessToken.js +0 -206
- package/dist/Core/BaseApplication.d.ts +0 -72
- package/dist/Core/BaseApplication.js +0 -138
- package/dist/Core/BaseClient.d.ts +0 -20
- package/dist/Core/BaseClient.js +0 -109
- package/dist/Core/Contracts/RequestInterface.d.ts +0 -10
- package/dist/Core/Contracts/RequestInterface.js +0 -30
- package/dist/Core/Decorators/FinallResult.d.ts +0 -4
- package/dist/Core/Decorators/FinallResult.js +0 -8
- package/dist/Core/Decorators/TerminateResult.d.ts +0 -4
- package/dist/Core/Decorators/TerminateResult.js +0 -8
- package/dist/Core/Http/StreamResponse.d.ts +0 -6
- package/dist/Core/Http/StreamResponse.js +0 -40
- package/dist/Core/Messages/Article.d.ts +0 -7
- package/dist/Core/Messages/Article.js +0 -31
- package/dist/Core/Messages/Card.d.ts +0 -6
- package/dist/Core/Messages/Card.js +0 -15
- package/dist/Core/Messages/DeviceEvent.d.ts +0 -5
- package/dist/Core/Messages/DeviceEvent.js +0 -19
- package/dist/Core/Messages/DeviceText.d.ts +0 -6
- package/dist/Core/Messages/DeviceText.js +0 -27
- package/dist/Core/Messages/File.d.ts +0 -4
- package/dist/Core/Messages/File.js +0 -12
- package/dist/Core/Messages/Image.d.ts +0 -4
- package/dist/Core/Messages/Image.js +0 -12
- package/dist/Core/Messages/InteractiveTaskCard.d.ts +0 -8
- package/dist/Core/Messages/InteractiveTaskCard.js +0 -22
- package/dist/Core/Messages/Link.d.ts +0 -5
- package/dist/Core/Messages/Link.js +0 -17
- package/dist/Core/Messages/Location.d.ts +0 -5
- package/dist/Core/Messages/Location.js +0 -19
- package/dist/Core/Messages/Markdown.d.ts +0 -5
- package/dist/Core/Messages/Markdown.js +0 -15
- package/dist/Core/Messages/Media.d.ts +0 -8
- package/dist/Core/Messages/Media.js +0 -31
- package/dist/Core/Messages/Message.d.ts +0 -47
- package/dist/Core/Messages/Message.js +0 -133
- package/dist/Core/Messages/MiniProgramNotice.d.ts +0 -5
- package/dist/Core/Messages/MiniProgramNotice.js +0 -16
- package/dist/Core/Messages/MiniProgramPage.d.ts +0 -6
- package/dist/Core/Messages/MiniProgramPage.js +0 -23
- package/dist/Core/Messages/Music.d.ts +0 -7
- package/dist/Core/Messages/Music.js +0 -39
- package/dist/Core/Messages/News.d.ts +0 -9
- package/dist/Core/Messages/News.js +0 -50
- package/dist/Core/Messages/NewsItem.d.ts +0 -7
- package/dist/Core/Messages/NewsItem.js +0 -34
- package/dist/Core/Messages/Raw.d.ts +0 -9
- package/dist/Core/Messages/Raw.js +0 -26
- package/dist/Core/Messages/ReplyInteractiveTaskCard.d.ts +0 -10
- package/dist/Core/Messages/ReplyInteractiveTaskCard.js +0 -25
- package/dist/Core/Messages/ShortVideo.d.ts +0 -4
- package/dist/Core/Messages/ShortVideo.js +0 -12
- package/dist/Core/Messages/TaskCard.d.ts +0 -5
- package/dist/Core/Messages/TaskCard.js +0 -19
- package/dist/Core/Messages/Text.d.ts +0 -7
- package/dist/Core/Messages/Text.js +0 -20
- package/dist/Core/Messages/TextCard.d.ts +0 -5
- package/dist/Core/Messages/TextCard.js +0 -17
- package/dist/Core/Messages/Transfer.d.ts +0 -7
- package/dist/Core/Messages/Transfer.js +0 -22
- package/dist/Core/Messages/Video.d.ts +0 -7
- package/dist/Core/Messages/Video.js +0 -33
- package/dist/Core/Messages/Voice.d.ts +0 -5
- package/dist/Core/Messages/Voice.js +0 -16
- package/dist/Core/Messages/index.d.ts +0 -24
- package/dist/Core/Messages/index.js +0 -36
- package/dist/Core/Mixins/HttpMixin.d.ts +0 -4
- package/dist/Core/Mixins/HttpMixin.js +0 -57
- package/dist/Core/ServerGuard.d.ts +0 -54
- package/dist/Core/ServerGuard.js +0 -288
- package/dist/Core/Types.d.ts +0 -237
- package/dist/Core/Types.js +0 -3
- package/dist/Core/Utils.d.ts +0 -31
- package/dist/MicroMerchant/Application.d.ts +0 -27
- package/dist/MicroMerchant/Application.js +0 -105
- package/dist/MicroMerchant/Base/MicroMerchantBase.d.ts +0 -7
- package/dist/MicroMerchant/Base/MicroMerchantBase.js +0 -52
- package/dist/MicroMerchant/Certficates/CertficatesClient.d.ts +0 -5
- package/dist/MicroMerchant/Certficates/CertficatesClient.js +0 -52
- package/dist/MicroMerchant/Core/BaseClient.d.ts +0 -9
- package/dist/MicroMerchant/Core/BaseClient.js +0 -106
- package/dist/MicroMerchant/Media/MediaClient.d.ts +0 -6
- package/dist/MicroMerchant/Media/MediaClient.js +0 -33
- package/dist/MicroMerchant/MerchantConfig/MerchantConfigClient.d.ts +0 -8
- package/dist/MicroMerchant/MerchantConfig/MerchantConfigClient.js +0 -49
- package/dist/MicroMerchant/Meterial/MeterialClient.d.ts +0 -5
- package/dist/MicroMerchant/Meterial/MeterialClient.js +0 -30
- package/dist/MicroMerchant/Withdraw/WithdrawClient.d.ts +0 -5
- package/dist/MicroMerchant/Withdraw/WithdrawClient.js +0 -28
- package/dist/MiniProgram/ActivityMessage/ActivityMessageClient.d.ts +0 -6
- package/dist/MiniProgram/ActivityMessage/ActivityMessageClient.js +0 -42
- package/dist/MiniProgram/AppCode/AppCodeClient.d.ts +0 -22
- package/dist/MiniProgram/AppCode/AppCodeClient.js +0 -79
- package/dist/MiniProgram/Application.d.ts +0 -83
- package/dist/MiniProgram/Application.js +0 -238
- package/dist/MiniProgram/Auth/AccessToken.d.ts +0 -5
- package/dist/MiniProgram/Auth/AccessToken.js +0 -31
- package/dist/MiniProgram/Auth/AuthClient.d.ts +0 -8
- package/dist/MiniProgram/Auth/AuthClient.js +0 -22
- package/dist/MiniProgram/Base/MiniProgramBase.d.ts +0 -9
- package/dist/MiniProgram/Base/MiniProgramBase.js +0 -21
- package/dist/MiniProgram/Broadcast/BroadcastClient.d.ts +0 -40
- package/dist/MiniProgram/Broadcast/BroadcastClient.js +0 -141
- package/dist/MiniProgram/DataCube/DataCubeClient.d.ts +0 -70
- package/dist/MiniProgram/DataCube/DataCubeClient.js +0 -116
- package/dist/MiniProgram/Encryptor.d.ts +0 -4
- package/dist/MiniProgram/Encryptor.js +0 -23
- package/dist/MiniProgram/Express/ExpressClient.d.ts +0 -65
- package/dist/MiniProgram/Express/ExpressClient.js +0 -113
- package/dist/MiniProgram/Live/LiveClient.d.ts +0 -5
- package/dist/MiniProgram/Live/LiveClient.js +0 -23
- package/dist/MiniProgram/NearbyPoi/NearbyPoiClient.d.ts +0 -31
- package/dist/MiniProgram/NearbyPoi/NearbyPoiClient.js +0 -67
- package/dist/MiniProgram/OpenData/OpenDataClient.d.ts +0 -7
- package/dist/MiniProgram/OpenData/OpenDataClient.js +0 -46
- package/dist/MiniProgram/PhoneNumber/PhoneNumberClient.d.ts +0 -10
- package/dist/MiniProgram/PhoneNumber/PhoneNumberClient.js +0 -20
- package/dist/MiniProgram/Plugin/PluginClient.d.ts +0 -17
- package/dist/MiniProgram/Plugin/PluginClient.js +0 -37
- package/dist/MiniProgram/Plugin/PluginDevClient.d.ts +0 -23
- package/dist/MiniProgram/Plugin/PluginDevClient.js +0 -49
- package/dist/MiniProgram/RealtimeLog/RealtimeLogClient.d.ts +0 -11
- package/dist/MiniProgram/RealtimeLog/RealtimeLogClient.js +0 -25
- package/dist/MiniProgram/RiskControl/RiskControlClient.d.ts +0 -4
- package/dist/MiniProgram/RiskControl/RiskControlClient.js +0 -12
- package/dist/MiniProgram/Search/SearchClient.d.ts +0 -4
- package/dist/MiniProgram/Search/SearchClient.js +0 -14
- package/dist/MiniProgram/Shop/AccoutClient.d.ts +0 -25
- package/dist/MiniProgram/Shop/AccoutClient.js +0 -42
- package/dist/MiniProgram/Shop/AftersaleClient.d.ts +0 -22
- package/dist/MiniProgram/Shop/AftersaleClient.js +0 -35
- package/dist/MiniProgram/Shop/BasicClient.d.ts +0 -39
- package/dist/MiniProgram/Shop/BasicClient.js +0 -69
- package/dist/MiniProgram/Shop/DeliveryClient.d.ts +0 -20
- package/dist/MiniProgram/Shop/DeliveryClient.js +0 -32
- package/dist/MiniProgram/Shop/OrderClient.d.ts +0 -39
- package/dist/MiniProgram/Shop/OrderClient.js +0 -60
- package/dist/MiniProgram/Shop/RegisterClient.d.ts +0 -25
- package/dist/MiniProgram/Shop/RegisterClient.js +0 -43
- package/dist/MiniProgram/Shop/SpuClient.d.ts +0 -67
- package/dist/MiniProgram/Shop/SpuClient.js +0 -92
- package/dist/MiniProgram/ShortLink/ShortLinkClient.d.ts +0 -11
- package/dist/MiniProgram/ShortLink/ShortLinkClient.js +0 -23
- package/dist/MiniProgram/Soter/SoterClient.d.ts +0 -10
- package/dist/MiniProgram/Soter/SoterClient.js +0 -22
- package/dist/MiniProgram/SubscribeMessage/SubscribeMessageClient.d.ts +0 -50
- package/dist/MiniProgram/SubscribeMessage/SubscribeMessageClient.js +0 -122
- package/dist/MiniProgram/TemplateMessage/TemplateMessageClient.d.ts +0 -18
- package/dist/MiniProgram/TemplateMessage/TemplateMessageClient.js +0 -50
- package/dist/MiniProgram/UniformMessage/UniformMessageClient.d.ts +0 -26
- package/dist/MiniProgram/UniformMessage/UniformMessageClient.js +0 -68
- package/dist/MiniProgram/Union/UnionClient.d.ts +0 -16
- package/dist/MiniProgram/Union/UnionClient.js +0 -69
- package/dist/MiniProgram/UrlLink/UrlLinkClient.d.ts +0 -9
- package/dist/MiniProgram/UrlLink/UrlLinkClient.js +0 -17
- package/dist/MiniProgram/UrlScheme/UrlSchemeClient.d.ts +0 -4
- package/dist/MiniProgram/UrlScheme/UrlSchemeClient.js +0 -12
- package/dist/OfficialAccount/Auth/AccessToken.d.ts +0 -5
- package/dist/OfficialAccount/Auth/AccessToken.js +0 -31
- package/dist/OfficialAccount/AutoReply/AutoReplyClient.d.ts +0 -7
- package/dist/OfficialAccount/AutoReply/AutoReplyClient.js +0 -15
- package/dist/OfficialAccount/Base/OfficialAccountBase.d.ts +0 -18
- package/dist/OfficialAccount/Base/OfficialAccountBase.js +0 -47
- package/dist/OfficialAccount/Broadcasting/BroadcastingClient.d.ts +0 -158
- package/dist/OfficialAccount/Broadcasting/BroadcastingClient.js +0 -233
- package/dist/OfficialAccount/Broadcasting/MessageBuilder.d.ts +0 -14
- package/dist/OfficialAccount/Broadcasting/MessageBuilder.js +0 -63
- package/dist/OfficialAccount/Card/BoardingPassClient.d.ts +0 -4
- package/dist/OfficialAccount/Card/BoardingPassClient.js +0 -12
- package/dist/OfficialAccount/Card/Card.d.ts +0 -17
- package/dist/OfficialAccount/Card/Card.js +0 -31
- package/dist/OfficialAccount/Card/Client.d.ts +0 -108
- package/dist/OfficialAccount/Card/Client.js +0 -218
- package/dist/OfficialAccount/Card/CodeClient.d.ts +0 -51
- package/dist/OfficialAccount/Card/CodeClient.js +0 -100
- package/dist/OfficialAccount/Card/CoinClient.d.ts +0 -10
- package/dist/OfficialAccount/Card/CoinClient.js +0 -41
- package/dist/OfficialAccount/Card/GeneralCardClient.d.ts +0 -19
- package/dist/OfficialAccount/Card/GeneralCardClient.js +0 -34
- package/dist/OfficialAccount/Card/JssdkClient.d.ts +0 -6
- package/dist/OfficialAccount/Card/JssdkClient.js +0 -67
- package/dist/OfficialAccount/Card/MeetingTicketClient.d.ts +0 -8
- package/dist/OfficialAccount/Card/MeetingTicketClient.js +0 -16
- package/dist/OfficialAccount/Card/MemberCardClient.d.ts +0 -35
- package/dist/OfficialAccount/Card/MemberCardClient.js +0 -62
- package/dist/OfficialAccount/Card/MovieTicketClient.d.ts +0 -8
- package/dist/OfficialAccount/Card/MovieTicketClient.js +0 -16
- package/dist/OfficialAccount/Card/SubMerchantClient.d.ts +0 -26
- package/dist/OfficialAccount/Card/SubMerchantClient.js +0 -73
- package/dist/OfficialAccount/Comment/CommentClient.d.ts +0 -60
- package/dist/OfficialAccount/Comment/CommentClient.js +0 -115
- package/dist/OfficialAccount/CustomerService/CustomerServiceClient.d.ts +0 -15
- package/dist/OfficialAccount/CustomerService/CustomerServiceClient.js +0 -78
- package/dist/OfficialAccount/CustomerService/CustomerServiceSession.d.ts +0 -8
- package/dist/OfficialAccount/CustomerService/CustomerServiceSession.js +0 -36
- package/dist/OfficialAccount/CustomerService/Messenger.d.ts +0 -18
- package/dist/OfficialAccount/CustomerService/Messenger.js +0 -62
- package/dist/OfficialAccount/DataCube/DataCubeClient.d.ts +0 -135
- package/dist/OfficialAccount/DataCube/DataCubeClient.js +0 -203
- package/dist/OfficialAccount/Device/DeviceClient.d.ts +0 -15
- package/dist/OfficialAccount/Device/DeviceClient.js +0 -70
- package/dist/OfficialAccount/Goods/GoodsClient.d.ts +0 -30
- package/dist/OfficialAccount/Goods/GoodsClient.js +0 -60
- package/dist/OfficialAccount/Material/MaterialClient.d.ts +0 -67
- package/dist/OfficialAccount/Material/MaterialClient.js +0 -193
- package/dist/OfficialAccount/Menu/MenuClient.d.ts +0 -27
- package/dist/OfficialAccount/Menu/MenuClient.js +0 -58
- package/dist/OfficialAccount/OCR/OCRClient.d.ts +0 -40
- package/dist/OfficialAccount/OCR/OCRClient.js +0 -85
- package/dist/OfficialAccount/POI/POIClient.d.ts +0 -39
- package/dist/OfficialAccount/POI/POIClient.js +0 -87
- package/dist/OfficialAccount/Semantic/SemanticClient.d.ts +0 -10
- package/dist/OfficialAccount/Semantic/SemanticClient.js +0 -24
- package/dist/OfficialAccount/Server/Guard.d.ts +0 -4
- package/dist/OfficialAccount/ShakeAround/Client.d.ts +0 -23
- package/dist/OfficialAccount/ShakeAround/Client.js +0 -43
- package/dist/OfficialAccount/ShakeAround/DeviceClient.d.ts +0 -51
- package/dist/OfficialAccount/ShakeAround/DeviceClient.js +0 -100
- package/dist/OfficialAccount/ShakeAround/GroupClient.d.ts +0 -44
- package/dist/OfficialAccount/ShakeAround/GroupClient.js +0 -84
- package/dist/OfficialAccount/ShakeAround/MaterialClient.d.ts +0 -9
- package/dist/OfficialAccount/ShakeAround/MaterialClient.js +0 -21
- package/dist/OfficialAccount/ShakeAround/PageClient.d.ts +0 -30
- package/dist/OfficialAccount/ShakeAround/PageClient.js +0 -56
- package/dist/OfficialAccount/ShakeAround/RelationClient.d.ts +0 -21
- package/dist/OfficialAccount/ShakeAround/RelationClient.js +0 -44
- package/dist/OfficialAccount/ShakeAround/ShakeAround.d.ts +0 -14
- package/dist/OfficialAccount/ShakeAround/ShakeAround.js +0 -25
- package/dist/OfficialAccount/ShakeAround/StatsClient.d.ts +0 -29
- package/dist/OfficialAccount/ShakeAround/StatsClient.js +0 -57
- package/dist/OfficialAccount/Store/StoreClient.d.ts +0 -63
- package/dist/OfficialAccount/Store/StoreClient.js +0 -104
- package/dist/OfficialAccount/SubscribeMessage/SubscribeMessageClient.d.ts +0 -39
- package/dist/OfficialAccount/SubscribeMessage/SubscribeMessageClient.js +0 -116
- package/dist/OfficialAccount/TemplateMessage/TemplateMessageClient.d.ts +0 -42
- package/dist/OfficialAccount/TemplateMessage/TemplateMessageClient.js +0 -114
- package/dist/OfficialAccount/User/TagClient.d.ts +0 -46
- package/dist/OfficialAccount/User/TagClient.js +0 -92
- package/dist/OfficialAccount/User/UserClient.d.ts +0 -47
- package/dist/OfficialAccount/User/UserClient.js +0 -95
- package/dist/OpenPlatform/Application.d.ts +0 -88
- package/dist/OpenPlatform/Application.js +0 -223
- package/dist/OpenPlatform/Auth/AccessToken.d.ts +0 -7
- package/dist/OpenPlatform/Auth/AccessToken.js +0 -33
- package/dist/OpenPlatform/Auth/VerifyTicket.d.ts +0 -8
- package/dist/OpenPlatform/Auth/VerifyTicket.js +0 -40
- package/dist/OpenPlatform/Authorizer/Aggregate/Account/Client.d.ts +0 -21
- package/dist/OpenPlatform/Authorizer/Aggregate/Account/Client.js +0 -45
- package/dist/OpenPlatform/Authorizer/Auth/AccessToken.d.ts +0 -12
- package/dist/OpenPlatform/Authorizer/Auth/AccessToken.js +0 -43
- package/dist/OpenPlatform/Authorizer/MiniProgram/Account/AccountClient.d.ts +0 -21
- package/dist/OpenPlatform/Authorizer/MiniProgram/Account/AccountClient.js +0 -42
- package/dist/OpenPlatform/Authorizer/MiniProgram/Application.d.ts +0 -15
- package/dist/OpenPlatform/Authorizer/MiniProgram/Application.js +0 -42
- package/dist/OpenPlatform/Authorizer/MiniProgram/Auth/Client.d.ts +0 -11
- package/dist/OpenPlatform/Authorizer/MiniProgram/Auth/Client.js +0 -39
- package/dist/OpenPlatform/Authorizer/MiniProgram/Code/CodeClient.d.ts +0 -85
- package/dist/OpenPlatform/Authorizer/MiniProgram/Code/CodeClient.js +0 -152
- package/dist/OpenPlatform/Authorizer/MiniProgram/Domain/DomainClient.d.ts +0 -14
- package/dist/OpenPlatform/Authorizer/MiniProgram/Domain/DomainClient.js +0 -27
- package/dist/OpenPlatform/Authorizer/MiniProgram/Setting/SettingClient.d.ts +0 -72
- package/dist/OpenPlatform/Authorizer/MiniProgram/Setting/SettingClient.js +0 -133
- package/dist/OpenPlatform/Authorizer/MiniProgram/Tester/TesterClient.d.ts +0 -17
- package/dist/OpenPlatform/Authorizer/MiniProgram/Tester/TesterClient.js +0 -35
- package/dist/OpenPlatform/Authorizer/OfficialAccount/Account/Client.d.ts +0 -18
- package/dist/OpenPlatform/Authorizer/OfficialAccount/Account/Client.js +0 -38
- package/dist/OpenPlatform/Authorizer/OfficialAccount/Application.d.ts +0 -7
- package/dist/OpenPlatform/Authorizer/OfficialAccount/Application.js +0 -22
- package/dist/OpenPlatform/Authorizer/OfficialAccount/MiniProgram/MiniProgramClient.d.ts +0 -19
- package/dist/OpenPlatform/Authorizer/OfficialAccount/MiniProgram/MiniProgramClient.js +0 -37
- package/dist/OpenPlatform/Authorizer/Server/Guard.d.ts +0 -4
- package/dist/OpenPlatform/Authorizer/Server/Guard.js +0 -13
- package/dist/OpenPlatform/Base/OpenPlatformBase.d.ts +0 -40
- package/dist/OpenPlatform/Base/OpenPlatformBase.js +0 -83
- package/dist/OpenPlatform/CodeTemplate/CodeTemplateClient.d.ts +0 -23
- package/dist/OpenPlatform/CodeTemplate/CodeTemplateClient.js +0 -48
- package/dist/OpenPlatform/Component/ComponentClient.d.ts +0 -15
- package/dist/OpenPlatform/Component/ComponentClient.js +0 -33
- package/dist/OpenPlatform/Server/OpenPlatformGuard.d.ts +0 -11
- package/dist/OpenPlatform/Server/OpenPlatformGuard.js +0 -54
- package/dist/OpenWork/Application.d.ts +0 -37
- package/dist/OpenWork/Application.js +0 -128
- package/dist/OpenWork/Auth/ProviderAccessToken.d.ts +0 -8
- package/dist/OpenWork/Auth/ProviderAccessToken.js +0 -33
- package/dist/OpenWork/Auth/SuiteAccessToken.d.ts +0 -8
- package/dist/OpenWork/Auth/SuiteAccessToken.js +0 -34
- package/dist/OpenWork/Auth/SuiteTicket.d.ts +0 -8
- package/dist/OpenWork/Auth/SuiteTicket.js +0 -40
- package/dist/OpenWork/Corp/CorpClient.d.ts +0 -72
- package/dist/OpenWork/Corp/CorpClient.js +0 -150
- package/dist/OpenWork/MiniProgram/MiniProgramClient.d.ts +0 -5
- package/dist/OpenWork/MiniProgram/MiniProgramClient.js +0 -18
- package/dist/OpenWork/Provider/ProviderClient.d.ts +0 -81
- package/dist/OpenWork/Provider/ProviderClient.js +0 -172
- package/dist/OpenWork/Server/OpenWorkGuard.d.ts +0 -13
- package/dist/OpenWork/Server/OpenWorkGuard.js +0 -51
- package/dist/OpenWork/Work/Application.d.ts +0 -5
- package/dist/OpenWork/Work/Application.js +0 -22
- package/dist/OpenWork/Work/Auth/AccessToken.d.ts +0 -12
- package/dist/OpenWork/Work/Auth/AccessToken.js +0 -44
- package/dist/Payment/Application.d.ts +0 -76
- package/dist/Payment/Application.js +0 -199
- package/dist/Payment/Base/PaymentBase.d.ts +0 -13
- package/dist/Payment/Base/PaymentBase.js +0 -40
- package/dist/Payment/Bill/BillClient.d.ts +0 -10
- package/dist/Payment/Bill/BillClient.js +0 -43
- package/dist/Payment/Core/BaseClient.d.ts +0 -17
- package/dist/Payment/Core/BaseClient.js +0 -116
- package/dist/Payment/Coupon/CouponClient.d.ts +0 -6
- package/dist/Payment/Coupon/CouponClient.js +0 -37
- package/dist/Payment/Jssdk/JssdkClient.d.ts +0 -38
- package/dist/Payment/Jssdk/JssdkClient.js +0 -122
- package/dist/Payment/Merchant/MerchantClient.d.ts +0 -7
- package/dist/Payment/Merchant/MerchantClient.js +0 -40
- package/dist/Payment/Notify/Handler.d.ts +0 -25
- package/dist/Payment/Notify/Handler.js +0 -96
- package/dist/Payment/Notify/Paid.d.ts +0 -6
- package/dist/Payment/Notify/Paid.js +0 -32
- package/dist/Payment/Notify/Refunded.d.ts +0 -7
- package/dist/Payment/Notify/Refunded.js +0 -39
- package/dist/Payment/Notify/Scanned.d.ts +0 -9
- package/dist/Payment/Notify/Scanned.js +0 -54
- package/dist/Payment/Order/OrderClient.d.ts +0 -25
- package/dist/Payment/Order/OrderClient.js +0 -76
- package/dist/Payment/ProfitSharing/ProfitSharingClient.d.ts +0 -10
- package/dist/Payment/ProfitSharing/ProfitSharingClient.js +0 -59
- package/dist/Payment/Redpack/RedpackClient.d.ts +0 -23
- package/dist/Payment/Redpack/RedpackClient.js +0 -73
- package/dist/Payment/Refund/RefundClient.d.ts +0 -43
- package/dist/Payment/Refund/RefundClient.js +0 -80
- package/dist/Payment/Reverse/ReverseClient.d.ts +0 -14
- package/dist/Payment/Reverse/ReverseClient.js +0 -30
- package/dist/Payment/Sandbox/SandboxClient.d.ts +0 -8
- package/dist/Payment/Sandbox/SandboxClient.js +0 -40
- package/dist/Payment/Security/SecurityClient.d.ts +0 -7
- package/dist/Payment/Security/SecurityClient.js +0 -18
- package/dist/Payment/Transfer/TransferClient.d.ts +0 -23
- package/dist/Payment/Transfer/TransferClient.js +0 -78
- package/dist/Work/Agent/AgentClient.d.ts +0 -6
- package/dist/Work/Agent/AgentClient.js +0 -25
- package/dist/Work/Agent/WorkbenchClient.d.ts +0 -24
- package/dist/Work/Agent/WorkbenchClient.js +0 -39
- package/dist/Work/Application.d.ts +0 -80
- package/dist/Work/Application.js +0 -263
- package/dist/Work/Auth/AccessToken.d.ts +0 -5
- package/dist/Work/Auth/AccessToken.js +0 -36
- package/dist/Work/Base/WorkBase.d.ts +0 -4
- package/dist/Work/Base/WorkBase.js +0 -12
- package/dist/Work/Calendar/CalendarClient.d.ts +0 -7
- package/dist/Work/Calendar/CalendarClient.js +0 -32
- package/dist/Work/Chat/ChatClient.d.ts +0 -7
- package/dist/Work/Chat/ChatClient.js +0 -27
- package/dist/Work/CorpGroup/CorpGroupClient.d.ts +0 -40
- package/dist/Work/CorpGroup/CorpGroupClient.js +0 -68
- package/dist/Work/Department/DepartmentClient.d.ts +0 -7
- package/dist/Work/Department/DepartmentClient.js +0 -29
- package/dist/Work/ExternalContact/Client.d.ts +0 -222
- package/dist/Work/ExternalContact/Client.js +0 -365
- package/dist/Work/ExternalContact/ContactWayClient.d.ts +0 -44
- package/dist/Work/ExternalContact/ContactWayClient.js +0 -82
- package/dist/Work/ExternalContact/GroupChatWayClient.d.ts +0 -32
- package/dist/Work/ExternalContact/GroupChatWayClient.js +0 -54
- package/dist/Work/ExternalContact/MessageClient.d.ts +0 -58
- package/dist/Work/ExternalContact/MessageClient.js +0 -158
- package/dist/Work/ExternalContact/MessageTemplateClient.d.ts +0 -14
- package/dist/Work/ExternalContact/MessageTemplateClient.js +0 -78
- package/dist/Work/ExternalContact/MomentClient.d.ts +0 -61
- package/dist/Work/ExternalContact/MomentClient.js +0 -104
- package/dist/Work/ExternalContact/SchoolClient.d.ts +0 -28
- package/dist/Work/ExternalContact/SchoolClient.js +0 -177
- package/dist/Work/ExternalContact/StatisticsClient.d.ts +0 -28
- package/dist/Work/ExternalContact/StatisticsClient.js +0 -52
- package/dist/Work/GroupRobot/GroupRobotClient.d.ts +0 -7
- package/dist/Work/GroupRobot/GroupRobotClient.js +0 -18
- package/dist/Work/GroupRobot/Messages/Image.d.ts +0 -6
- package/dist/Work/GroupRobot/Messages/Image.js +0 -15
- package/dist/Work/GroupRobot/Messages/Markdown.d.ts +0 -6
- package/dist/Work/GroupRobot/Messages/Markdown.js +0 -14
- package/dist/Work/GroupRobot/Messages/Message.d.ts +0 -3
- package/dist/Work/GroupRobot/Messages/Message.js +0 -7
- package/dist/Work/GroupRobot/Messages/News.d.ts +0 -8
- package/dist/Work/GroupRobot/Messages/News.js +0 -32
- package/dist/Work/GroupRobot/Messages/NewsItem.d.ts +0 -6
- package/dist/Work/GroupRobot/Messages/NewsItem.js +0 -20
- package/dist/Work/GroupRobot/Messages/Text.d.ts +0 -8
- package/dist/Work/GroupRobot/Messages/Text.js +0 -24
- package/dist/Work/GroupRobot/Messages/index.d.ts +0 -6
- package/dist/Work/GroupRobot/Messages/index.js +0 -18
- package/dist/Work/GroupRobot/Messenger.d.ts +0 -11
- package/dist/Work/GroupRobot/Messenger.js +0 -39
- package/dist/Work/Invoice/InvoiceClient.d.ts +0 -7
- package/dist/Work/Invoice/InvoiceClient.js +0 -38
- package/dist/Work/Jssdk/JssdkClient.d.ts +0 -21
- package/dist/Work/Jssdk/JssdkClient.js +0 -106
- package/dist/Work/Kf/KfAccountClient.d.ts +0 -41
- package/dist/Work/Kf/KfAccountClient.js +0 -71
- package/dist/Work/Kf/KfMessageClient.d.ts +0 -44
- package/dist/Work/Kf/KfMessageClient.js +0 -73
- package/dist/Work/Kf/KfServicerClient.d.ts +0 -26
- package/dist/Work/Kf/KfServicerClient.js +0 -47
- package/dist/Work/Live/LiveClient.d.ts +0 -6
- package/dist/Work/Live/LiveClient.js +0 -32
- package/dist/Work/Media/MediaClient.d.ts +0 -52
- package/dist/Work/Media/MediaClient.js +0 -124
- package/dist/Work/Menu/MenuClient.d.ts +0 -6
- package/dist/Work/Menu/MenuClient.js +0 -24
- package/dist/Work/Message/MessageClient.d.ts +0 -7
- package/dist/Work/Message/MessageClient.js +0 -16
- package/dist/Work/Message/Messenger.d.ts +0 -18
- package/dist/Work/Message/Messenger.js +0 -69
- package/dist/Work/MiniProgram/Application.d.ts +0 -7
- package/dist/Work/MiniProgram/Application.js +0 -26
- package/dist/Work/MiniProgram/Auth/AuthClient.d.ts +0 -8
- package/dist/Work/MsgAudit/MsgAuditClient.d.ts +0 -7
- package/dist/Work/MsgAudit/MsgAuditClient.js +0 -32
- package/dist/Work/OA/OAClient.d.ts +0 -11
- package/dist/Work/OA/OAClient.js +0 -67
- package/dist/Work/Schedule/ScheduleClient.d.ts +0 -8
- package/dist/Work/Schedule/ScheduleClient.js +0 -39
- package/dist/Work/Server/Guard.d.ts +0 -6
- package/dist/Work/Server/Guard.js +0 -34
- package/dist/Work/User/TagClient.d.ts +0 -13
- package/dist/Work/User/TagClient.js +0 -53
- package/dist/Work/User/UserClient.d.ts +0 -16
- package/dist/Work/User/UserClient.js +0 -80
- package/dist/index.d.ts +0 -119
- package/dist/index.js +0 -86
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TextCard = void 0;
|
|
4
|
-
const Message_1 = require("./Message");
|
|
5
|
-
class TextCard extends Message_1.Message {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.type = 'textcard';
|
|
9
|
-
this.properties = [
|
|
10
|
-
'title',
|
|
11
|
-
'description',
|
|
12
|
-
'url',
|
|
13
|
-
];
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
exports.TextCard = TextCard;
|
|
17
|
-
;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Transfer = void 0;
|
|
4
|
-
const Message_1 = require("./Message");
|
|
5
|
-
class Transfer extends Message_1.Message {
|
|
6
|
-
constructor(account) {
|
|
7
|
-
super({ account });
|
|
8
|
-
this.type = 'transfer_customer_service';
|
|
9
|
-
this.properties = [
|
|
10
|
-
'account',
|
|
11
|
-
];
|
|
12
|
-
}
|
|
13
|
-
toXmlArray() {
|
|
14
|
-
return this.get('account') ? {
|
|
15
|
-
TransInfo: {
|
|
16
|
-
KfAccount: this.get('account')
|
|
17
|
-
}
|
|
18
|
-
} : {};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.Transfer = Transfer;
|
|
22
|
-
;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Video = void 0;
|
|
4
|
-
const Media_1 = require("./Media");
|
|
5
|
-
class Video extends Media_1.Media {
|
|
6
|
-
constructor(mediaId, attributes = {}) {
|
|
7
|
-
super(mediaId, 'video', attributes);
|
|
8
|
-
this.type = 'video';
|
|
9
|
-
this.properties = [
|
|
10
|
-
'title',
|
|
11
|
-
'description',
|
|
12
|
-
'media_id',
|
|
13
|
-
'thumb_media_id',
|
|
14
|
-
];
|
|
15
|
-
}
|
|
16
|
-
toXmlArray() {
|
|
17
|
-
let music = {
|
|
18
|
-
Music: {
|
|
19
|
-
Title: this.get('title'),
|
|
20
|
-
Description: this.get('description'),
|
|
21
|
-
MusicUrl: this.get('url'),
|
|
22
|
-
HQMusicUrl: this.get('hq_url'),
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
let thumbMediaId = this.get('thumb_media_id');
|
|
26
|
-
if (thumbMediaId) {
|
|
27
|
-
music['Music']['ThumbMediaId'] = thumbMediaId;
|
|
28
|
-
}
|
|
29
|
-
return music;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
exports.Video = Video;
|
|
33
|
-
;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Voice = void 0;
|
|
4
|
-
const Media_1 = require("./Media");
|
|
5
|
-
class Voice extends Media_1.Media {
|
|
6
|
-
constructor() {
|
|
7
|
-
super(...arguments);
|
|
8
|
-
this.type = 'voice';
|
|
9
|
-
this.properties = [
|
|
10
|
-
'media_id',
|
|
11
|
-
'recognition',
|
|
12
|
-
];
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
exports.Voice = Voice;
|
|
16
|
-
;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export * from './Article';
|
|
2
|
-
export * from './Card';
|
|
3
|
-
export * from './DeviceEvent';
|
|
4
|
-
export * from './DeviceText';
|
|
5
|
-
export * from './File';
|
|
6
|
-
export * from './Image';
|
|
7
|
-
export * from './Link';
|
|
8
|
-
export * from './Location';
|
|
9
|
-
export * from './Markdown';
|
|
10
|
-
export * from './Media';
|
|
11
|
-
export * from './Message';
|
|
12
|
-
export * from './MiniProgramNotice';
|
|
13
|
-
export * from './MiniProgramPage';
|
|
14
|
-
export * from './Music';
|
|
15
|
-
export * from './News';
|
|
16
|
-
export * from './NewsItem';
|
|
17
|
-
export * from './Raw';
|
|
18
|
-
export * from './ShortVideo';
|
|
19
|
-
export * from './TaskCard';
|
|
20
|
-
export * from './Text';
|
|
21
|
-
export * from './TextCard';
|
|
22
|
-
export * from './Transfer';
|
|
23
|
-
export * from './Video';
|
|
24
|
-
export * from './Voice';
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
|
-
};
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./Article"), exports);
|
|
14
|
-
__exportStar(require("./Card"), exports);
|
|
15
|
-
__exportStar(require("./DeviceEvent"), exports);
|
|
16
|
-
__exportStar(require("./DeviceText"), exports);
|
|
17
|
-
__exportStar(require("./File"), exports);
|
|
18
|
-
__exportStar(require("./Image"), exports);
|
|
19
|
-
__exportStar(require("./Link"), exports);
|
|
20
|
-
__exportStar(require("./Location"), exports);
|
|
21
|
-
__exportStar(require("./Markdown"), exports);
|
|
22
|
-
__exportStar(require("./Media"), exports);
|
|
23
|
-
__exportStar(require("./Message"), exports);
|
|
24
|
-
__exportStar(require("./MiniProgramNotice"), exports);
|
|
25
|
-
__exportStar(require("./MiniProgramPage"), exports);
|
|
26
|
-
__exportStar(require("./Music"), exports);
|
|
27
|
-
__exportStar(require("./News"), exports);
|
|
28
|
-
__exportStar(require("./NewsItem"), exports);
|
|
29
|
-
__exportStar(require("./Raw"), exports);
|
|
30
|
-
__exportStar(require("./ShortVideo"), exports);
|
|
31
|
-
__exportStar(require("./TaskCard"), exports);
|
|
32
|
-
__exportStar(require("./Text"), exports);
|
|
33
|
-
__exportStar(require("./TextCard"), exports);
|
|
34
|
-
__exportStar(require("./Transfer"), exports);
|
|
35
|
-
__exportStar(require("./Video"), exports);
|
|
36
|
-
__exportStar(require("./Voice"), exports);
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const axios_1 = __importDefault(require("axios"));
|
|
16
|
-
const BaseApplication_1 = __importDefault(require("../BaseApplication"));
|
|
17
|
-
const Utils_1 = require("../Utils");
|
|
18
|
-
const form_data_1 = __importDefault(require("form-data"));
|
|
19
|
-
class HttpMixin {
|
|
20
|
-
doRequest(payload) {
|
|
21
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
-
let opts = (0, Utils_1.merge)({}, payload || {});
|
|
23
|
-
if (typeof opts.baseURL == 'undefined' && this['baseUrl']) {
|
|
24
|
-
opts.baseURL = this['baseUrl'];
|
|
25
|
-
}
|
|
26
|
-
if (opts.url.substr(0, 7) == 'http://' || opts.url.substr(0, 8) == 'https://') {
|
|
27
|
-
delete opts.baseURL;
|
|
28
|
-
}
|
|
29
|
-
if (typeof opts.method == 'undefined') {
|
|
30
|
-
opts.method = 'post';
|
|
31
|
-
}
|
|
32
|
-
if (!opts.responseType) {
|
|
33
|
-
opts.responseType = 'json';
|
|
34
|
-
}
|
|
35
|
-
if (this['app'] && this['app'] instanceof BaseApplication_1.default) {
|
|
36
|
-
opts = (0, Utils_1.merge)((0, Utils_1.merge)({}, this['app'].config.http || {}), opts);
|
|
37
|
-
}
|
|
38
|
-
if (opts.data && opts.data instanceof form_data_1.default) {
|
|
39
|
-
opts.headers = (0, Utils_1.merge)(opts.headers || {}, opts.data.getHeaders());
|
|
40
|
-
opts.headers['Content-Length'] = yield new Promise((resolve, reject) => {
|
|
41
|
-
opts.data.getLength((err, length) => {
|
|
42
|
-
if (err) {
|
|
43
|
-
resolve('0');
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
resolve(length);
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
this['app']['log']('debug', 'doRequest', opts);
|
|
52
|
-
return axios_1.default.request(opts);
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.default = HttpMixin;
|
|
57
|
-
;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import Response from './Http/Response';
|
|
2
|
-
import BaseApplication from './BaseApplication';
|
|
3
|
-
import { Message } from './Messages';
|
|
4
|
-
import { ServerHandler, ServerHandlers } from './Types';
|
|
5
|
-
export default class ServerGuard {
|
|
6
|
-
static SUCCESS_EMPTY_RESPONSE: string;
|
|
7
|
-
static MESSAGE_TYPE_MAPPING: object;
|
|
8
|
-
protected app: BaseApplication;
|
|
9
|
-
protected alwaysValidate: boolean;
|
|
10
|
-
protected handlers: ServerHandlers;
|
|
11
|
-
constructor(app: BaseApplication);
|
|
12
|
-
/**
|
|
13
|
-
* 注册消息处理器
|
|
14
|
-
* @param condition EasyWechat.Messages.Message.xxx,用于处理特定消息类型,默认:* 表示全部
|
|
15
|
-
* @param handler 处理函数,该函数需要接收一个消息对象
|
|
16
|
-
*/
|
|
17
|
-
on(condition: string, handler: ServerHandler): void;
|
|
18
|
-
/**
|
|
19
|
-
* 注册消息处理器
|
|
20
|
-
* @param condition EasyWechat.Messages.Message.xxx,用于处理特定消息类型,默认:* 表示全部
|
|
21
|
-
* @param handler 处理函数,该函数需要接收一个消息对象
|
|
22
|
-
*/
|
|
23
|
-
observe(condition: string, handler: ServerHandler): void;
|
|
24
|
-
/**
|
|
25
|
-
* 注册消息处理器
|
|
26
|
-
* @param handler 处理函数,该函数需要接收一个消息对象
|
|
27
|
-
* @param condition EasyWechat.Messages.Message.xxx,用于处理特定消息类型,默认:* 表示全部
|
|
28
|
-
*/
|
|
29
|
-
push(handler: ServerHandler, condition?: string): void;
|
|
30
|
-
setHandlers(handlers?: ServerHandlers): void;
|
|
31
|
-
protected dispatch(event: string, payload: any): Promise<any>;
|
|
32
|
-
protected notify(event: string, payload: any): Promise<any>;
|
|
33
|
-
protected _callHandler(handler: ServerHandler, payload: any): Promise<any>;
|
|
34
|
-
/**
|
|
35
|
-
* 处理消息
|
|
36
|
-
*/
|
|
37
|
-
serve(): Promise<Response>;
|
|
38
|
-
validate(): Promise<this>;
|
|
39
|
-
forceValidate(): this;
|
|
40
|
-
protected resolve(): Promise<Response>;
|
|
41
|
-
protected shouldReturnRawResponse(): Promise<boolean>;
|
|
42
|
-
protected buildResponse(to: string, from: string, message: any): Promise<string>;
|
|
43
|
-
protected buildReply(to: string, from: string, message: Message): Promise<string>;
|
|
44
|
-
protected getToken(): string;
|
|
45
|
-
protected isSafeMode(): Promise<boolean>;
|
|
46
|
-
protected signature(params: any): string;
|
|
47
|
-
protected handleRequest(): Promise<object>;
|
|
48
|
-
/**
|
|
49
|
-
* 获取消息
|
|
50
|
-
*/
|
|
51
|
-
getMessage(): Promise<object>;
|
|
52
|
-
protected parseMessage(content: string): Promise<any>;
|
|
53
|
-
protected decryptMessage(message: object): Promise<string>;
|
|
54
|
-
}
|
package/dist/Core/ServerGuard.js
DELETED
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
const Response_1 = __importDefault(require("./Http/Response"));
|
|
16
|
-
const Messages_1 = require("./Messages");
|
|
17
|
-
const Utils_1 = require("./Utils");
|
|
18
|
-
const FinallResult_1 = __importDefault(require("./Decorators/FinallResult"));
|
|
19
|
-
const TerminateResult_1 = __importDefault(require("./Decorators/TerminateResult"));
|
|
20
|
-
class ServerGuard {
|
|
21
|
-
constructor(app) {
|
|
22
|
-
this.app = null;
|
|
23
|
-
this.alwaysValidate = false;
|
|
24
|
-
this.handlers = {};
|
|
25
|
-
this.app = app;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* 注册消息处理器
|
|
29
|
-
* @param condition EasyWechat.Messages.Message.xxx,用于处理特定消息类型,默认:* 表示全部
|
|
30
|
-
* @param handler 处理函数,该函数需要接收一个消息对象
|
|
31
|
-
*/
|
|
32
|
-
on(condition, handler) {
|
|
33
|
-
this.push(handler, condition);
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* 注册消息处理器
|
|
37
|
-
* @param condition EasyWechat.Messages.Message.xxx,用于处理特定消息类型,默认:* 表示全部
|
|
38
|
-
* @param handler 处理函数,该函数需要接收一个消息对象
|
|
39
|
-
*/
|
|
40
|
-
observe(condition, handler) {
|
|
41
|
-
this.push(handler, condition);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* 注册消息处理器
|
|
45
|
-
* @param handler 处理函数,该函数需要接收一个消息对象
|
|
46
|
-
* @param condition EasyWechat.Messages.Message.xxx,用于处理特定消息类型,默认:* 表示全部
|
|
47
|
-
*/
|
|
48
|
-
push(handler, condition = '*') {
|
|
49
|
-
if (!this.handlers[condition]) {
|
|
50
|
-
this.handlers[condition] = [];
|
|
51
|
-
}
|
|
52
|
-
this.handlers[condition].push(handler);
|
|
53
|
-
}
|
|
54
|
-
setHandlers(handlers = {}) {
|
|
55
|
-
this.handlers = handlers;
|
|
56
|
-
}
|
|
57
|
-
dispatch(event, payload) {
|
|
58
|
-
return this.notify(event, payload);
|
|
59
|
-
}
|
|
60
|
-
notify(event, payload) {
|
|
61
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
let result = null;
|
|
63
|
-
for (let condition in this.handlers) {
|
|
64
|
-
let handlers = this.handlers[condition];
|
|
65
|
-
if (condition == '*' || condition == event || Number(Number(condition) & Number(event)) == Number(event)) {
|
|
66
|
-
let isBreak = false;
|
|
67
|
-
for (let i = 0; i < handlers.length; i++) {
|
|
68
|
-
let handler = handlers[i];
|
|
69
|
-
let res = yield this._callHandler(handler, payload);
|
|
70
|
-
if (res instanceof TerminateResult_1.default) {
|
|
71
|
-
return res.content;
|
|
72
|
-
}
|
|
73
|
-
else if (res === true) {
|
|
74
|
-
break;
|
|
75
|
-
}
|
|
76
|
-
else if (res === false) {
|
|
77
|
-
isBreak = true;
|
|
78
|
-
break;
|
|
79
|
-
}
|
|
80
|
-
else if (res && !(result instanceof FinallResult_1.default)) {
|
|
81
|
-
result = res;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
if (isBreak) {
|
|
85
|
-
break;
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return result instanceof FinallResult_1.default ? result.content : result;
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
_callHandler(handler, payload) {
|
|
93
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
try {
|
|
95
|
-
if (typeof handler == 'function') {
|
|
96
|
-
return yield handler.call(this, payload);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
100
|
-
this.app['log']('ServerGuard.notify: ', e);
|
|
101
|
-
}
|
|
102
|
-
return false;
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* 处理消息
|
|
107
|
-
*/
|
|
108
|
-
serve() {
|
|
109
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
let content = yield this.app['request'].getContent();
|
|
111
|
-
this.app['log']('Request received:', {
|
|
112
|
-
'method': this.app['request'].getMethod(),
|
|
113
|
-
'uri': this.app['request'].getUri(),
|
|
114
|
-
'content-type': this.app['request'].getContentType(),
|
|
115
|
-
'content': content ? content.toString() : '',
|
|
116
|
-
});
|
|
117
|
-
yield this.validate();
|
|
118
|
-
let res = yield this.resolve();
|
|
119
|
-
this.app['log']('Server response created:', {
|
|
120
|
-
content: res.getContent().toString()
|
|
121
|
-
});
|
|
122
|
-
return res;
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
validate() {
|
|
126
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
if (!this.alwaysValidate && !(yield this.isSafeMode())) {
|
|
128
|
-
return this;
|
|
129
|
-
}
|
|
130
|
-
let signature = yield this.app['request'].get('signature');
|
|
131
|
-
let timestamp = yield this.app['request'].get('timestamp');
|
|
132
|
-
let nonce = yield this.app['request'].get('nonce');
|
|
133
|
-
if (signature !== this.signature([this.getToken(), timestamp, nonce])) {
|
|
134
|
-
throw new Error('Invalid request signature.');
|
|
135
|
-
}
|
|
136
|
-
return this;
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
forceValidate() {
|
|
140
|
-
this.alwaysValidate = true;
|
|
141
|
-
return this;
|
|
142
|
-
}
|
|
143
|
-
resolve() {
|
|
144
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
145
|
-
let result = yield this.handleRequest();
|
|
146
|
-
let res;
|
|
147
|
-
if (yield this.shouldReturnRawResponse()) {
|
|
148
|
-
res = new Response_1.default(Buffer.from(result['response']));
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
res = new Response_1.default(Buffer.from(yield this.buildResponse(result['to'], result['from'], result['response'])), 200, { 'Content-Type': 'application/xml' });
|
|
152
|
-
}
|
|
153
|
-
return res;
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
shouldReturnRawResponse() {
|
|
157
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
-
return false;
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
buildResponse(to, from, message) {
|
|
162
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
163
|
-
if (!message || ServerGuard.SUCCESS_EMPTY_RESPONSE === message) {
|
|
164
|
-
return ServerGuard.SUCCESS_EMPTY_RESPONSE;
|
|
165
|
-
}
|
|
166
|
-
if (message instanceof Messages_1.Raw) {
|
|
167
|
-
return message.get('content', ServerGuard.SUCCESS_EMPTY_RESPONSE);
|
|
168
|
-
}
|
|
169
|
-
if ((0, Utils_1.isString)(message) || (0, Utils_1.isNumber)(message)) {
|
|
170
|
-
message = new Messages_1.Text(message + '');
|
|
171
|
-
}
|
|
172
|
-
if ((0, Utils_1.isArray)(message) && message[0] instanceof Messages_1.NewsItem) {
|
|
173
|
-
message = new Messages_1.News(message);
|
|
174
|
-
}
|
|
175
|
-
if (message instanceof Messages_1.NewsItem) {
|
|
176
|
-
message = new Messages_1.News([message]);
|
|
177
|
-
}
|
|
178
|
-
if (!(message instanceof Messages_1.Message)) {
|
|
179
|
-
throw new Error('The message object should be instance of EasyWechat.Messages.*');
|
|
180
|
-
}
|
|
181
|
-
return yield this.buildReply(to, from, message);
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
buildReply(to, from, message) {
|
|
185
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
186
|
-
let prepends = {
|
|
187
|
-
ToUserName: to,
|
|
188
|
-
FromUserName: from,
|
|
189
|
-
CreateTime: (0, Utils_1.getTimestamp)(),
|
|
190
|
-
MsgType: message.getType(),
|
|
191
|
-
};
|
|
192
|
-
let res = message.transformToXml(prepends);
|
|
193
|
-
if (yield this.isSafeMode()) {
|
|
194
|
-
this.app['log']('Messages safe mode is enabled.');
|
|
195
|
-
return this.app['encryptor'].encrypt(res);
|
|
196
|
-
}
|
|
197
|
-
return res;
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
getToken() {
|
|
201
|
-
return this.app.config.token;
|
|
202
|
-
}
|
|
203
|
-
isSafeMode() {
|
|
204
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
205
|
-
let signature = yield this.app['request'].get('signature');
|
|
206
|
-
let encrypt_type = yield this.app['request'].get('encrypt_type');
|
|
207
|
-
return signature && 'aes' === encrypt_type;
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
signature(params) {
|
|
211
|
-
params.sort();
|
|
212
|
-
return (0, Utils_1.createHash)(params.join(''), 'sha1');
|
|
213
|
-
}
|
|
214
|
-
handleRequest() {
|
|
215
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
216
|
-
let castedMessage = yield this.getMessage();
|
|
217
|
-
let response = yield this.notify(ServerGuard.MESSAGE_TYPE_MAPPING[castedMessage['MsgType'] || castedMessage['msg_type'] || 'text'], castedMessage);
|
|
218
|
-
return {
|
|
219
|
-
to: castedMessage['FromUserName'] || '',
|
|
220
|
-
from: castedMessage['ToUserName'] || '',
|
|
221
|
-
response,
|
|
222
|
-
};
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* 获取消息
|
|
227
|
-
*/
|
|
228
|
-
getMessage() {
|
|
229
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
230
|
-
let content = yield this.app.request.getContent();
|
|
231
|
-
let message = yield this.parseMessage(content ? content.toString() : '');
|
|
232
|
-
// console.log('message', message, typeof message);
|
|
233
|
-
// if (!message) {
|
|
234
|
-
// throw new Error('No message received.');
|
|
235
|
-
// }
|
|
236
|
-
if ((yield this.isSafeMode()) && message['Encrypt']) {
|
|
237
|
-
let decrypted = yield this.decryptMessage(message);
|
|
238
|
-
message = yield this.parseMessage(decrypted);
|
|
239
|
-
}
|
|
240
|
-
return message;
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
parseMessage(content) {
|
|
244
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
245
|
-
try {
|
|
246
|
-
if (!content) {
|
|
247
|
-
return {};
|
|
248
|
-
}
|
|
249
|
-
else if (0 === content.indexOf('<')) {
|
|
250
|
-
content = yield (0, Utils_1.parseXml)(content);
|
|
251
|
-
}
|
|
252
|
-
else {
|
|
253
|
-
// Handle JSON format.
|
|
254
|
-
try {
|
|
255
|
-
content = JSON.parse(content);
|
|
256
|
-
}
|
|
257
|
-
catch (e) { }
|
|
258
|
-
}
|
|
259
|
-
return content;
|
|
260
|
-
}
|
|
261
|
-
catch (e) {
|
|
262
|
-
throw new Error(`Invalid message content: ${content}`);
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
decryptMessage(message) {
|
|
267
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
268
|
-
return this.app['encryptor'].decrypt(message['Encrypt'], yield this.app['request'].get('msg_signature'), yield this.app['request'].get('nonce'), yield this.app['request'].get('timestamp'));
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
exports.default = ServerGuard;
|
|
273
|
-
ServerGuard.SUCCESS_EMPTY_RESPONSE = 'success';
|
|
274
|
-
ServerGuard.MESSAGE_TYPE_MAPPING = {
|
|
275
|
-
text: Messages_1.Message.TEXT + '',
|
|
276
|
-
image: Messages_1.Message.IMAGE + '',
|
|
277
|
-
voice: Messages_1.Message.VOICE + '',
|
|
278
|
-
video: Messages_1.Message.VIDEO + '',
|
|
279
|
-
shortvideo: Messages_1.Message.SHORT_VIDEO + '',
|
|
280
|
-
location: Messages_1.Message.LOCATION + '',
|
|
281
|
-
link: Messages_1.Message.LINK + '',
|
|
282
|
-
device_event: Messages_1.Message.DEVICE_EVENT + '',
|
|
283
|
-
device_text: Messages_1.Message.DEVICE_TEXT + '',
|
|
284
|
-
event: Messages_1.Message.EVENT + '',
|
|
285
|
-
file: Messages_1.Message.FILE + '',
|
|
286
|
-
miniprogrampage: Messages_1.Message.MINIPROGRAM_PAGE + '',
|
|
287
|
-
};
|
|
288
|
-
;
|