fishpi 0.0.3 → 0.0.7
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/LICENSE +21 -21
- package/README.md +56 -52
- package/lib/src/article.d.ts +60 -0
- package/lib/src/article.js +254 -0
- package/lib/src/breezemoon.d.ts +20 -0
- package/lib/src/breezemoon.js +114 -0
- package/lib/src/chat.d.ts +66 -0
- package/lib/src/chat.js +315 -0
- package/lib/src/chatroom.d.ts +21 -23
- package/lib/src/chatroom.js +377 -262
- package/lib/src/comment.d.ts +31 -0
- package/lib/src/comment.js +207 -0
- package/lib/src/emoji.d.ts +197 -0
- package/lib/src/emoji.js +308 -0
- package/lib/src/index.d.ts +23 -26
- package/lib/src/index.js +179 -218
- package/lib/src/notice.d.ts +1 -3
- package/lib/src/notice.js +116 -59
- package/lib/src/typing.d.ts +1901 -0
- package/lib/src/typing.js +411 -0
- package/lib/src/user.d.ts +35 -0
- package/lib/src/user.js +243 -0
- package/lib/src/utils.d.ts +4 -3
- package/lib/src/utils.js +84 -39
- package/package.json +48 -48
- package/lib/test/index.d.ts +0 -1
- package/lib/test/index.js +0 -27
package/lib/src/emoji.js
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
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 __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
var utils_1 = require("./utils");
|
|
40
|
+
var Emoji = /** @class */ (function () {
|
|
41
|
+
function Emoji(token) {
|
|
42
|
+
if (token === void 0) { token = ''; }
|
|
43
|
+
this._apiKey = '';
|
|
44
|
+
if (!token) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
this._apiKey = token;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 重新设置请求 Token
|
|
51
|
+
* @param apiKey 接口 API Key
|
|
52
|
+
*/
|
|
53
|
+
Emoji.prototype.setToken = function (token) {
|
|
54
|
+
this._apiKey = token;
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(Emoji.prototype, "default", {
|
|
57
|
+
get: function () {
|
|
58
|
+
return {
|
|
59
|
+
"doge": "https://cdn.jsdelivr.net/npm/vditor@3.8.7/dist/images/emoji/doge.png",
|
|
60
|
+
"trollface": "https://cdn.jsdelivr.net/npm/vditor@3.8.7/dist/images/emoji/trollface.png",
|
|
61
|
+
"huaji": "https://cdn.jsdelivr.net/npm/vditor@3.8.7/dist/images/emoji/huaji.gif",
|
|
62
|
+
"octocat": "https://cdn.jsdelivr.net/npm/vditor@3.8.7/dist/images/emoji/octocat.png",
|
|
63
|
+
"wulian": "https://cdn.jsdelivr.net/npm/vditor@3.8.7/dist/images/emoji/wulian.png",
|
|
64
|
+
"smile": "https://".concat(utils_1.domain, "/emoji/graphics/smile.png"),
|
|
65
|
+
"laughing": "https://".concat(utils_1.domain, "/emoji/graphics/laughing.png"),
|
|
66
|
+
"blush": "https://".concat(utils_1.domain, "/emoji/graphics/blush.png"),
|
|
67
|
+
"smiley": "https://".concat(utils_1.domain, "/emoji/graphics/smiley.png"),
|
|
68
|
+
"relaxed": "https://".concat(utils_1.domain, "/emoji/graphics/relaxed.png"),
|
|
69
|
+
"smirk": "https://".concat(utils_1.domain, "/emoji/graphics/smirk.png"),
|
|
70
|
+
"heart_eyes": "https://".concat(utils_1.domain, "/emoji/graphics/heart_eyes.png"),
|
|
71
|
+
"kissing_heart": "https://".concat(utils_1.domain, "/emoji/graphics/kissing_heart.png"),
|
|
72
|
+
"kissing_closed_eyes": "https://".concat(utils_1.domain, "/emoji/graphics/kissing_closed_eyes.png"),
|
|
73
|
+
"flushed": "https://".concat(utils_1.domain, "/emoji/graphics/flushed.png"),
|
|
74
|
+
"relieved": "https://".concat(utils_1.domain, "/emoji/graphics/relieved.png"),
|
|
75
|
+
"satisfied": "https://".concat(utils_1.domain, "/emoji/graphics/satisfied.png"),
|
|
76
|
+
"grin": "https://".concat(utils_1.domain, "/emoji/graphics/grin.png"),
|
|
77
|
+
"wink": "https://".concat(utils_1.domain, "/emoji/graphics/wink.png"),
|
|
78
|
+
"stuck_out_tongue_winking_eye": "https://".concat(utils_1.domain, "/emoji/graphics/stuck_out_tongue_winking_eye.png"),
|
|
79
|
+
"stuck_out_tongue_closed_eyes": "https://".concat(utils_1.domain, "/emoji/graphics/stuck_out_tongue_closed_eyes.png"),
|
|
80
|
+
"grinning": "https://".concat(utils_1.domain, "/emoji/graphics/grinning.png"),
|
|
81
|
+
"kissing": "https://".concat(utils_1.domain, "/emoji/graphics/kissing.png"),
|
|
82
|
+
"kissing_smiling_eyes": "https://".concat(utils_1.domain, "/emoji/graphics/kissing_smiling_eyes.png"),
|
|
83
|
+
"stuck_out_tongue": "https://".concat(utils_1.domain, "/emoji/graphics/stuck_out_tongue.png"),
|
|
84
|
+
"sleeping": "https://".concat(utils_1.domain, "/emoji/graphics/sleeping.png"),
|
|
85
|
+
"worried": "https://".concat(utils_1.domain, "/emoji/graphics/worried.png"),
|
|
86
|
+
"frowning": "https://".concat(utils_1.domain, "/emoji/graphics/frowning.png"),
|
|
87
|
+
"anguished": "https://".concat(utils_1.domain, "/emoji/graphics/anguished.png"),
|
|
88
|
+
"open_mouth": "https://".concat(utils_1.domain, "/emoji/graphics/open_mouth.png"),
|
|
89
|
+
"grimacing": "https://".concat(utils_1.domain, "/emoji/graphics/grimacing.png"),
|
|
90
|
+
"confused": "https://".concat(utils_1.domain, "/emoji/graphics/confused.png"),
|
|
91
|
+
"hushed": "https://".concat(utils_1.domain, "/emoji/graphics/hushed.png"),
|
|
92
|
+
"expressionless": "https://".concat(utils_1.domain, "/emoji/graphics/expressionless.png"),
|
|
93
|
+
"unamused": "https://".concat(utils_1.domain, "/emoji/graphics/unamused.png"),
|
|
94
|
+
"sweat_smile": "https://".concat(utils_1.domain, "/emoji/graphics/sweat_smile.png"),
|
|
95
|
+
"sweat": "https://".concat(utils_1.domain, "/emoji/graphics/sweat.png"),
|
|
96
|
+
"disappointed_relieved": "https://".concat(utils_1.domain, "/emoji/graphics/disappointed_relieved.png"),
|
|
97
|
+
"weary": "https://".concat(utils_1.domain, "/emoji/graphics/weary.png"),
|
|
98
|
+
"pensive": "https://".concat(utils_1.domain, "/emoji/graphics/pensive.png"),
|
|
99
|
+
"disappointed": "https://".concat(utils_1.domain, "/emoji/graphics/disappointed.png"),
|
|
100
|
+
"confounded": "https://".concat(utils_1.domain, "/emoji/graphics/confounded.png"),
|
|
101
|
+
"fearful": "https://".concat(utils_1.domain, "/emoji/graphics/fearful.png"),
|
|
102
|
+
"cold_sweat": "https://".concat(utils_1.domain, "/emoji/graphics/cold_sweat.png"),
|
|
103
|
+
"persevere": "https://".concat(utils_1.domain, "/emoji/graphics/persevere.png"),
|
|
104
|
+
"cry": "https://".concat(utils_1.domain, "/emoji/graphics/cry.png"),
|
|
105
|
+
"sob": "https://".concat(utils_1.domain, "/emoji/graphics/sob.png"),
|
|
106
|
+
"joy": "https://".concat(utils_1.domain, "/emoji/graphics/joy.png"),
|
|
107
|
+
"astonished": "https://".concat(utils_1.domain, "/emoji/graphics/astonished.png"),
|
|
108
|
+
"scream": "https://".concat(utils_1.domain, "/emoji/graphics/scream.png"),
|
|
109
|
+
"tired_face": "https://".concat(utils_1.domain, "/emoji/graphics/tired_face.png"),
|
|
110
|
+
"angry": "https://".concat(utils_1.domain, "/emoji/graphics/angry.png"),
|
|
111
|
+
"rage": "https://".concat(utils_1.domain, "/emoji/graphics/rage.png"),
|
|
112
|
+
"triumph": "https://".concat(utils_1.domain, "/emoji/graphics/triumph.png"),
|
|
113
|
+
"sleepy": "https://".concat(utils_1.domain, "/emoji/graphics/sleepy.png"),
|
|
114
|
+
"yum": "https://".concat(utils_1.domain, "/emoji/graphics/yum.png"),
|
|
115
|
+
"mask": "https://".concat(utils_1.domain, "/emoji/graphics/mask.png"),
|
|
116
|
+
"sunglasses": "https://".concat(utils_1.domain, "/emoji/graphics/sunglasses.png"),
|
|
117
|
+
"dizzy_face": "https://".concat(utils_1.domain, "/emoji/graphics/dizzy_face.png"),
|
|
118
|
+
"imp": "https://".concat(utils_1.domain, "/emoji/graphics/imp.png"),
|
|
119
|
+
"smiling_imp": "https://".concat(utils_1.domain, "/emoji/graphics/smiling_imp.png"),
|
|
120
|
+
"neutral_face": "https://".concat(utils_1.domain, "/emoji/graphics/neutral_face.png"),
|
|
121
|
+
"no_mouth": "https://".concat(utils_1.domain, "/emoji/graphics/no_mouth.png"),
|
|
122
|
+
"innocent": "https://".concat(utils_1.domain, "/emoji/graphics/innocent.png"),
|
|
123
|
+
"alien": "https://".concat(utils_1.domain, "/emoji/graphics/alien.png"),
|
|
124
|
+
"yellow_heart": "https://".concat(utils_1.domain, "/emoji/graphics/yellow_heart.png"),
|
|
125
|
+
"blue_heart": "https://".concat(utils_1.domain, "/emoji/graphics/blue_heart.png"),
|
|
126
|
+
"purple_heart": "https://".concat(utils_1.domain, "/emoji/graphics/purple_heart.png"),
|
|
127
|
+
"heart": "https://".concat(utils_1.domain, "/emoji/graphics/heart.png"),
|
|
128
|
+
"green_heart": "https://".concat(utils_1.domain, "/emoji/graphics/green_heart.png"),
|
|
129
|
+
"broken_heart": "https://".concat(utils_1.domain, "/emoji/graphics/broken_heart.png"),
|
|
130
|
+
"heartbeat": "https://".concat(utils_1.domain, "/emoji/graphics/heartbeat.png"),
|
|
131
|
+
"heartpulse": "https://".concat(utils_1.domain, "/emoji/graphics/heartpulse.png"),
|
|
132
|
+
"two_hearts": "https://".concat(utils_1.domain, "/emoji/graphics/two_hearts.png"),
|
|
133
|
+
"revolving_hearts": "https://".concat(utils_1.domain, "/emoji/graphics/revolving_hearts.png"),
|
|
134
|
+
"cupid": "https://".concat(utils_1.domain, "/emoji/graphics/cupid.png"),
|
|
135
|
+
"sparkling_heart": "https://".concat(utils_1.domain, "/emoji/graphics/sparkling_heart.png"),
|
|
136
|
+
"sparkles": "https://".concat(utils_1.domain, "/emoji/graphics/sparkles.png"),
|
|
137
|
+
"star": "https://".concat(utils_1.domain, "/emoji/graphics/star.png"),
|
|
138
|
+
"star2": "https://".concat(utils_1.domain, "/emoji/graphics/star2.png"),
|
|
139
|
+
"dizzy": "https://".concat(utils_1.domain, "/emoji/graphics/dizzy.png"),
|
|
140
|
+
"boom": "https://".concat(utils_1.domain, "/emoji/graphics/boom.png"),
|
|
141
|
+
"collision": "https://".concat(utils_1.domain, "/emoji/graphics/collision.png"),
|
|
142
|
+
"anger": "https://".concat(utils_1.domain, "/emoji/graphics/anger.png"),
|
|
143
|
+
"exclamation": "https://".concat(utils_1.domain, "/emoji/graphics/exclamation.png"),
|
|
144
|
+
"question": "https://".concat(utils_1.domain, "/emoji/graphics/question.png"),
|
|
145
|
+
"grey_exclamation": "https://".concat(utils_1.domain, "/emoji/graphics/grey_exclamation.png"),
|
|
146
|
+
"grey_question": "https://".concat(utils_1.domain, "/emoji/graphics/grey_question.png"),
|
|
147
|
+
"zzz": "https://".concat(utils_1.domain, "/emoji/graphics/zzz.png"),
|
|
148
|
+
"dash": "https://".concat(utils_1.domain, "/emoji/graphics/dash.png"),
|
|
149
|
+
"sweat_drops": "https://".concat(utils_1.domain, "/emoji/graphics/sweat_drops.png"),
|
|
150
|
+
"notes": "https://".concat(utils_1.domain, "/emoji/graphics/notes.png"),
|
|
151
|
+
"musical_note": "https://".concat(utils_1.domain, "/emoji/graphics/musical_note.png"),
|
|
152
|
+
"fire": "https://".concat(utils_1.domain, "/emoji/graphics/fire.png"),
|
|
153
|
+
"poop": "https://".concat(utils_1.domain, "/emoji/graphics/poop.png"),
|
|
154
|
+
"+1": "https://".concat(utils_1.domain, "/emoji/graphics/%2B1.png"),
|
|
155
|
+
"thumbsup": "https://".concat(utils_1.domain, "/emoji/graphics/thumbsup.png"),
|
|
156
|
+
"-1": "https://".concat(utils_1.domain, "/emoji/graphics/-1.png"),
|
|
157
|
+
"thumbsdown": "https://".concat(utils_1.domain, "/emoji/graphics/thumbsdown.png"),
|
|
158
|
+
"ok_hand": "https://".concat(utils_1.domain, "/emoji/graphics/ok_hand.png"),
|
|
159
|
+
"punch": "https://".concat(utils_1.domain, "/emoji/graphics/punch.png"),
|
|
160
|
+
"facepunch": "https://".concat(utils_1.domain, "/emoji/graphics/facepunch.png"),
|
|
161
|
+
"fist": "https://".concat(utils_1.domain, "/emoji/graphics/fist.png"),
|
|
162
|
+
"v": "https://".concat(utils_1.domain, "/emoji/graphics/v.png"),
|
|
163
|
+
"wave": "https://".concat(utils_1.domain, "/emoji/graphics/wave.png"),
|
|
164
|
+
"hand": "https://".concat(utils_1.domain, "/emoji/graphics/hand.png"),
|
|
165
|
+
"raised_hand": "https://".concat(utils_1.domain, "/emoji/graphics/raised_hand.png"),
|
|
166
|
+
"open_hands": "https://".concat(utils_1.domain, "/emoji/graphics/open_hands.png"),
|
|
167
|
+
"point_up": "https://".concat(utils_1.domain, "/emoji/graphics/point_up.png"),
|
|
168
|
+
"point_down": "https://".concat(utils_1.domain, "/emoji/graphics/point_down.png"),
|
|
169
|
+
"point_left": "https://".concat(utils_1.domain, "/emoji/graphics/point_left.png"),
|
|
170
|
+
"point_right": "https://".concat(utils_1.domain, "/emoji/graphics/point_right.png"),
|
|
171
|
+
"raised_hands": "https://".concat(utils_1.domain, "/emoji/graphics/raised_hands.png"),
|
|
172
|
+
"pray": "https://".concat(utils_1.domain, "/emoji/graphics/pray.png"),
|
|
173
|
+
"point_up_2": "https://".concat(utils_1.domain, "/emoji/graphics/point_up_2.png"),
|
|
174
|
+
"clap": "https://".concat(utils_1.domain, "/emoji/graphics/clap.png"),
|
|
175
|
+
"muscle": "https://".concat(utils_1.domain, "/emoji/graphics/muscle.png"),
|
|
176
|
+
"couple": "https://".concat(utils_1.domain, "/emoji/graphics/couple.png"),
|
|
177
|
+
"family": "https://".concat(utils_1.domain, "/emoji/graphics/family.png"),
|
|
178
|
+
"two_men_holding_hands": "https://".concat(utils_1.domain, "/emoji/graphics/two_men_holding_hands.png"),
|
|
179
|
+
"two_women_holding_hands": "https://".concat(utils_1.domain, "/emoji/graphics/two_women_holding_hands.png"),
|
|
180
|
+
"dancer": "https://".concat(utils_1.domain, "/emoji/graphics/dancer.png"),
|
|
181
|
+
"dancers": "https://".concat(utils_1.domain, "/emoji/graphics/dancers.png"),
|
|
182
|
+
"ok_woman": "https://".concat(utils_1.domain, "/emoji/graphics/ok_woman.png"),
|
|
183
|
+
"no_good": "https://".concat(utils_1.domain, "/emoji/graphics/no_good.png"),
|
|
184
|
+
"information_desk_person": "https://".concat(utils_1.domain, "/emoji/graphics/information_desk_person.png"),
|
|
185
|
+
"raising_hand": "https://".concat(utils_1.domain, "/emoji/graphics/raising_hand.png"),
|
|
186
|
+
"bride_with_veil": "https://".concat(utils_1.domain, "/emoji/graphics/bride_with_veil.png"),
|
|
187
|
+
"person_with_pouting_face": "https://".concat(utils_1.domain, "/emoji/graphics/person_with_pouting_face.png"),
|
|
188
|
+
"person_frowning": "https://".concat(utils_1.domain, "/emoji/graphics/person_frowning.png"),
|
|
189
|
+
"bow": "https://".concat(utils_1.domain, "/emoji/graphics/bow.png"),
|
|
190
|
+
"couplekiss": "https://".concat(utils_1.domain, "/emoji/graphics/couplekiss.png"),
|
|
191
|
+
"couple_with_heart": "https://".concat(utils_1.domain, "/emoji/graphics/couple_with_heart.png"),
|
|
192
|
+
"massage": "https://".concat(utils_1.domain, "/emoji/graphics/massage.png"),
|
|
193
|
+
"haircut": "https://".concat(utils_1.domain, "/emoji/graphics/haircut.png"),
|
|
194
|
+
"nail_care": "https://".concat(utils_1.domain, "/emoji/graphics/nail_care.png"),
|
|
195
|
+
"boy": "https://".concat(utils_1.domain, "/emoji/graphics/boy.png"),
|
|
196
|
+
"girl": "https://".concat(utils_1.domain, "/emoji/graphics/girl.png"),
|
|
197
|
+
"woman": "https://".concat(utils_1.domain, "/emoji/graphics/woman.png"),
|
|
198
|
+
"man": "https://".concat(utils_1.domain, "/emoji/graphics/man.png"),
|
|
199
|
+
"baby": "https://".concat(utils_1.domain, "/emoji/graphics/baby.png"),
|
|
200
|
+
"older_woman": "https://".concat(utils_1.domain, "/emoji/graphics/older_woman.png"),
|
|
201
|
+
"older_man": "https://".concat(utils_1.domain, "/emoji/graphics/older_man.png"),
|
|
202
|
+
"person_with_blond_hair": "https://".concat(utils_1.domain, "/emoji/graphics/person_with_blond_hair.png"),
|
|
203
|
+
"man_with_gua_pi_mao": "https://".concat(utils_1.domain, "/emoji/graphics/man_with_gua_pi_mao.png"),
|
|
204
|
+
"man_with_turban": "https://".concat(utils_1.domain, "/emoji/graphics/man_with_turban.png"),
|
|
205
|
+
"construction_worker": "https://".concat(utils_1.domain, "/emoji/graphics/construction_worker.png"),
|
|
206
|
+
"cop": "https://".concat(utils_1.domain, "/emoji/graphics/cop.png"),
|
|
207
|
+
"angel": "https://".concat(utils_1.domain, "/emoji/graphics/angel.png"),
|
|
208
|
+
"princess": "https://".concat(utils_1.domain, "/emoji/graphics/princess.png"),
|
|
209
|
+
"smiley_cat": "https://".concat(utils_1.domain, "/emoji/graphics/smiley_cat.png"),
|
|
210
|
+
"smile_cat": "https://".concat(utils_1.domain, "/emoji/graphics/smile_cat.png"),
|
|
211
|
+
"heart_eyes_cat": "https://".concat(utils_1.domain, "/emoji/graphics/heart_eyes_cat.png"),
|
|
212
|
+
"kissing_cat": "https://".concat(utils_1.domain, "/emoji/graphics/kissing_cat.png"),
|
|
213
|
+
"smirk_cat": "https://".concat(utils_1.domain, "/emoji/graphics/smirk_cat.png"),
|
|
214
|
+
"scream_cat": "https://".concat(utils_1.domain, "/emoji/graphics/scream_cat.png"),
|
|
215
|
+
"crying_cat_face": "https://".concat(utils_1.domain, "/emoji/graphics/crying_cat_face.png"),
|
|
216
|
+
"joy_cat": "https://".concat(utils_1.domain, "/emoji/graphics/joy_cat.png"),
|
|
217
|
+
"pouting_cat": "https://".concat(utils_1.domain, "/emoji/graphics/pouting_cat.png"),
|
|
218
|
+
"japanese_ogre": "https://".concat(utils_1.domain, "/emoji/graphics/japanese_ogre.png"),
|
|
219
|
+
"japanese_goblin": "https://".concat(utils_1.domain, "/emoji/graphics/japanese_goblin.png"),
|
|
220
|
+
"see_no_evil": "https://".concat(utils_1.domain, "/emoji/graphics/see_no_evil.png"),
|
|
221
|
+
"hear_no_evil": "https://".concat(utils_1.domain, "/emoji/graphics/hear_no_evil.png"),
|
|
222
|
+
"speak_no_evil": "https://".concat(utils_1.domain, "/emoji/graphics/speak_no_evil.png"),
|
|
223
|
+
"guardsman": "https://".concat(utils_1.domain, "/emoji/graphics/guardsman.png"),
|
|
224
|
+
"skull": "https://".concat(utils_1.domain, "/emoji/graphics/skull.png"),
|
|
225
|
+
"feet": "https://".concat(utils_1.domain, "/emoji/graphics/feet.png"),
|
|
226
|
+
"lips": "https://".concat(utils_1.domain, "/emoji/graphics/lips.png"),
|
|
227
|
+
"kiss": "https://".concat(utils_1.domain, "/emoji/graphics/kiss.png"),
|
|
228
|
+
"droplet": "https://".concat(utils_1.domain, "/emoji/graphics/droplet.png"),
|
|
229
|
+
"ear": "https://".concat(utils_1.domain, "/emoji/graphics/ear.png"),
|
|
230
|
+
"eyes": "https://".concat(utils_1.domain, "/emoji/graphics/eyes.png"),
|
|
231
|
+
"nose": "https://".concat(utils_1.domain, "/emoji/graphics/nose.png"),
|
|
232
|
+
"tongue": "https://".concat(utils_1.domain, "/emoji/graphics/tongue.png"),
|
|
233
|
+
"love_letter": "https://".concat(utils_1.domain, "/emoji/graphics/love_letter.png"),
|
|
234
|
+
"bust_in_silhouette": "https://".concat(utils_1.domain, "/emoji/graphics/bust_in_silhouette.png"),
|
|
235
|
+
"busts_in_silhouette": "https://".concat(utils_1.domain, "/emoji/graphics/busts_in_silhouette.png"),
|
|
236
|
+
"speech_balloon": "https://".concat(utils_1.domain, "/emoji/graphics/speech_balloon.png"),
|
|
237
|
+
"thought_balloon": "https://".concat(utils_1.domain, "/emoji/graphics/thought_balloon.png")
|
|
238
|
+
};
|
|
239
|
+
},
|
|
240
|
+
enumerable: false,
|
|
241
|
+
configurable: true
|
|
242
|
+
});
|
|
243
|
+
Emoji.prototype.get = function () {
|
|
244
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
245
|
+
var rsp, e_1;
|
|
246
|
+
return __generator(this, function (_a) {
|
|
247
|
+
switch (_a.label) {
|
|
248
|
+
case 0:
|
|
249
|
+
_a.trys.push([0, 2, , 3]);
|
|
250
|
+
return [4 /*yield*/, (0, utils_1.request)({
|
|
251
|
+
url: "api/cloud/get",
|
|
252
|
+
method: 'post',
|
|
253
|
+
data: {
|
|
254
|
+
gameId: 'emojis',
|
|
255
|
+
apiKey: this._apiKey
|
|
256
|
+
},
|
|
257
|
+
})];
|
|
258
|
+
case 1:
|
|
259
|
+
rsp = _a.sent();
|
|
260
|
+
if (rsp.status === 401) {
|
|
261
|
+
throw new Error('登录已失效,请重新登录!');
|
|
262
|
+
}
|
|
263
|
+
return [2 /*return*/, JSON.parse(rsp.data.data)];
|
|
264
|
+
case 2:
|
|
265
|
+
e_1 = _a.sent();
|
|
266
|
+
throw e_1;
|
|
267
|
+
case 3: return [2 /*return*/];
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
});
|
|
271
|
+
};
|
|
272
|
+
/**
|
|
273
|
+
* 设置表情包列表
|
|
274
|
+
* @param data 所有表情包图像列表
|
|
275
|
+
*/
|
|
276
|
+
Emoji.prototype.set = function (data) {
|
|
277
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
278
|
+
var rsp, e_2;
|
|
279
|
+
return __generator(this, function (_a) {
|
|
280
|
+
switch (_a.label) {
|
|
281
|
+
case 0:
|
|
282
|
+
_a.trys.push([0, 2, , 3]);
|
|
283
|
+
return [4 /*yield*/, (0, utils_1.request)({
|
|
284
|
+
url: "api/cloud/sync",
|
|
285
|
+
method: 'post',
|
|
286
|
+
data: {
|
|
287
|
+
gameId: 'emojis',
|
|
288
|
+
data: JSON.stringify(data),
|
|
289
|
+
apiKey: this._apiKey
|
|
290
|
+
},
|
|
291
|
+
})];
|
|
292
|
+
case 1:
|
|
293
|
+
rsp = _a.sent();
|
|
294
|
+
if (rsp.status === 401) {
|
|
295
|
+
throw new Error('登录已失效,请重新登录!');
|
|
296
|
+
}
|
|
297
|
+
return [2 /*return*/, rsp.data];
|
|
298
|
+
case 2:
|
|
299
|
+
e_2 = _a.sent();
|
|
300
|
+
throw e_2;
|
|
301
|
+
case 3: return [2 /*return*/];
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
});
|
|
305
|
+
};
|
|
306
|
+
return Emoji;
|
|
307
|
+
}());
|
|
308
|
+
exports.default = Emoji;
|
package/lib/src/index.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
-
import { ApiResponse, Account, UserInfo, AtUserList, UploadInfo } from './typing';
|
|
1
|
+
import { ApiResponse, Account, UserInfo, AtUserList, UploadInfo, ApiKey } from './typing';
|
|
2
2
|
import ChatRoom from './chatroom';
|
|
3
3
|
import Notice from './notice';
|
|
4
|
+
import Emoji from './emoji';
|
|
5
|
+
import User from './user';
|
|
6
|
+
import Article from './article';
|
|
7
|
+
import Chat from './chat';
|
|
4
8
|
declare class FishPi {
|
|
5
9
|
/**
|
|
6
10
|
* 请求 API 的 API Key
|
|
@@ -14,20 +18,33 @@ declare class FishPi {
|
|
|
14
18
|
* 通知接口对象
|
|
15
19
|
*/
|
|
16
20
|
notice: Notice;
|
|
21
|
+
/**
|
|
22
|
+
* 表情包接口对象
|
|
23
|
+
*/
|
|
24
|
+
emoji: Emoji;
|
|
25
|
+
/**
|
|
26
|
+
* 用户接口对象
|
|
27
|
+
*/
|
|
28
|
+
account: User;
|
|
29
|
+
/**
|
|
30
|
+
* 文章接口对象
|
|
31
|
+
*/
|
|
32
|
+
article: Article;
|
|
33
|
+
/**
|
|
34
|
+
* 私聊接口对象
|
|
35
|
+
*/
|
|
36
|
+
chat: Chat;
|
|
17
37
|
/**
|
|
18
38
|
* 构造一个 API 请求对象
|
|
19
39
|
* @param token 接口 API Key,没有可以传空
|
|
20
40
|
*/
|
|
21
41
|
constructor(token?: string);
|
|
42
|
+
setToken(apiKey: string): Promise<void>;
|
|
22
43
|
/**
|
|
23
44
|
* 登录账号返回 API Key
|
|
24
45
|
* @param data 用户账密
|
|
25
46
|
*/
|
|
26
|
-
login(data: Account): Promise<
|
|
27
|
-
/**
|
|
28
|
-
* 返回登录账户信息,需要先登录或设置有效的 api key
|
|
29
|
-
*/
|
|
30
|
-
info(): Promise<ApiResponse<UserInfo>>;
|
|
47
|
+
login(data: Account): Promise<ApiKey>;
|
|
31
48
|
/**
|
|
32
49
|
* 查询指定用户信息
|
|
33
50
|
* @param username 用户名
|
|
@@ -38,26 +55,6 @@ declare class FishPi {
|
|
|
38
55
|
* @param username 用户名
|
|
39
56
|
*/
|
|
40
57
|
names(name: string): Promise<AtUserList>;
|
|
41
|
-
/**
|
|
42
|
-
* 查询登录用户常用表情
|
|
43
|
-
*/
|
|
44
|
-
emotions(): Promise<ApiResponse<Array<string>>>;
|
|
45
|
-
/**
|
|
46
|
-
* 查询登录用户当前活跃度,请求频率请控制在 30 ~ 60 秒一次
|
|
47
|
-
*/
|
|
48
|
-
liveness(): Promise<number>;
|
|
49
|
-
/**
|
|
50
|
-
* 检查登录用户是否已经签到
|
|
51
|
-
*/
|
|
52
|
-
isCheckIn(): Promise<boolean>;
|
|
53
|
-
/**
|
|
54
|
-
* 检查登录用户是否已经领取昨日活跃奖励
|
|
55
|
-
*/
|
|
56
|
-
isCollectedLiveness(): Promise<boolean>;
|
|
57
|
-
/**
|
|
58
|
-
* 领取昨日活跃度奖励
|
|
59
|
-
*/
|
|
60
|
-
rewardLiveness(): Promise<number>;
|
|
61
58
|
/**
|
|
62
59
|
* 上传文件
|
|
63
60
|
* @param files 要上传的文件,如果是在 Node 使用,则传入文件路径数组,若是在浏览器使用,则传入文件对象数组。
|