aint-sdk 0.1.0-alpha.2 → 0.1.0-alpha.4

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.
Files changed (71) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +31 -0
  3. package/client.d.mts +12 -0
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +12 -0
  6. package/client.d.ts.map +1 -1
  7. package/client.js +14 -0
  8. package/client.js.map +1 -1
  9. package/client.mjs +14 -0
  10. package/client.mjs.map +1 -1
  11. package/core/pagination.d.mts +56 -0
  12. package/core/pagination.d.mts.map +1 -0
  13. package/core/pagination.d.ts +56 -0
  14. package/core/pagination.d.ts.map +1 -0
  15. package/core/pagination.js +102 -0
  16. package/core/pagination.js.map +1 -0
  17. package/core/pagination.mjs +96 -0
  18. package/core/pagination.mjs.map +1 -0
  19. package/index.d.mts +1 -0
  20. package/index.d.mts.map +1 -1
  21. package/index.d.ts +1 -0
  22. package/index.d.ts.map +1 -1
  23. package/index.js +3 -1
  24. package/index.js.map +1 -1
  25. package/index.mjs +1 -0
  26. package/index.mjs.map +1 -1
  27. package/package.json +11 -1
  28. package/pagination.d.mts +2 -0
  29. package/pagination.d.mts.map +1 -0
  30. package/pagination.d.ts +2 -0
  31. package/pagination.d.ts.map +1 -0
  32. package/pagination.js +6 -0
  33. package/pagination.js.map +1 -0
  34. package/pagination.mjs +2 -0
  35. package/pagination.mjs.map +1 -0
  36. package/resources/chapters.d.mts +232 -0
  37. package/resources/chapters.d.mts.map +1 -0
  38. package/resources/chapters.d.ts +232 -0
  39. package/resources/chapters.d.ts.map +1 -0
  40. package/resources/chapters.js +78 -0
  41. package/resources/chapters.js.map +1 -0
  42. package/resources/chapters.mjs +74 -0
  43. package/resources/chapters.mjs.map +1 -0
  44. package/resources/index.d.mts +2 -0
  45. package/resources/index.d.mts.map +1 -1
  46. package/resources/index.d.ts +2 -0
  47. package/resources/index.d.ts.map +1 -1
  48. package/resources/index.js +5 -1
  49. package/resources/index.js.map +1 -1
  50. package/resources/index.mjs +2 -0
  51. package/resources/index.mjs.map +1 -1
  52. package/resources/projects.d.mts +220 -0
  53. package/resources/projects.d.mts.map +1 -0
  54. package/resources/projects.d.ts +220 -0
  55. package/resources/projects.d.ts.map +1 -0
  56. package/resources/projects.js +73 -0
  57. package/resources/projects.js.map +1 -0
  58. package/resources/projects.mjs +69 -0
  59. package/resources/projects.mjs.map +1 -0
  60. package/src/client.ts +75 -0
  61. package/src/core/pagination.ts +166 -0
  62. package/src/index.ts +1 -0
  63. package/src/pagination.ts +2 -0
  64. package/src/resources/chapters.ts +301 -0
  65. package/src/resources/index.ts +19 -0
  66. package/src/resources/projects.ts +289 -0
  67. package/src/version.ts +1 -1
  68. package/version.d.mts +1 -1
  69. package/version.d.ts +1 -1
  70. package/version.js +1 -1
  71. package/version.mjs +1 -1
