rettiwt-api 2.4.2 → 2.5.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 +5 -0
- package/.github/workflows/documentation.yml +1 -1
- package/.github/workflows/publish.yml +1 -1
- package/.prettierrc +1 -1
- package/README.md +69 -19
- package/dist/Rettiwt.d.ts +7 -4
- package/dist/Rettiwt.js +4 -2
- package/dist/Rettiwt.js.map +1 -1
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/Auth.d.ts +2 -1
- package/dist/commands/Auth.js +10 -17
- package/dist/commands/Auth.js.map +1 -1
- package/dist/commands/Tweet.js +36 -3
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/enums/{ApiErrors.js → Api.js} +1 -1
- package/dist/enums/Api.js.map +1 -0
- package/dist/enums/Http.d.ts +68 -0
- package/dist/enums/Http.js +73 -0
- package/dist/enums/Http.js.map +1 -0
- package/dist/enums/Logging.d.ts +1 -0
- package/dist/enums/Logging.js +1 -0
- package/dist/enums/Logging.js.map +1 -1
- package/dist/index.d.ts +15 -14
- package/dist/index.js +22 -17
- package/dist/index.js.map +1 -1
- package/dist/models/args/TweetArgs.d.ts +44 -0
- package/dist/models/args/TweetArgs.js +82 -0
- package/dist/models/args/TweetArgs.js.map +1 -0
- package/dist/models/{public → data}/CursoredData.d.ts +5 -3
- package/dist/models/{public → data}/CursoredData.js +1 -0
- package/dist/models/data/CursoredData.js.map +1 -0
- package/dist/{types/public → models/data}/List.d.ts +8 -1
- package/dist/models/data/List.js.map +1 -0
- package/dist/models/data/Media.d.ts +14 -0
- package/dist/models/data/Media.js +19 -0
- package/dist/models/data/Media.js.map +1 -0
- package/dist/{types/public → models/data}/Tweet.d.ts +26 -8
- package/dist/models/{public → data}/Tweet.js +4 -0
- package/dist/models/data/Tweet.js.map +1 -0
- package/dist/{types/public → models/data}/User.d.ts +8 -1
- package/dist/models/data/User.js.map +1 -0
- package/dist/models/errors/ApiError.d.ts +17 -0
- package/dist/models/errors/ApiError.js +42 -0
- package/dist/models/errors/ApiError.js.map +1 -0
- package/dist/models/errors/HttpError.d.ts +17 -0
- package/dist/models/errors/HttpError.js +42 -0
- package/dist/models/errors/HttpError.js.map +1 -0
- package/dist/models/errors/RettiwtError.d.ts +8 -0
- package/dist/models/errors/RettiwtError.js +34 -0
- package/dist/models/errors/RettiwtError.js.map +1 -0
- package/dist/models/errors/TimeoutError.d.ts +14 -0
- package/dist/models/errors/TimeoutError.js +39 -0
- package/dist/models/errors/TimeoutError.js.map +1 -0
- package/dist/services/internal/ErrorService.d.ts +85 -0
- package/dist/services/internal/ErrorService.js +144 -0
- package/dist/services/internal/ErrorService.js.map +1 -0
- package/dist/services/internal/FetcherService.d.ts +22 -24
- package/dist/services/internal/FetcherService.js +79 -59
- package/dist/services/internal/FetcherService.js.map +1 -1
- package/dist/services/public/AuthService.d.ts +66 -0
- package/dist/services/public/AuthService.js +160 -0
- package/dist/services/public/AuthService.js.map +1 -0
- package/dist/services/public/TweetService.d.ts +27 -8
- package/dist/services/public/TweetService.js +45 -8
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +5 -5
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/ErrorHandler.d.ts +13 -0
- package/dist/types/{public/User.js → ErrorHandler.js} +1 -1
- package/dist/types/ErrorHandler.js.map +1 -0
- package/dist/types/RettiwtConfig.d.ts +32 -0
- package/dist/types/RettiwtConfig.js.map +1 -0
- package/package.json +6 -5
- package/src/Rettiwt.ts +10 -5
- package/src/cli.ts +4 -2
- package/src/commands/Auth.ts +5 -16
- package/src/commands/Tweet.ts +56 -3
- package/src/enums/Http.ts +68 -0
- package/src/enums/Logging.ts +1 -0
- package/src/index.ts +25 -18
- package/src/models/args/TweetArgs.ts +98 -0
- package/src/models/{public → data}/CursoredData.ts +6 -5
- package/src/models/{public → data}/List.ts +14 -4
- package/src/models/data/Media.ts +19 -0
- package/src/models/{public → data}/Tweet.ts +39 -5
- package/src/models/{public → data}/User.ts +28 -4
- package/src/models/errors/ApiError.ts +24 -0
- package/src/models/errors/HttpError.ts +24 -0
- package/src/models/errors/RettiwtError.ts +12 -0
- package/src/models/errors/TimeoutError.ts +18 -0
- package/src/services/internal/ErrorService.ts +158 -0
- package/src/services/internal/FetcherService.ts +94 -80
- package/src/services/public/AuthService.ts +97 -0
- package/src/services/public/TweetService.ts +48 -10
- package/src/services/public/UserService.ts +7 -5
- package/src/types/ErrorHandler.ts +13 -0
- package/src/types/RettiwtConfig.ts +40 -0
- package/dist/enums/ApiErrors.js.map +0 -1
- package/dist/enums/HTTP.d.ts +0 -17
- package/dist/enums/HTTP.js +0 -22
- package/dist/enums/HTTP.js.map +0 -1
- package/dist/models/internal/RettiwtConfig.d.ts +0 -18
- package/dist/models/internal/RettiwtConfig.js +0 -24
- package/dist/models/internal/RettiwtConfig.js.map +0 -1
- package/dist/models/public/CursoredData.js.map +0 -1
- package/dist/models/public/List.d.ts +0 -22
- package/dist/models/public/List.js.map +0 -1
- package/dist/models/public/Tweet.d.ts +0 -62
- package/dist/models/public/Tweet.js.map +0 -1
- package/dist/models/public/User.d.ts +0 -29
- package/dist/models/public/User.js.map +0 -1
- package/dist/types/internal/RettiwtConfig.d.ts +0 -15
- package/dist/types/internal/RettiwtConfig.js.map +0 -1
- package/dist/types/public/CursoredData.d.ts +0 -22
- package/dist/types/public/CursoredData.js +0 -3
- package/dist/types/public/CursoredData.js.map +0 -1
- package/dist/types/public/List.js +0 -3
- package/dist/types/public/List.js.map +0 -1
- package/dist/types/public/Tweet.js +0 -3
- package/dist/types/public/Tweet.js.map +0 -1
- package/dist/types/public/User.js.map +0 -1
- package/src/enums/HTTP.ts +0 -17
- package/src/models/internal/RettiwtConfig.ts +0 -26
- package/src/types/internal/RettiwtConfig.ts +0 -18
- package/src/types/public/CursoredData.ts +0 -24
- package/src/types/public/List.ts +0 -27
- package/src/types/public/Tweet.ts +0 -86
- package/src/types/public/User.ts +0 -48
- /package/dist/enums/{ApiErrors.d.ts → Api.d.ts} +0 -0
- /package/dist/models/{public → data}/List.js +0 -0
- /package/dist/models/{public → data}/User.js +0 -0
- /package/dist/types/{internal/RettiwtConfig.js → RettiwtConfig.js} +0 -0
- /package/src/enums/{ApiErrors.ts → Api.ts} +0 -0
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EHttpStatus = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The different types of http status codes
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
var EHttpStatus;
|
|
10
|
+
(function (EHttpStatus) {
|
|
11
|
+
EHttpStatus[EHttpStatus["CONTINUE"] = 100] = "CONTINUE";
|
|
12
|
+
EHttpStatus[EHttpStatus["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|
|
13
|
+
EHttpStatus[EHttpStatus["PROCESSING"] = 102] = "PROCESSING";
|
|
14
|
+
EHttpStatus[EHttpStatus["OK"] = 200] = "OK";
|
|
15
|
+
EHttpStatus[EHttpStatus["CREATED"] = 201] = "CREATED";
|
|
16
|
+
EHttpStatus[EHttpStatus["ACCEPTED"] = 202] = "ACCEPTED";
|
|
17
|
+
EHttpStatus[EHttpStatus["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
|
|
18
|
+
EHttpStatus[EHttpStatus["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
19
|
+
EHttpStatus[EHttpStatus["RESET_CONTENT"] = 205] = "RESET_CONTENT";
|
|
20
|
+
EHttpStatus[EHttpStatus["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
|
|
21
|
+
EHttpStatus[EHttpStatus["MULTI_STATUS"] = 207] = "MULTI_STATUS";
|
|
22
|
+
EHttpStatus[EHttpStatus["ALREADY_REPORTED"] = 208] = "ALREADY_REPORTED";
|
|
23
|
+
EHttpStatus[EHttpStatus["IM_USED"] = 226] = "IM_USED";
|
|
24
|
+
EHttpStatus[EHttpStatus["MULTIPLE_CHOICES"] = 300] = "MULTIPLE_CHOICES";
|
|
25
|
+
EHttpStatus[EHttpStatus["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
|
|
26
|
+
EHttpStatus[EHttpStatus["FOUND"] = 302] = "FOUND";
|
|
27
|
+
EHttpStatus[EHttpStatus["SEE_OTHER"] = 303] = "SEE_OTHER";
|
|
28
|
+
EHttpStatus[EHttpStatus["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
|
|
29
|
+
EHttpStatus[EHttpStatus["USE_PROXY"] = 305] = "USE_PROXY";
|
|
30
|
+
EHttpStatus[EHttpStatus["SWITCH_PROXY"] = 306] = "SWITCH_PROXY";
|
|
31
|
+
EHttpStatus[EHttpStatus["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
|
|
32
|
+
EHttpStatus[EHttpStatus["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
|
|
33
|
+
EHttpStatus[EHttpStatus["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
34
|
+
EHttpStatus[EHttpStatus["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
35
|
+
EHttpStatus[EHttpStatus["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
|
|
36
|
+
EHttpStatus[EHttpStatus["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
37
|
+
EHttpStatus[EHttpStatus["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
38
|
+
EHttpStatus[EHttpStatus["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
39
|
+
EHttpStatus[EHttpStatus["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
|
|
40
|
+
EHttpStatus[EHttpStatus["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
|
|
41
|
+
EHttpStatus[EHttpStatus["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
42
|
+
EHttpStatus[EHttpStatus["CONFLICT"] = 409] = "CONFLICT";
|
|
43
|
+
EHttpStatus[EHttpStatus["GONE"] = 410] = "GONE";
|
|
44
|
+
EHttpStatus[EHttpStatus["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
|
|
45
|
+
EHttpStatus[EHttpStatus["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
46
|
+
EHttpStatus[EHttpStatus["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
47
|
+
EHttpStatus[EHttpStatus["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
|
|
48
|
+
EHttpStatus[EHttpStatus["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
|
|
49
|
+
EHttpStatus[EHttpStatus["RANGE_NOT_SATISFIABLE"] = 416] = "RANGE_NOT_SATISFIABLE";
|
|
50
|
+
EHttpStatus[EHttpStatus["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
|
|
51
|
+
EHttpStatus[EHttpStatus["I_AM_A_TEAPOT"] = 418] = "I_AM_A_TEAPOT";
|
|
52
|
+
EHttpStatus[EHttpStatus["MISDIRECTED_REQUEST"] = 421] = "MISDIRECTED_REQUEST";
|
|
53
|
+
EHttpStatus[EHttpStatus["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
|
|
54
|
+
EHttpStatus[EHttpStatus["LOCKED"] = 423] = "LOCKED";
|
|
55
|
+
EHttpStatus[EHttpStatus["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
|
|
56
|
+
EHttpStatus[EHttpStatus["UPGRADE_REQUIRED"] = 426] = "UPGRADE_REQUIRED";
|
|
57
|
+
EHttpStatus[EHttpStatus["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
|
|
58
|
+
EHttpStatus[EHttpStatus["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
59
|
+
EHttpStatus[EHttpStatus["REQUEST_HEADER_FIELDS_TOO_LARGE"] = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE";
|
|
60
|
+
EHttpStatus[EHttpStatus["UNAVAILABLE_FOR_LEGAL_REASONS"] = 451] = "UNAVAILABLE_FOR_LEGAL_REASONS";
|
|
61
|
+
EHttpStatus[EHttpStatus["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
62
|
+
EHttpStatus[EHttpStatus["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
63
|
+
EHttpStatus[EHttpStatus["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
64
|
+
EHttpStatus[EHttpStatus["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
65
|
+
EHttpStatus[EHttpStatus["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
66
|
+
EHttpStatus[EHttpStatus["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
67
|
+
EHttpStatus[EHttpStatus["VARIANT_ALSO_NEGOTIATES"] = 506] = "VARIANT_ALSO_NEGOTIATES";
|
|
68
|
+
EHttpStatus[EHttpStatus["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
|
|
69
|
+
EHttpStatus[EHttpStatus["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
|
|
70
|
+
EHttpStatus[EHttpStatus["NOT_EXTENDED"] = 510] = "NOT_EXTENDED";
|
|
71
|
+
EHttpStatus[EHttpStatus["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
|
|
72
|
+
})(EHttpStatus || (exports.EHttpStatus = EHttpStatus = {}));
|
|
73
|
+
//# sourceMappingURL=Http.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Http.js","sourceRoot":"","sources":["../../src/enums/Http.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,WA8DX;AA9DD,WAAY,WAAW;IACtB,uDAAc,CAAA;IACd,6EAAyB,CAAA;IACzB,2DAAgB,CAAA;IAChB,2CAAQ,CAAA;IACR,qDAAa,CAAA;IACb,uDAAc,CAAA;IACd,iGAAmC,CAAA;IACnC,2DAAgB,CAAA;IAChB,iEAAmB,CAAA;IACnB,qEAAqB,CAAA;IACrB,+DAAkB,CAAA;IAClB,uEAAsB,CAAA;IACtB,qDAAa,CAAA;IACb,uEAAsB,CAAA;IACtB,yEAAuB,CAAA;IACvB,iDAAW,CAAA;IACX,yDAAe,CAAA;IACf,+DAAkB,CAAA;IAClB,yDAAe,CAAA;IACf,+DAAkB,CAAA;IAClB,2EAAwB,CAAA;IACxB,2EAAwB,CAAA;IACxB,6DAAiB,CAAA;IACjB,+DAAkB,CAAA;IAClB,uEAAsB,CAAA;IACtB,yDAAe,CAAA;IACf,yDAAe,CAAA;IACf,2EAAwB,CAAA;IACxB,mEAAoB,CAAA;IACpB,iGAAmC,CAAA;IACnC,qEAAqB,CAAA;IACrB,uDAAc,CAAA;IACd,+CAAU,CAAA;IACV,qEAAqB,CAAA;IACrB,6EAAyB,CAAA;IACzB,yEAAuB,CAAA;IACvB,+DAAkB,CAAA;IAClB,mFAA4B,CAAA;IAC5B,iFAA2B,CAAA;IAC3B,2EAAwB,CAAA;IACxB,iEAAmB,CAAA;IACnB,6EAAyB,CAAA;IACzB,+EAA0B,CAAA;IAC1B,mDAAY,CAAA;IACZ,yEAAuB,CAAA;IACvB,uEAAsB,CAAA;IACtB,iFAA2B,CAAA;IAC3B,yEAAuB,CAAA;IACvB,qGAAqC,CAAA;IACrC,iGAAmC,CAAA;IACnC,iFAA2B,CAAA;IAC3B,qEAAqB,CAAA;IACrB,6DAAiB,CAAA;IACjB,6EAAyB,CAAA;IACzB,qEAAqB,CAAA;IACrB,2FAAgC,CAAA;IAChC,qFAA6B,CAAA;IAC7B,+EAA0B,CAAA;IAC1B,iEAAmB,CAAA;IACnB,+DAAkB,CAAA;IAClB,qGAAqC,CAAA;AACtC,CAAC,EA9DW,WAAW,2BAAX,WAAW,QA8DtB"}
|
package/dist/enums/Logging.d.ts
CHANGED
package/dist/enums/Logging.js
CHANGED
|
@@ -10,6 +10,7 @@ var ELogActions;
|
|
|
10
10
|
(function (ELogActions) {
|
|
11
11
|
ELogActions["FETCH"] = "FETCH";
|
|
12
12
|
ELogActions["POST"] = "POST";
|
|
13
|
+
ELogActions["UPLOAD"] = "UPLOAD";
|
|
13
14
|
ELogActions["EXTRACT"] = "EXTRACT";
|
|
14
15
|
ELogActions["DESERIALIZE"] = "DESERIALIZE";
|
|
15
16
|
ELogActions["AUTHORIZATION"] = "AUTHORIZATION";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../src/enums/Logging.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"Logging.js","sourceRoot":"","sources":["../../src/enums/Logging.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,IAAY,WAOX;AAPD,WAAY,WAAW;IACtB,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,0CAA2B,CAAA;IAC3B,8CAA+B,CAAA;AAChC,CAAC,EAPW,WAAW,2BAAX,WAAW,QAOtB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
export * from './Rettiwt';
|
|
2
|
-
export * from './enums/ApiErrors';
|
|
3
|
-
export * from './enums/HTTP';
|
|
4
|
-
export * from './enums/Logging';
|
|
5
|
-
export * from './models/internal/RettiwtConfig';
|
|
6
|
-
export * from './models/public/CursoredData';
|
|
7
|
-
export * from './models/public/List';
|
|
8
|
-
export * from './models/public/Tweet';
|
|
9
|
-
export * from './models/public/User';
|
|
10
2
|
export { TweetFilter } from 'rettiwt-core';
|
|
3
|
+
export * from './enums/Api';
|
|
4
|
+
export * from './enums/Http';
|
|
5
|
+
export * from './enums/Logging';
|
|
6
|
+
export * from './models/args/TweetArgs';
|
|
7
|
+
export * from './models/errors/ApiError';
|
|
8
|
+
export * from './models/errors/HttpError';
|
|
9
|
+
export * from './models/errors/RettiwtError';
|
|
10
|
+
export * from './models/data/CursoredData';
|
|
11
|
+
export * from './models/data/List';
|
|
12
|
+
export * from './models/data/Tweet';
|
|
13
|
+
export * from './models/data/User';
|
|
14
|
+
export * from './services/internal/ErrorService';
|
|
11
15
|
export * from './services/internal/FetcherService';
|
|
12
16
|
export * from './services/internal/LogService';
|
|
17
|
+
export * from './services/public/AuthService';
|
|
13
18
|
export * from './services/public/TweetService';
|
|
14
19
|
export * from './services/public/UserService';
|
|
15
|
-
export * from './types/
|
|
16
|
-
export * from './types/
|
|
17
|
-
export * from './types/public/List';
|
|
18
|
-
export * from './types/public/Tweet';
|
|
19
|
-
export * from './types/public/User';
|
|
20
|
-
export { ITweetFilter } from 'rettiwt-core';
|
|
20
|
+
export * from './types/RettiwtConfig';
|
|
21
|
+
export * from './types/ErrorHandler';
|
package/dist/index.js
CHANGED
|
@@ -17,27 +17,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.TweetFilter = void 0;
|
|
18
18
|
// MAIN
|
|
19
19
|
__exportStar(require("./Rettiwt"), exports);
|
|
20
|
-
//
|
|
21
|
-
__exportStar(require("./enums/ApiErrors"), exports);
|
|
22
|
-
__exportStar(require("./enums/HTTP"), exports);
|
|
23
|
-
__exportStar(require("./enums/Logging"), exports);
|
|
24
|
-
// Exporting models
|
|
25
|
-
__exportStar(require("./models/internal/RettiwtConfig"), exports);
|
|
26
|
-
__exportStar(require("./models/public/CursoredData"), exports);
|
|
27
|
-
__exportStar(require("./models/public/List"), exports);
|
|
28
|
-
__exportStar(require("./models/public/Tweet"), exports);
|
|
29
|
-
__exportStar(require("./models/public/User"), exports);
|
|
20
|
+
// EXTERNAL
|
|
30
21
|
var rettiwt_core_1 = require("rettiwt-core");
|
|
31
22
|
Object.defineProperty(exports, "TweetFilter", { enumerable: true, get: function () { return rettiwt_core_1.TweetFilter; } });
|
|
32
|
-
//
|
|
23
|
+
// ENUMS
|
|
24
|
+
__exportStar(require("./enums/Api"), exports);
|
|
25
|
+
__exportStar(require("./enums/Http"), exports);
|
|
26
|
+
__exportStar(require("./enums/Logging"), exports);
|
|
27
|
+
// ARGS MODELS
|
|
28
|
+
__exportStar(require("./models/args/TweetArgs"), exports);
|
|
29
|
+
// ERROR MODELS
|
|
30
|
+
__exportStar(require("./models/errors/ApiError"), exports);
|
|
31
|
+
__exportStar(require("./models/errors/HttpError"), exports);
|
|
32
|
+
__exportStar(require("./models/errors/RettiwtError"), exports);
|
|
33
|
+
// DATA MODELS
|
|
34
|
+
__exportStar(require("./models/data/CursoredData"), exports);
|
|
35
|
+
__exportStar(require("./models/data/List"), exports);
|
|
36
|
+
__exportStar(require("./models/data/Tweet"), exports);
|
|
37
|
+
__exportStar(require("./models/data/User"), exports);
|
|
38
|
+
// SERVICES
|
|
39
|
+
__exportStar(require("./services/internal/ErrorService"), exports);
|
|
33
40
|
__exportStar(require("./services/internal/FetcherService"), exports);
|
|
34
41
|
__exportStar(require("./services/internal/LogService"), exports);
|
|
42
|
+
__exportStar(require("./services/public/AuthService"), exports);
|
|
35
43
|
__exportStar(require("./services/public/TweetService"), exports);
|
|
36
44
|
__exportStar(require("./services/public/UserService"), exports);
|
|
37
|
-
//
|
|
38
|
-
__exportStar(require("./types/
|
|
39
|
-
__exportStar(require("./types/
|
|
40
|
-
__exportStar(require("./types/public/List"), exports);
|
|
41
|
-
__exportStar(require("./types/public/Tweet"), exports);
|
|
42
|
-
__exportStar(require("./types/public/User"), exports);
|
|
45
|
+
// TYPES
|
|
46
|
+
__exportStar(require("./types/RettiwtConfig"), exports);
|
|
47
|
+
__exportStar(require("./types/ErrorHandler"), exports);
|
|
43
48
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAO;AACP,4CAA0B;AAE1B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,OAAO;AACP,4CAA0B;AAE1B,WAAW;AACX,6CAA2C;AAAlC,2GAAA,WAAW,OAAA;AAEpB,QAAQ;AACR,8CAA4B;AAC5B,+CAA6B;AAC7B,kDAAgC;AAEhC,cAAc;AACd,0DAAwC;AAExC,eAAe;AACf,2DAAyC;AACzC,4DAA0C;AAC1C,+DAA6C;AAE7C,cAAc;AACd,6DAA2C;AAC3C,qDAAmC;AACnC,sDAAoC;AACpC,qDAAmC;AAEnC,WAAW;AACX,mEAAiD;AACjD,qEAAmD;AACnD,iEAA+C;AAC/C,gEAA8C;AAC9C,iEAA+C;AAC/C,gEAA8C;AAE9C,QAAQ;AACR,wDAAsC;AACtC,uDAAqC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The arguments specifying the tweet to be posted.
|
|
3
|
+
*/
|
|
4
|
+
export declare class TweetArgs {
|
|
5
|
+
/**
|
|
6
|
+
* The text content of the tweet.
|
|
7
|
+
*
|
|
8
|
+
* @remarks Length must be \<= 280 characters.
|
|
9
|
+
*/
|
|
10
|
+
text: string;
|
|
11
|
+
/**
|
|
12
|
+
* The media content of the tweet.
|
|
13
|
+
*
|
|
14
|
+
* @remarks Max number of media that can be posted is 4.
|
|
15
|
+
*/
|
|
16
|
+
media?: TweetMediaArgs[];
|
|
17
|
+
/**
|
|
18
|
+
* @param tweet - The tweet arguments specifying the tweet.
|
|
19
|
+
*/
|
|
20
|
+
constructor(tweet: TweetArgs);
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The arguments specifying the media to be posted in a single tweet.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export declare class TweetMediaArgs {
|
|
28
|
+
/**
|
|
29
|
+
* The path to the media file.
|
|
30
|
+
*
|
|
31
|
+
* @remarks The size of the media file must be \<= 5242880 bytes.
|
|
32
|
+
*/
|
|
33
|
+
path: string;
|
|
34
|
+
/**
|
|
35
|
+
* The list of id of users to be tagged in the media.
|
|
36
|
+
*
|
|
37
|
+
* @remarks Max number of tags is 10.
|
|
38
|
+
*/
|
|
39
|
+
tags?: string[];
|
|
40
|
+
/**
|
|
41
|
+
* @param media - The media arguments specifying the media.
|
|
42
|
+
*/
|
|
43
|
+
constructor(media: TweetMediaArgs);
|
|
44
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TweetMediaArgs = exports.TweetArgs = void 0;
|
|
13
|
+
// PACKAGES
|
|
14
|
+
var class_validator_1 = require("class-validator");
|
|
15
|
+
var rettiwt_core_1 = require("rettiwt-core");
|
|
16
|
+
/**
|
|
17
|
+
* The arguments specifying the tweet to be posted.
|
|
18
|
+
*/
|
|
19
|
+
var TweetArgs = exports.TweetArgs = /** @class */ (function () {
|
|
20
|
+
/**
|
|
21
|
+
* @param tweet - The tweet arguments specifying the tweet.
|
|
22
|
+
*/
|
|
23
|
+
function TweetArgs(tweet) {
|
|
24
|
+
this.text = tweet.text;
|
|
25
|
+
this.media = tweet.media ? tweet.media.map(function (item) { return new TweetMediaArgs(item); }) : undefined;
|
|
26
|
+
// Validating this object
|
|
27
|
+
var validationResult = (0, class_validator_1.validateSync)(this);
|
|
28
|
+
// If validation error occured
|
|
29
|
+
if (validationResult.length) {
|
|
30
|
+
throw new rettiwt_core_1.DataValidationError(validationResult);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
35
|
+
(0, class_validator_1.IsString)(),
|
|
36
|
+
(0, class_validator_1.MaxLength)(280),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], TweetArgs.prototype, "text", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, class_validator_1.IsOptional)(),
|
|
41
|
+
(0, class_validator_1.IsArray)(),
|
|
42
|
+
(0, class_validator_1.ArrayMaxSize)(4),
|
|
43
|
+
(0, class_validator_1.IsObject)({ each: true }),
|
|
44
|
+
__metadata("design:type", Array)
|
|
45
|
+
], TweetArgs.prototype, "media", void 0);
|
|
46
|
+
return TweetArgs;
|
|
47
|
+
}());
|
|
48
|
+
/**
|
|
49
|
+
* The arguments specifying the media to be posted in a single tweet.
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
var TweetMediaArgs = exports.TweetMediaArgs = /** @class */ (function () {
|
|
54
|
+
/**
|
|
55
|
+
* @param media - The media arguments specifying the media.
|
|
56
|
+
*/
|
|
57
|
+
function TweetMediaArgs(media) {
|
|
58
|
+
var _a;
|
|
59
|
+
this.path = media.path;
|
|
60
|
+
this.tags = (_a = media.tags) !== null && _a !== void 0 ? _a : [];
|
|
61
|
+
// Validating this object
|
|
62
|
+
var validationResult = (0, class_validator_1.validateSync)(this);
|
|
63
|
+
// If validation error occured
|
|
64
|
+
if (validationResult.length) {
|
|
65
|
+
throw new rettiwt_core_1.DataValidationError(validationResult);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, class_validator_1.IsNotEmpty)(),
|
|
70
|
+
(0, class_validator_1.IsString)(),
|
|
71
|
+
__metadata("design:type", String)
|
|
72
|
+
], TweetMediaArgs.prototype, "path", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
(0, class_validator_1.IsOptional)(),
|
|
75
|
+
(0, class_validator_1.IsArray)(),
|
|
76
|
+
(0, class_validator_1.ArrayMaxSize)(10),
|
|
77
|
+
(0, class_validator_1.IsNumberString)(undefined, { each: true }),
|
|
78
|
+
__metadata("design:type", Array)
|
|
79
|
+
], TweetMediaArgs.prototype, "tags", void 0);
|
|
80
|
+
return TweetMediaArgs;
|
|
81
|
+
}());
|
|
82
|
+
//# sourceMappingURL=TweetArgs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TweetArgs.js","sourceRoot":"","sources":["../../../src/models/args/TweetArgs.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,WAAW;AACX,mDAUyB;AACzB,6CAAmD;AAEnD;;GAEG;AACH;IAsBC;;OAEG;IACH,mBAAmB,KAAgB;QAClC,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAC,IAAI,IAAK,OAAA,IAAI,cAAc,CAAC,IAAI,CAAC,EAAxB,C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 @@
|
|
|
1
1
|
import { Tweet } from './Tweet';
|
|
2
2
|
import { User } from './User';
|
|
3
|
-
import { ICursor, ICursoredData } from '../../types/public/CursoredData';
|
|
4
3
|
/**
|
|
5
4
|
* The data that us fetched batch-wise along with a cursor.
|
|
6
5
|
*
|
|
@@ -8,8 +7,10 @@ import { ICursor, ICursoredData } from '../../types/public/CursoredData';
|
|
|
8
7
|
*
|
|
9
8
|
* @public
|
|
10
9
|
*/
|
|
11
|
-
export declare class CursoredData<T extends Tweet | User>
|
|
10
|
+
export declare class CursoredData<T extends Tweet | User> {
|
|
11
|
+
/** The list of data of the given type. */
|
|
12
12
|
list: T[];
|
|
13
|
+
/** The cursor to the next batch of data. */
|
|
13
14
|
next: Cursor;
|
|
14
15
|
/**
|
|
15
16
|
* @param list - The list of data item to store.
|
|
@@ -22,7 +23,8 @@ export declare class CursoredData<T extends Tweet | User> implements ICursoredDa
|
|
|
22
23
|
*
|
|
23
24
|
* @public
|
|
24
25
|
*/
|
|
25
|
-
export declare class Cursor
|
|
26
|
+
export declare class Cursor {
|
|
27
|
+
/** The cursor string. */
|
|
26
28
|
value: string;
|
|
27
29
|
/**
|
|
28
30
|
* Initializes a new cursor from the given cursor string.
|
|
@@ -16,6 +16,7 @@ var CursoredData = /** @class */ (function () {
|
|
|
16
16
|
function CursoredData(list, next) {
|
|
17
17
|
if (list === void 0) { list = []; }
|
|
18
18
|
if (next === void 0) { next = ''; }
|
|
19
|
+
/** The list of data of the given type. */
|
|
19
20
|
this.list = [];
|
|
20
21
|
this.list = list;
|
|
21
22
|
this.next = new Cursor(next);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CursoredData.js","sourceRoot":"","sources":["../../../src/models/data/CursoredData.ts"],"names":[],"mappings":";;;AAIA;;;;;;GAMG;AACH;IAOC;;;OAGG;IACH,sBAAmB,IAAc,EAAE,IAAiB;QAAjC,qBAAA,EAAA,SAAc;QAAE,qBAAA,EAAA,SAAiB;QAVpD,0CAA0C;QACnC,SAAI,GAAQ,EAAE,CAAC;QAUrB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IACF,mBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,oCAAY;AAiBzB;;;;GAIG;AACH;IAIC;;;;OAIG;IACH,gBAAmB,SAAiB;QACnC,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;IACxB,CAAC;IACF,aAAC;AAAD,CAAC,AAZD,IAYC;AAZY,wBAAM"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { IList as IRawList } from 'rettiwt-core';
|
|
1
2
|
/**
|
|
2
3
|
* The details of a single Twitter List.
|
|
3
4
|
*
|
|
4
5
|
* @public
|
|
5
6
|
*/
|
|
6
|
-
export
|
|
7
|
+
export declare class List {
|
|
7
8
|
/** The rest id of the list. */
|
|
8
9
|
id: string;
|
|
9
10
|
/** The name of the list. */
|
|
@@ -18,4 +19,10 @@ export interface IList {
|
|
|
18
19
|
subscriberCount: number;
|
|
19
20
|
/** The rest id of the user who created the list. */
|
|
20
21
|
createdBy: string;
|
|
22
|
+
/**
|
|
23
|
+
* Initializes a new Tweet List from the given raw list data.
|
|
24
|
+
*
|
|
25
|
+
* @param list - list The raw tweet list data.
|
|
26
|
+
*/
|
|
27
|
+
constructor(list: IRawList);
|
|
21
28
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/models/data/List.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IAsBC;;;;OAIG;IACH,cAAmB,IAAc;QAChC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,WAAW,EAAE,CAAC;QACzD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC;QACrC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC7C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,CAAC;IAC9C,CAAC;IACF,WAAC;AAAD,CAAC,AApCD,IAoCC;AApCY,oBAAI"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IMediaUploadInitializeResponse } from 'rettiwt-core';
|
|
2
|
+
/**
|
|
3
|
+
* The details of a single media file.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export declare class Media {
|
|
8
|
+
/** The id of the media. */
|
|
9
|
+
id: string;
|
|
10
|
+
/**
|
|
11
|
+
* @param media - The raw media data.
|
|
12
|
+
*/
|
|
13
|
+
constructor(media: IMediaUploadInitializeResponse);
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Media = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The details of a single media file.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
var Media = /** @class */ (function () {
|
|
10
|
+
/**
|
|
11
|
+
* @param media - The raw media data.
|
|
12
|
+
*/
|
|
13
|
+
function Media(media) {
|
|
14
|
+
this.id = media.media_id_string;
|
|
15
|
+
}
|
|
16
|
+
return Media;
|
|
17
|
+
}());
|
|
18
|
+
exports.Media = Media;
|
|
19
|
+
//# sourceMappingURL=Media.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Media.js","sourceRoot":"","sources":["../../../src/models/data/Media.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IAIC;;OAEG;IACH,eAAmB,KAAqC;QACvD,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,eAAe,CAAC;IACjC,CAAC;IACF,YAAC;AAAD,CAAC,AAVD,IAUC;AAVY,sBAAK"}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { EMediaType } from 'rettiwt-core';
|
|
2
|
-
import {
|
|
1
|
+
import { ITweet as IRawTweet, IEntities as IRawTweetEntities, IExtendedMedia as IRawExtendedMedia, EMediaType } from 'rettiwt-core';
|
|
2
|
+
import { User } from './User';
|
|
3
3
|
/**
|
|
4
4
|
* The details of a single Tweet.
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
8
|
+
export declare class Tweet {
|
|
9
9
|
/** The rest id of the tweet. */
|
|
10
10
|
id: string;
|
|
11
11
|
/** The details of the user who made the tweet. */
|
|
12
|
-
tweetBy:
|
|
12
|
+
tweetBy: User;
|
|
13
13
|
/** The date and time of creation of the tweet, in UTC string format. */
|
|
14
14
|
createdAt: string;
|
|
15
15
|
/** Additional tweet entities like urls, mentions, etc. */
|
|
16
|
-
entities:
|
|
16
|
+
entities: TweetEntities;
|
|
17
17
|
/** The urls of the media contents of the tweet (if any). */
|
|
18
|
-
media:
|
|
18
|
+
media: TweetMedia[];
|
|
19
19
|
/** The rest id of the tweet which is quoted in the tweet. */
|
|
20
20
|
quoted: string;
|
|
21
21
|
/** The full text content of the tweet. */
|
|
@@ -36,28 +36,46 @@ export interface ITweet {
|
|
|
36
36
|
viewCount: number;
|
|
37
37
|
/** The number of bookmarks of a tweet. */
|
|
38
38
|
bookmarkCount: number;
|
|
39
|
+
/**
|
|
40
|
+
* Initializes a new Tweet from the given raw tweet data.
|
|
41
|
+
*
|
|
42
|
+
* @param tweet - The raw tweet data.
|
|
43
|
+
*/
|
|
44
|
+
constructor(tweet: IRawTweet);
|
|
39
45
|
}
|
|
40
46
|
/**
|
|
41
47
|
* The different types parsed entities like urls, media, mentions, hashtags, etc.
|
|
42
48
|
*
|
|
43
49
|
* @public
|
|
44
50
|
*/
|
|
45
|
-
export
|
|
51
|
+
export declare class TweetEntities {
|
|
46
52
|
/** The list of hashtags mentioned in the tweet. */
|
|
47
53
|
hashtags: string[];
|
|
48
54
|
/** The list of urls mentioned in the tweet. */
|
|
49
55
|
urls: string[];
|
|
50
56
|
/** The list of IDs of users mentioned in the tweet. */
|
|
51
57
|
mentionedUsers: string[];
|
|
58
|
+
/**
|
|
59
|
+
* Initializes the TweetEntities from the raw tweet entities.
|
|
60
|
+
*
|
|
61
|
+
* @param entities - The raw tweet entities.
|
|
62
|
+
*/
|
|
63
|
+
constructor(entities: IRawTweetEntities);
|
|
52
64
|
}
|
|
53
65
|
/**
|
|
54
66
|
* A single media content.
|
|
55
67
|
*
|
|
56
68
|
* @public
|
|
57
69
|
*/
|
|
58
|
-
export
|
|
70
|
+
export declare class TweetMedia {
|
|
59
71
|
/** The type of media. */
|
|
60
72
|
type: EMediaType;
|
|
61
73
|
/** The direct URL to the media. */
|
|
62
74
|
url: string;
|
|
75
|
+
/**
|
|
76
|
+
* Initializes the TweetMedia from the raw tweet media.
|
|
77
|
+
*
|
|
78
|
+
* @param media - The raw tweet media.
|
|
79
|
+
*/
|
|
80
|
+
constructor(media: IRawExtendedMedia);
|
|
63
81
|
}
|
|
@@ -51,8 +51,11 @@ var TweetEntities = /** @class */ (function () {
|
|
|
51
51
|
* @param entities - The raw tweet entities.
|
|
52
52
|
*/
|
|
53
53
|
function TweetEntities(entities) {
|
|
54
|
+
/** The list of hashtags mentioned in the tweet. */
|
|
54
55
|
this.hashtags = [];
|
|
56
|
+
/** The list of urls mentioned in the tweet. */
|
|
55
57
|
this.urls = [];
|
|
58
|
+
/** The list of IDs of users mentioned in the tweet. */
|
|
56
59
|
this.mentionedUsers = [];
|
|
57
60
|
// Extracting user mentions
|
|
58
61
|
if (entities.user_mentions) {
|
|
@@ -93,6 +96,7 @@ var TweetMedia = /** @class */ (function () {
|
|
|
93
96
|
function TweetMedia(media) {
|
|
94
97
|
var _this = this;
|
|
95
98
|
var _a, _b;
|
|
99
|
+
/** The direct URL to the media. */
|
|
96
100
|
this.url = '';
|
|
97
101
|
this.type = media.type;
|
|
98
102
|
// If the media is a photo
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../../src/models/data/Tweet.ts"],"names":[],"mappings":";;;AAAA,WAAW;AACX,6CAKsB;AAEtB,SAAS;AACT,+BAA8B;AAE9B,UAAU;AACV,oDAAuD;AAEvD;;;;GAIG;AACH;IA8CC;;;;OAIG;IACH,eAAmB,KAAgB;;QAClC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,OAAO,CAAC;QACxB,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC,UAAU,CAAC;QACzC,IAAI,CAAC,OAAO,GAAG,IAAI,WAAI,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QACxD,IAAI,CAAC,QAAQ,GAAG,IAAI,aAAa,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACzD,IAAI,CAAC,KAAK,GAAG,MAAA,MAAA,KAAK,CAAC,MAAM,CAAC,iBAAiB,0CAAE,KAAK,0CAAE,GAAG,CAAC,UAAC,KAAK,IAAK,OAAA,IAAI,UAAU,CAAC,KAAK,CAAC,EAArB,CAAqB,CAAC,CAAC;QAC1F,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,oBAAoB,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAA,yBAAa,EAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,yBAAyB,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC;QAC9B,IAAI,CAAC,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2
3
|
* The details of a single user.
|
|
3
4
|
*
|
|
4
5
|
* @public
|
|
5
6
|
*/
|
|
6
|
-
export
|
|
7
|
+
export declare class User {
|
|
7
8
|
/** The rest id of the user. */
|
|
8
9
|
id: string;
|
|
9
10
|
/** The username/screenname of the user. */
|
|
@@ -32,4 +33,10 @@ export interface IUser {
|
|
|
32
33
|
profileBanner: string;
|
|
33
34
|
/** The url of the profile image. */
|
|
34
35
|
profileImage: string;
|
|
36
|
+
/**
|
|
37
|
+
* Initializes a new User from the given raw user data.
|
|
38
|
+
*
|
|
39
|
+
* @param user - The raw user data.
|
|
40
|
+
*/
|
|
41
|
+
constructor(user: IRawUser);
|
|
35
42
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/models/data/User.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH;IA2CC;;;;OAIG;IACH,cAAmB,IAAc;QAChC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC;QACxC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QAC3C,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QACvC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC;QACpD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC;QAClD,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC;QACjD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC;QAChD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;QACvD,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC;QACpD,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,uBAAuB,CAAC;IACzD,CAAC;IACF,WAAC;AAAD,CAAC,AAhED,IAgEC;AAhEY,oBAAI"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { RettiwtError } from './RettiwtError';
|
|
2
|
+
/**
|
|
3
|
+
* Represents an error that is thrown by Twitter API.
|
|
4
|
+
*
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare class ApiError extends RettiwtError {
|
|
8
|
+
/** The error code thrown by Twitter API. */
|
|
9
|
+
code: number;
|
|
10
|
+
/**
|
|
11
|
+
* Initializes a new ApiError based on the given error details.
|
|
12
|
+
*
|
|
13
|
+
* @param errorCode - The error code thrown by Twitter API.
|
|
14
|
+
* @param message - Any additional error message.
|
|
15
|
+
*/
|
|
16
|
+
constructor(errorCode: number, message?: string);
|
|
17
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ApiError = void 0;
|
|
19
|
+
// ERRORS
|
|
20
|
+
var RettiwtError_1 = require("./RettiwtError");
|
|
21
|
+
/**
|
|
22
|
+
* Represents an error that is thrown by Twitter API.
|
|
23
|
+
*
|
|
24
|
+
* @internal
|
|
25
|
+
*/
|
|
26
|
+
var ApiError = /** @class */ (function (_super) {
|
|
27
|
+
__extends(ApiError, _super);
|
|
28
|
+
/**
|
|
29
|
+
* Initializes a new ApiError based on the given error details.
|
|
30
|
+
*
|
|
31
|
+
* @param errorCode - The error code thrown by Twitter API.
|
|
32
|
+
* @param message - Any additional error message.
|
|
33
|
+
*/
|
|
34
|
+
function ApiError(errorCode, message) {
|
|
35
|
+
var _this = _super.call(this, message) || this;
|
|
36
|
+
_this.code = errorCode;
|
|
37
|
+
return _this;
|
|
38
|
+
}
|
|
39
|
+
return ApiError;
|
|
40
|
+
}(RettiwtError_1.RettiwtError));
|
|
41
|
+
exports.ApiError = ApiError;
|
|
42
|
+
//# sourceMappingURL=ApiError.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ApiError.js","sourceRoot":"","sources":["../../../src/models/errors/ApiError.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,SAAS;AACT,+CAA8C;AAE9C;;;;GAIG;AACH;IAA8B,4BAAY;IAIzC;;;;;OAKG;IACH,kBAAmB,SAAiB,EAAE,OAAgB;QAAtD,YACC,kBAAM,OAAO,CAAC,SAGd;QADA,KAAI,CAAC,IAAI,GAAG,SAAS,CAAC;;IACvB,CAAC;IACF,eAAC;AAAD,CAAC,AAfD,CAA8B,2BAAY,GAezC;AAfY,4BAAQ"}
|