aint-sdk 0.1.0-alpha.2 → 0.1.0-alpha.3
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 +8 -0
- package/README.md +31 -0
- package/client.d.mts +9 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +9 -0
- package/client.d.ts.map +1 -1
- package/client.js +11 -0
- package/client.js.map +1 -1
- package/client.mjs +11 -0
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +56 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +56 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +102 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +96 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/package.json +11 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/projects.d.mts +220 -0
- package/resources/projects.d.mts.map +1 -0
- package/resources/projects.d.ts +220 -0
- package/resources/projects.d.ts.map +1 -0
- package/resources/projects.js +73 -0
- package/resources/projects.js.map +1 -0
- package/resources/projects.mjs +69 -0
- package/resources/projects.mjs.map +1 -0
- package/src/client.ts +52 -0
- package/src/core/pagination.ts +166 -0
- package/src/index.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/index.ts +9 -0
- package/src/resources/projects.ts +289 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { PageNumberPagination, type PageNumberPaginationParams, PagePromise } from '../core/pagination';
|
|
6
|
+
import { buildHeaders } from '../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../internal/request-options';
|
|
8
|
+
import { path } from '../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class Projects extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Creates a new project
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const project = await client.projects.create();
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
create(body: ProjectCreateParams, options?: RequestOptions): APIPromise<Project> {
|
|
20
|
+
return this._client.post('/projects', { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Updates an existing project
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const project = await client.projects.update('id');
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
update(id: string, body: ProjectUpdateParams, options?: RequestOptions): APIPromise<Project> {
|
|
32
|
+
return this._client.patch(path`/projects/${id}`, { body, ...options });
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Returns a paginated list of the user's projects
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* // Automatically fetches more pages as needed.
|
|
41
|
+
* for await (const project of client.projects.list()) {
|
|
42
|
+
* // ...
|
|
43
|
+
* }
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
list(
|
|
47
|
+
query: ProjectListParams | null | undefined = {},
|
|
48
|
+
options?: RequestOptions,
|
|
49
|
+
): PagePromise<ProjectsPageNumberPagination, Project> {
|
|
50
|
+
return this._client.getAPIList('/projects', PageNumberPagination<Project>, { query, ...options });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Deletes a project (soft delete)
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* await client.projects.delete('id');
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
delete(id: string, options?: RequestOptions): APIPromise<void> {
|
|
62
|
+
return this._client.delete(path`/projects/${id}`, {
|
|
63
|
+
...options,
|
|
64
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Returns a single project by ID
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const project = await client.projects.get('id');
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
get(id: string, options?: RequestOptions): APIPromise<Project> {
|
|
77
|
+
return this._client.get(path`/projects/${id}`, options);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type ProjectsPageNumberPagination = PageNumberPagination<Project>;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* A translation project
|
|
85
|
+
*/
|
|
86
|
+
export interface Project {
|
|
87
|
+
/**
|
|
88
|
+
* Unique project identifier
|
|
89
|
+
*/
|
|
90
|
+
id: string;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Project name
|
|
94
|
+
*/
|
|
95
|
+
name: string;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Number of translation batches
|
|
99
|
+
*/
|
|
100
|
+
batch_count?: number | null;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Number of chapters in the project
|
|
104
|
+
*/
|
|
105
|
+
chapter_count?: number | null;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Project creation timestamp
|
|
109
|
+
*/
|
|
110
|
+
created_at?: string | null;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Custom translation instructions
|
|
114
|
+
*/
|
|
115
|
+
custom_instructions?: string | null;
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Project description
|
|
119
|
+
*/
|
|
120
|
+
description?: string | null;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Last update timestamp
|
|
124
|
+
*/
|
|
125
|
+
last_updated_at?: string | null;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Name of the last updated chapter
|
|
129
|
+
*/
|
|
130
|
+
last_updated_chapter_name?: string | null;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Source language for translation
|
|
134
|
+
*/
|
|
135
|
+
original_language?: string | null;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* JSON string of section break positions for latest file uploaded for batch
|
|
139
|
+
* translation
|
|
140
|
+
*/
|
|
141
|
+
section_breaks?: string | null;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* Target language for translation
|
|
145
|
+
*/
|
|
146
|
+
translated_language?: string | null;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Latest filename of uploaded content for batch translation
|
|
150
|
+
*/
|
|
151
|
+
uploaded_filename?: string | null;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Length of latest file uploaded for batch translation in characters
|
|
155
|
+
*/
|
|
156
|
+
uploaded_length?: number | null;
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* UUID of latest file uploaded for batch translation
|
|
160
|
+
*/
|
|
161
|
+
uploaded_uuid?: string | null;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Paginated list of projects
|
|
166
|
+
*/
|
|
167
|
+
export interface ProjectListResponse {
|
|
168
|
+
/**
|
|
169
|
+
* List of projects
|
|
170
|
+
*/
|
|
171
|
+
data: Array<Project>;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Current page number
|
|
175
|
+
*/
|
|
176
|
+
page: number;
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Number of items per page
|
|
180
|
+
*/
|
|
181
|
+
page_size: number;
|
|
182
|
+
|
|
183
|
+
/**
|
|
184
|
+
* Total number of projects
|
|
185
|
+
*/
|
|
186
|
+
total: number;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Total number of pages
|
|
190
|
+
*/
|
|
191
|
+
total_pages: number;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface ProjectCreateParams {
|
|
195
|
+
/**
|
|
196
|
+
* Custom translation instructions
|
|
197
|
+
*/
|
|
198
|
+
custom_instructions?: string | null;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Project description
|
|
202
|
+
*/
|
|
203
|
+
description?: string | null;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Project name (defaults to 'My Project')
|
|
207
|
+
*/
|
|
208
|
+
name?: string;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Source language (defaults to 'Korean')
|
|
212
|
+
*/
|
|
213
|
+
original_language?: string | null;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Target language (defaults to 'English')
|
|
217
|
+
*/
|
|
218
|
+
translated_language?: string | null;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export interface ProjectUpdateParams {
|
|
222
|
+
/**
|
|
223
|
+
* Custom translation instructions
|
|
224
|
+
*/
|
|
225
|
+
custom_instructions?: string | null;
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Project description
|
|
229
|
+
*/
|
|
230
|
+
description?: string | null;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Project name
|
|
234
|
+
*/
|
|
235
|
+
name?: string;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Source language
|
|
239
|
+
*/
|
|
240
|
+
original_language?: string | null;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* JSON string of section break positions for batch translation
|
|
244
|
+
*/
|
|
245
|
+
section_breaks?: string | null;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Target language
|
|
249
|
+
*/
|
|
250
|
+
translated_language?: string | null;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
export interface ProjectListParams extends PageNumberPaginationParams {
|
|
254
|
+
/**
|
|
255
|
+
* Filter by original language
|
|
256
|
+
*/
|
|
257
|
+
original_language?: string;
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* Search query for project name
|
|
261
|
+
*/
|
|
262
|
+
query?: string;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Sort direction
|
|
266
|
+
*/
|
|
267
|
+
sort_direction?: 'asc' | 'desc';
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Field to sort by
|
|
271
|
+
*/
|
|
272
|
+
sort_field?: 'last_updated_at' | 'created_at' | 'name';
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Filter by translated language
|
|
276
|
+
*/
|
|
277
|
+
translated_language?: string;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
export declare namespace Projects {
|
|
281
|
+
export {
|
|
282
|
+
type Project as Project,
|
|
283
|
+
type ProjectListResponse as ProjectListResponse,
|
|
284
|
+
type ProjectsPageNumberPagination as ProjectsPageNumberPagination,
|
|
285
|
+
type ProjectCreateParams as ProjectCreateParams,
|
|
286
|
+
type ProjectUpdateParams as ProjectUpdateParams,
|
|
287
|
+
type ProjectListParams as ProjectListParams,
|
|
288
|
+
};
|
|
289
|
+
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.3'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.3";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.0-alpha.
|
|
1
|
+
export declare const VERSION = "0.1.0-alpha.3";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.VERSION = void 0;
|
|
4
|
-
exports.VERSION = '0.1.0-alpha.
|
|
4
|
+
exports.VERSION = '0.1.0-alpha.3'; // x-release-please-version
|
|
5
5
|
//# sourceMappingURL=version.js.map
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.1.0-alpha.
|
|
1
|
+
export const VERSION = '0.1.0-alpha.3'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|