rettiwt-api 4.2.0 → 5.0.0-alpha.1
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/.eslintrc.js +2 -3
- package/.github/workflows/documentation.yml +1 -1
- package/.github/workflows/publish-alpha.yml +1 -1
- package/.github/workflows/publish.yml +1 -1
- package/.prettierignore +1 -1
- package/.tool-versions +1 -1
- package/README.md +100 -100
- package/dist/Rettiwt.d.ts +1 -1
- package/dist/Rettiwt.js +15 -8
- package/dist/Rettiwt.js.map +1 -1
- package/dist/cli.js +8 -11
- package/dist/cli.js.map +1 -1
- package/dist/collections/Extractors.d.ts +1 -0
- package/dist/collections/Extractors.js +38 -69
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +2 -1
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.d.ts +3 -3
- package/dist/collections/Requests.js +36 -35
- package/dist/collections/Requests.js.map +1 -1
- package/dist/commands/List.js +21 -78
- package/dist/commands/List.js.map +1 -1
- package/dist/commands/Tweet.js +185 -370
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +129 -306
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Authentication.d.ts +18 -0
- package/dist/enums/Authentication.js +24 -0
- package/dist/enums/Authentication.js.map +1 -0
- package/dist/enums/Data.d.ts +12 -0
- package/dist/enums/Data.js +14 -1
- package/dist/enums/Data.js.map +1 -1
- package/dist/enums/Resource.d.ts +1 -0
- package/dist/enums/Resource.js +1 -0
- package/dist/enums/Resource.js.map +1 -1
- package/dist/helper/CliUtils.js +1 -2
- package/dist/helper/CliUtils.js.map +1 -1
- package/dist/helper/JsonUtils.js +6 -11
- package/dist/helper/JsonUtils.js.map +1 -1
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/models/args/FetchArgs.d.ts +4 -133
- package/dist/models/args/FetchArgs.js +12 -416
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/args/PostArgs.d.ts +16 -101
- package/dist/models/args/PostArgs.js +26 -258
- package/dist/models/args/PostArgs.js.map +1 -1
- package/dist/models/auth/AccountCredential.d.ts +13 -0
- package/dist/models/auth/AccountCredential.js +21 -0
- package/dist/models/auth/AccountCredential.js.map +1 -0
- package/dist/models/auth/AuthCookie.d.ts +19 -0
- package/dist/models/auth/AuthCookie.js +53 -0
- package/dist/models/auth/AuthCookie.js.map +1 -0
- package/dist/models/auth/AuthCredential.d.ts +28 -0
- package/dist/models/auth/AuthCredential.js +76 -0
- package/dist/models/auth/AuthCredential.js.map +1 -0
- package/dist/models/data/CursoredData.d.ts +3 -4
- package/dist/models/data/CursoredData.js +19 -19
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/List.d.ts +2 -8
- package/dist/models/data/List.js +10 -4
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Notification.d.ts +5 -21
- package/dist/models/data/Notification.js +24 -33
- package/dist/models/data/Notification.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +4 -17
- package/dist/models/data/Tweet.js +83 -73
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +2 -15
- package/dist/models/data/User.js +33 -23
- package/dist/models/data/User.js.map +1 -1
- package/dist/models/errors/ApiError.js +8 -24
- package/dist/models/errors/ApiError.js.map +1 -1
- package/dist/models/errors/HttpError.js +8 -24
- package/dist/models/errors/HttpError.js.map +1 -1
- package/dist/models/errors/RettiwtError.js +5 -23
- package/dist/models/errors/RettiwtError.js.map +1 -1
- package/dist/models/errors/TimeoutError.js +5 -22
- package/dist/models/errors/TimeoutError.js.map +1 -1
- package/dist/services/{public → internal}/AuthService.d.ts +5 -34
- package/dist/services/internal/AuthService.js +109 -0
- package/dist/services/internal/AuthService.js.map +1 -0
- package/dist/services/internal/ErrorService.js +38 -40
- package/dist/services/internal/ErrorService.js.map +1 -1
- package/dist/services/internal/LogService.d.ts +0 -6
- package/dist/services/internal/LogService.js +12 -32
- package/dist/services/internal/LogService.js.map +1 -1
- package/dist/services/public/FetcherService.d.ts +5 -3
- package/dist/services/public/FetcherService.js +96 -141
- package/dist/services/public/FetcherService.js.map +1 -1
- package/dist/services/public/ListService.js +31 -100
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +29 -4
- package/dist/services/public/TweetService.js +208 -386
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.js +186 -385
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/RettiwtConfig.d.ts +8 -0
- package/dist/types/args/FetchArgs.d.ts +59 -0
- package/dist/types/args/FetchArgs.js +3 -0
- package/dist/types/args/FetchArgs.js.map +1 -0
- package/dist/types/args/PostArgs.d.ts +56 -0
- package/dist/types/args/PostArgs.js +3 -0
- package/dist/types/args/PostArgs.js.map +1 -0
- package/dist/types/auth/AccountCredential.d.ts +11 -0
- package/dist/types/auth/AccountCredential.js +3 -0
- package/dist/types/auth/AccountCredential.js.map +1 -0
- package/dist/types/auth/AuthCookie.d.ts +13 -0
- package/dist/types/auth/AuthCookie.js +3 -0
- package/dist/types/auth/AuthCookie.js.map +1 -0
- package/dist/types/auth/AuthCredential.d.ts +21 -0
- package/dist/types/auth/AuthCredential.js +3 -0
- package/dist/types/auth/AuthCredential.js.map +1 -0
- package/dist/types/data/CursoredData.d.ts +25 -0
- package/dist/types/data/CursoredData.js +3 -0
- package/dist/types/data/CursoredData.js.map +1 -0
- package/dist/types/data/List.d.ts +21 -0
- package/dist/types/data/List.js +3 -0
- package/dist/types/data/List.js.map +1 -0
- package/dist/types/data/Notification.d.ts +20 -0
- package/dist/types/data/Notification.js +3 -0
- package/dist/types/data/Notification.js.map +1 -0
- package/dist/types/data/Tweet.d.ts +71 -0
- package/dist/types/data/Tweet.js +3 -0
- package/dist/types/data/Tweet.js.map +1 -0
- package/dist/types/data/User.d.ts +35 -0
- package/dist/types/data/User.js +3 -0
- package/dist/types/data/User.js.map +1 -0
- package/eslint.config.mjs +17 -0
- package/package.json +22 -19
- package/src/Rettiwt.ts +1 -1
- package/src/cli.ts +0 -2
- package/src/collections/Extractors.ts +2 -0
- package/src/collections/Groups.ts +1 -0
- package/src/collections/Requests.ts +37 -36
- package/src/enums/Authentication.ts +19 -0
- package/src/enums/Data.ts +13 -0
- package/src/enums/Resource.ts +1 -0
- package/src/helper/JsonUtils.ts +1 -1
- package/src/index.ts +1 -2
- package/src/models/args/FetchArgs.ts +4 -470
- package/src/models/args/PostArgs.ts +20 -285
- package/src/models/auth/AccountCredential.ts +19 -0
- package/src/models/auth/AuthCookie.ts +56 -0
- package/src/models/auth/AuthCredential.ts +83 -0
- package/src/models/data/CursoredData.ts +12 -9
- package/src/models/data/List.ts +3 -14
- package/src/models/data/Notification.ts +6 -28
- package/src/models/data/Tweet.ts +17 -43
- package/src/models/data/User.ts +5 -31
- package/src/services/{public → internal}/AuthService.ts +28 -55
- package/src/services/internal/LogService.ts +4 -19
- package/src/services/public/FetcherService.ts +18 -8
- package/src/services/public/TweetService.ts +44 -4
- package/src/services/public/UserService.ts +2 -2
- package/src/types/RettiwtConfig.ts +7 -0
- package/src/types/args/FetchArgs.ts +64 -0
- package/src/types/args/PostArgs.ts +62 -0
- package/src/types/auth/AccountCredential.ts +13 -0
- package/src/types/auth/AuthCookie.ts +20 -0
- package/src/types/auth/AuthCredential.ts +26 -0
- package/src/types/data/CursoredData.ts +28 -0
- package/src/types/data/List.ts +27 -0
- package/src/types/data/Notification.ts +26 -0
- package/src/types/data/Tweet.ts +96 -0
- package/src/types/data/User.ts +48 -0
- package/tsconfig.json +7 -5
- package/.eslintignore +0 -3
- package/dist/commands/Auth.d.ts +0 -10
- package/dist/commands/Auth.js +0 -101
- package/dist/commands/Auth.js.map +0 -1
- package/dist/models/errors/DataValidationError.d.ts +0 -30
- package/dist/models/errors/DataValidationError.js +0 -34
- package/dist/models/errors/DataValidationError.js.map +0 -1
- package/dist/services/public/AuthService.js +0 -205
- package/dist/services/public/AuthService.js.map +0 -1
- package/src/commands/Auth.ts +0 -46
- package/src/models/errors/DataValidationError.ts +0 -44
|
@@ -1,277 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.
|
|
28
|
-
|
|
29
|
-
var rettiwt_core_1 = require("rettiwt-core");
|
|
30
|
-
var Resource_1 = require("../../enums/Resource");
|
|
31
|
-
var DataValidationError_1 = require("../errors/DataValidationError");
|
|
3
|
+
exports.PostArgs = exports.UploadArgs = void 0;
|
|
4
|
+
const rettiwt_core_1 = require("rettiwt-core");
|
|
32
5
|
/**
|
|
33
|
-
* Options specifying the
|
|
6
|
+
* Options specifying the media file to be uploaded.
|
|
34
7
|
*
|
|
35
8
|
* @public
|
|
36
9
|
*/
|
|
37
|
-
|
|
10
|
+
class UploadArgs {
|
|
11
|
+
id;
|
|
12
|
+
media;
|
|
13
|
+
size;
|
|
38
14
|
/**
|
|
39
|
-
* @param
|
|
40
|
-
* @param args -
|
|
15
|
+
* @param step - The upload step.
|
|
16
|
+
* @param args - The upload arguments for uploading the media file.
|
|
41
17
|
*/
|
|
42
|
-
|
|
18
|
+
constructor(step, args) {
|
|
19
|
+
this.size = args.size;
|
|
20
|
+
this.media = args.media;
|
|
43
21
|
this.id = args.id;
|
|
44
|
-
this.tweet = args.tweet ? new TweetArgs(resource, args.tweet) : undefined;
|
|
45
|
-
this.upload = args.upload ? new UploadArgs(resource, args.upload) : undefined;
|
|
46
|
-
// Validating this object
|
|
47
|
-
var validationResult = (0, class_validator_1.validateSync)(this, { groups: [resource] });
|
|
48
|
-
// If valiation error occured
|
|
49
|
-
if (validationResult.length) {
|
|
50
|
-
throw new DataValidationError_1.DataValidationError(validationResult);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, class_validator_1.IsEmpty)({
|
|
55
|
-
groups: [
|
|
56
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_APPEND,
|
|
57
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE,
|
|
58
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE,
|
|
59
|
-
Resource_1.EResourceType.TWEET_POST,
|
|
60
|
-
Resource_1.EResourceType.TWEET_SCHEDULE,
|
|
61
|
-
],
|
|
62
|
-
}),
|
|
63
|
-
(0, class_validator_1.IsNotEmpty)({
|
|
64
|
-
groups: [
|
|
65
|
-
Resource_1.EResourceType.TWEET_LIKE,
|
|
66
|
-
Resource_1.EResourceType.TWEET_RETWEET,
|
|
67
|
-
Resource_1.EResourceType.TWEET_UNLIKE,
|
|
68
|
-
Resource_1.EResourceType.TWEET_UNPOST,
|
|
69
|
-
Resource_1.EResourceType.TWEET_UNRETWEET,
|
|
70
|
-
Resource_1.EResourceType.TWEET_UNSCHEDULE,
|
|
71
|
-
Resource_1.EResourceType.USER_FOLLOW,
|
|
72
|
-
Resource_1.EResourceType.USER_UNFOLLOW,
|
|
73
|
-
],
|
|
74
|
-
}),
|
|
75
|
-
(0, class_validator_1.IsNumberString)(undefined, {
|
|
76
|
-
groups: [
|
|
77
|
-
Resource_1.EResourceType.TWEET_LIKE,
|
|
78
|
-
Resource_1.EResourceType.TWEET_RETWEET,
|
|
79
|
-
Resource_1.EResourceType.TWEET_UNLIKE,
|
|
80
|
-
Resource_1.EResourceType.TWEET_UNPOST,
|
|
81
|
-
Resource_1.EResourceType.TWEET_UNRETWEET,
|
|
82
|
-
Resource_1.EResourceType.TWEET_UNSCHEDULE,
|
|
83
|
-
Resource_1.EResourceType.USER_FOLLOW,
|
|
84
|
-
Resource_1.EResourceType.USER_UNFOLLOW,
|
|
85
|
-
],
|
|
86
|
-
}),
|
|
87
|
-
__metadata("design:type", String)
|
|
88
|
-
], PostArgs.prototype, "id", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
(0, class_validator_1.IsEmpty)({
|
|
91
|
-
groups: [
|
|
92
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_APPEND,
|
|
93
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE,
|
|
94
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE,
|
|
95
|
-
Resource_1.EResourceType.TWEET_LIKE,
|
|
96
|
-
Resource_1.EResourceType.TWEET_RETWEET,
|
|
97
|
-
Resource_1.EResourceType.TWEET_UNLIKE,
|
|
98
|
-
Resource_1.EResourceType.TWEET_UNPOST,
|
|
99
|
-
Resource_1.EResourceType.TWEET_UNRETWEET,
|
|
100
|
-
Resource_1.EResourceType.TWEET_UNSCHEDULE,
|
|
101
|
-
Resource_1.EResourceType.USER_FOLLOW,
|
|
102
|
-
Resource_1.EResourceType.USER_UNFOLLOW,
|
|
103
|
-
],
|
|
104
|
-
}),
|
|
105
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
106
|
-
(0, class_validator_1.IsObject)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
107
|
-
__metadata("design:type", TweetArgs)
|
|
108
|
-
], PostArgs.prototype, "tweet", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
(0, class_validator_1.IsEmpty)({
|
|
111
|
-
groups: [
|
|
112
|
-
Resource_1.EResourceType.TWEET_LIKE,
|
|
113
|
-
Resource_1.EResourceType.TWEET_POST,
|
|
114
|
-
Resource_1.EResourceType.TWEET_RETWEET,
|
|
115
|
-
Resource_1.EResourceType.TWEET_SCHEDULE,
|
|
116
|
-
Resource_1.EResourceType.TWEET_UNLIKE,
|
|
117
|
-
Resource_1.EResourceType.TWEET_UNPOST,
|
|
118
|
-
Resource_1.EResourceType.TWEET_UNRETWEET,
|
|
119
|
-
Resource_1.EResourceType.TWEET_UNSCHEDULE,
|
|
120
|
-
Resource_1.EResourceType.USER_FOLLOW,
|
|
121
|
-
Resource_1.EResourceType.USER_UNFOLLOW,
|
|
122
|
-
],
|
|
123
|
-
}),
|
|
124
|
-
(0, class_validator_1.IsNotEmpty)({
|
|
125
|
-
groups: [
|
|
126
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE,
|
|
127
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_APPEND,
|
|
128
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE,
|
|
129
|
-
],
|
|
130
|
-
}),
|
|
131
|
-
(0, class_validator_1.IsObject)({
|
|
132
|
-
groups: [
|
|
133
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE,
|
|
134
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_APPEND,
|
|
135
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE,
|
|
136
|
-
],
|
|
137
|
-
}),
|
|
138
|
-
__metadata("design:type", UploadArgs)
|
|
139
|
-
], PostArgs.prototype, "upload", void 0);
|
|
140
|
-
return PostArgs;
|
|
141
|
-
}());
|
|
142
|
-
/**
|
|
143
|
-
* Options specifying the tweet that is to be posted.
|
|
144
|
-
*
|
|
145
|
-
* @public
|
|
146
|
-
*/
|
|
147
|
-
var TweetArgs = exports.TweetArgs = /** @class */ (function (_super) {
|
|
148
|
-
__extends(TweetArgs, _super);
|
|
149
|
-
/**
|
|
150
|
-
* @param args - Arguments specifying the tweet to be posted.
|
|
151
|
-
*/
|
|
152
|
-
function TweetArgs(resource, args) {
|
|
153
|
-
var _this = _super.call(this) || this;
|
|
154
|
-
_this.media = args.media ? args.media.map(function (item) { return new TweetMediaArgs(item); }) : undefined;
|
|
155
|
-
_this.quote = args.quote;
|
|
156
|
-
_this.replyTo = args.replyTo;
|
|
157
|
-
_this.scheduleFor = args.scheduleFor;
|
|
158
|
-
_this.text = args.text;
|
|
159
|
-
// Validating this object
|
|
160
|
-
var validationResult = (0, class_validator_1.validateSync)(_this, { groups: [resource] });
|
|
161
|
-
// If valiation error occured
|
|
162
|
-
if (validationResult.length) {
|
|
163
|
-
throw new DataValidationError_1.DataValidationError(validationResult);
|
|
164
|
-
}
|
|
165
|
-
return _this;
|
|
166
22
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
(0, class_validator_1.IsArray)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
170
|
-
(0, class_validator_1.ArrayMaxSize)(4, { groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
171
|
-
(0, class_validator_1.IsObject)({ each: true, groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
172
|
-
__metadata("design:type", Array)
|
|
173
|
-
], TweetArgs.prototype, "media", void 0);
|
|
174
|
-
__decorate([
|
|
175
|
-
(0, class_validator_1.IsOptional)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
176
|
-
(0, class_validator_1.IsNumberString)(undefined, { groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
177
|
-
__metadata("design:type", String)
|
|
178
|
-
], TweetArgs.prototype, "quote", void 0);
|
|
179
|
-
__decorate([
|
|
180
|
-
(0, class_validator_1.IsOptional)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
181
|
-
(0, class_validator_1.IsNumberString)(undefined, { groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
182
|
-
__metadata("design:type", String)
|
|
183
|
-
], TweetArgs.prototype, "replyTo", void 0);
|
|
184
|
-
__decorate([
|
|
185
|
-
(0, class_validator_1.IsEmpty)({ groups: [Resource_1.EResourceType.TWEET_POST] }),
|
|
186
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
187
|
-
(0, class_validator_1.IsDate)({ groups: [Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
188
|
-
(0, class_validator_1.MinDate)(function () { return new Date(); }, { groups: [Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
189
|
-
__metadata("design:type", Date)
|
|
190
|
-
], TweetArgs.prototype, "scheduleFor", void 0);
|
|
191
|
-
__decorate([
|
|
192
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
193
|
-
(0, class_validator_1.IsString)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
194
|
-
(0, class_validator_1.MaxLength)(280, { groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
195
|
-
__metadata("design:type", String)
|
|
196
|
-
], TweetArgs.prototype, "text", void 0);
|
|
197
|
-
return TweetArgs;
|
|
198
|
-
}(rettiwt_core_1.NewTweet));
|
|
23
|
+
}
|
|
24
|
+
exports.UploadArgs = UploadArgs;
|
|
199
25
|
/**
|
|
200
|
-
* Options specifying the
|
|
26
|
+
* Options specifying the data that is to be posted.
|
|
201
27
|
*
|
|
202
28
|
* @public
|
|
203
29
|
*/
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
*/
|
|
209
|
-
function TweetMediaArgs(args) {
|
|
210
|
-
var _this = this;
|
|
211
|
-
var _a;
|
|
212
|
-
_this = _super.call(this) || this;
|
|
213
|
-
_this.id = args.id;
|
|
214
|
-
_this.tags = (_a = args.tags) !== null && _a !== void 0 ? _a : [];
|
|
215
|
-
// Validating this object
|
|
216
|
-
var validationResult = (0, class_validator_1.validateSync)(_this);
|
|
217
|
-
// If validation error occured
|
|
218
|
-
if (validationResult.length) {
|
|
219
|
-
throw new DataValidationError_1.DataValidationError(validationResult);
|
|
220
|
-
}
|
|
221
|
-
return _this;
|
|
222
|
-
}
|
|
223
|
-
__decorate([
|
|
224
|
-
(0, class_validator_1.IsNotEmpty)(),
|
|
225
|
-
(0, class_validator_1.IsNumberString)(),
|
|
226
|
-
__metadata("design:type", String)
|
|
227
|
-
], TweetMediaArgs.prototype, "id", void 0);
|
|
228
|
-
__decorate([
|
|
229
|
-
(0, class_validator_1.IsOptional)(),
|
|
230
|
-
(0, class_validator_1.IsArray)(),
|
|
231
|
-
(0, class_validator_1.ArrayMaxSize)(10),
|
|
232
|
-
(0, class_validator_1.IsNumberString)(undefined, { each: true }),
|
|
233
|
-
__metadata("design:type", Array)
|
|
234
|
-
], TweetMediaArgs.prototype, "tags", void 0);
|
|
235
|
-
return TweetMediaArgs;
|
|
236
|
-
}(rettiwt_core_1.NewTweetMedia));
|
|
237
|
-
/**
|
|
238
|
-
* Options specifying the media file to be uploaded.
|
|
239
|
-
*
|
|
240
|
-
* @internal
|
|
241
|
-
*/
|
|
242
|
-
var UploadArgs = exports.UploadArgs = /** @class */ (function () {
|
|
30
|
+
class PostArgs {
|
|
31
|
+
id;
|
|
32
|
+
tweet;
|
|
33
|
+
upload;
|
|
243
34
|
/**
|
|
244
|
-
* @param
|
|
245
|
-
* @param args -
|
|
35
|
+
* @param resource - The resource to be posted.
|
|
36
|
+
* @param args - Additional user-defined arguments for posting the resource.
|
|
246
37
|
*/
|
|
247
|
-
|
|
248
|
-
this.size = args.size;
|
|
249
|
-
this.media = args.media;
|
|
38
|
+
constructor(resource, args) {
|
|
250
39
|
this.id = args.id;
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
// If validation error occured
|
|
254
|
-
if (validationResult.length) {
|
|
255
|
-
throw new DataValidationError_1.DataValidationError(validationResult);
|
|
256
|
-
}
|
|
40
|
+
this.tweet = args.tweet ? new rettiwt_core_1.NewTweet(args.tweet) : undefined;
|
|
41
|
+
this.upload = args.upload ? new UploadArgs(resource, args.upload) : undefined;
|
|
257
42
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.MEDIA_UPLOAD_APPEND, Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE] }),
|
|
261
|
-
(0, class_validator_1.IsNumberString)(undefined, { groups: [Resource_1.EResourceType.MEDIA_UPLOAD_APPEND, Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE] }),
|
|
262
|
-
__metadata("design:type", String)
|
|
263
|
-
], UploadArgs.prototype, "id", void 0);
|
|
264
|
-
__decorate([
|
|
265
|
-
(0, class_validator_1.IsEmpty)({ groups: [Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE, Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE] }),
|
|
266
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.MEDIA_UPLOAD_APPEND] }),
|
|
267
|
-
__metadata("design:type", Object)
|
|
268
|
-
], UploadArgs.prototype, "media", void 0);
|
|
269
|
-
__decorate([
|
|
270
|
-
(0, class_validator_1.IsEmpty)({ groups: [Resource_1.EResourceType.MEDIA_UPLOAD_APPEND, Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE] }),
|
|
271
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE] }),
|
|
272
|
-
(0, class_validator_1.Max)(5242880, { groups: [Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE] }),
|
|
273
|
-
__metadata("design:type", Number)
|
|
274
|
-
], UploadArgs.prototype, "size", void 0);
|
|
275
|
-
return UploadArgs;
|
|
276
|
-
}());
|
|
43
|
+
}
|
|
44
|
+
exports.PostArgs = PostArgs;
|
|
277
45
|
//# sourceMappingURL=PostArgs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostArgs.js","sourceRoot":"","sources":["../../../src/models/args/PostArgs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PostArgs.js","sourceRoot":"","sources":["../../../src/models/args/PostArgs.ts"],"names":[],"mappings":";;;AAAA,+CAAwC;AAKxC;;;;GAIG;AACH,MAAa,UAAU;IACf,EAAE,CAAU;IACZ,KAAK,CAAwB;IAC7B,IAAI,CAAU;IAErB;;;OAGG;IACH,YAAmB,IAAmB,EAAE,IAAiB;QACxD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACnB,CAAC;CACD;AAdD,gCAcC;AAED;;;;GAIG;AACH,MAAa,QAAQ;IACb,EAAE,CAAU;IACZ,KAAK,CAAY;IACjB,MAAM,CAAc;IAE3B;;;OAGG;IACH,YAAmB,QAAuB,EAAE,IAAe;QAC1D,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,uBAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,CAAC;CACD;AAdD,4BAcC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IAccountCredential } from '../../types/auth/AccountCredential';
|
|
2
|
+
/**
|
|
3
|
+
* The credentials of the Twitter account to be logged into.
|
|
4
|
+
*/
|
|
5
|
+
export declare class AccountCredential implements IAccountCredential {
|
|
6
|
+
email: string;
|
|
7
|
+
password: string;
|
|
8
|
+
userName: string;
|
|
9
|
+
/**
|
|
10
|
+
* @param cred - The credentials to the Twitter account.
|
|
11
|
+
*/
|
|
12
|
+
constructor(cred: IAccountCredential);
|
|
13
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AccountCredential = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The credentials of the Twitter account to be logged into.
|
|
6
|
+
*/
|
|
7
|
+
class AccountCredential {
|
|
8
|
+
email;
|
|
9
|
+
password;
|
|
10
|
+
userName;
|
|
11
|
+
/**
|
|
12
|
+
* @param cred - The credentials to the Twitter account.
|
|
13
|
+
*/
|
|
14
|
+
constructor(cred) {
|
|
15
|
+
this.email = cred.email;
|
|
16
|
+
this.userName = cred.userName;
|
|
17
|
+
this.password = cred.password;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.AccountCredential = AccountCredential;
|
|
21
|
+
//# sourceMappingURL=AccountCredential.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountCredential.js","sourceRoot":"","sources":["../../../src/models/auth/AccountCredential.ts"],"names":[],"mappings":";;;AAEA;;GAEG;AACH,MAAa,iBAAiB;IACtB,KAAK,CAAS;IACd,QAAQ,CAAS;IACjB,QAAQ,CAAS;IAExB;;OAEG;IACH,YAAmB,IAAwB;QAC1C,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAC/B,CAAC;CACD;AAbD,8CAaC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Cookie } from 'cookiejar';
|
|
2
|
+
import { IAuthCookie } from '../../types/auth/AuthCookie';
|
|
3
|
+
/**
|
|
4
|
+
* The cookie containing the tokens that are used to authenticate against Twitter.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AuthCookie implements IAuthCookie {
|
|
7
|
+
auth_token: string;
|
|
8
|
+
ct0: string;
|
|
9
|
+
kdt: string;
|
|
10
|
+
twid: string;
|
|
11
|
+
/**
|
|
12
|
+
* @param cookies - The cookie list obtained from the browser.
|
|
13
|
+
*/
|
|
14
|
+
constructor(cookies: Cookie[]);
|
|
15
|
+
/**
|
|
16
|
+
* @returns the string representation of 'this' object.
|
|
17
|
+
*/
|
|
18
|
+
toString(): string;
|
|
19
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthCookie = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The cookie containing the tokens that are used to authenticate against Twitter.
|
|
6
|
+
*/
|
|
7
|
+
class AuthCookie {
|
|
8
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
9
|
+
auth_token;
|
|
10
|
+
ct0;
|
|
11
|
+
kdt;
|
|
12
|
+
twid;
|
|
13
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
14
|
+
/**
|
|
15
|
+
* @param cookies - The cookie list obtained from the browser.
|
|
16
|
+
*/
|
|
17
|
+
constructor(cookies) {
|
|
18
|
+
// Initializing defaults
|
|
19
|
+
this.auth_token = '';
|
|
20
|
+
this.ct0 = '';
|
|
21
|
+
this.kdt = '';
|
|
22
|
+
this.twid = '';
|
|
23
|
+
// Parsing the cookies
|
|
24
|
+
for (const cookie of cookies) {
|
|
25
|
+
if (cookie.name == 'kdt') {
|
|
26
|
+
this.kdt = cookie.value;
|
|
27
|
+
}
|
|
28
|
+
else if (cookie.name == 'twid') {
|
|
29
|
+
this.twid = cookie.value;
|
|
30
|
+
}
|
|
31
|
+
else if (cookie.name == 'ct0') {
|
|
32
|
+
this.ct0 = cookie.value;
|
|
33
|
+
}
|
|
34
|
+
else if (cookie.name == 'auth_token') {
|
|
35
|
+
this.auth_token = cookie.value;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* @returns the string representation of 'this' object.
|
|
41
|
+
*/
|
|
42
|
+
toString() {
|
|
43
|
+
/** The string representation of 'this' object. */
|
|
44
|
+
let outStr = '';
|
|
45
|
+
// Iterating through the (key, value) pairs of this cookie
|
|
46
|
+
for (const [key, value] of Object.entries(this)) {
|
|
47
|
+
outStr += `${key}=${value};`;
|
|
48
|
+
}
|
|
49
|
+
return outStr;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.AuthCookie = AuthCookie;
|
|
53
|
+
//# sourceMappingURL=AuthCookie.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCookie.js","sourceRoot":"","sources":["../../../src/models/auth/AuthCookie.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,MAAa,UAAU;IACtB,yDAAyD;IAElD,UAAU,CAAS;IACnB,GAAG,CAAS;IACZ,GAAG,CAAS;IACZ,IAAI,CAAS;IAEpB,wDAAwD;IAExD;;OAEG;IACH,YAAmB,OAAiB;QACnC,wBAAwB;QACxB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QAEf,sBAAsB;QACtB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC9B,IAAI,MAAM,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;gBAC1B,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;YACzB,CAAC;iBAAM,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,EAAE,CAAC;gBAClC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;YAC1B,CAAC;iBAAM,IAAI,MAAM,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;gBACjC,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;YACzB,CAAC;iBAAM,IAAI,MAAM,CAAC,IAAI,IAAI,YAAY,EAAE,CAAC;gBACxC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC;YAChC,CAAC;QACF,CAAC;IACF,CAAC;IAED;;OAEG;IACI,QAAQ;QACd,kDAAkD;QAClD,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,0DAA0D;QAC1D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACjD,MAAM,IAAI,GAAG,GAAG,IAAI,KAAe,GAAG,CAAC;QACxC,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AAhDD,gCAgDC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { AxiosRequestHeaders } from 'axios';
|
|
2
|
+
import { Cookie } from 'cookiejar';
|
|
3
|
+
import { EAuthenticationType } from '../../enums/Authentication';
|
|
4
|
+
import { IAuthCredential } from '../../types/auth/AuthCredential';
|
|
5
|
+
/**
|
|
6
|
+
* The credentials for authenticating against Twitter.
|
|
7
|
+
*
|
|
8
|
+
* Depending on which tokens are present, the authentication type is determined as follows:
|
|
9
|
+
* - authToken, guestToken =\> Guest authentication.
|
|
10
|
+
* - authToken, csrfToken, cookie =\> User authentication.
|
|
11
|
+
* - authToken, guestToken, cookie =\> Guest authentication while logging in.
|
|
12
|
+
*/
|
|
13
|
+
export declare class AuthCredential implements IAuthCredential {
|
|
14
|
+
authToken?: string;
|
|
15
|
+
authenticationType?: EAuthenticationType;
|
|
16
|
+
cookies?: string;
|
|
17
|
+
csrfToken?: string;
|
|
18
|
+
guestToken?: string;
|
|
19
|
+
/**
|
|
20
|
+
* @param cookies - The list of cookies to be used for authenticating against Twitter.
|
|
21
|
+
* @param guestToken - The guest token to be used to authenticate a guest session.
|
|
22
|
+
*/
|
|
23
|
+
constructor(cookies?: Cookie[], guestToken?: string);
|
|
24
|
+
/**
|
|
25
|
+
* @returns The HTTP header representation of 'this' object.
|
|
26
|
+
*/
|
|
27
|
+
toHeader(): AxiosRequestHeaders;
|
|
28
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthCredential = void 0;
|
|
4
|
+
const axios_1 = require("axios");
|
|
5
|
+
const Authentication_1 = require("../../enums/Authentication");
|
|
6
|
+
const AuthCookie_1 = require("./AuthCookie");
|
|
7
|
+
/**
|
|
8
|
+
* The credentials for authenticating against Twitter.
|
|
9
|
+
*
|
|
10
|
+
* Depending on which tokens are present, the authentication type is determined as follows:
|
|
11
|
+
* - authToken, guestToken =\> Guest authentication.
|
|
12
|
+
* - authToken, csrfToken, cookie =\> User authentication.
|
|
13
|
+
* - authToken, guestToken, cookie =\> Guest authentication while logging in.
|
|
14
|
+
*/
|
|
15
|
+
class AuthCredential {
|
|
16
|
+
authToken;
|
|
17
|
+
authenticationType;
|
|
18
|
+
cookies;
|
|
19
|
+
csrfToken;
|
|
20
|
+
guestToken;
|
|
21
|
+
/**
|
|
22
|
+
* @param cookies - The list of cookies to be used for authenticating against Twitter.
|
|
23
|
+
* @param guestToken - The guest token to be used to authenticate a guest session.
|
|
24
|
+
*/
|
|
25
|
+
constructor(cookies, guestToken) {
|
|
26
|
+
this.authToken =
|
|
27
|
+
'AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA';
|
|
28
|
+
// If guest credentials given
|
|
29
|
+
if (!cookies && guestToken) {
|
|
30
|
+
this.guestToken = guestToken;
|
|
31
|
+
this.authenticationType = Authentication_1.EAuthenticationType.GUEST;
|
|
32
|
+
}
|
|
33
|
+
// If login credentials given
|
|
34
|
+
else if (cookies && guestToken) {
|
|
35
|
+
// Parsing the cookies
|
|
36
|
+
const parsedCookie = new AuthCookie_1.AuthCookie(cookies);
|
|
37
|
+
this.cookies = parsedCookie.toString();
|
|
38
|
+
this.guestToken = guestToken;
|
|
39
|
+
this.authenticationType = Authentication_1.EAuthenticationType.LOGIN;
|
|
40
|
+
}
|
|
41
|
+
// If user credentials given
|
|
42
|
+
else if (cookies && !guestToken) {
|
|
43
|
+
// Parsing the cookies
|
|
44
|
+
const parsedCookie = new AuthCookie_1.AuthCookie(cookies);
|
|
45
|
+
this.cookies = parsedCookie.toString();
|
|
46
|
+
this.csrfToken = parsedCookie.ct0;
|
|
47
|
+
this.authenticationType = Authentication_1.EAuthenticationType.USER;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* @returns The HTTP header representation of 'this' object.
|
|
52
|
+
*/
|
|
53
|
+
toHeader() {
|
|
54
|
+
const headers = new axios_1.AxiosHeaders();
|
|
55
|
+
/**
|
|
56
|
+
* Conditionally initializing only those data which are supplied.
|
|
57
|
+
*
|
|
58
|
+
* This is done to ensure that the data that is not supplied, is not included in output, not even undefined.
|
|
59
|
+
*/
|
|
60
|
+
if (this.authToken) {
|
|
61
|
+
headers.set('authorization', `Bearer ${this.authToken}`);
|
|
62
|
+
}
|
|
63
|
+
if (this.guestToken) {
|
|
64
|
+
headers.set('x-guest-token', this.guestToken);
|
|
65
|
+
}
|
|
66
|
+
if (this.csrfToken) {
|
|
67
|
+
headers.set('x-csrf-token', this.csrfToken);
|
|
68
|
+
}
|
|
69
|
+
if (this.cookies) {
|
|
70
|
+
headers.set('cookie', this.cookies);
|
|
71
|
+
}
|
|
72
|
+
return headers;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.AuthCredential = AuthCredential;
|
|
76
|
+
//# sourceMappingURL=AuthCredential.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCredential.js","sourceRoot":"","sources":["../../../src/models/auth/AuthCredential.ts"],"names":[],"mappings":";;;AAAA,iCAA0D;AAI1D,+DAAiE;AAGjE,6CAA0C;AAE1C;;;;;;;GAOG;AACH,MAAa,cAAc;IACnB,SAAS,CAAU;IACnB,kBAAkB,CAAuB;IACzC,OAAO,CAAU;IACjB,SAAS,CAAU;IACnB,UAAU,CAAU;IAE3B;;;OAGG;IACH,YAAmB,OAAkB,EAAE,UAAmB;QACzD,IAAI,CAAC,SAAS;YACb,0GAA0G,CAAC;QAC5G,6BAA6B;QAC7B,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE,CAAC;YAC5B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;YAC7B,IAAI,CAAC,kBAAkB,GAAG,oCAAmB,CAAC,KAAK,CAAC;QACrD,CAAC;QACD,6BAA6B;aACxB,IAAI,OAAO,IAAI,UAAU,EAAE,CAAC;YAChC,sBAAsB;YACtB,MAAM,YAAY,GAAe,IAAI,uBAAU,CAAC,OAAO,CAAC,CAAC;YAEzD,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;YACvC,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;YAC7B,IAAI,CAAC,kBAAkB,GAAG,oCAAmB,CAAC,KAAK,CAAC;QACrD,CAAC;QACD,4BAA4B;aACvB,IAAI,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;YACjC,sBAAsB;YACtB,MAAM,YAAY,GAAe,IAAI,uBAAU,CAAC,OAAO,CAAC,CAAC;YAEzD,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;YACvC,IAAI,CAAC,SAAS,GAAG,YAAY,CAAC,GAAG,CAAC;YAClC,IAAI,CAAC,kBAAkB,GAAG,oCAAmB,CAAC,IAAI,CAAC;QACpD,CAAC;IACF,CAAC;IAED;;OAEG;IACI,QAAQ;QACd,MAAM,OAAO,GAAG,IAAI,oBAAY,EAAE,CAAC;QAEnC;;;;WAIG;QACH,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,UAAU,IAAI,CAAC,SAAS,EAAE,CAAC,CAAC;QAC1D,CAAC;QACD,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACrB,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC/C,CAAC;QACD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACpB,OAAO,CAAC,GAAG,CAAC,cAAc,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;YAClB,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACrC,CAAC;QAED,OAAO,OAAO,CAAC;IAChB,CAAC;CACD;AAjED,wCAiEC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EBaseType } from '../../enums/Data';
|
|
2
|
+
import { ICursor, ICursoredData } from '../../types/data/CursoredData';
|
|
2
3
|
import { Notification } from './Notification';
|
|
3
4
|
import { Tweet } from './Tweet';
|
|
4
5
|
import { User } from './User';
|
|
@@ -9,10 +10,8 @@ import { User } from './User';
|
|
|
9
10
|
*
|
|
10
11
|
* @public
|
|
11
12
|
*/
|
|
12
|
-
export declare class CursoredData<T extends Notification | Tweet | User> {
|
|
13
|
-
/** The batch of data of the given type. */
|
|
13
|
+
export declare class CursoredData<T extends Notification | Tweet | User> implements ICursoredData<T> {
|
|
14
14
|
list: T[];
|
|
15
|
-
/** The cursor to the next batch of data. */
|
|
16
15
|
next: Cursor;
|
|
17
16
|
/**
|
|
18
17
|
* @param response - The raw response.
|
|
@@ -25,7 +24,7 @@ export declare class CursoredData<T extends Notification | Tweet | User> {
|
|
|
25
24
|
*
|
|
26
25
|
* @public
|
|
27
26
|
*/
|
|
28
|
-
export declare class Cursor {
|
|
27
|
+
export declare class Cursor implements ICursor {
|
|
29
28
|
/** The cursor string. */
|
|
30
29
|
value: string;
|
|
31
30
|
/**
|