twitter-openapi-typescript-generated 0.0.18 → 0.0.19
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/README.md +2 -2
- package/dist/models/TimelineTerminateTimeline.d.ts +1 -0
- package/dist/models/TimelineTerminateTimeline.d.ts.map +1 -1
- package/dist/models/TimelineTerminateTimeline.js +2 -1
- package/dist/models/TimelineTerminateTimeline.js.map +1 -1
- package/package.json +1 -1
- package/src/models/TimelineTerminateTimeline.ts +2 -1
- package/tools/openapi-generator-config.yaml +1 -1
- package/twitter-openapi/dist/compatible/openapi-3.0.yaml +1 -0
- package/twitter-openapi/dist/compatible_discriminator/openapi-3.0.yaml +1 -0
- package/twitter-openapi/dist/docs/openapi-3.0.yaml +1 -0
- package/twitter-openapi/src/openapi/schemas/instruction.yaml +1 -1
- package/twitter-openapi/src/openapi/schemas/tweet.yaml +0 -1
- package/twitter-openapi/test/python/test_serialize_guest.py +49 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
## twitter-openapi-typescript-generated@0.0.
|
|
1
|
+
## twitter-openapi-typescript-generated@0.0.19
|
|
2
2
|
|
|
3
3
|
This generator creates TypeScript/JavaScript client that utilizes [Fetch API](https://fetch.spec.whatwg.org/). The generated Node module can be used in the following environments:
|
|
4
4
|
|
|
@@ -36,7 +36,7 @@ navigate to the folder of your consuming project and run one of the following co
|
|
|
36
36
|
_published:_
|
|
37
37
|
|
|
38
38
|
```
|
|
39
|
-
npm install twitter-openapi-typescript-generated@0.0.
|
|
39
|
+
npm install twitter-openapi-typescript-generated@0.0.19 --save
|
|
40
40
|
```
|
|
41
41
|
|
|
42
42
|
_unPublished (not recommended):_
|
|
@@ -35,6 +35,7 @@ export interface TimelineTerminateTimeline {
|
|
|
35
35
|
export declare const TimelineTerminateTimelineDirectionEnum: {
|
|
36
36
|
readonly Top: "Top";
|
|
37
37
|
readonly Bottom: "Bottom";
|
|
38
|
+
readonly TopAndBottom: "TopAndBottom";
|
|
38
39
|
};
|
|
39
40
|
export type TimelineTerminateTimelineDirectionEnum = typeof TimelineTerminateTimelineDirectionEnum[keyof typeof TimelineTerminateTimelineDirectionEnum];
|
|
40
41
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineTerminateTimeline.d.ts","sourceRoot":"","sources":["../../src/models/TimelineTerminateTimeline.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOzD;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC;;;;OAIG;IACH,SAAS,EAAE,sCAAsC,CAAC;IAClD;;;;OAIG;IACH,IAAI,EAAE,eAAe,CAAC;CACzB;AAGD;;GAEG;AACH,eAAO,MAAM,sCAAsC
|
|
1
|
+
{"version":3,"file":"TimelineTerminateTimeline.d.ts","sourceRoot":"","sources":["../../src/models/TimelineTerminateTimeline.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAOzD;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACtC;;;;OAIG;IACH,SAAS,EAAE,sCAAsC,CAAC;IAClD;;;;OAIG;IACH,IAAI,EAAE,eAAe,CAAC;CACzB;AAGD;;GAEG;AACH,eAAO,MAAM,sCAAsC;;;;CAIzC,CAAC;AACX,MAAM,MAAM,sCAAsC,GAAG,OAAO,sCAAsC,CAAC,MAAM,OAAO,sCAAsC,CAAC,CAAC;AAGxJ;;GAEG;AACH,wBAAgB,mCAAmC,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAM1E;AAED,wBAAgB,iCAAiC,CAAC,IAAI,EAAE,GAAG,GAAG,yBAAyB,CAEtF;AAED,wBAAgB,sCAAsC,CAAC,IAAI,EAAE,GAAG,EAAE,mBAAmB,EAAE,OAAO,GAAG,yBAAyB,CASzH;AAED,wBAAgB,+BAA+B,CAAC,KAAK,CAAC,EAAE,yBAAyB,GAAG,IAAI,GAAG,GAAG,CAY7F"}
|
|
@@ -20,7 +20,8 @@ var InstructionType_1 = require("./InstructionType");
|
|
|
20
20
|
*/
|
|
21
21
|
exports.TimelineTerminateTimelineDirectionEnum = {
|
|
22
22
|
Top: 'Top',
|
|
23
|
-
Bottom: 'Bottom'
|
|
23
|
+
Bottom: 'Bottom',
|
|
24
|
+
TopAndBottom: 'TopAndBottom'
|
|
24
25
|
};
|
|
25
26
|
/**
|
|
26
27
|
* Check if a given object implements the TimelineTerminateTimeline interface.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TimelineTerminateTimeline.js","sourceRoot":"","sources":["../../src/models/TimelineTerminateTimeline.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;;;AAIH,qDAI2B;AAuB3B;;GAEG;AACU,QAAA,sCAAsC,GAAG;IAClD,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;
|
|
1
|
+
{"version":3,"file":"TimelineTerminateTimeline.js","sourceRoot":"","sources":["../../src/models/TimelineTerminateTimeline.ts"],"names":[],"mappings":";AAAA,oBAAoB;AACpB,oBAAoB;AACpB;;;;;;;;;;GAUG;;;AAIH,qDAI2B;AAuB3B;;GAEG;AACU,QAAA,sCAAsC,GAAG;IAClD,GAAG,EAAE,KAAK;IACV,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,cAAc;CACtB,CAAC;AAIX;;GAEG;AACH,SAAgB,mCAAmC,CAAC,KAAa;IAC7D,IAAI,UAAU,GAAG,IAAI,CAAC;IACtB,UAAU,GAAG,UAAU,IAAI,WAAW,IAAI,KAAK,CAAC;IAChD,UAAU,GAAG,UAAU,IAAI,MAAM,IAAI,KAAK,CAAC;IAE3C,OAAO,UAAU,CAAC;AACtB,CAAC;AAND,kFAMC;AAED,SAAgB,iCAAiC,CAAC,IAAS;IACvD,OAAO,sCAAsC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC;AAFD,8EAEC;AAED,SAAgB,sCAAsC,CAAC,IAAS,EAAE,mBAA4B;IAC1F,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,IAAI,CAAC,IAAI,KAAK,IAAI,CAAC,EAAE;QACzC,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,WAAW,EAAE,IAAI,CAAC,WAAW,CAAC;QAC9B,MAAM,EAAE,IAAA,yCAAuB,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAChD,CAAC;AACN,CAAC;AATD,wFASC;AAED,SAAgB,+BAA+B,CAAC,KAAwC;IACpF,IAAI,KAAK,KAAK,SAAS,EAAE;QACrB,OAAO,SAAS,CAAC;KACpB;IACD,IAAI,KAAK,KAAK,IAAI,EAAE;QAChB,OAAO,IAAI,CAAC;KACf;IACD,OAAO;QAEH,WAAW,EAAE,KAAK,CAAC,SAAS;QAC5B,MAAM,EAAE,IAAA,uCAAqB,EAAC,KAAK,CAAC,IAAI,CAAC;KAC5C,CAAC;AACN,CAAC;AAZD,0EAYC"}
|
package/package.json
CHANGED
|
@@ -46,7 +46,8 @@ export interface TimelineTerminateTimeline {
|
|
|
46
46
|
*/
|
|
47
47
|
export const TimelineTerminateTimelineDirectionEnum = {
|
|
48
48
|
Top: 'Top',
|
|
49
|
-
Bottom: 'Bottom'
|
|
49
|
+
Bottom: 'Bottom',
|
|
50
|
+
TopAndBottom: 'TopAndBottom'
|
|
50
51
|
} as const;
|
|
51
52
|
export type TimelineTerminateTimelineDirectionEnum = typeof TimelineTerminateTimelineDirectionEnum[keyof typeof TimelineTerminateTimelineDirectionEnum];
|
|
52
53
|
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
import openapi_client as pt
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def get_kwargs(key, additional):
|
|
8
|
+
kwargs = {"path_query_id": placeholder[key]["queryId"]}
|
|
9
|
+
if placeholder[key].get("variables") is not None:
|
|
10
|
+
kwargs["variables"] = json.dumps(placeholder[key]["variables"] | additional)
|
|
11
|
+
if placeholder[key].get("features") is not None:
|
|
12
|
+
kwargs["features"] = json.dumps(placeholder[key]["features"])
|
|
13
|
+
if placeholder[key].get("fieldToggles") is not None:
|
|
14
|
+
kwargs["field_toggles"] = json.dumps(placeholder[key]["fieldToggles"])
|
|
15
|
+
return kwargs
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
if __name__ == "__main__":
|
|
19
|
+
if Path("cookie.json").exists():
|
|
20
|
+
with open("cookie.json", "r") as f:
|
|
21
|
+
cookies = json.load(f)
|
|
22
|
+
cookies_str = "; ".join([f"{k}={v}" for k, v in cookies.items()])
|
|
23
|
+
|
|
24
|
+
with open("src/config/placeholder.json", "r") as f:
|
|
25
|
+
placeholder = json.load(f)
|
|
26
|
+
|
|
27
|
+
api_conf = pt.Configuration(
|
|
28
|
+
api_key={
|
|
29
|
+
"ClientLanguage": "en",
|
|
30
|
+
"ActiveUser": "yes",
|
|
31
|
+
"GuestToken": cookies["gt"],
|
|
32
|
+
},
|
|
33
|
+
)
|
|
34
|
+
api_conf.access_token = "AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA"
|
|
35
|
+
api_client = pt.ApiClient(configuration=api_conf, cookie=cookies_str)
|
|
36
|
+
api_client.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36"
|
|
37
|
+
|
|
38
|
+
pt.TweetApi(api_client).get_user_tweets_with_http_info(
|
|
39
|
+
**get_kwargs("UserTweets", {}),
|
|
40
|
+
)
|
|
41
|
+
pt.TweetApi(api_client).get_user_highlights_tweets_with_http_info(
|
|
42
|
+
**get_kwargs("UserHighlightsTweets", {}),
|
|
43
|
+
)
|
|
44
|
+
pt.DefaultApi(api_client).get_tweet_result_by_rest_id_with_http_info(
|
|
45
|
+
**get_kwargs("TweetResultByRestId", {}),
|
|
46
|
+
)
|
|
47
|
+
pt.UserApi(api_client).get_user_by_screen_name_with_http_info(
|
|
48
|
+
**get_kwargs("UserByScreenName", {})
|
|
49
|
+
)
|