@usehercules/sdk 1.14.1 → 1.14.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.
Files changed (163) hide show
  1. package/CHANGELOG.md +47 -0
  2. package/README.md +9 -0
  3. package/client.d.mts +13 -4
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +13 -4
  6. package/client.d.ts.map +1 -1
  7. package/client.js +21 -5
  8. package/client.js.map +1 -1
  9. package/client.mjs +21 -5
  10. package/client.mjs.map +1 -1
  11. package/internal/parse.d.mts.map +1 -1
  12. package/internal/parse.d.ts.map +1 -1
  13. package/internal/parse.js +5 -0
  14. package/internal/parse.js.map +1 -1
  15. package/internal/parse.mjs +5 -0
  16. package/internal/parse.mjs.map +1 -1
  17. package/package.json +1 -1
  18. package/resources/content/{models/models.d.mts → collections/collections.d.mts} +88 -87
  19. package/resources/content/collections/collections.d.mts.map +1 -0
  20. package/resources/content/{models/models.d.ts → collections/collections.d.ts} +88 -87
  21. package/resources/content/collections/collections.d.ts.map +1 -0
  22. package/resources/content/collections/collections.js +58 -0
  23. package/resources/content/collections/collections.js.map +1 -0
  24. package/resources/content/collections/collections.mjs +53 -0
  25. package/resources/content/collections/collections.mjs.map +1 -0
  26. package/resources/content/{models → collections}/fields.d.mts +23 -22
  27. package/resources/content/collections/fields.d.mts.map +1 -0
  28. package/resources/content/{models → collections}/fields.d.ts +23 -22
  29. package/resources/content/collections/fields.d.ts.map +1 -0
  30. package/resources/content/collections/fields.js +41 -0
  31. package/resources/content/collections/fields.js.map +1 -0
  32. package/resources/content/collections/fields.mjs +37 -0
  33. package/resources/content/collections/fields.mjs.map +1 -0
  34. package/resources/content/collections/index.d.mts +3 -0
  35. package/resources/content/collections/index.d.mts.map +1 -0
  36. package/resources/content/collections/index.d.ts +3 -0
  37. package/resources/content/collections/index.d.ts.map +1 -0
  38. package/resources/content/{models → collections}/index.js +3 -3
  39. package/resources/content/collections/index.js.map +1 -0
  40. package/resources/content/{models → collections}/index.mjs +1 -1
  41. package/resources/content/collections/index.mjs.map +1 -0
  42. package/resources/content/collections.d.mts +2 -0
  43. package/resources/content/collections.d.mts.map +1 -0
  44. package/resources/content/collections.d.ts +2 -0
  45. package/resources/content/collections.d.ts.map +1 -0
  46. package/resources/content/{models.js → collections.js} +2 -2
  47. package/resources/content/collections.js.map +1 -0
  48. package/resources/content/collections.mjs +3 -0
  49. package/resources/content/collections.mjs.map +1 -0
  50. package/resources/content/content.d.mts +4 -4
  51. package/resources/content/content.d.mts.map +1 -1
  52. package/resources/content/content.d.ts +4 -4
  53. package/resources/content/content.d.ts.map +1 -1
  54. package/resources/content/content.js +4 -4
  55. package/resources/content/content.js.map +1 -1
  56. package/resources/content/content.mjs +4 -4
  57. package/resources/content/content.mjs.map +1 -1
  58. package/resources/content/entries.d.mts +18 -18
  59. package/resources/content/entries.d.mts.map +1 -1
  60. package/resources/content/entries.d.ts +18 -18
  61. package/resources/content/entries.d.ts.map +1 -1
  62. package/resources/content/entries.js +2 -2
  63. package/resources/content/entries.mjs +2 -2
  64. package/resources/content/index.d.mts +1 -1
  65. package/resources/content/index.d.mts.map +1 -1
  66. package/resources/content/index.d.ts +1 -1
  67. package/resources/content/index.d.ts.map +1 -1
  68. package/resources/content/index.js +3 -3
  69. package/resources/content/index.js.map +1 -1
  70. package/resources/content/index.mjs +1 -1
  71. package/resources/content/index.mjs.map +1 -1
  72. package/resources/email/email.d.mts +166 -0
  73. package/resources/email/email.d.mts.map +1 -0
  74. package/resources/email/email.d.ts +166 -0
  75. package/resources/email/email.d.ts.map +1 -0
  76. package/resources/email/email.js +43 -0
  77. package/resources/email/email.js.map +1 -0
  78. package/resources/email/email.mjs +38 -0
  79. package/resources/email/email.mjs.map +1 -0
  80. package/resources/email/identities.d.mts +107 -0
  81. package/resources/email/identities.d.mts.map +1 -0
  82. package/resources/email/identities.d.ts +107 -0
  83. package/resources/email/identities.d.ts.map +1 -0
  84. package/resources/email/identities.js +51 -0
  85. package/resources/email/identities.js.map +1 -0
  86. package/resources/email/identities.mjs +47 -0
  87. package/resources/email/identities.mjs.map +1 -0
  88. package/resources/email/index.d.mts +3 -0
  89. package/resources/email/index.d.mts.map +1 -0
  90. package/resources/email/index.d.ts +3 -0
  91. package/resources/email/index.d.ts.map +1 -0
  92. package/resources/email/index.js +9 -0
  93. package/resources/email/index.js.map +1 -0
  94. package/resources/email/index.mjs +4 -0
  95. package/resources/email/index.mjs.map +1 -0
  96. package/resources/email.d.mts +2 -0
  97. package/resources/email.d.mts.map +1 -0
  98. package/resources/email.d.ts +2 -0
  99. package/resources/email.d.ts.map +1 -0
  100. package/resources/email.js +6 -0
  101. package/resources/email.js.map +1 -0
  102. package/resources/{content/models.mjs → email.mjs} +2 -2
  103. package/resources/email.mjs.map +1 -0
  104. package/resources/files.d.mts +8 -6
  105. package/resources/files.d.mts.map +1 -1
  106. package/resources/files.d.ts +8 -6
  107. package/resources/files.d.ts.map +1 -1
  108. package/resources/files.js +3 -2
  109. package/resources/files.js.map +1 -1
  110. package/resources/files.mjs +3 -2
  111. package/resources/files.mjs.map +1 -1
  112. package/resources/index.d.mts +1 -0
  113. package/resources/index.d.mts.map +1 -1
  114. package/resources/index.d.ts +1 -0
  115. package/resources/index.d.ts.map +1 -1
  116. package/resources/index.js +3 -1
  117. package/resources/index.js.map +1 -1
  118. package/resources/index.mjs +1 -0
  119. package/resources/index.mjs.map +1 -1
  120. package/src/client.ts +46 -8
  121. package/src/internal/parse.ts +6 -0
  122. package/src/resources/content/{models/models.ts → collections/collections.ts} +112 -108
  123. package/src/resources/content/{models → collections}/fields.ts +39 -27
  124. package/src/resources/content/{models → collections}/index.ts +8 -8
  125. package/src/resources/content/collections.ts +3 -0
  126. package/src/resources/content/content.ts +16 -16
  127. package/src/resources/content/entries.ts +20 -20
  128. package/src/resources/content/index.ts +9 -9
  129. package/src/resources/email/email.ts +229 -0
  130. package/src/resources/email/identities.ts +151 -0
  131. package/src/resources/email/index.ts +18 -0
  132. package/src/resources/{content/models.ts → email.ts} +1 -1
  133. package/src/resources/files.ts +8 -6
  134. package/src/resources/index.ts +9 -0
  135. package/src/version.ts +1 -1
  136. package/version.d.mts +1 -1
  137. package/version.d.ts +1 -1
  138. package/version.js +1 -1
  139. package/version.mjs +1 -1
  140. package/resources/content/models/fields.d.mts.map +0 -1
  141. package/resources/content/models/fields.d.ts.map +0 -1
  142. package/resources/content/models/fields.js +0 -37
  143. package/resources/content/models/fields.js.map +0 -1
  144. package/resources/content/models/fields.mjs +0 -33
  145. package/resources/content/models/fields.mjs.map +0 -1
  146. package/resources/content/models/index.d.mts +0 -3
  147. package/resources/content/models/index.d.mts.map +0 -1
  148. package/resources/content/models/index.d.ts +0 -3
  149. package/resources/content/models/index.d.ts.map +0 -1
  150. package/resources/content/models/index.js.map +0 -1
  151. package/resources/content/models/index.mjs.map +0 -1
  152. package/resources/content/models/models.d.mts.map +0 -1
  153. package/resources/content/models/models.d.ts.map +0 -1
  154. package/resources/content/models/models.js +0 -54
  155. package/resources/content/models/models.js.map +0 -1
  156. package/resources/content/models/models.mjs +0 -49
  157. package/resources/content/models/models.mjs.map +0 -1
  158. package/resources/content/models.d.mts +0 -2
  159. package/resources/content/models.d.mts.map +0 -1
  160. package/resources/content/models.d.ts +0 -2
  161. package/resources/content/models.d.ts.map +0 -1
  162. package/resources/content/models.js.map +0 -1
  163. package/resources/content/models.mjs.map +0 -1