@@ -0,0 +1,232 @@
1
+ import { APIResource } from "../core/resource.js";
2
+ import { APIPromise } from "../core/api-promise.js";
3
+ import { PageNumberPagination, type PageNumberPaginationParams, PagePromise } from "../core/pagination.js";
4
+ import { RequestOptions } from "../internal/request-options.js";
5
+ export declare class Chapters extends APIResource {
6
+ /**
7
+ * Creates a new chapter in a project
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const chapter = await client.chapters.create({
12
+ * project_id: 'prj_xyz789',
13
+ * title: 'Chapter 1 - The Beginning',
14
+ * });
15
+ * ```
16
+ */
17
+ create(body: ChapterCreateParams, options?: RequestOptions): APIPromise<Chapter>;
18
+ /**
19
+ * Updates an existing chapter
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const chapter = await client.chapters.update('id');
24
+ * ```
25
+ */
26
+ update(id: string, body: ChapterUpdateParams, options?: RequestOptions): APIPromise<Chapter>;
27
+ /**
28
+ * Returns a paginated list of chapters for a project
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * // Automatically fetches more pages as needed.
33
+ * for await (const chapterListItem of client.chapters.list({
34
+ * project_id: 'project_id',
35
+ * })) {
36
+ * // ...
37
+ * }
38
+ * ```
39
+ */
40
+ list(query: ChapterListParams, options?: RequestOptions): PagePromise<ChapterListItemsPageNumberPagination, ChapterListItem>;
41
+ /**
42
+ * Deletes a chapter (soft delete)
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * await client.chapters.delete('id');
47
+ * ```
48
+ */
49
+ delete(id: string, options?: RequestOptions): APIPromise<void>;
50
+ /**
51
+ * Returns a single chapter by ID, including full text content and cost breakdown
52
+ *
53
+ * @example
54
+ * ```ts
55
+ * const chapter = await client.chapters.get('id');
56
+ * ```
57
+ */
58
+ get(id: string, options?: RequestOptions): APIPromise<Chapter>;
59
+ }
60
+ export type ChapterListItemsPageNumberPagination = PageNumberPagination<ChapterListItem>;
61
+ /**
62
+ * A chapter with full content and cost breakdown
63
+ */
64
+ export interface Chapter {
65
+ /**
66
+ * Unique chapter identifier
67
+ */
68
+ id: string;
69
+ /**
70
+ * Parent project identifier
71
+ */
72
+ project_id: string;
73
+ /**
74
+ * Chapter title
75
+ */
76
+ title: string;
77
+ /**
78
+ * Cost breakdown for the translation
79
+ */
80
+ cost?: Chapter.Cost | null;
81
+ /**
82
+ * Chapter creation timestamp
83
+ */
84
+ created_at?: string | null;
85
+ /**
86
+ * Timestamp of most recent translation edit
87
+ */
88
+ last_edited_at?: string | null;
89
+ /**
90
+ * Source language of the most recent translation
91
+ */
92
+ original_language?: string | null;
93
+ /**
94
+ * Original source text
95
+ */
96
+ original_text?: string | null;
97
+ /**
98
+ * AI-generated summary of the chapter content
99
+ */
100
+ summary_text?: string | null;
101
+ /**
102
+ * Target language of the most recent translation
103
+ */
104
+ translated_language?: string | null;
105
+ /**
106
+ * Translated text
107
+ */
108
+ translated_text?: string | null;
109
+ }
110
+ export declare namespace Chapter {
111
+ /**
112
+ * Cost breakdown for the translation
113
+ */
114
+ interface Cost {
115
+ /**
116
+ * AI edit cost
117
+ */
118
+ edit?: number | null;
119
+ /**
120
+ * AI glossary generation cost
121
+ */
122
+ glossary?: number | null;
123
+ /**
124
+ * Summary generation cost
125
+ */
126
+ summary?: number | null;
127
+ /**
128
+ * Total cost (sum of all costs)
129
+ */
130
+ total?: number | null;
131
+ /**
132
+ * Translation cost
133
+ */
134
+ translation?: number | null;
135
+ }
136
+ }
137
+ /**
138
+ * A chapter summary for list responses
139
+ */
140
+ export interface ChapterListItem {
141
+ /**
142
+ * Unique chapter identifier
143
+ */
144
+ id: string;
145
+ /**
146
+ * Parent project identifier
147
+ */
148
+ project_id: string;
149
+ /**
150
+ * Chapter title
151
+ */
152
+ title: string;
153
+ /**
154
+ * Chapter creation timestamp
155
+ */
156
+ created_at?: string | null;
157
+ /**
158
+ * Timestamp of most recent translation edit
159
+ */
160
+ last_edited_at?: string | null;
161
+ /**
162
+ * Source language of the most recent translation
163
+ */
164
+ original_language?: string | null;
165
+ /**
166
+ * AI-generated summary of the chapter content
167
+ */
168
+ summary_text?: string | null;
169
+ /**
170
+ * Target language of the most recent translation
171
+ */
172
+ translated_language?: string | null;
173
+ }
174
+ /**
175
+ * Paginated list of chapters
176
+ */
177
+ export interface ChapterListResponse {
178
+ /**
179
+ * List of chapters
180
+ */
181
+ data: Array<ChapterListItem>;
182
+ /**
183
+ * Current page number
184
+ */
185
+ page: number;
186
+ /**
187
+ * Number of items per page
188
+ */
189
+ page_size: number;
190
+ /**
191
+ * Total number of chapters
192
+ */
193
+ total: number;
194
+ /**
195
+ * Total number of pages
196
+ */
197
+ total_pages: number;
198
+ }
199
+ export interface ChapterCreateParams {
200
+ /**
201
+ * Parent project ID
202
+ */
203
+ project_id: string;
204
+ /**
205
+ * Chapter title
206
+ */
207
+ title: string;
208
+ }
209
+ export interface ChapterUpdateParams {
210
+ /**
211
+ * Chapter title
212
+ */
213
+ title?: string;
214
+ }
215
+ export interface ChapterListParams extends PageNumberPaginationParams {
216
+ /**
217
+ * Project ID to filter chapters by
218
+ */
219
+ project_id: string;
220
+ /**
221
+ * Sort direction
222
+ */
223
+ sort_direction?: 'asc' | 'desc';
224
+ /**
225
+ * Field to sort by
226
+ */
227
+ sort_field?: 'title' | 'created_at' | 'last_edited_at';
228
+ }
229
+ export declare namespace Chapters {
230
+ export { type Chapter as Chapter, type ChapterListItem as ChapterListItem, type ChapterListResponse as ChapterListResponse, type ChapterListItemsPageNumberPagination as ChapterListItemsPageNumberPagination, type ChapterCreateParams as ChapterCreateParams, type ChapterUpdateParams as ChapterUpdateParams, type ChapterListParams as ChapterListParams, };
231
+ }
232
+ //# sourceMappingURL=chapters.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chapters.d.ts","sourceRoot":"","sources":["../src/resources/chapters.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,WAAW,EAAE;OAEtE,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAIhF;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAI5F;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAK,EAAE,iBAAiB,EACxB,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,oCAAoC,EAAE,eAAe,CAAC;IAIrE;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAO9D;;;;;;;OAOG;IACH,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;CAG/D;AAED,MAAM,MAAM,oCA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AAmB,IAAI,mBAAmB,EAC/C,KAAK,mBAAmB,IAAI,mBAAmB,EAC/C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Chapters = void 0;
5
+ const resource_1 = require("../core/resource.js");
6
+ const pagination_1 = require("../core/pagination.js");
7
+ const headers_1 = require("../internal/headers.js");
8
+ const path_1 = require("../internal/utils/path.js");
9
+ class Chapters extends resource_1.APIResource {
10
+ /**
11
+ * Creates a new chapter in a project
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const chapter = await client.chapters.create({
16
+ * project_id: 'prj_xyz789',
17
+ * title: 'Chapter 1 - The Beginning',
18
+ * });
19
+ * ```
20
+ */
21
+ create(body, options) {
22
+ return this._client.post('/chapters', { body, ...options });
23
+ }
24
+ /**
25
+ * Updates an existing chapter
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const chapter = await client.chapters.update('id');
30
+ * ```
31
+ */
32
+ update(id, body, options) {
33
+ return this._client.patch((0, path_1.path) `/chapters/${id}`, { body, ...options });
34
+ }
35
+ /**
36
+ * Returns a paginated list of chapters for a project
37
+ *
38
+ * @example
39
+ * ```ts
40
+ * // Automatically fetches more pages as needed.
41
+ * for await (const chapterListItem of client.chapters.list({
42
+ * project_id: 'project_id',
43
+ * })) {
44
+ * // ...
45
+ * }
46
+ * ```
47
+ */
48
+ list(query, options) {
49
+ return this._client.getAPIList('/chapters', (pagination_1.PageNumberPagination), { query, ...options });
50
+ }
51
+ /**
52
+ * Deletes a chapter (soft delete)
53
+ *
54
+ * @example
55
+ * ```ts
56
+ * await client.chapters.delete('id');
57
+ * ```
58
+ */
59
+ delete(id, options) {
60
+ return this._client.delete((0, path_1.path) `/chapters/${id}`, {
61
+ ...options,
62
+ headers: (0, headers_1.buildHeaders)([{ Accept: '*/*' }, options?.headers]),
63
+ });
64
+ }
65
+ /**
66
+ * Returns a single chapter by ID, including full text content and cost breakdown
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * const chapter = await client.chapters.get('id');
71
+ * ```
72
+ */
73
+ get(id, options) {
74
+ return this._client.get((0, path_1.path) `/chapters/${id}`, options);
75
+ }
76
+ }
77
+ exports.Chapters = Chapters;
78
+ //# sourceMappingURL=chapters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chapters.js","sourceRoot":"","sources":["../src/resources/chapters.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAwG;AACxG,oDAAmD;AAEnD,oDAA8C;AAE9C,MAAa,QAAS,SAAQ,sBAAW;IACvC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,IAAyB,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAwB,EACxB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,iCAAqC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,EAAE,EAAE;YAChD,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,EAAU,EAAE,OAAwB;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF;AA1ED,4BA0EC"}
@@ -0,0 +1,74 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ import { APIResource } from "../core/resource.mjs";
3
+ import { PageNumberPagination } from "../core/pagination.mjs";
4
+ import { buildHeaders } from "../internal/headers.mjs";
5
+ import { path } from "../internal/utils/path.mjs";
6
+ export class Chapters extends APIResource {
7
+ /**
8
+ * Creates a new chapter in a project
9
+ *
10
+ * @example
11
+ * ```ts
12
+ * const chapter = await client.chapters.create({
13
+ * project_id: 'prj_xyz789',
14
+ * title: 'Chapter 1 - The Beginning',
15
+ * });
16
+ * ```
17
+ */
18
+ create(body, options) {
19
+ return this._client.post('/chapters', { body, ...options });
20
+ }
21
+ /**
22
+ * Updates an existing chapter
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * const chapter = await client.chapters.update('id');
27
+ * ```
28
+ */
29
+ update(id, body, options) {
30
+ return this._client.patch(path `/chapters/${id}`, { body, ...options });
31
+ }
32
+ /**
33
+ * Returns a paginated list of chapters for a project
34
+ *
35
+ * @example
36
+ * ```ts
37
+ * // Automatically fetches more pages as needed.
38
+ * for await (const chapterListItem of client.chapters.list({
39
+ * project_id: 'project_id',
40
+ * })) {
41
+ * // ...
42
+ * }
43
+ * ```
44
+ */
45
+ list(query, options) {
46
+ return this._client.getAPIList('/chapters', (PageNumberPagination), { query, ...options });
47
+ }
48
+ /**
49
+ * Deletes a chapter (soft delete)
50
+ *
51
+ * @example
52
+ * ```ts
53
+ * await client.chapters.delete('id');
54
+ * ```
55
+ */
56
+ delete(id, options) {
57
+ return this._client.delete(path `/chapters/${id}`, {
58
+ ...options,
59
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
60
+ });
61
+ }
62
+ /**
63
+ * Returns a single chapter by ID, including full text content and cost breakdown
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * const chapter = await client.chapters.get('id');
68
+ * ```
69
+ */
70
+ get(id, options) {
71
+ return this._client.get(path `/chapters/${id}`, options);
72
+ }
73
+ }
74
+ //# sourceMappingURL=chapters.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chapters.mjs","sourceRoot":"","sources":["../src/resources/chapters.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,oBAAoB,EAAgD;OACtE,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;OAUG;IACH,MAAM,CAAC,IAAyB,EAAE,OAAwB;QACxD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,IAAyB,EAAE,OAAwB;QACpE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,aAAa,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,IAAI,CACF,KAAwB,EACxB,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,WAAW,EAAE,CAAA,oBAAqC,CAAA,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5G,CAAC;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,aAAa,EAAE,EAAE,EAAE;YAChD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;SAC7D,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CAAC,EAAU,EAAE,OAAwB;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;CACF"}
@@ -1,2 +1,4 @@
1
+ export { Chapters, type Chapter, type ChapterListItem, type ChapterListResponse, type ChapterCreateParams, type ChapterUpdateParams, type ChapterListParams, type ChapterListItemsPageNumberPagination, } from "./chapters.mjs";
2
+ export { Projects, type Project, type ProjectListResponse, type ProjectCreateParams, type ProjectUpdateParams, type ProjectListParams, type ProjectsPageNumberPagination, } from "./projects.mjs";
1
3
  export { Users, type User } from "./users.mjs";
