1 | /* eslint-disable sort-keys */
|
2 | /**
|
3 | * Wechaty Chatbot SDK - https://github.com/wechaty/wechaty
|
4 | *
|
5 | * @copyright 2016 Huan LI (李卓桓) <https://github.com/huan>, and
|
6 | * Wechaty Contributors <https://github.com/wechaty>.
|
7 | *
|
8 | * Licensed under the Apache License, Version 2.0 (the "License");
|
9 | * you may not use this file except in compliance with the License.
|
10 | * You may obtain a copy of the License at
|
11 | *
|
12 | * http://www.apache.org/licenses/LICENSE-2.0
|
13 | *
|
14 | * Unless required by applicable law or agreed to in writing, software
|
15 | * distributed under the License is distributed on an "AS IS" BASIS,
|
16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17 | * See the License for the specific language governing permissions and
|
18 | * limitations under the License.
|
19 | *
|
20 | */
|
21 | const OFFICIAL_PUPPET_DEPENDENCIES = {
|
22 | /**
|
23 | * The following puppets were DEPRECATED before 2020
|
24 | */
|
25 | // 'wechaty-puppet-ioscat' : '^0.5.22', // https://www.npmjs.com/package/wechaty-puppet-ioscat
|
26 | // 'wechaty-puppet-padchat' : '^0.19.3', // https://www.npmjs.com/package/wechaty-puppet-padchat
|
27 | // 'wechaty-puppet-padpro' : '^0.3.21', // https://www.npmjs.com/package/wechaty-puppet-padpro
|
28 |
|
29 | /**
|
30 | * Deprecated History:
|
31 | * https://github.com/wechaty/puppet-service-providers/issues/11
|
32 | */
|
33 | // Dec 2020
|
34 | // - https://github.com/wechaty/puppet-services/issues/61
|
35 | // 'wechaty-puppet-padplus' : '^0.7.30', // https://www.npmjs.com/package/wechaty-puppet-padplus
|
36 | // Sep 2021:
|
37 | // 'wechaty-puppet-hostie' : '*', // https://www.npmjs.com/package/wechaty-puppet-hostie
|
38 |
|
39 | /**
|
40 | * Wechaty Internal Puppets: dependency by package.json
|
41 | *
|
42 | * Huan(202108): DO NOT REMOVE THE SPECIFIC VERSIONS BELOW
|
43 | * All the internal puppets which have already depended in package.json
|
44 | * MUST be listed below with their correct version number (ranges)
|
45 | * because the `bin/puppet-install.ts` will use those version
|
46 | * to install all them inside the Docker
|
47 | */
|
48 | 'wechaty-puppet-service' : '>=1.11.2', // https://www.npmjs.com/package/wechaty-puppet-service
|
49 | 'wechaty-puppet-mock' : '>=1.10.2', // https://www.npmjs.com/package/wechaty-puppet-mock
|
50 |
|
51 | /**
|
52 | * WeChat Puppets
|
53 | */
|
54 | 'wechaty-puppet-wechat' : '>=1.11.8', // https://www.npmjs.com/package/wechaty-puppet-wechat
|
55 | 'wechaty-puppet-wechat4u' : '>=1.11.1', // https://www.npmjs.com/package/wechaty-puppet-wechat4u
|
56 | 'wechaty-puppet-padlocal' : '>=0.4.1', // https://www.npmjs.com/package/wechaty-puppet-padlocal
|
57 | 'wechaty-puppet-xp' : '>=1.10.2', // https://www.npmjs.com/package/wechaty-puppet-xp
|
58 | 'wechaty-puppet-oicq' : '>=1.10.2', // https://www.npmjs.com/package/wechaty-puppet-oicq
|
59 | 'wechaty-puppet-official-account' : '>=1.10.2', // https://www.npmjs.com/package/wechaty-puppet-official-account
|
60 |
|
61 | /**
|
62 | * Non-WeChat External Puppets
|
63 | */
|
64 | 'wechaty-puppet-gitter' : '>=1.10.1', // https://www.npmjs.com/package/wechaty-puppet-gitter
|
65 | 'wechaty-puppet-lark' : '>=0.4.5', // https://www.npmjs.com/package/wechaty-puppet-lark
|
66 | 'wechaty-puppet-whatsapp' : '>=1.10.4', // https://www.npmjs.com/package/wechaty-puppet-whatsapp
|
67 | 'wechaty-puppet-walnut' : '>=0.1.41', // https://www.npmjs.com/package/wechaty-puppet-walnut
|
68 |
|
69 | /**
|
70 | * Scoped puppets (private)
|
71 | */
|
72 | '@juzibot/wechaty-puppet-donut' : '*', // https://www.npmjs.com/package/wechaty-puppet-donut (to be published)
|
73 | '@juzibot/wechaty-puppet-wxwork' : '*', // https://www.npmjs.com/package/wechaty-puppet-wxwork (to be published)
|
74 | }
|
75 |
|
76 | type OfficialPuppetNpmName = keyof typeof OFFICIAL_PUPPET_DEPENDENCIES
|
77 |
|
78 | const isPuppetModuleName = (name: string): name is OfficialPuppetNpmName => name in OFFICIAL_PUPPET_DEPENDENCIES
|
79 |
|
80 | /**
|
81 | * Updates:
|
82 | * - Huan(202004): we change default puppet from puppet-service -> puppet-wechat (with UOS support)
|
83 | * - Huan(202009): use puppet service as default
|
84 | * - Huan(202201): use puppet-wechat4u as default
|
85 | */
|
86 | const OFFICIAL_PUPPET_DEFAULT: OfficialPuppetNpmName = 'wechaty-puppet-wechat4u'
|
87 |
|
88 | // i.e. @juzibot/wechaty-puppet-donut
|
89 | type PuppetNpmScope = `@${string}/` | ''
|
90 | type PuppetNpmName = `${PuppetNpmScope}wechaty-puppet-${string}`
|
91 |
|
92 | /**
|
93 | * @deprecated: use `OfficialPuppetNpmName` instead. will be removed after Dec 31, 2022
|
94 | */
|
95 | type PuppetModuleName = OfficialPuppetNpmName
|
96 |
|
97 | export {
|
98 | type OfficialPuppetNpmName,
|
99 | type PuppetNpmName,
|
100 | type PuppetModuleName, // DEPRECATED
|
101 | OFFICIAL_PUPPET_DEPENDENCIES,
|
102 | OFFICIAL_PUPPET_DEFAULT,
|
103 | isPuppetModuleName,
|
104 | }
|