node-easywechat 2.10.1 → 3.0.0-alpha.2
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 +6 -195
- 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/{Work/MiniProgram/Auth/AuthClient.js → Core/Contracts/RefreshableAccessTokenInterface.js} +8 -13
- package/dist/Core/Contracts/ServerInterface.d.ts +8 -0
- package/dist/Core/Contracts/ServerInterface.js +20 -0
- package/dist/Core/Encryptor.d.ts +30 -4
- package/dist/Core/Encryptor.js +41 -17
- 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 +89 -0
- package/dist/Core/HttpClient/HttpClientResponse.d.ts +82 -0
- package/dist/Core/HttpClient/HttpClientResponse.js +203 -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 +155 -0
- package/dist/Core/Message.js +85 -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/MiniApp/AccessToken.d.ts +4 -0
- package/dist/MiniApp/AccessToken.js +8 -0
- package/dist/MiniApp/Account.d.ts +4 -0
- package/dist/MiniApp/Account.js +8 -0
- package/dist/MiniApp/Application.d.ts +59 -0
- package/dist/MiniApp/Application.js +123 -0
- package/dist/MiniApp/Contracts/AccountInterface.d.ts +23 -0
- package/dist/MiniApp/Contracts/AccountInterface.js +25 -0
- package/dist/MiniApp/Contracts/ApplicationInterface.d.ts +68 -0
- package/dist/MiniApp/Contracts/ApplicationInterface.js +60 -0
- package/dist/MiniApp/Decryptor.d.ts +4 -0
- package/dist/MiniApp/Decryptor.js +20 -0
- package/dist/MiniApp/Server.d.ts +4 -0
- package/dist/MiniApp/Server.js +9 -0
- package/dist/MiniApp/Utils.d.ts +22 -0
- package/dist/MiniApp/Utils.js +56 -0
- package/dist/OfficialAccount/AccessToken.d.ts +26 -0
- package/dist/OfficialAccount/AccessToken.js +84 -0
- package/dist/OfficialAccount/Account.d.ts +13 -0
- package/dist/OfficialAccount/Account.js +25 -0
- package/dist/OfficialAccount/Application.d.ts +70 -66
- package/dist/OfficialAccount/Application.js +148 -195
- 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 +94 -0
- package/dist/OfficialAccount/Utils.d.ts +7 -0
- package/dist/OfficialAccount/{Server/Guard.js → Utils.js} +12 -6
- 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 +6 -6
- package/dist/BaseService/Application.d.ts +0 -17
- package/dist/BaseService/Application.js +0 -41
- 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 -96
- package/dist/Core/BaseAccessToken.js +0 -222
- 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 -40
- 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 -99
- 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 -200
- 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 -216
- package/dist/OpenPlatform/Auth/AccessToken.d.ts +0 -8
- package/dist/OpenPlatform/Auth/AccessToken.js +0 -58
- 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 -13
- package/dist/OpenPlatform/Authorizer/Auth/AccessToken.js +0 -69
- 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 -21
- package/dist/OpenPlatform/Authorizer/MiniProgram/Application.js +0 -48
- 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/Material/MaterialClient.d.ts +0 -8
- package/dist/OpenPlatform/Authorizer/MiniProgram/Material/MaterialClient.js +0 -45
- package/dist/OpenPlatform/Authorizer/MiniProgram/Privacy/PrivacyClient.d.ts +0 -22
- package/dist/OpenPlatform/Authorizer/MiniProgram/Privacy/PrivacyClient.js +0 -37
- package/dist/OpenPlatform/Authorizer/MiniProgram/Security/SecurityClient.d.ts +0 -14
- package/dist/OpenPlatform/Authorizer/MiniProgram/Security/SecurityClient.js +0 -24
- 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 -20
- 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 -119
- package/dist/OpenWork/Auth/ProviderAccessToken.d.ts +0 -9
- package/dist/OpenWork/Auth/ProviderAccessToken.js +0 -58
- package/dist/OpenWork/Auth/SuiteAccessToken.d.ts +0 -9
- package/dist/OpenWork/Auth/SuiteAccessToken.js +0 -59
- 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 -81
- package/dist/OpenWork/Corp/CorpClient.js +0 -165
- 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 -173
- 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 -184
- 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 -78
- 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 -84
- package/dist/Work/Application.js +0 -236
- 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 -223
- package/dist/Work/ExternalContact/Client.js +0 -366
- 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/InterceptClient.d.ts +0 -30
- package/dist/Work/ExternalContact/InterceptClient.js +0 -48
- 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/ProductClient.d.ts +0 -39
- package/dist/Work/ExternalContact/ProductClient.js +0 -62
- 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 -22
- 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 -90
|
@@ -1,173 +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 BaseClient_1 = __importDefault(require("../../Core/BaseClient"));
|
|
16
|
-
const Utils_1 = require("../../Core/Utils");
|
|
17
|
-
class ProviderClient extends BaseClient_1.default {
|
|
18
|
-
constructor(app) {
|
|
19
|
-
super(app, app['provider_access_token']);
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* 扫码授权登录 - 获取登录的地址
|
|
23
|
-
* @see https://developer.work.weixin.qq.com/document/path/91124
|
|
24
|
-
* @param redirectUri
|
|
25
|
-
* @param userType
|
|
26
|
-
* @param state
|
|
27
|
-
* @returns
|
|
28
|
-
*/
|
|
29
|
-
getLoginUrl(redirectUri = '', userType = 'admin', state = '') {
|
|
30
|
-
if (!redirectUri)
|
|
31
|
-
redirectUri = this.app.config.redirect_uri_single;
|
|
32
|
-
if (!state)
|
|
33
|
-
state = (0, Utils_1.randomString)(32);
|
|
34
|
-
let params = {
|
|
35
|
-
appid: this.app.config.corp_id,
|
|
36
|
-
redirect_uri: redirectUri,
|
|
37
|
-
usertype: userType,
|
|
38
|
-
state,
|
|
39
|
-
};
|
|
40
|
-
return 'https://open.work.weixin.qq.com/wwopen/sso/3rd_qrConnect?' + (0, Utils_1.buildQueryString)(params);
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* 扫码授权登录 - 获取登录用户信息
|
|
44
|
-
* @param authCode
|
|
45
|
-
* @returns
|
|
46
|
-
*/
|
|
47
|
-
getLoginInfo(authCode) {
|
|
48
|
-
return this.httpPostJson('cgi-bin/service/get_login_info', {
|
|
49
|
-
auth_code: authCode,
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
/**
|
|
53
|
-
* 获取注册定制化URL - 推广二维码
|
|
54
|
-
* @see https://developer.work.weixin.qq.com/document/path/90578
|
|
55
|
-
* @param registerCode
|
|
56
|
-
* @returns
|
|
57
|
-
*/
|
|
58
|
-
getRegisterUri(registerCode = '') {
|
|
59
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
if (!registerCode) {
|
|
61
|
-
let response = yield this.getRegisterCode();
|
|
62
|
-
if (!response || response.errcode || !response['register_code']) {
|
|
63
|
-
throw new Error('Fail to get register code');
|
|
64
|
-
}
|
|
65
|
-
registerCode = response['register_code'];
|
|
66
|
-
}
|
|
67
|
-
let params = {
|
|
68
|
-
register_code: registerCode,
|
|
69
|
-
};
|
|
70
|
-
return 'https://open.work.weixin.qq.com/3rdservice/wework/register?' + (0, Utils_1.buildQueryString)(params);
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* 获取注册码 - 推广二维码
|
|
75
|
-
* @see https://developer.work.weixin.qq.com/document/path/90581
|
|
76
|
-
* @param corpName
|
|
77
|
-
* @param adminName
|
|
78
|
-
* @param adminMobile
|
|
79
|
-
* @param state
|
|
80
|
-
* @returns
|
|
81
|
-
*/
|
|
82
|
-
getRegisterCode(corpName = '', adminName = '', adminMobile = '', state = '') {
|
|
83
|
-
let params = {
|
|
84
|
-
template_id: this.app.config.reg_template_id,
|
|
85
|
-
};
|
|
86
|
-
if (corpName)
|
|
87
|
-
params['corp_name'] = corpName;
|
|
88
|
-
if (adminName)
|
|
89
|
-
params['admin_name'] = adminName;
|
|
90
|
-
if (adminMobile)
|
|
91
|
-
params['admin_mobile'] = adminMobile;
|
|
92
|
-
if (state)
|
|
93
|
-
params['state'] = state;
|
|
94
|
-
return this.httpPostJson('cgi-bin/service/get_register_code', params);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* 查询注册状态
|
|
98
|
-
* @see https://developer.work.weixin.qq.com/document/path/90582
|
|
99
|
-
* @param registerCode
|
|
100
|
-
* @returns
|
|
101
|
-
*/
|
|
102
|
-
getRegisterInfo(registerCode) {
|
|
103
|
-
return this.httpPostJson('cgi-bin/service/get_register_info', {
|
|
104
|
-
register_code: registerCode,
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* 设置授权应用可见范围
|
|
109
|
-
* @see https://developer.work.weixin.qq.com/document/path/90583
|
|
110
|
-
* @param accessToken
|
|
111
|
-
* @param agentId
|
|
112
|
-
* @param allowUser
|
|
113
|
-
* @param allowParty
|
|
114
|
-
* @param allowTag
|
|
115
|
-
* @returns
|
|
116
|
-
*/
|
|
117
|
-
setAgentScope(accessToken, agentId, allowUser = [], allowParty = [], allowTag = []) {
|
|
118
|
-
return this.httpGet('cgi-bin/agent/set_scope', {
|
|
119
|
-
access_token: accessToken,
|
|
120
|
-
agentid: agentId,
|
|
121
|
-
allow_user: allowUser,
|
|
122
|
-
allow_party: allowParty,
|
|
123
|
-
allow_tag: allowTag,
|
|
124
|
-
});
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* 设置通讯录同步完成
|
|
128
|
-
* @see https://developer.work.weixin.qq.com/document/path/90584
|
|
129
|
-
* @param accessToken
|
|
130
|
-
* @returns
|
|
131
|
-
*/
|
|
132
|
-
contactSyncSuccess(accessToken) {
|
|
133
|
-
return this.httpGet('cgi-bin/sync/contact_sync_success', {
|
|
134
|
-
access_token: accessToken,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* 通讯录单个搜索
|
|
139
|
-
* @see https://developer.work.weixin.qq.com/document/path/91844
|
|
140
|
-
* @param corpId
|
|
141
|
-
* @param queryWord
|
|
142
|
-
* @param agentId
|
|
143
|
-
* @param offset
|
|
144
|
-
* @param limit
|
|
145
|
-
* @param queryType
|
|
146
|
-
* @param fullMatchField
|
|
147
|
-
* @returns
|
|
148
|
-
*/
|
|
149
|
-
searchContact(corpId, queryWord, agentId, offset = 0, limit = 50, queryType = 0, fullMatchField = null) {
|
|
150
|
-
let params = {
|
|
151
|
-
auth_corpid: corpId,
|
|
152
|
-
query_word: queryWord,
|
|
153
|
-
agentid: agentId,
|
|
154
|
-
offset: offset,
|
|
155
|
-
limit: limit,
|
|
156
|
-
query_type: queryType,
|
|
157
|
-
};
|
|
158
|
-
if (fullMatchField != null) {
|
|
159
|
-
params['full_match_field'] = fullMatchField;
|
|
160
|
-
}
|
|
161
|
-
return this.httpGet('cgi-bin/service/contact/search', params);
|
|
162
|
-
}
|
|
163
|
-
/**
|
|
164
|
-
* 获取带参授权链接
|
|
165
|
-
* @see https://developer.work.weixin.qq.com/document/path/95436
|
|
166
|
-
* @param params
|
|
167
|
-
* @returns
|
|
168
|
-
*/
|
|
169
|
-
getCustomizedAuthUrl(params) {
|
|
170
|
-
return this.httpPostJson('cgi-bin/service/get_customized_auth_url', params);
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
exports.default = ProviderClient;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import ServerGuard from '../../Core/ServerGuard';
|
|
2
|
-
export declare const EVENT_AUTHORIZED = "authorized";
|
|
3
|
-
export declare const EVENT_UNAUTHORIZED = "unauthorized";
|
|
4
|
-
export declare const EVENT_UPDATE_AUTHORIZED = "updateauthorized";
|
|
5
|
-
export declare const EVENT_COMPONENT_VERIFY_TICKET = "component_verify_ticket";
|
|
6
|
-
export declare const EVENT_THIRD_FAST_REGISTERED = "notify_third_fasteregister";
|
|
7
|
-
export default class OpenWorkGuard extends ServerGuard {
|
|
8
|
-
protected alwaysValidate: boolean;
|
|
9
|
-
validate(): Promise<this>;
|
|
10
|
-
protected shouldReturnRawResponse(): Promise<boolean>;
|
|
11
|
-
protected isSafeMode(): Promise<boolean>;
|
|
12
|
-
protected decryptMessage(message: object): Promise<string>;
|
|
13
|
-
}
|
|
@@ -1,51 +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
|
-
exports.EVENT_THIRD_FAST_REGISTERED = exports.EVENT_COMPONENT_VERIFY_TICKET = exports.EVENT_UPDATE_AUTHORIZED = exports.EVENT_UNAUTHORIZED = exports.EVENT_AUTHORIZED = void 0;
|
|
16
|
-
const ServerGuard_1 = __importDefault(require("../../Core/ServerGuard"));
|
|
17
|
-
const Encryptor_1 = __importDefault(require("../../Core/Encryptor"));
|
|
18
|
-
exports.EVENT_AUTHORIZED = 'authorized';
|
|
19
|
-
exports.EVENT_UNAUTHORIZED = 'unauthorized';
|
|
20
|
-
exports.EVENT_UPDATE_AUTHORIZED = 'updateauthorized';
|
|
21
|
-
exports.EVENT_COMPONENT_VERIFY_TICKET = 'component_verify_ticket';
|
|
22
|
-
exports.EVENT_THIRD_FAST_REGISTERED = 'notify_third_fasteregister';
|
|
23
|
-
class OpenWorkGuard extends ServerGuard_1.default {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(...arguments);
|
|
26
|
-
this.alwaysValidate = true;
|
|
27
|
-
}
|
|
28
|
-
validate() {
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
return this;
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
shouldReturnRawResponse() {
|
|
34
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
-
return (yield this.app['request'].get('echostr')) != null;
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
isSafeMode() {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
return true;
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
decryptMessage(message) {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
let encryptor = new Encryptor_1.default(message['ToUserName'], this.app.config.token, this.app.config.aes_key);
|
|
46
|
-
return encryptor.decrypt(message['Encrypt'], yield this.app['request'].get('msg_signature'), yield this.app['request'].get('nonce'), yield this.app['request'].get('timestamp'));
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
exports.default = OpenWorkGuard;
|
|
51
|
-
;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import OpenWorkApplication from '../Application';
|
|
2
|
-
import BaseApplication from '../../Work/Application';
|
|
3
|
-
export default class Work extends BaseApplication {
|
|
4
|
-
constructor(authCorpId: string, permanentCode: string, component: OpenWorkApplication, prepends?: Object);
|
|
5
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const Application_1 = __importDefault(require("../../Work/Application"));
|
|
7
|
-
const AccessToken_1 = __importDefault(require("./Auth/AccessToken"));
|
|
8
|
-
const Utils_1 = require("../../Core/Utils");
|
|
9
|
-
class Work extends Application_1.default {
|
|
10
|
-
constructor(authCorpId, permanentCode, component, prepends = {}) {
|
|
11
|
-
let config = (0, Utils_1.merge)((0, Utils_1.merge)({}, component.getConfig()), {
|
|
12
|
-
corp_id: authCorpId,
|
|
13
|
-
});
|
|
14
|
-
super(config, (0, Utils_1.merge)((0, Utils_1.merge)({}, prepends), {
|
|
15
|
-
access_token: function (app) {
|
|
16
|
-
return new AccessToken_1.default(app, authCorpId, permanentCode, component);
|
|
17
|
-
}
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.default = Work;
|
|
22
|
-
;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import BaseAccessToken from '../../../Core/BaseAccessToken';
|
|
2
|
-
import OpenWorkApplication from '../../Application';
|
|
3
|
-
import BaseApplicatioin from '../../../Core/BaseApplication';
|
|
4
|
-
export default class AccessToken extends BaseAccessToken {
|
|
5
|
-
protected requestMethod: string;
|
|
6
|
-
protected authCorpId: string;
|
|
7
|
-
protected permanentCode: string;
|
|
8
|
-
protected component: OpenWorkApplication;
|
|
9
|
-
constructor(app: BaseApplicatioin, authCorpId: string, permanentCode: string, component: OpenWorkApplication);
|
|
10
|
-
protected getCredentials(): Promise<object>;
|
|
11
|
-
getEndpoint(): Promise<string>;
|
|
12
|
-
}
|
|
@@ -1,44 +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 BaseAccessToken_1 = __importDefault(require("../../../Core/BaseAccessToken"));
|
|
16
|
-
const Utils_1 = require("../../../Core/Utils");
|
|
17
|
-
class AccessToken extends BaseAccessToken_1.default {
|
|
18
|
-
constructor(app, authCorpId, permanentCode, component) {
|
|
19
|
-
super(app);
|
|
20
|
-
this.requestMethod = 'POST';
|
|
21
|
-
this.authCorpId = '';
|
|
22
|
-
this.permanentCode = '';
|
|
23
|
-
this.component = null;
|
|
24
|
-
this.authCorpId = authCorpId;
|
|
25
|
-
this.permanentCode = permanentCode;
|
|
26
|
-
this.component = component;
|
|
27
|
-
}
|
|
28
|
-
getCredentials() {
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
return {
|
|
31
|
-
auth_corpid: this.authCorpId,
|
|
32
|
-
permanent_code: this.permanentCode,
|
|
33
|
-
};
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
getEndpoint() {
|
|
37
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
-
return 'cgi-bin/service/get_corp_token?' + (0, Utils_1.buildQueryString)({
|
|
39
|
-
suite_access_token: (yield this.component['suite_access_token'].getToken())['suite_access_token'],
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
exports.default = AccessToken;
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import BaseApplication from '../Core/BaseApplication';
|
|
2
|
-
import Response from '../Core/Http/Response';
|
|
3
|
-
import AccessToken from '../OfficialAccount/Auth/AccessToken';
|
|
4
|
-
import UrlClient from '../BaseService/Url/UrlClient';
|
|
5
|
-
import PaymentBase from './Base/PaymentBase';
|
|
6
|
-
import BillClient from './Bill/BillClient';
|
|
7
|
-
import CouponClient from './Coupon/CouponClient';
|
|
8
|
-
import JssdkClient from './Jssdk/JssdkClient';
|
|
9
|
-
import MerchantClient from './Merchant/MerchantClient';
|
|
10
|
-
import OrderClient from './Order/OrderClient';
|
|
11
|
-
import RedpackClient from './Redpack/RedpackClient';
|
|
12
|
-
import RefundClient from './Refund/RefundClient';
|
|
13
|
-
import ReverseClient from './Reverse/ReverseClient';
|
|
14
|
-
import SandboxClient from './Sandbox/SandboxClient';
|
|
15
|
-
import TransferClient from './Transfer/TransferClient';
|
|
16
|
-
import SecurityClient from './Security/SecurityClient';
|
|
17
|
-
import ProfitSharingClient from './ProfitSharing/ProfitSharingClient';
|
|
18
|
-
import { EasyWechatConfig, PaymentPaidHandler, PaymentRefundedHandler, PaymentScannedHandler } from '../Core/Types';
|
|
19
|
-
export default class Payment extends BaseApplication {
|
|
20
|
-
protected defaultConfig: EasyWechatConfig;
|
|
21
|
-
base: PaymentBase;
|
|
22
|
-
bill: BillClient;
|
|
23
|
-
coupon: CouponClient;
|
|
24
|
-
jssdk: JssdkClient;
|
|
25
|
-
merchant: MerchantClient;
|
|
26
|
-
order: OrderClient;
|
|
27
|
-
redpack: RedpackClient;
|
|
28
|
-
refund: RefundClient;
|
|
29
|
-
reverse: ReverseClient;
|
|
30
|
-
sandbox: SandboxClient;
|
|
31
|
-
transfer: TransferClient;
|
|
32
|
-
security: SecurityClient;
|
|
33
|
-
profit_sharing: ProfitSharingClient;
|
|
34
|
-
access_token: AccessToken;
|
|
35
|
-
url: UrlClient;
|
|
36
|
-
constructor(config?: EasyWechatConfig, prepends?: Object, id?: String);
|
|
37
|
-
registerProviders(): void;
|
|
38
|
-
scheme(product_id: string): string;
|
|
39
|
-
codeUrlScheme(codeUrl: string): string;
|
|
40
|
-
/**
|
|
41
|
-
* 设置子商户
|
|
42
|
-
* @param mchId
|
|
43
|
-
* @param appId
|
|
44
|
-
*/
|
|
45
|
-
setSubMerchant(mchId: string, appId?: string): this;
|
|
46
|
-
/**
|
|
47
|
-
* 判断是否沙盒模式
|
|
48
|
-
*/
|
|
49
|
-
inSandbox(): boolean;
|
|
50
|
-
getKey(endpoint?: string): Promise<string>;
|
|
51
|
-
/**
|
|
52
|
-
* 处理付款结果通知
|
|
53
|
-
* @param closure 处理函数。需接收2个参数,第1个参数通知消息message,第2个参数为设置错误消息的方法。处理函数需要return true;表示处理成功
|
|
54
|
-
*/
|
|
55
|
-
handlePaidNotify(closure: PaymentPaidHandler): Promise<Response>;
|
|
56
|
-
/**
|
|
57
|
-
* 处理退款结果通知
|
|
58
|
-
* @param closure 处理函数。需接收3个参数,第1个参数通知消息message,第2个参数为message['req_info']解密后的信息,第3个参数为设置错误消息的方法。处理函数需要return true;表示处理成功
|
|
59
|
-
*/
|
|
60
|
-
handleRefundedNotify(closure: PaymentRefundedHandler): Promise<Response>;
|
|
61
|
-
/**
|
|
62
|
-
* 扫码支付通知
|
|
63
|
-
* @param closure 处理函数。需接收3个参数,第1个参数通知消息message,第2个参数返回“通信错误”给微信,第3个参数返回“业务错误”给微信。处理函数需要return prepay_id
|
|
64
|
-
*/
|
|
65
|
-
handleScannedNotify(closure: PaymentScannedHandler): Promise<Response>;
|
|
66
|
-
/**
|
|
67
|
-
* 刷卡支付
|
|
68
|
-
* @param params 支付订单参数
|
|
69
|
-
*/
|
|
70
|
-
pay(): Promise<any>;
|
|
71
|
-
/**
|
|
72
|
-
* 付款码查询openid
|
|
73
|
-
* @param auth_code 扫码支付付款码
|
|
74
|
-
*/
|
|
75
|
-
authCodeToOpenid(): Promise<any>;
|
|
76
|
-
}
|
|
@@ -1,184 +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 BaseApplication_1 = __importDefault(require("../Core/BaseApplication"));
|
|
16
|
-
const Utils_1 = require("../Core/Utils");
|
|
17
|
-
const Paid_1 = __importDefault(require("./Notify/Paid"));
|
|
18
|
-
const Refunded_1 = __importDefault(require("./Notify/Refunded"));
|
|
19
|
-
const Scanned_1 = __importDefault(require("./Notify/Scanned"));
|
|
20
|
-
const AccessToken_1 = __importDefault(require("../OfficialAccount/Auth/AccessToken"));
|
|
21
|
-
const UrlClient_1 = __importDefault(require("../BaseService/Url/UrlClient"));
|
|
22
|
-
const PaymentBase_1 = __importDefault(require("./Base/PaymentBase"));
|
|
23
|
-
const BillClient_1 = __importDefault(require("./Bill/BillClient"));
|
|
24
|
-
const CouponClient_1 = __importDefault(require("./Coupon/CouponClient"));
|
|
25
|
-
const JssdkClient_1 = __importDefault(require("./Jssdk/JssdkClient"));
|
|
26
|
-
const MerchantClient_1 = __importDefault(require("./Merchant/MerchantClient"));
|
|
27
|
-
const OrderClient_1 = __importDefault(require("./Order/OrderClient"));
|
|
28
|
-
const RedpackClient_1 = __importDefault(require("./Redpack/RedpackClient"));
|
|
29
|
-
const RefundClient_1 = __importDefault(require("./Refund/RefundClient"));
|
|
30
|
-
const ReverseClient_1 = __importDefault(require("./Reverse/ReverseClient"));
|
|
31
|
-
const SandboxClient_1 = __importDefault(require("./Sandbox/SandboxClient"));
|
|
32
|
-
const TransferClient_1 = __importDefault(require("./Transfer/TransferClient"));
|
|
33
|
-
const SecurityClient_1 = __importDefault(require("./Security/SecurityClient"));
|
|
34
|
-
const ProfitSharingClient_1 = __importDefault(require("./ProfitSharing/ProfitSharingClient"));
|
|
35
|
-
class Payment extends BaseApplication_1.default {
|
|
36
|
-
constructor(config = {}, prepends = {}, id = null) {
|
|
37
|
-
super(config, prepends, id);
|
|
38
|
-
this.defaultConfig = {
|
|
39
|
-
// 必要配置
|
|
40
|
-
app_id: '',
|
|
41
|
-
mch_id: '',
|
|
42
|
-
key: '',
|
|
43
|
-
http: {
|
|
44
|
-
baseURL: 'https://api.mch.weixin.qq.com/',
|
|
45
|
-
},
|
|
46
|
-
};
|
|
47
|
-
this.registerProviders();
|
|
48
|
-
}
|
|
49
|
-
registerProviders() {
|
|
50
|
-
super.registerCommonProviders();
|
|
51
|
-
this.offsetSet('base', function (app) {
|
|
52
|
-
return new PaymentBase_1.default(app);
|
|
53
|
-
});
|
|
54
|
-
this.offsetSet('bill', function (app) {
|
|
55
|
-
return new BillClient_1.default(app);
|
|
56
|
-
});
|
|
57
|
-
this.offsetSet('coupon', function (app) {
|
|
58
|
-
return new CouponClient_1.default(app);
|
|
59
|
-
});
|
|
60
|
-
this.offsetSet('jssdk', function (app) {
|
|
61
|
-
return new JssdkClient_1.default(app);
|
|
62
|
-
});
|
|
63
|
-
this.offsetSet('merchant', function (app) {
|
|
64
|
-
return new MerchantClient_1.default(app);
|
|
65
|
-
});
|
|
66
|
-
this.offsetSet('order', function (app) {
|
|
67
|
-
return new OrderClient_1.default(app);
|
|
68
|
-
});
|
|
69
|
-
this.offsetSet('redpack', function (app) {
|
|
70
|
-
return new RedpackClient_1.default(app);
|
|
71
|
-
});
|
|
72
|
-
this.offsetSet('refund', function (app) {
|
|
73
|
-
return new RefundClient_1.default(app);
|
|
74
|
-
});
|
|
75
|
-
this.offsetSet('reverse', function (app) {
|
|
76
|
-
return new ReverseClient_1.default(app);
|
|
77
|
-
});
|
|
78
|
-
this.offsetSet('sandbox', function (app) {
|
|
79
|
-
return new SandboxClient_1.default(app);
|
|
80
|
-
});
|
|
81
|
-
this.offsetSet('transfer', function (app) {
|
|
82
|
-
return new TransferClient_1.default(app);
|
|
83
|
-
});
|
|
84
|
-
this.offsetSet('security', function (app) {
|
|
85
|
-
return new SecurityClient_1.default(app);
|
|
86
|
-
});
|
|
87
|
-
this.offsetSet('profit_sharing', function (app) {
|
|
88
|
-
return new ProfitSharingClient_1.default(app);
|
|
89
|
-
});
|
|
90
|
-
// OfficialAccount
|
|
91
|
-
if (!this.access_token) {
|
|
92
|
-
this.offsetSet('access_token', function (app) {
|
|
93
|
-
return new AccessToken_1.default(app);
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
// BaseService
|
|
97
|
-
this.offsetSet('url', function (app) {
|
|
98
|
-
return new UrlClient_1.default(app);
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
scheme(product_id) {
|
|
102
|
-
let params = {
|
|
103
|
-
appid: this.config.app_id,
|
|
104
|
-
mch_id: this.config.mch_id,
|
|
105
|
-
time_stamp: (0, Utils_1.getTimestamp)(),
|
|
106
|
-
nonce_str: (0, Utils_1.randomString)(16),
|
|
107
|
-
product_id,
|
|
108
|
-
};
|
|
109
|
-
params['sign'] = (0, Utils_1.makeSignature)(params, this.config.key);
|
|
110
|
-
return 'weixin://wxpay/bizpayurl?' + (0, Utils_1.buildQueryString)(params);
|
|
111
|
-
}
|
|
112
|
-
codeUrlScheme(codeUrl) {
|
|
113
|
-
return 'weixin://wxpay/bizpayurl?sr=' + codeUrl;
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* 设置子商户
|
|
117
|
-
* @param mchId
|
|
118
|
-
* @param appId
|
|
119
|
-
*/
|
|
120
|
-
setSubMerchant(mchId, appId = null) {
|
|
121
|
-
this.config.sub_mch_id = mchId;
|
|
122
|
-
this.config.sub_appid = appId;
|
|
123
|
-
return this;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* 判断是否沙盒模式
|
|
127
|
-
*/
|
|
128
|
-
inSandbox() {
|
|
129
|
-
return !!this.config.sandbox;
|
|
130
|
-
}
|
|
131
|
-
getKey(endpoint = null) {
|
|
132
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
-
if ('sandboxnew/pay/getsignkey' === endpoint) {
|
|
134
|
-
return this.config.key;
|
|
135
|
-
}
|
|
136
|
-
let key = this.inSandbox() ? yield this.sandbox.getKey() : this.config.key;
|
|
137
|
-
if (!key) {
|
|
138
|
-
throw new Error('config key should not empty.');
|
|
139
|
-
}
|
|
140
|
-
if (32 !== key.length) {
|
|
141
|
-
throw new Error(`'${key}' should be 32 chars length.`);
|
|
142
|
-
}
|
|
143
|
-
return key;
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
/**
|
|
147
|
-
* 处理付款结果通知
|
|
148
|
-
* @param closure 处理函数。需接收2个参数,第1个参数通知消息message,第2个参数为设置错误消息的方法。处理函数需要return true;表示处理成功
|
|
149
|
-
*/
|
|
150
|
-
handlePaidNotify(closure) {
|
|
151
|
-
return (new Paid_1.default(this)).handle(closure);
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* 处理退款结果通知
|
|
155
|
-
* @param closure 处理函数。需接收3个参数,第1个参数通知消息message,第2个参数为message['req_info']解密后的信息,第3个参数为设置错误消息的方法。处理函数需要return true;表示处理成功
|
|
156
|
-
*/
|
|
157
|
-
handleRefundedNotify(closure) {
|
|
158
|
-
return (new Refunded_1.default(this)).handle(closure);
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* 扫码支付通知
|
|
162
|
-
* @param closure 处理函数。需接收3个参数,第1个参数通知消息message,第2个参数返回“通信错误”给微信,第3个参数返回“业务错误”给微信。处理函数需要return prepay_id
|
|
163
|
-
*/
|
|
164
|
-
handleScannedNotify(closure) {
|
|
165
|
-
return (new Scanned_1.default(this)).handle(closure);
|
|
166
|
-
}
|
|
167
|
-
// map to `base` module
|
|
168
|
-
/**
|
|
169
|
-
* 刷卡支付
|
|
170
|
-
* @param params 支付订单参数
|
|
171
|
-
*/
|
|
172
|
-
pay() {
|
|
173
|
-
return this.base.pay.apply(this.base, arguments);
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* 付款码查询openid
|
|
177
|
-
* @param auth_code 扫码支付付款码
|
|
178
|
-
*/
|
|
179
|
-
authCodeToOpenid() {
|
|
180
|
-
return this.base.authCodeToOpenid.apply(this.base, arguments);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
exports.default = Payment;
|
|
184
|
-
;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import BaseClient from '../Core/BaseClient';
|
|
2
|
-
export default class PaymentBase extends BaseClient {
|
|
3
|
-
/**
|
|
4
|
-
* 刷卡支付
|
|
5
|
-
* @param params 支付订单参数
|
|
6
|
-
*/
|
|
7
|
-
pay(params: object): Promise<any>;
|
|
8
|
-
/**
|
|
9
|
-
* 付款码查询openid
|
|
10
|
-
* @param auth_code 扫码支付付款码
|
|
11
|
-
*/
|
|
12
|
-
authCodeToOpenid(auth_code: string): Promise<any>;
|
|
13
|
-
}
|
|
@@ -1,40 +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 BaseClient_1 = __importDefault(require("../Core/BaseClient"));
|
|
16
|
-
class PaymentBase extends BaseClient_1.default {
|
|
17
|
-
/**
|
|
18
|
-
* 刷卡支付
|
|
19
|
-
* @param params 支付订单参数
|
|
20
|
-
*/
|
|
21
|
-
pay(params) {
|
|
22
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
params['appid'] = this.app.config.app_id;
|
|
24
|
-
return yield this.request(this.wrap('pay/micropay'), params);
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* 付款码查询openid
|
|
29
|
-
* @param auth_code 扫码支付付款码
|
|
30
|
-
*/
|
|
31
|
-
authCodeToOpenid(auth_code) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
return yield this.request('tools/authcodetoopenid', {
|
|
34
|
-
appid: this.app.config.app_id,
|
|
35
|
-
auth_code,
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
exports.default = PaymentBase;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import BaseClient from '../Core/BaseClient';
|
|
2
|
-
export default class BillClient extends BaseClient {
|
|
3
|
-
/**
|
|
4
|
-
* 下载对账单
|
|
5
|
-
* @param date 对账单的日期,格式:20140603
|
|
6
|
-
* @param type 账单类型,默认:ALL
|
|
7
|
-
* @param options 其它参数
|
|
8
|
-
*/
|
|
9
|
-
get(date: string, type?: string, options?: object): Promise<any>;
|
|
10
|
-
}
|