2
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oCAAoC,GAC1C;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,GAClC;OACM,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE"}
@@ -1,2 +1,4 @@
1
+ export { Chapters, type Chapter, type ChapterListItem, type ChapterListResponse, type ChapterCreateParams, type ChapterUpdateParams, type ChapterListParams, type ChapterListItemsPageNumberPagination, } from "./chapters.js";
2
+ export { Projects, type Project, type ProjectListResponse, type ProjectCreateParams, type ProjectUpdateParams, type ProjectListParams, type ProjectsPageNumberPagination, } from "./projects.js";
1
3
  export { Users, type User } from "./users.js";
2
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"OAEO,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,oCAAoC,GAC1C;OACM,EACL,QAAQ,EACR,KAAK,OAAO,EACZ,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACtB,KAAK,4BAA4B,GAClC;OACM,EAAE,KAAK,EAAE,KAAK,IAAI,EAAE"}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.Users = void 0;
4
+ exports.Users = exports.Projects = exports.Chapters = void 0;
5
+ var chapters_1 = require("./chapters.js");
6
+ Object.defineProperty(exports, "Chapters", { enumerable: true, get: function () { return chapters_1.Chapters; } });
7
+ var projects_1 = require("./projects.js");
8
+ Object.defineProperty(exports, "Projects", { enumerable: true, get: function () { return projects_1.Projects; } });
5
9
  var users_1 = require("./users.js");
