fishpi 0.0.46 → 0.0.47
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/lib/article.d.ts +6 -1
- package/lib/article.js +33 -4
- package/lib/typing.d.ts +2 -2
- package/lib/typing.js +23 -1
- package/package.json +1 -1
package/lib/article.d.ts
CHANGED
|
@@ -80,9 +80,14 @@ declare class Article {
|
|
|
80
80
|
follow(followingId: string): Promise<ApiResponse<undefined>>;
|
|
81
81
|
/**
|
|
82
82
|
* 关注/取消关注文章
|
|
83
|
-
* @param
|
|
83
|
+
* @param followingId 文章id
|
|
84
84
|
*/
|
|
85
85
|
watch(followingId: string): Promise<ApiResponse<undefined>>;
|
|
86
|
+
/**
|
|
87
|
+
* 打赏文章
|
|
88
|
+
* @param id 文章id
|
|
89
|
+
*/
|
|
90
|
+
reward(id: string): Promise<ApiResponse<undefined>>;
|
|
86
91
|
/**
|
|
87
92
|
* 获取文章在线人数
|
|
88
93
|
* @param id 文章id
|
package/lib/article.js
CHANGED
|
@@ -330,7 +330,7 @@ var Article = /** @class */ (function () {
|
|
|
330
330
|
};
|
|
331
331
|
/**
|
|
332
332
|
* 关注/取消关注文章
|
|
333
|
-
* @param
|
|
333
|
+
* @param followingId 文章id
|
|
334
334
|
*/
|
|
335
335
|
Article.prototype.watch = function (followingId) {
|
|
336
336
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -358,13 +358,42 @@ var Article = /** @class */ (function () {
|
|
|
358
358
|
});
|
|
359
359
|
});
|
|
360
360
|
};
|
|
361
|
+
/**
|
|
362
|
+
* 打赏文章
|
|
363
|
+
* @param id 文章id
|
|
364
|
+
*/
|
|
365
|
+
Article.prototype.reward = function (id) {
|
|
366
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
367
|
+
var rsp, e_10;
|
|
368
|
+
return __generator(this, function (_a) {
|
|
369
|
+
switch (_a.label) {
|
|
370
|
+
case 0:
|
|
371
|
+
_a.trys.push([0, 2, , 3]);
|
|
372
|
+
return [4 /*yield*/, (0, utils_1.request)({
|
|
373
|
+
url: "article/reward?articleId=".concat(id),
|
|
374
|
+
method: 'post',
|
|
375
|
+
data: {
|
|
376
|
+
apiKey: this._apiKey,
|
|
377
|
+
},
|
|
378
|
+
})];
|
|
379
|
+
case 1:
|
|
380
|
+
rsp = _a.sent();
|
|
381
|
+
return [2 /*return*/, rsp];
|
|
382
|
+
case 2:
|
|
383
|
+
e_10 = _a.sent();
|
|
384
|
+
throw e_10;
|
|
385
|
+
case 3: return [2 /*return*/];
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
});
|
|
389
|
+
};
|
|
361
390
|
/**
|
|
362
391
|
* 获取文章在线人数
|
|
363
392
|
* @param id 文章id
|
|
364
393
|
*/
|
|
365
394
|
Article.prototype.heat = function (id) {
|
|
366
395
|
return __awaiter(this, void 0, void 0, function () {
|
|
367
|
-
var rsp,
|
|
396
|
+
var rsp, e_11;
|
|
368
397
|
return __generator(this, function (_a) {
|
|
369
398
|
switch (_a.label) {
|
|
370
399
|
case 0:
|
|
@@ -379,8 +408,8 @@ var Article = /** @class */ (function () {
|
|
|
379
408
|
throw new Error(rsp.msg);
|
|
380
409
|
return [2 /*return*/, rsp.articleHeat];
|
|
381
410
|
case 2:
|
|
382
|
-
|
|
383
|
-
throw
|
|
411
|
+
e_11 = _a.sent();
|
|
412
|
+
throw e_11;
|
|
384
413
|
case 3: return [2 /*return*/];
|
|
385
414
|
}
|
|
386
415
|
});
|
package/lib/typing.d.ts
CHANGED
|
@@ -542,7 +542,7 @@ export declare class MetalAttr {
|
|
|
542
542
|
fontcolor: string;
|
|
543
543
|
toString(): string;
|
|
544
544
|
}
|
|
545
|
-
export
|
|
545
|
+
export declare class MetalBase {
|
|
546
546
|
/**
|
|
547
547
|
* 徽章属性
|
|
548
548
|
*/
|
|
@@ -1979,7 +1979,7 @@ export interface ArticleDetail {
|
|
|
1979
1979
|
*/
|
|
1980
1980
|
articleCommentable?: boolean;
|
|
1981
1981
|
/**
|
|
1982
|
-
*
|
|
1982
|
+
* 是否已打赏
|
|
1983
1983
|
*/
|
|
1984
1984
|
rewarded?: boolean;
|
|
1985
1985
|
/**
|
package/lib/typing.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ArticleListType = exports.ArticleStatus = exports.YesNoStatus = exports.VoteStatus = exports.PublicStatus = exports.ArticleType = exports.ReportType = exports.ReportDataType = exports.NoticeType = exports.ChatRoomMessageType = exports.ChatMessageType = exports.ChatContentType = exports.ClientType = exports.MetalAttr = exports.RedPacketType = exports.GestureType = exports.UserAppRole = exports.DataType = void 0;
|
|
3
|
+
exports.ArticleListType = exports.ArticleStatus = exports.YesNoStatus = exports.VoteStatus = exports.PublicStatus = exports.ArticleType = exports.ReportType = exports.ReportDataType = exports.NoticeType = exports.ChatRoomMessageType = exports.ChatMessageType = exports.ChatContentType = exports.ClientType = exports.MetalBase = exports.MetalAttr = exports.RedPacketType = exports.GestureType = exports.UserAppRole = exports.DataType = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* 数据类型
|
|
6
6
|
*/
|
|
@@ -215,6 +215,28 @@ var MetalAttr = /** @class */ (function () {
|
|
|
215
215
|
return MetalAttr;
|
|
216
216
|
}());
|
|
217
217
|
exports.MetalAttr = MetalAttr;
|
|
218
|
+
var MetalBase = /** @class */ (function () {
|
|
219
|
+
function MetalBase() {
|
|
220
|
+
/**
|
|
221
|
+
* 徽章属性
|
|
222
|
+
*/
|
|
223
|
+
this.attr = new MetalAttr();
|
|
224
|
+
/**
|
|
225
|
+
* 徽章名
|
|
226
|
+
*/
|
|
227
|
+
this.name = '';
|
|
228
|
+
/**
|
|
229
|
+
* 徽章描述
|
|
230
|
+
*/
|
|
231
|
+
this.description = '';
|
|
232
|
+
/**
|
|
233
|
+
* 徽章数据
|
|
234
|
+
*/
|
|
235
|
+
this.data = '';
|
|
236
|
+
}
|
|
237
|
+
return MetalBase;
|
|
238
|
+
}());
|
|
239
|
+
exports.MetalBase = MetalBase;
|
|
218
240
|
var ClientType;
|
|
219
241
|
(function (ClientType) {
|
|
220
242
|
/**
|