@@ -8,61 +8,116 @@ import { CursorIDPage, type CursorIDPageParams, PagePromise } from '../../../cor
8
8
  import { RequestOptions } from '../../../internal/request-options';
9
9
  import { path } from '../../../internal/utils/path';
10
10
 
11
- export class Models extends APIResource {
11
+ export class Collections extends APIResource {
12
12
  fields: FieldsAPI.Fields = new FieldsAPI.Fields(this._client);
13
13
 
14
14
  /**
15
- * Creates a new content model with optional initial fields. Content models define
16
- * the schema for entries. Example models: 'Blog Post', 'Product', 'Author'.
15
+ * Creates a new content collection with optional initial fields. Content
16
+ * collections define the schema for entries. Example collections: 'Blog Post',
17
+ * 'Product', 'Author'.
17
18
  */
18
- create(body: ModelCreateParams, options?: RequestOptions): APIPromise<Model> {
19
- return this._client.post('/v1/content/models', { body, ...options });
19
+ create(body: CollectionCreateParams, options?: RequestOptions): APIPromise<Collection> {
20
+ return this._client.post('/v1/content/collections', { body, ...options });
20
21
  }
21
22
 
22
23
  /**
23
- * Updates an existing content model. Use this to modify the name, description, or
24
- * lock status. The api_id cannot be changed after creation.
24
+ * Updates an existing content collection. Use this to modify the name,
25
+ * description, or lock status. The api_id cannot be changed after creation.
25
26
  */
26
27
  update(
27
- modelID: string,
28
- body: ModelUpdateParams | null | undefined = {},
28
+ collectionID: string,
29
+ body: CollectionUpdateParams | null | undefined = {},
29
30
  options?: RequestOptions,
30
- ): APIPromise<Model> {
31
- return this._client.patch(path`/v1/content/models/${modelID}`, { body, ...options });
31
+ ): APIPromise<Collection> {
32
+ return this._client.patch(path`/v1/content/collections/${collectionID}`, { body, ...options });
32
33
  }
33
34
 
34
35
  /**
35
- * Retrieves a paginated list of content models. Content models define the
36
- * schema/structure for content entries.
36
+ * Retrieves a paginated list of content collections. Content collections define
37
+ * the schema/structure for content entries.
37
38
  */
38
39
  list(
39
- query: ModelListParams | null | undefined = {},
40
+ query: CollectionListParams | null | undefined = {},
40
41
  options?: RequestOptions,
41
- ): PagePromise<ModelsCursorIDPage, Model> {
42
- return this._client.getAPIList('/v1/content/models', CursorIDPage<Model>, { query, ...options });
42
+ ): PagePromise<CollectionsCursorIDPage, Collection> {
43
+ return this._client.getAPIList('/v1/content/collections', CursorIDPage<Collection>, {
44
+ query,
45
+ ...options,
46
+ });
43
47
  }
44
48
 
45
49
  /**
46
- * Archives a content model, hiding it from the API. Existing entries are
50
+ * Archives a content collection, hiding it from the API. Existing entries are
47
51
  * preserved. Use this instead of deletion to maintain data integrity.
48
52
  */
49
- archive(modelID: string, options?: RequestOptions): APIPromise<Model> {
50
- return this._client.delete(path`/v1/content/models/${modelID}`, options);
53
+ archive(collectionID: string, options?: RequestOptions): APIPromise<Collection> {
54
+ return this._client.delete(path`/v1/content/collections/${collectionID}`, options);
51
55
  }
52
56
 
53
57
  /**
54
- * Retrieves a content model by ID. Returns the model object including all field
55
- * definitions.
58
+ * Retrieves a content collection by ID. Returns the collection object including
59
+ * all field definitions.
56
60
  */
57
- get(modelID: string, options?: RequestOptions): APIPromise<Model> {
58
- return this._client.get(path`/v1/content/models/${modelID}`, options);
61
+ get(collectionID: string, options?: RequestOptions): APIPromise<Collection> {
62
+ return this._client.get(path`/v1/content/collections/${collectionID}`, options);
59
63
  }
60
64
  }
61
65
 
62
- export type ModelsCursorIDPage = CursorIDPage<Model>;
66
+ export type CollectionsCursorIDPage = CursorIDPage<Collection>;
63
67
 
64
68
  /**
65
- * A field definition within a content model
69
+ * A content collection defines the schema/structure for content entries. Each
70
+ * collection has fields that define what data entries can contain.
71
+ */
72
+ export interface Collection {
73
+ /**
74
+ * Unique identifier for the content collection
75
+ */
76
+ id: string;
77
+
78
+ /**
79
+ * API identifier for the collection (camelCase, e.g., 'blogPost', 'product')
80
+ */
81
+ api_id: string;
82
+
83
+ /**
84
+ * Timestamp when the collection was created
85
+ */
86
+ created: string;
87
+
88
+ /**
89
+ * Whether field modifications are locked (for production safety)
90
+ */
91
+ locked: boolean;
92
+
93
+ /**
94
+ * Display name for the collection
95
+ */
96
+ name: string;
97
+
98
+ /**
99
+ * Timestamp when the collection was last updated
100
+ */
101
+ updated: string;
102
+
103
+ /**
104
+ * Schema version number
105
+ */
106
+ version: number;
107
+
108
+ /**
109
+ * Description of the collection
110
+ */
111
+ description?: string | null;
112
+
113
+ /**
114
+ * Fields defined in this collection
115
+ */
116
+ fields?: Array<Field>;
117
+ }
118
+
119
+ /**
120
+ * A field definition within a content collection
66
121
  */
67
122
  export interface Field {
68
123
  /**
@@ -107,7 +162,7 @@ export interface Field {
107
162
  description?: string | null;
108
163
 
109
164
  /**
110
- * Display order within the model
165
+ * Display order within the collection
111
166
  */
112
167
  display_order?: number;
113
168
 
@@ -128,14 +183,14 @@ export namespace Field {
128
183
  */
129
184
  export interface Validation {
130
185
  /**
131
- * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
186
+ * Allowed collection apiIds for reference fields
132
187
  */
133
- allowed_mime_types?: Array<string>;
188
+ allowed_collections?: Array<string>;
134
189
 
135
190
  /**
136
- * Allowed model apiIds for reference fields
191
+ * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
137
192
  */
138
- allowed_models?: Array<string>;
193
+ allowed_mime_types?: Array<string>;
139
194
 
140
195
  /**
141
196
  * Allowed values for enum fields
@@ -190,88 +245,37 @@ export namespace Field {
190
245
  }
191
246
  }
192
247
 
193
- /**
194
- * A content model defines the schema/structure for content entries. Each model has
195
- * fields that define what data entries can contain.
196
- */
197
- export interface Model {
198
- /**
199
- * Unique identifier for the content model
200
- */
201
- id: string;
202
-
248
+ export interface CollectionCreateParams {
203
249
  /**
204
- * API identifier for the model (camelCase, e.g., 'blogPost', 'product')
250
+ * API identifier for the collection (camelCase, e.g., 'blogPost')
205
251
  */
206
252
  api_id: string;
207
253
 
208
254
  /**
209
- * Timestamp when the model was created
210
- */
211
- created: string;
212
-
213
- /**
214
- * Whether field modifications are locked (for production safety)
215
- */
216
- locked: boolean;
217
-
218
- /**
219
- * Display name for the model
255
+ * Display name for the collection
220
256
  */
221
257
  name: string;
222
258
 
223
259
  /**
224
- * Timestamp when the model was last updated
225
- */
226
- updated: string;
227
-
228
- /**
229
- * Schema version number
230
- */
231
- version: number;
232
-
233
- /**
234
- * Description of the model
235
- */
236
- description?: string | null;
237
-
238
- /**
239
- * Fields defined in this model
240
- */
241
- fields?: Array<Field>;
242
- }
243
-
244
- export interface ModelCreateParams {
245
- /**
246
- * API identifier for the model (camelCase, e.g., 'blogPost')
247
- */
248
- api_id: string;
249
-
250
- /**
251
- * Display name for the model
252
- */
253
- name: string;
254
-
255
- /**
256
- * Optional custom ID for the model. Must start with 'cm\_'. If not provided, one
257
- * will be generated.
260
+ * Optional custom ID for the collection. Must start with 'cm\_'. If not provided,
261
+ * one will be generated.
258
262
  */
259
263
  id?: string;
260
264
 
261
265
  /**
262
- * Description of the model
266
+ * Description of the collection
263
267
  */
264
268
  description?: string;
265
269
 
266
270
  /**
267
- * Initial fields to create with the model
271
+ * Initial fields to create with the collection
268
272
  */
269
- fields?: Array<ModelCreateParams.Field>;
273
+ fields?: Array<CollectionCreateParams.Field>;
270
274
  }
271
275
 
272
- export namespace ModelCreateParams {
276
+ export namespace CollectionCreateParams {
273
277
  /**
274
- * Request to add a new field to a content model
278
+ * Request to add a new field to a content collection
275
279
  */
276
280
  export interface Field {
277
281
  /**
@@ -312,7 +316,7 @@ export namespace ModelCreateParams {
312
316
  description?: string;
313
317
 
314
318
  /**
315
- * Display order within the model
319
+ * Display order within the collection
316
320
  */
317
321
  display_order?: number;
318
322
 
@@ -333,14 +337,14 @@ export namespace ModelCreateParams {
333
337
  */
334
338
  export interface Validation {
335
339
  /**
336
- * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
340
+ * Allowed collection apiIds for reference fields
337
341
  */
338
- allowed_mime_types?: Array<string>;
342
+ allowed_collections?: Array<string>;
339
343
 
340
344
  /**
341
- * Allowed model apiIds for reference fields
345
+ * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
342
346
  */
343
- allowed_models?: Array<string>;
347
+ allowed_mime_types?: Array<string>;
344
348
 
345
349
  /**
346
350
  * Allowed values for enum fields
@@ -396,35 +400,35 @@ export namespace ModelCreateParams {
396
400
  }
397
401
  }
398
402
 
399
- export interface ModelUpdateParams {
403
+ export interface CollectionUpdateParams {
400
404
  /**
401
- * Description of the model
405
+ * Description of the collection
402
406
  */
403
407
  description?: string;
404
408
 
405
409
  /**
406
- * Lock the model to prevent field modifications
410
+ * Lock the collection to prevent field modifications
407
411
  */
408
412
  locked?: boolean;
409
413
 
410
414
  /**
411
- * Display name for the model
415
+ * Display name for the collection
412
416
  */
413
417
  name?: string;
414
418
  }
415
419
 
416
- export interface ModelListParams extends CursorIDPageParams {}
420
+ export interface CollectionListParams extends CursorIDPageParams {}
417
421
 
418
- Models.Fields = Fields;
422
+ Collections.Fields = Fields;
419
423
 
420
- export declare namespace Models {
424
+ export declare namespace Collections {
421
425
  export {
426
+ type Collection as Collection,
422
427
  type Field as Field,
423
- type Model as Model,
424
- type ModelsCursorIDPage as ModelsCursorIDPage,
425
- type ModelCreateParams as ModelCreateParams,
426
- type ModelUpdateParams as ModelUpdateParams,
427
- type ModelListParams as ModelListParams,
428
+ type CollectionsCursorIDPage as CollectionsCursorIDPage,
429
+ type CollectionCreateParams as CollectionCreateParams,
430
+ type CollectionUpdateParams as CollectionUpdateParams,
431
+ type CollectionListParams as CollectionListParams,
428
432
  };
429
433
 
430
434
  export {
@@ -1,7 +1,7 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
3
  import { APIResource } from '../../../core/resource';
4
- import * as ModelsAPI from './models';
4
+ import * as CollectionsAPI from './collections';
5
5
  import { APIPromise } from '../../../core/api-promise';
6
6
  import { buildHeaders } from '../../../internal/headers';
7
7
  import { RequestOptions } from '../../../internal/request-options';
@@ -9,29 +9,41 @@ import { path } from '../../../internal/utils/path';
9
9
 
10
10
  export class Fields extends APIResource {
11
11
  /**
12
- * Adds a new field to a content model. Fields define the structure of entries. The
13
- * model must not be locked. Adding a field increments the model version.
12
+ * Adds a new field to a content collection. Fields define the structure of
13
+ * entries. The collection must not be locked. Adding a field increments the
14
+ * collection version.
14
15
  */
15
- create(modelID: string, body: FieldCreateParams, options?: RequestOptions): APIPromise<ModelsAPI.Field> {
16
- return this._client.post(path`/v1/content/models/${modelID}/fields`, { body, ...options });
16
+ create(
17
+ collectionID: string,
18
+ body: FieldCreateParams,
19
+ options?: RequestOptions,
20
+ ): APIPromise<CollectionsAPI.Field> {
21
+ return this._client.post(path`/v1/content/collections/${collectionID}/fields`, { body, ...options });
17
22
  }
18
23
 
19
24
  /**
20
- * Updates an existing field in a content model. The field type cannot be changed
21
- * after creation. The model must not be locked.
25
+ * Updates an existing field in a content collection. The field type cannot be
26
+ * changed after creation. The collection must not be locked.
22
27
  */
23
- update(fieldID: string, params: FieldUpdateParams, options?: RequestOptions): APIPromise<ModelsAPI.Field> {
24
- const { model_id, ...body } = params;
25
- return this._client.patch(path`/v1/content/models/${model_id}/fields/${fieldID}`, { body, ...options });
28
+ update(
29
+ fieldID: string,
30
+ params: FieldUpdateParams,
31
+ options?: RequestOptions,
32
+ ): APIPromise<CollectionsAPI.Field> {
33
+ const { collection_id, ...body } = params;
34
+ return this._client.patch(path`/v1/content/collections/${collection_id}/fields/${fieldID}`, {
35
+ body,
36
+ ...options,
37
+ });
26
38
  }
27
39
 
28
40
  /**
29
- * Removes a field from a content model. Existing entry data for this field is
30
- * preserved but will no longer be validated. The model must not be locked.
41
+ * Removes a field from a content collection. Existing entry data for this field is
42
+ * preserved but will no longer be validated. The collection must not be locked.
31
43
  */
32
44
  delete(fieldID: string, params: FieldDeleteParams, options?: RequestOptions): APIPromise<void> {
33
- const { model_id } = params;
34
- return this._client.delete(path`/v1/content/models/${model_id}/fields/${fieldID}`, {
45
+ const { collection_id } = params;
46
+ return this._client.delete(path`/v1/content/collections/${collection_id}/fields/${fieldID}`, {
35
47
  ...options,
36
48
  headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
37
49
  });
@@ -77,7 +89,7 @@ export interface FieldCreateParams {
77
89
  description?: string;
78
90
 
79
91
  /**
80
- * Display order within the model
92
+ * Display order within the collection
81
93
  */
82
94
  display_order?: number;
83
95
 
@@ -98,14 +110,14 @@ export namespace FieldCreateParams {
98
110
  */
99
111
  export interface Validation {
100
112
  /**
101
- * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
113
+ * Allowed collection apiIds for reference fields
102
114
  */
103
- allowed_mime_types?: Array<string>;
115
+ allowed_collections?: Array<string>;
104
116
 
105
117
  /**
106
- * Allowed model apiIds for reference fields
118
+ * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
107
119
  */
108
- allowed_models?: Array<string>;
120
+ allowed_mime_types?: Array<string>;
109
121
 
110
122
  /**
111
123
  * Allowed values for enum fields
@@ -162,9 +174,9 @@ export namespace FieldCreateParams {
162
174
 
163
175
  export interface FieldUpdateParams {
164
176
  /**
165
- * Path param: The unique identifier of the content model
177
+ * Path param: The unique identifier of the content collection
166
178
  */
167
- model_id: string;
179
+ collection_id: string;
168
180
 
169
181
  /**
170
182
  * Body param: Description of the field
@@ -198,14 +210,14 @@ export namespace FieldUpdateParams {
198
210
  */
199
211
  export interface Validation {
200
212
  /**
201
- * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
213
+ * Allowed collection apiIds for reference fields
202
214
  */
203
- allowed_mime_types?: Array<string>;
215
+ allowed_collections?: Array<string>;
204
216
 
205
217
  /**
206
- * Allowed model apiIds for reference fields
218
+ * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
207
219
  */
208
- allowed_models?: Array<string>;
220
+ allowed_mime_types?: Array<string>;
209
221
 
210
222
  /**
211
223
  * Allowed values for enum fields
@@ -262,9 +274,9 @@ export namespace FieldUpdateParams {
262
274
 
263
275
  export interface FieldDeleteParams {
264
276
  /**
265
- * The unique identifier of the content model
277
+ * The unique identifier of the content collection
266
278
  */
267
- model_id: string;
279
+ collection_id: string;
268
280
  }
269
281
 
270
282
  export declare namespace Fields {
@@ -1,12 +1,12 @@
1
1
  // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
2
 
3
- export { Fields, type FieldCreateParams, type FieldUpdateParams, type FieldDeleteParams } from './fields';
4
3
  export {
5
- Models,
4
+ Collections,
5
+ type Collection,
6
6
  type Field,
7
- type Model,
8
- type ModelCreateParams,
9
- type ModelUpdateParams,
10
- type ModelListParams,
11
- type ModelsCursorIDPage,
12
- } from './models';
7
+ type CollectionCreateParams,
8
+ type CollectionUpdateParams,
9
+ type CollectionListParams,
10
+ type CollectionsCursorIDPage,
11
+ } from './collections';
12
+ export { Fields, type FieldCreateParams, type FieldUpdateParams, type FieldDeleteParams } from './fields';
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './collections/index';
@@ -29,16 +29,16 @@ import {
29
29
  Locales,
30
30
  LocalesCursorIDPage,
31
31
  } from './locales';
32
- import * as ModelsAPI from './models/models';
32
+ import * as CollectionsAPI from './collections/collections';
33
33
  import {
34
+ Collection,
35
+ CollectionCreateParams,
36
+ CollectionListParams,
37
+ CollectionUpdateParams,
38
+ Collections,
39
+ CollectionsCursorIDPage,
34
40
  Field,
35
- Model,
36
- ModelCreateParams,
37
- ModelListParams,
38
- ModelUpdateParams,
39
- Models,
40
- ModelsCursorIDPage,
41
- } from './models/models';
41
+ } from './collections/collections';
42
42
  import * as ReleasesAPI from './releases/releases';
43
43
  import {
44
44
  Release,
@@ -55,14 +55,14 @@ import {
55
55
  * Content APIs are currently in beta.
56
56
  */
57
57
  export class Content extends APIResource {
58
- models: ModelsAPI.Models = new ModelsAPI.Models(this._client);
58
+ collections: CollectionsAPI.Collections = new CollectionsAPI.Collections(this._client);
59
59
  entries: EntriesAPI.Entries = new EntriesAPI.Entries(this._client);
60
60
  assets: AssetsAPI.Assets = new AssetsAPI.Assets(this._client);
61
61
  locales: LocalesAPI.Locales = new LocalesAPI.Locales(this._client);
62
62
  releases: ReleasesAPI.Releases = new ReleasesAPI.Releases(this._client);
63
63
  }
64
64
 
65
- Content.Models = Models;
65
+ Content.Collections = Collections;
66
66
  Content.Entries = Entries;
67
67
  Content.Assets = Assets;
68
68
  Content.Locales = Locales;
@@ -70,13 +70,13 @@ Content.Releases = Releases;
70
70
 
71
71
  export declare namespace Content {
72
72
  export {
73
- Models as Models,
73
+ Collections as Collections,
74
+ type Collection as Collection,
74
75
  type Field as Field,
75
- type Model as Model,
76
- type ModelsCursorIDPage as ModelsCursorIDPage,
77
- type ModelCreateParams as ModelCreateParams,
78
- type ModelUpdateParams as ModelUpdateParams,
79
- type ModelListParams as ModelListParams,
76
+ type CollectionsCursorIDPage as CollectionsCursorIDPage,
77
+ type CollectionCreateParams as CollectionCreateParams,
78
+ type CollectionUpdateParams as CollectionUpdateParams,
79
+ type CollectionListParams as CollectionListParams,
80
80
  };
81
81
 
82
82
  export {
@@ -8,7 +8,7 @@ import { path } from '../../internal/utils/path';
8
8
 
9
9
  export class Entries extends APIResource {
10
10
  /**
11
- * Creates a new content entry for a given model. Entries start as drafts by
11
+ * Creates a new content entry for a given collection. Entries start as drafts by
12
12
  * default. Use the publish endpoint to make entries publicly accessible.
13
13
  */
14
14
  create(body: EntryCreateParams, options?: RequestOptions): APIPromise<Entry> {
@@ -29,7 +29,7 @@ export class Entries extends APIResource {
29
29
  }
30
30
 
31
31
  /**
32
- * Retrieves a paginated list of content entries. Supports filtering by model,
32
+ * Retrieves a paginated list of content entries. Supports filtering by collection,
33
33
  * status, locale, and custom field queries. Use the 'where' parameter for
34
34
  * field-based filtering with operators like $eq, $contains, $gt, etc.
35
35
  */
@@ -81,8 +81,8 @@ export class Entries extends APIResource {
81
81
  export type EntriesCursorIDPage = CursorIDPage<Entry>;
82
82
 
83
83
  /**
84
- * A content entry containing field values based on its model schema. Entries can
85
- * be drafts, published, or archived.
84
+ * A content entry containing field values based on its collection schema. Entries
85
+ * can be drafts, published, or archived.
86
86
  */
87
87
  export interface Entry {
88
88
  /**
@@ -90,6 +90,11 @@ export interface Entry {
90
90
  */
91
91
  id: string;
92
92
 
93
+ /**
94
+ * ID of the content collection this entry belongs to
95
+ */
96
+ collection_id: string;
97
+
93
98
  /**
94
99
  * Timestamp when the entry was created
95
100
  */
@@ -106,11 +111,6 @@ export interface Entry {
106
111
  */
107
112
  locale: string;
108
113
 
109
- /**
110
- * ID of the content model this entry belongs to
111
- */
112
- model_id: string;
113
-
114
114
  /**
115
115
  * Publishing status: draft, published, or archived
116
116
  */
@@ -127,14 +127,14 @@ export interface Entry {
127
127
  version: number;
128
128
 
129
129
  /**
130
- * Timestamp when first published
130
+ * API ID of the content collection (included when populated)
131
131
  */
132
- first_published_at?: string | null;
132
+ collection_api_id?: string;
133
133
 
134
134
  /**
135
- * API ID of the content model (included when populated)
135
+ * Timestamp when first published
136
136
  */
137
- model_api_id?: string;
137
+ first_published_at?: string | null;
138
138
 
139
139
  /**
140
140
  * Timestamp when last published
@@ -154,9 +154,9 @@ export interface Entry {
154
154
 
155
155
  export interface EntryCreateParams {
156
156
  /**
157
- * API ID of the content model (e.g., 'blogPost')
157
+ * API ID of the content collection (e.g., 'blogPost')
158
158
  */
159
- model: string;
159
+ collection: string;
160
160
 
161
161
  /**
162
162
  * Optional custom ID for the entry. Must start with 'ce\_'. If not provided, one
@@ -200,6 +200,11 @@ export interface EntryUpdateParams {
200
200
  }
201
201
 
202
202
  export interface EntryListParams extends CursorIDPageParams {
203
+ /**
204
+ * Filter by content collection API ID (e.g., 'blogPost')
205
+ */
206
+ collection?: string;
207
+
203
208
  /**
204
209
  * Filter by creation date
205
210
  */
@@ -215,11 +220,6 @@ export interface EntryListParams extends CursorIDPageParams {
215
220
  */
216
221
  locale?: string;
217
222
 
218
- /**
219
- * Filter by content model API ID (e.g., 'blogPost')
220
- */
221
- model?: string;
222
-
223
223
  /**
224
224
  * JSON-encoded sort order. Example: {"field":"publishedAt","direction":"desc"}
225
225
  */