6
10
  Object.defineProperty(exports, "Users", { enumerable: true, get: function () { return users_1.Users; } });
7
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,oCAA2C;AAAlC,8FAAA,KAAK,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,0CASoB;AARlB,oGAAA,QAAQ,OAAA;AASV,0CAQoB;AAPlB,oGAAA,QAAQ,OAAA;AAQV,oCAA2C;AAAlC,8FAAA,KAAK,OAAA"}
@@ -1,3 +1,5 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+ export { Chapters, } from "./chapters.mjs";
3
+ export { Projects, } from "./projects.mjs";
2
4
  export { Users } from "./users.mjs";
3
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,KAAK,EAAa"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EACL,QAAQ,GAQT;OACM,EACL,QAAQ,GAOT;OACM,EAAE,KAAK,EAAa"}
@@ -0,0 +1,220 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { PageNumberPagination, type PageNumberPaginationParams, PagePromise } from "../core/pagination.mjs";
4
+ import { RequestOptions } from "../internal/request-options.mjs";
5
+ export declare class Projects extends APIResource {
6
+ /**
7
+ * Creates a new project
8
+ *
9
+ * @example
10
+ * ```ts
11
+ * const project = await client.projects.create();
12
+ * ```
13
+ */
14
+ create(body: ProjectCreateParams, options?: RequestOptions): APIPromise<Project>;
15
+ /**
16
+ * Updates an existing project
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * const project = await client.projects.update('id');
21
+ * ```
22
+ */
23
+ update(id: string, body: ProjectUpdateParams, options?: RequestOptions): APIPromise<Project>;
24
+ /**
25
+ * Returns a paginated list of the user's projects
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * // Automatically fetches more pages as needed.
30
+ * for await (const project of client.projects.list()) {
31
+ * // ...
32
+ * }
33
+ * ```
34
+ */
35
+ list(query?: ProjectListParams | null | undefined, options?: RequestOptions): PagePromise<ProjectsPageNumberPagination, Project>;
36
+ /**
37
+ * Deletes a project (soft delete)
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * await client.projects.delete('id');
42
+ * ```
43
+ */
44
+ delete(id: string, options?: RequestOptions): APIPromise<void>;
45
+ /**
46
+ * Returns a single project by ID
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const project = await client.projects.get('id');
51
+ * ```
52
+ */
53
+ get(id: string, options?: RequestOptions): APIPromise<Project>;
54
+ }
55
+ export type ProjectsPageNumberPagination = PageNumberPagination<Project>;
56
+ /**
57
+ * A translation project
58
+ */
59
+ export interface Project {
60
+ /**
61
+ * Unique project identifier
62
+ */
63
+ id: string;
64
+ /**
65
+ * Project name
66
+ */
67
+ name: string;
68
+ /**
69
+ * Number of translation batches
70
+ */
71
+ batch_count?: number | null;
72
+ /**
73
+ * Number of chapters in the project
74
+ */
75
+ chapter_count?: number | null;
76
+ /**
77
+ * Project creation timestamp
78
+ */
79
+ created_at?: string | null;
80
+ /**
81
+ * Custom translation instructions
82
+ */
83
+ custom_instructions?: string | null;
84
+ /**
85
+ * Project description
86
+ */
87
+ description?: string | null;
88
+ /**
89
+ * Last update timestamp
90
+ */
91
+ last_updated_at?: string | null;
92
+ /**
93
+ * Name of the last updated chapter
94
+ */
95
+ last_updated_chapter_name?: string | null;
96
+ /**
97
+ * Source language for translation
98
+ */
99
+ original_language?: string | null;
100
+ /**
101
+ * JSON string of section break positions for latest file uploaded for batch
102
+ * translation
103
+ */
104
+ section_breaks?: string | null;
105
+ /**
106
+ * Target language for translation
107
+ */
108
+ translated_language?: string | null;
109
+ /**
110
+ * Latest filename of uploaded content for batch translation
111
+ */
112
+ uploaded_filename?: string | null;
113
+ /**
114
+ * Length of latest file uploaded for batch translation in characters
115
+ */
116
+ uploaded_length?: number | null;
117
+ /**
118
+ * UUID of latest file uploaded for batch translation
119
+ */
120
+ uploaded_uuid?: string | null;
121
+ }
122
+ /**
123
+ * Paginated list of projects
124
+ */
125
+ export interface ProjectListResponse {
126
+ /**
127
+ * List of projects
128
+ */
129
+ data: Array<Project>;
130
+ /**
131
+ * Current page number
132
+ */
133
+ page: number;
134
+ /**
135
+ * Number of items per page
136
+ */
137
+ page_size: number;
138
+ /**
139
+ * Total number of projects
140
+ */
141
+ total: number;
142
+ /**
143
+ * Total number of pages
144
+ */
145
+ total_pages: number;
146
+ }
147
+ export interface ProjectCreateParams {
148
+ /**
149
+ * Custom translation instructions
150
+ */
151
+ custom_instructions?: string | null;
152
+ /**
153
+ * Project description
154
+ */
155
+ description?: string | null;
156
+ /**
157
+ * Project name (defaults to 'My Project')
158
+ */
159
+ name?: string;
160
+ /**
161
+ * Source language (defaults to 'Korean')
162
+ */
163
+ original_language?: string | null;
164
+ /**
165
+ * Target language (defaults to 'English')
166
+ */
167
+ translated_language?: string | null;
168
+ }
169
+ export interface ProjectUpdateParams {
170
+ /**
171
+ * Custom translation instructions
172
+ */
173
+ custom_instructions?: string | null;
174
+ /**
175
+ * Project description
176
+ */
177
+ description?: string | null;
178
+ /**
179
+ * Project name
180
+ */
181
+ name?: string;
182
+ /**
183
+ * Source language
184
+ */
185
+ original_language?: string | null;
186
+ /**
187
+ * JSON string of section break positions for batch translation
188
+ */
189
+ section_breaks?: string | null;
190
+ /**
191
+ * Target language
192
+ */
193
+ translated_language?: string | null;
194
+ }
195
+ export interface ProjectListParams extends PageNumberPaginationParams {
196
+ /**
197
+ * Filter by original language
198
+ */
199
+ original_language?: string;
200
+ /**
201
+ * Search query for project name
202
+ */
203
+ query?: string;
204
+ /**
205
+ * Sort direction
206
+ */
207
+ sort_direction?: 'asc' | 'desc';
208
+ /**
209
+ * Field to sort by
210
+ */
211
+ sort_field?: 'last_updated_at' | 'created_at' | 'name';
212
+ /**
213
+ * Filter by translated language
214
+ */
215
+ translated_language?: string;
216
+ }
217
+ export declare namespace Projects {
218
+ export { type Project as Project, type ProjectListResponse as ProjectListResponse, type ProjectsPageNumberPagination as ProjectsPageNumberPagination, type ProjectCreateParams as ProjectCreateParams, type ProjectUpdateParams as ProjectUpdateParams, type ProjectListParams as ProjectListParams, };
219
+ }
220
+ //# sourceMappingURL=projects.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.d.mts","sourceRoot":"","sources":["../src/resources/projects.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,oBAAoB,EAAE,KAAK,0BAA0B,EAAE,WAAW,EAAE;OAEtE,EAAE,cAAc,EAAE;AAGzB,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;OAOG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAIhF;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,OAAO,CAAC;IAI5F;;;;;;;;;;OAUG;IACH,IAAI,CACF,KAAK,GAAE,iBAAiB,GAAG,IAAI,GAAG,SAAc,EAChD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,4BAA4B,EAAE,OAAO,CAAC;IAIrD;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,IAAI,CAAC;IAO9D;;;;;;;OAOG;IACH,GAAG,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