Skip to content

Commit 42ae8bb

Browse files
authored
Merge pull request #13 from fa0311/dev
update package v0.0.8
2 parents 4fa2f07 + 5ebdfa0 commit 42ae8bb

File tree

9 files changed

+33
-21
lines changed

9 files changed

+33
-21
lines changed

twitter-openapi-typescript/package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

twitter-openapi-typescript/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "twitter-openapi-typescript",
3-
"version": "0.0.7",
3+
"version": "0.0.8",
44
"description": "Implementation of Twitter internal API in TypeScript",
55
"scripts": {
66
"test": "jest",
@@ -21,7 +21,7 @@
2121
"main": "./dist/src/index.js",
2222
"typings": "./dist/src/index.d.ts",
2323
"dependencies": {
24-
"twitter-openapi-typescript-generated": "^0.0.5"
24+
"twitter-openapi-typescript-generated": "^0.0.6"
2525
},
2626
"devDependencies": {
2727
"@types/jest": "^28.0.0",

twitter-openapi-typescript/src/apis/defaultApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export class DefaultApiUtils {
1919
async request<T1, T2>(param: RequestParam<T1, T2>): Promise<TwitterApiUtilsResponse<T1>> {
2020
const apiFn: typeof param.apiFn = param.apiFn.bind(this.api);
2121
const response = await apiFn({
22+
pathQueryId: this.flag[param.key]['queryId'],
2223
queryId: this.flag[param.key]['queryId'],
2324
variables: JSON.stringify({ ...this.flag[param.key]['variables'], ...param.param }),
2425
features: JSON.stringify(this.flag[param.key]['features']),

twitter-openapi-typescript/src/apis/postApi.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ export class PostApiUtils {
5151
const features = i.PostCreateTweetRequestFeaturesFromJSON(this.flag[queryId]['features']);
5252
const variables = i.PostCreateTweetRequestVariablesFromJSON(this.flag[queryId]['variables']);
5353
const response = await this.api.postCreateTweetRaw({
54+
pathQueryId: this.flag[queryId]['queryId'],
5455
postCreateTweetRequest: {
55-
queryId: queryId,
56+
queryId: this.flag[queryId]['queryId'],
5657
features: features,
5758
variables: { ...variables, ...args },
5859
},
@@ -70,10 +71,11 @@ export class PostApiUtils {
7071
...param.extraParam,
7172
};
7273
const queryId = 'DeleteTweet';
73-
const variables = i.PostDeleteTweetRequestVariablesFromJSON(this.flag[queryId]['variables']);
74+
const variables = i.PostCreateRetweetRequestVariablesFromJSON(this.flag[queryId]['variables']);
7475
const response = await this.api.postDeleteTweetRaw({
76+
pathQueryId: this.flag[queryId]['queryId'],
7577
postDeleteTweetRequest: {
76-
queryId: queryId,
78+
queryId: this.flag[queryId]['queryId'],
7779
variables: { ...variables, ...args },
7880
},
7981
});
@@ -90,10 +92,11 @@ export class PostApiUtils {
9092
...param.extraParam,
9193
};
9294
const queryId = 'CreateRetweet';
93-
const variables = i.PostCreateTweetRequestVariablesFromJSON(this.flag[queryId]['variables']);
95+
const variables = i.PostCreateRetweetRequestVariablesFromJSON(this.flag[queryId]['variables']);
9496
const response = await this.api.postCreateRetweetRaw({
97+
pathQueryId: this.flag[queryId]['queryId'],
9598
postCreateRetweetRequest: {
96-
queryId: queryId,
99+
queryId: this.flag[queryId]['queryId'],
97100
variables: { ...variables, ...args },
98101
},
99102
});
@@ -111,8 +114,9 @@ export class PostApiUtils {
111114
const queryId = 'DeleteRetweet';
112115
const variables = i.PostDeleteRetweetRequestVariablesFromJSON(this.flag[queryId]['variables']);
113116
const response = await this.api.postDeleteRetweetRaw({
117+
pathQueryId: this.flag[queryId]['queryId'],
114118
postDeleteRetweetRequest: {
115-
queryId: queryId,
119+
queryId: this.flag[queryId]['queryId'],
116120
variables: { ...variables, ...args },
117121
},
118122
});
@@ -131,10 +135,11 @@ export class PostApiUtils {
131135
...param.extraParam,
132136
};
133137
const queryId = 'FavoriteTweet';
134-
const variables = i.PostDeleteTweetRequestVariablesFromJSON(this.flag[queryId]['variables']);
138+
const variables = i.PostCreateRetweetRequestVariablesFromJSON(this.flag[queryId]['variables']);
135139
const response = await this.api.postFavoriteTweetRaw({
140+
pathQueryId: this.flag[queryId]['queryId'],
136141
postFavoriteTweetRequest: {
137-
queryId: queryId,
142+
queryId: this.flag[queryId]['queryId'],
138143
variables: { ...variables, ...args },
139144
},
140145
});
@@ -153,10 +158,11 @@ export class PostApiUtils {
153158
...param.extraParam,
154159
};
155160
const queryId = 'UnfavoriteTweet';
156-
const variables = i.PostDeleteTweetRequestVariablesFromJSON(this.flag[queryId]['variables']);
161+
const variables = i.PostCreateRetweetRequestVariablesFromJSON(this.flag[queryId]['variables']);
157162
const response = await this.api.postUnfavoriteTweetRaw({
163+
pathQueryId: this.flag[queryId]['queryId'],
158164
postUnfavoriteTweetRequest: {
159-
queryId: queryId,
165+
queryId: this.flag[queryId]['queryId'],
160166
variables: { ...variables, ...args },
161167
},
162168
});

twitter-openapi-typescript/src/apis/tweetApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export class TweetApiUtils {
7474
async request<T>(param: RequestParam<i.InstructionUnion[], T>): Promise<TweetListApiUtilsResponse> {
7575
const apiFn: typeof param.apiFn = param.apiFn.bind(this.api);
7676
const response = await apiFn({
77+
pathQueryId: this.flag[param.key]['queryId'],
7778
queryId: this.flag[param.key]['queryId'],
7879
variables: JSON.stringify({ ...this.flag[param.key]['variables'], ...param.param }),
7980
features: JSON.stringify(this.flag[param.key]['features']),

twitter-openapi-typescript/src/apis/userApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export class UserApiUtils {
1919
async request<T>(param: RequestParam<i.UserResults, T>): Promise<UserApiUtilsResponse> {
2020
const apiFn: typeof param.apiFn = param.apiFn.bind(this.api);
2121
const response = await apiFn({
22+
pathQueryId: this.flag[param.key]['queryId'],
2223
queryId: this.flag[param.key]['queryId'],
2324
variables: JSON.stringify({ ...this.flag[param.key]['variables'], ...param.param }),
2425
features: JSON.stringify(this.flag[param.key]['features']),

twitter-openapi-typescript/src/apis/userListApi.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class UserListApiUtils {
2828
async request<T>(param: RequestParam<i.InstructionUnion[], T>): Promise<UserListApiUtilsResponse> {
2929
const apiFn: typeof param.apiFn = param.apiFn.bind(this.api);
3030
const response = await apiFn({
31+
pathQueryId: this.flag[param.key]['queryId'],
3132
queryId: this.flag[param.key]['queryId'],
3233
variables: JSON.stringify({ ...this.flag[param.key]['variables'], ...param.param }),
3334
features: JSON.stringify(this.flag[param.key]['features']),

twitter-openapi-typescript/src/models/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as i from 'twitter-openapi-typescript-generated';
22

33
export type ApiFunction<T> = (requestParameters: {
4+
pathQueryId: string;
45
queryId: string;
56
variables: string;
67
features: string;

twitter-openapi-typescript/test/raw/tweet_api.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { getClient, logger } from '@test/init';
33
test('getHomeTimelineRaw', async () => {
44
const client = await getClient();
55
const response = await client.getTweetApi().api.getHomeTimelineRaw({
6+
pathQueryId: client.flag.HomeTimeline.pathQueryId,
67
queryId: client.flag.HomeTimeline.queryId,
78
variables: JSON.stringify(client.flag.HomeTimeline.variables),
89
features: JSON.stringify(client.flag.HomeTimeline.features),

0 commit comments

Comments
 (0)