@growi/sdk-typescript 1.0.0-RC.0
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/CHANGELOG.md +11 -0
- package/LICENSE +21 -0
- package/README.md +210 -0
- package/README_JP.md +211 -0
- package/dist/apiv1/index.d.ts +22 -0
- package/dist/apiv1/index.d.ts.map +1 -0
- package/dist/apiv1/index.js +3 -0
- package/dist/apiv1/index.js.map +1 -0
- package/dist/apiv3/index.d.ts +245 -0
- package/dist/apiv3/index.d.ts.map +1 -0
- package/dist/apiv3/index.js +3 -0
- package/dist/apiv3/index.js.map +1 -0
- package/dist/generated/v1/index.d.ts +47 -0
- package/dist/generated/v1/index.d.ts.map +1 -0
- package/dist/generated/v1/index.js +131 -0
- package/dist/generated/v1/index.js.map +1 -0
- package/dist/generated/v1/index.schemas.d.ts +491 -0
- package/dist/generated/v1/index.schemas.d.ts.map +1 -0
- package/dist/generated/v1/index.schemas.js +12 -0
- package/dist/generated/v1/index.schemas.js.map +1 -0
- package/dist/generated/v3/index.d.ts +493 -0
- package/dist/generated/v3/index.d.ts.map +1 -0
- package/dist/generated/v3/index.js +1981 -0
- package/dist/generated/v3/index.js.map +1 -0
- package/dist/generated/v3/index.schemas.d.ts +3548 -0
- package/dist/generated/v3/index.schemas.d.ts.map +1 -0
- package/dist/generated/v3/index.schemas.js +30 -0
- package/dist/generated/v3/index.schemas.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/axios-instance.d.ts +5 -0
- package/dist/utils/axios-instance.d.ts.map +1 -0
- package/dist/utils/axios-instance.js +19 -0
- package/dist/utils/axios-instance.js.map +1 -0
- package/package.json +53 -0
- package/src/apiv1/index.ts +7 -0
- package/src/apiv3/index.ts +7 -0
- package/src/generated/v1/index.schemas.ts +554 -0
- package/src/generated/v1/index.ts +231 -0
- package/src/generated/v3/index.schemas.ts +3891 -0
- package/src/generated/v3/index.ts +3362 -0
- package/src/index.ts +8 -0
- package/src/utils/axios-instance.ts +23 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval v7.9.0 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* GROWI REST API v1
|
|
5
|
+
* OpenAPI spec version: 7.2.6-RC.0
|
|
6
|
+
*/
|
|
7
|
+
import type {
|
|
8
|
+
AddComment200,
|
|
9
|
+
AddCommentBody,
|
|
10
|
+
GetComments200,
|
|
11
|
+
GetCommentsParams,
|
|
12
|
+
GetPageTag200,
|
|
13
|
+
GetPageTagParams,
|
|
14
|
+
GetUpdatePostPage200,
|
|
15
|
+
GetUpdatePostPageParams,
|
|
16
|
+
ListTags200,
|
|
17
|
+
ListTagsParams,
|
|
18
|
+
PostLogin200,
|
|
19
|
+
PostLoginBody,
|
|
20
|
+
PostRegister200,
|
|
21
|
+
PostRegisterBody,
|
|
22
|
+
RemoveAttachment200,
|
|
23
|
+
RemoveAttachmentBody,
|
|
24
|
+
RemoveComment200,
|
|
25
|
+
RemoveCommentBody,
|
|
26
|
+
RemoveProfileImage200,
|
|
27
|
+
RemoveProfileImageBody,
|
|
28
|
+
SearchPages200,
|
|
29
|
+
SearchPagesParams,
|
|
30
|
+
SearchTags200,
|
|
31
|
+
SearchTagsParams,
|
|
32
|
+
UpdateComment200,
|
|
33
|
+
UpdateCommentBody,
|
|
34
|
+
UpdateTag200,
|
|
35
|
+
UpdateTagBody,
|
|
36
|
+
UploadProfileImage200,
|
|
37
|
+
UploadProfileImageBodyOne,
|
|
38
|
+
UploadProfileImageBodyTwo,
|
|
39
|
+
} from './index.schemas.js';
|
|
40
|
+
|
|
41
|
+
import { customInstance } from '../../utils/axios-instance.js';
|
|
42
|
+
|
|
43
|
+
type SecondParameter<T extends (...args: never) => unknown> = Parameters<T>[1];
|
|
44
|
+
|
|
45
|
+
export const getGrowirestapiv1 = () => {
|
|
46
|
+
/**
|
|
47
|
+
* Get comments of the page of the revision
|
|
48
|
+
* @summary /comments.get
|
|
49
|
+
*/
|
|
50
|
+
const getComments = (params?: GetCommentsParams, options?: SecondParameter<typeof customInstance>) => {
|
|
51
|
+
return customInstance<GetComments200>({ url: `/comments.get`, method: 'GET', params }, options);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Post comment for the page
|
|
56
|
+
* @summary /comments.add
|
|
57
|
+
*/
|
|
58
|
+
const addComment = (addCommentBody: AddCommentBody, options?: SecondParameter<typeof customInstance>) => {
|
|
59
|
+
return customInstance<AddComment200>(
|
|
60
|
+
{ url: `/comments.add`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: addCommentBody },
|
|
61
|
+
options,
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Update comment dody
|
|
67
|
+
* @summary /comments.update
|
|
68
|
+
*/
|
|
69
|
+
const updateComment = (updateCommentBody: UpdateCommentBody, options?: SecondParameter<typeof customInstance>) => {
|
|
70
|
+
return customInstance<UpdateComment200>(
|
|
71
|
+
{ url: `/comments.update`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: updateCommentBody },
|
|
72
|
+
options,
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Remove specified comment
|
|
78
|
+
* @summary /comments.remove
|
|
79
|
+
*/
|
|
80
|
+
const removeComment = (removeCommentBody: RemoveCommentBody, options?: SecondParameter<typeof customInstance>) => {
|
|
81
|
+
return customInstance<RemoveComment200>(
|
|
82
|
+
{ url: `/comments.remove`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: removeCommentBody },
|
|
83
|
+
options,
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* @summary /login
|
|
89
|
+
*/
|
|
90
|
+
const postLogin = (postLoginBody: PostLoginBody, options?: SecondParameter<typeof customInstance>) => {
|
|
91
|
+
return customInstance<PostLogin200>({ url: `/login`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: postLoginBody }, options);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @summary /register
|
|
96
|
+
*/
|
|
97
|
+
const postRegister = (postRegisterBody: PostRegisterBody, options?: SecondParameter<typeof customInstance>) => {
|
|
98
|
+
return customInstance<PostRegister200>(
|
|
99
|
+
{ url: `/register`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: postRegisterBody },
|
|
100
|
+
options,
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Get page tag
|
|
106
|
+
* @summary /pages.getPageTag
|
|
107
|
+
*/
|
|
108
|
+
const getPageTag = (params?: GetPageTagParams, options?: SecondParameter<typeof customInstance>) => {
|
|
109
|
+
return customInstance<GetPageTag200>({ url: `/pages.getPageTag`, method: 'GET', params }, options);
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Get UpdatePost setting list
|
|
114
|
+
* @summary /pages.updatePost
|
|
115
|
+
*/
|
|
116
|
+
const getUpdatePostPage = (params?: GetUpdatePostPageParams, options?: SecondParameter<typeof customInstance>) => {
|
|
117
|
+
return customInstance<GetUpdatePostPage200>({ url: `/pages.updatePost`, method: 'GET', params }, options);
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Search pages
|
|
122
|
+
* @summary /search
|
|
123
|
+
*/
|
|
124
|
+
const searchPages = (params: SearchPagesParams, options?: SecondParameter<typeof customInstance>) => {
|
|
125
|
+
return customInstance<SearchPages200>({ url: `/search`, method: 'GET', params }, options);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* Search tags
|
|
130
|
+
* @summary /tags.search
|
|
131
|
+
*/
|
|
132
|
+
const searchTags = (params?: SearchTagsParams, options?: SecondParameter<typeof customInstance>) => {
|
|
133
|
+
return customInstance<SearchTags200>({ url: `/tags.search`, method: 'GET', params }, options);
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Update tag
|
|
138
|
+
* @summary /tags.update
|
|
139
|
+
*/
|
|
140
|
+
const updateTag = (updateTagBody: UpdateTagBody, options?: SecondParameter<typeof customInstance>) => {
|
|
141
|
+
return customInstance<UpdateTag200>({ url: `/tags.update`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: updateTagBody }, options);
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Get tags
|
|
146
|
+
* @summary /tags.list
|
|
147
|
+
*/
|
|
148
|
+
const listTags = (params?: ListTagsParams, options?: SecondParameter<typeof customInstance>) => {
|
|
149
|
+
return customInstance<ListTags200>({ url: `/tags.list`, method: 'GET', params }, options);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* @summary /user-activation/{token}
|
|
154
|
+
*/
|
|
155
|
+
const getUserActivationToken = (token: string, options?: SecondParameter<typeof customInstance>) => {
|
|
156
|
+
return customInstance<string>({ url: `/user-activation/${token}`, method: 'GET' }, options);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* Upload profile image
|
|
161
|
+
* @summary /attachments.uploadProfileImage
|
|
162
|
+
*/
|
|
163
|
+
const uploadProfileImage = (
|
|
164
|
+
uploadProfileImageBody: UploadProfileImageBodyOne | UploadProfileImageBodyTwo,
|
|
165
|
+
options?: SecondParameter<typeof customInstance>,
|
|
166
|
+
) => {
|
|
167
|
+
return customInstance<UploadProfileImage200>({ url: `/attachments.uploadProfileImage`, method: 'POST', data: uploadProfileImageBody }, options);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Remove attachment
|
|
172
|
+
* @summary /attachments.remove
|
|
173
|
+
*/
|
|
174
|
+
const removeAttachment = (removeAttachmentBody: RemoveAttachmentBody, options?: SecondParameter<typeof customInstance>) => {
|
|
175
|
+
return customInstance<RemoveAttachment200>(
|
|
176
|
+
{ url: `/attachments.remove`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: removeAttachmentBody },
|
|
177
|
+
options,
|
|
178
|
+
);
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* Remove profile image
|
|
183
|
+
* @summary /attachments.removeProfileImage
|
|
184
|
+
*/
|
|
185
|
+
const removeProfileImage = (removeProfileImageBody: RemoveProfileImageBody, options?: SecondParameter<typeof customInstance>) => {
|
|
186
|
+
return customInstance<RemoveProfileImage200>(
|
|
187
|
+
{ url: `/attachments.removeProfileImage`, method: 'POST', headers: { 'Content-Type': 'application/json' }, data: removeProfileImageBody },
|
|
188
|
+
options,
|
|
189
|
+
);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
return {
|
|
193
|
+
getComments,
|
|
194
|
+
addComment,
|
|
195
|
+
updateComment,
|
|
196
|
+
removeComment,
|
|
197
|
+
postLogin,
|
|
198
|
+
postRegister,
|
|
199
|
+
getPageTag,
|
|
200
|
+
getUpdatePostPage,
|
|
201
|
+
searchPages,
|
|
202
|
+
searchTags,
|
|
203
|
+
updateTag,
|
|
204
|
+
listTags,
|
|
205
|
+
getUserActivationToken,
|
|
206
|
+
uploadProfileImage,
|
|
207
|
+
removeAttachment,
|
|
208
|
+
removeProfileImage,
|
|
209
|
+
};
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
type AwaitedInput<T> = PromiseLike<T> | T;
|
|
213
|
+
|
|
214
|
+
type Awaited<O> = O extends AwaitedInput<infer T> ? T : never;
|
|
215
|
+
|
|
216
|
+
export type GetCommentsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['getComments']>>>;
|
|
217
|
+
export type AddCommentResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['addComment']>>>;
|
|
218
|
+
export type UpdateCommentResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['updateComment']>>>;
|
|
219
|
+
export type RemoveCommentResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['removeComment']>>>;
|
|
220
|
+
export type PostLoginResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['postLogin']>>>;
|
|
221
|
+
export type PostRegisterResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['postRegister']>>>;
|
|
222
|
+
export type GetPageTagResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['getPageTag']>>>;
|
|
223
|
+
export type GetUpdatePostPageResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['getUpdatePostPage']>>>;
|
|
224
|
+
export type SearchPagesResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['searchPages']>>>;
|
|
225
|
+
export type SearchTagsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['searchTags']>>>;
|
|
226
|
+
export type UpdateTagResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['updateTag']>>>;
|
|
227
|
+
export type ListTagsResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['listTags']>>>;
|
|
228
|
+
export type GetUserActivationTokenResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['getUserActivationToken']>>>;
|
|
229
|
+
export type UploadProfileImageResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['uploadProfileImage']>>>;
|
|
230
|
+
export type RemoveAttachmentResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['removeAttachment']>>>;
|
|
231
|
+
export type RemoveProfileImageResult = NonNullable<Awaited<ReturnType<ReturnType<typeof getGrowirestapiv1>['removeProfileImage']>>>;
|