-
Notifications
You must be signed in to change notification settings - Fork 4
/
mix.exs
212 lines (204 loc) · 5.78 KB
/
mix.exs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
defmodule WeChat.MixProject do
use Mix.Project
alias WeChat.{Requester, Refresher, ServerMessage, Storage, MiniProgram, Work, Pay}
@version "0.16.0"
@source_url "https://github.com/feng19/wechat"
def project do
[
app: :wechat,
version: @version,
elixir: "~> 1.13",
start_permanent: Mix.env() == :prod,
elixirc_paths: elixirc_paths(Mix.env()),
deps: deps(),
docs: docs(),
package: package()
]
end
# Run "mix help compile.app" to learn about applications.
def application do
[
extra_applications: [:logger, :eex],
mod: {WeChat.Application, []}
]
end
defp elixirc_paths(:test), do: ["lib", "test/support"]
defp elixirc_paths(_), do: ["lib"]
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:tesla, "~> 1.4"},
{:finch, "~> 0.9"},
{:jason, "~> 1.2"},
{:saxy, "~> 1.2", optional: true},
{:plug, "~> 1.11", optional: true},
{:x509, "~> 0.8", optional: true},
{:ex_doc, ">= 0.0.0", only: [:docs, :dev], runtime: false}
]
end
defp docs do
[
extras: [
"LICENSE.md": [title: "License"],
"README.md": [title: "Overview"]
],
main: "readme",
source_url: @source_url,
source_ref: "master",
formatters: ["html"],
formatter_opts: [gfm: true],
groups_for_modules: groups_for_modules(),
groups_for_docs: [Action: &(&1[:doc_group] == :action)],
nest_modules_by_prefix: [
Requester,
Refresher,
WeChat.Plug,
ServerMessage,
Storage,
MiniProgram,
MiniProgram.Live,
Work,
Work.App,
Work.Contacts,
Work.Customer,
Work.KF,
Work.OA,
Work.WeDrive,
Pay,
Pay.Middleware
]
]
end
defp groups_for_modules do
[
{"用户管理 APIs", [WeChat.User, WeChat.UserTag, WeChat.UserBlacklist]},
{"素材管理 APIs", [WeChat.Material.Article, WeChat.Material, WeChat.DraftBox, WeChat.Publish]},
{"消息管理 APIs",
[
WeChat.CustomMessage,
WeChat.CustomService,
WeChat.SubscribeMessage,
WeChat.Template,
WeChat.BatchSends
]},
{"微信卡券 APIs",
[WeChat.Card, WeChat.CardManaging, WeChat.CardDistributing, WeChat.MemberCard]},
{"电子发票 APIs", [WeChat.EInvoice, WeChat.InvoicingPlatform]},
{"事件推送",
[
WeChat.Plug.EventHandler,
WeChat.Plug.WorkEventHandler,
ServerMessage.EventHelper,
ServerMessage.Encryptor,
ServerMessage.ReplyMessage,
ServerMessage.XmlParser
]},
{"网页开发", [WeChat.WebPage, WeChat.Plug.OAuth2Checker, WeChat.Plug.HubSpringboard]},
{"Hub", [WeChat.HubClient, WeChat.HubServer, WeChat.Plug.HubExposer]},
{"Other APIs",
[
# 微信门店
WeChat.POI,
# 自定义菜单
WeChat.Menu,
# 图文消息留言管理
WeChat.Comment,
# 账号管理
WeChat.Account,
# 第三方平台
WeChat.Component
]},
{"小程序 APIs",
[
MiniProgram.Auth,
MiniProgram.Code,
MiniProgram.UrlScheme,
MiniProgram.NearbyPOI,
MiniProgram.Store,
MiniProgram.Search,
MiniProgram.OCR,
MiniProgram.Security,
MiniProgram.Live.Room,
MiniProgram.Live.Goods,
MiniProgram.Live.Role,
MiniProgram.Live.Subscribe,
MiniProgram.UserInfo,
MiniProgram.SubscribeMessage
]},
{"企业微信 APIs",
[
Work,
Work.Agent,
Work.App,
Work.App.Chat,
Work.App.Menu,
Work.App.Workbench,
Work.ChatRobot,
Work.Living,
Work.Material,
Work.Meeting,
Work.Message,
Work.MiniProgram,
Work.Contacts.Department,
Work.Contacts.User,
Work.Contacts.Tag,
Work.Customer,
Work.Customer.ContactWay,
Work.Customer.GroupChat,
Work.Customer.GroupMsg,
Work.Customer.Moment,
Work.Customer.Strategy,
Work.Customer.Tag,
Work.Customer.Transfer,
Work.Customer.Welcome,
Work.KF.Account,
Work.KF.Customer,
Work.KF.Message,
Work.LinkedCorp.Message,
Work.OA.Approval,
Work.OA.Calendar,
Work.OA.Checkin,
Work.OA.Journal,
Work.OA.MeetingRoom,
Work.OA.Pstncc,
Work.OA.Schedule,
Work.OA.Vacation,
Work.WeDrive.FileACL,
Work.WeDrive.FileManagement,
Work.WeDrive.SpaceACL,
Work.WeDrive.SpaceManagement
]},
{"微信支付",
[
Pay,
Pay.Crypto,
Pay.Certificates,
Pay.Middleware.Authorization,
Pay.Middleware.VerifySignature,
Pay.Middleware.XMLBuilder,
Pay.Middleware.XMLParser,
Pay.EventHandler,
Pay.Transactions,
Pay.Refund,
Pay.CombineTransactions,
Pay.Bill,
Pay.Sandbox
]},
{"Access Token",
[Refresher.Default, Refresher.DefaultSettings, Refresher.Pay, WeChat.TokenChecker]},
{"请求客户端", [Requester.OfficialAccount, Requester.Work, Requester.Pay]},
{"存储器",
[Storage.Adapter, Storage.Cache, Storage.File, Storage.HttpForHubClient, Storage.PayFile]}
]
end
defp package do
[
name: "wechat_sdk",
description: "WeChat SDK for Elixir, 支持: 公众号/小程序/第三方应用/企业微信/微信支付",
files: ["lib", "mix.exs", "README.md", "LICENSE.md"],
maintainers: ["feng19"],
licenses: ["Apache-2.0"],
links: %{"GitHub" => @source_url}
]
end
end