@usehercules/sdk 1.14.0 → 1.14.2

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 (136) hide show
  1. package/CHANGELOG.md +39 -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/{models.mjs → collections.mjs} +2 -2
  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/domains.d.mts +54 -0
  73. package/resources/domains.d.mts.map +1 -0
  74. package/resources/domains.d.ts +54 -0
  75. package/resources/domains.d.ts.map +1 -0
  76. package/resources/domains.js +21 -0
  77. package/resources/domains.js.map +1 -0
  78. package/resources/domains.mjs +17 -0
  79. package/resources/domains.mjs.map +1 -0
  80. package/resources/files.d.mts +8 -6
  81. package/resources/files.d.mts.map +1 -1
  82. package/resources/files.d.ts +8 -6
  83. package/resources/files.d.ts.map +1 -1
  84. package/resources/files.js +3 -2
  85. package/resources/files.js.map +1 -1
  86. package/resources/files.mjs +3 -2
  87. package/resources/files.mjs.map +1 -1
  88. package/resources/index.d.mts +1 -0
  89. package/resources/index.d.mts.map +1 -1
  90. package/resources/index.d.ts +1 -0
  91. package/resources/index.d.ts.map +1 -1
  92. package/resources/index.js +3 -1
  93. package/resources/index.js.map +1 -1
  94. package/resources/index.mjs +1 -0
  95. package/resources/index.mjs.map +1 -1
  96. package/src/client.ts +34 -7
  97. package/src/internal/parse.ts +6 -0
  98. package/src/resources/content/{models/models.ts → collections/collections.ts} +112 -108
  99. package/src/resources/content/{models → collections}/fields.ts +39 -27
  100. package/src/resources/content/{models → collections}/index.ts +8 -8
  101. package/src/resources/content/{models.ts → collections.ts} +1 -1
  102. package/src/resources/content/content.ts +16 -16
  103. package/src/resources/content/entries.ts +20 -20
  104. package/src/resources/content/index.ts +9 -9
  105. package/src/resources/domains.ts +74 -0
  106. package/src/resources/files.ts +8 -6
  107. package/src/resources/index.ts +1 -0
  108. package/src/version.ts +1 -1
  109. package/version.d.mts +1 -1
  110. package/version.d.ts +1 -1
  111. package/version.js +1 -1
  112. package/version.mjs +1 -1
  113. package/resources/content/models/fields.d.mts.map +0 -1
  114. package/resources/content/models/fields.d.ts.map +0 -1
  115. package/resources/content/models/fields.js +0 -37
  116. package/resources/content/models/fields.js.map +0 -1
  117. package/resources/content/models/fields.mjs +0 -33
  118. package/resources/content/models/fields.mjs.map +0 -1
  119. package/resources/content/models/index.d.mts +0 -3
  120. package/resources/content/models/index.d.mts.map +0 -1
  121. package/resources/content/models/index.d.ts +0 -3
  122. package/resources/content/models/index.d.ts.map +0 -1
  123. package/resources/content/models/index.js.map +0 -1
  124. package/resources/content/models/index.mjs.map +0 -1
  125. package/resources/content/models/models.d.mts.map +0 -1
  126. package/resources/content/models/models.d.ts.map +0 -1
  127. package/resources/content/models/models.js +0 -54
  128. package/resources/content/models/models.js.map +0 -1
  129. package/resources/content/models/models.mjs +0 -49
  130. package/resources/content/models/models.mjs.map +0 -1
  131. package/resources/content/models.d.mts +0 -2
  132. package/resources/content/models.d.mts.map +0 -1
  133. package/resources/content/models.d.ts +0 -2
  134. package/resources/content/models.d.ts.map +0 -1
  135. package/resources/content/models.js.map +0 -1
  136. package/resources/content/models.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"parse.mjs","sourceRoot":"","sources":["../src/internal/parse.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAI/E,EAAE,oBAAoB,EAAE,SAAS,EAAE;AAW1C,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAI,MAAgB,EAAE,KAAuB;IACrF,MAAM,EAAE,QAAQ,EAAE,YAAY,EAAE,mBAAmB,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACzE,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,IAAI,EAAE;QAC7B,8DAA8D;QAC9D,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG,EAAE,CAAC;YAC5B,OAAO,IAAS,CAAC;QACnB,CAAC;QAED,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,EAAE,CAAC;YACnC,OAAO,QAAwB,CAAC;QAClC,CAAC;QAED,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACzD,MAAM,SAAS,GAAG,WAAW,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC;QACrD,MAAM,MAAM,GAAG,SAAS,EAAE,QAAQ,CAAC,kBAAkB,CAAC,IAAI,SAAS,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;QACvF,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,IAAS,CAAC;QACnB,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,IAAoB,CAAC;IAC9B,CAAC,CAAC,EAAE,CAAC;IAC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CAAC;YAC7D,IAAI,aAAa,KAAK,GAAG,EAAE,CAAC;gBAC1B,8CAA8C;gBAC9C,OAAO,SAAc,CAAC;YACxB,CAAC;YAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,IAAS,CAAC;QACnB,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QACnC,OAAO,IAAoB,CAAC;IAC9B,CAAC,CAAC,EAAE,CAAC;IACL,SAAS,CAAC,MAAM,CAAC,CAAC,KAAK,CACrB,IAAI,YAAY,mBAAmB,EACnC,oBAAoB,CAAC;QACnB,mBAAmB;QACnB,GAAG,EAAE,QAAQ,CAAC,GAAG;QACjB,MAAM,EAAE,QAAQ,CAAC,MAAM;QACvB,IAAI;QACJ,UAAU,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,SAAS;KACnC,CAAC,CACH,CAAC;IACF,OAAO,IAAI,CAAC;AACd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usehercules/sdk",
3
- "version": "1.14.0",
3
+ "version": "1.14.2",
4
4
  "description": "The official TypeScript library for the Hercules API",
5
5
  "author": "Hercules <hello@hercules.app>",
6
6
  "types": "./index.d.ts",
@@ -4,37 +4,80 @@ import { FieldCreateParams, FieldDeleteParams, FieldUpdateParams, Fields } from
4
4
  import { APIPromise } from "../../../core/api-promise.mjs";
5
5
  import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.mjs";
6
6
  import { RequestOptions } from "../../../internal/request-options.mjs";
7
- export declare class Models extends APIResource {
7
+ export declare class Collections extends APIResource {
8
8
  fields: FieldsAPI.Fields;
9
9
  /**
10
- * Creates a new content model with optional initial fields. Content models define
11
- * the schema for entries. Example models: 'Blog Post', 'Product', 'Author'.
10
+ * Creates a new content collection with optional initial fields. Content
11
+ * collections define the schema for entries. Example collections: 'Blog Post',
12
+ * 'Product', 'Author'.
12
13
  */
13
- create(body: ModelCreateParams, options?: RequestOptions): APIPromise<Model>;
14
+ create(body: CollectionCreateParams, options?: RequestOptions): APIPromise<Collection>;
14
15
  /**
15
- * Updates an existing content model. Use this to modify the name, description, or
16
- * lock status. The api_id cannot be changed after creation.
16
+ * Updates an existing content collection. Use this to modify the name,
17
+ * description, or lock status. The api_id cannot be changed after creation.
17
18
  */
18
- update(modelID: string, body?: ModelUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Model>;
19
+ update(collectionID: string, body?: CollectionUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Collection>;
19
20
  /**
20
- * Retrieves a paginated list of content models. Content models define the
21
- * schema/structure for content entries.
21
+ * Retrieves a paginated list of content collections. Content collections define
22
+ * the schema/structure for content entries.
22
23
  */
23
- list(query?: ModelListParams | null | undefined, options?: RequestOptions): PagePromise<ModelsCursorIDPage, Model>;
24
+ list(query?: CollectionListParams | null | undefined, options?: RequestOptions): PagePromise<CollectionsCursorIDPage, Collection>;
24
25
  /**
25
- * Archives a content model, hiding it from the API. Existing entries are
26
+ * Archives a content collection, hiding it from the API. Existing entries are
26
27
  * preserved. Use this instead of deletion to maintain data integrity.
27
28
  */
28
- archive(modelID: string, options?: RequestOptions): APIPromise<Model>;
29
+ archive(collectionID: string, options?: RequestOptions): APIPromise<Collection>;
29
30
  /**
30
- * Retrieves a content model by ID. Returns the model object including all field
31
- * definitions.
31
+ * Retrieves a content collection by ID. Returns the collection object including
32
+ * all field definitions.
32
33
  */
33
- get(modelID: string, options?: RequestOptions): APIPromise<Model>;
34
+ get(collectionID: string, options?: RequestOptions): APIPromise<Collection>;
34
35
  }
35
- export type ModelsCursorIDPage = CursorIDPage<Model>;
36
+ export type CollectionsCursorIDPage = CursorIDPage<Collection>;
36
37
  /**
37
- * A field definition within a content model
38
+ * A content collection defines the schema/structure for content entries. Each
39
+ * collection has fields that define what data entries can contain.
40
+ */
41
+ export interface Collection {
42
+ /**
43
+ * Unique identifier for the content collection
44
+ */
45
+ id: string;
46
+ /**
47
+ * API identifier for the collection (camelCase, e.g., 'blogPost', 'product')
48
+ */
49
+ api_id: string;
50
+ /**
51
+ * Timestamp when the collection was created
52
+ */
53
+ created: string;
54
+ /**
55
+ * Whether field modifications are locked (for production safety)
56
+ */
57
+ locked: boolean;
58
+ /**
59
+ * Display name for the collection
60
+ */
61
+ name: string;
62
+ /**
63
+ * Timestamp when the collection was last updated
64
+ */
65
+ updated: string;
66
+ /**
67
+ * Schema version number
68
+ */
69
+ version: number;
70
+ /**
71
+ * Description of the collection
72
+ */
73
+ description?: string | null;
74
+ /**
75
+ * Fields defined in this collection
76
+ */
77
+ fields?: Array<Field>;
78
+ }
79
+ /**
80
+ * A field definition within a content collection
38
81
  */
39
82
  export interface Field {
40
83
  /**
@@ -62,7 +105,7 @@ export interface Field {
62
105
  */
63
106
  description?: string | null;
64
107
  /**
65
- * Display order within the model
108
+ * Display order within the collection
66
109
  */
67
110
  display_order?: number;
68
111
  /**
@@ -80,13 +123,13 @@ export declare namespace Field {
80
123
  */
81
124
  interface Validation {
82
125
  /**
83
- * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
126
+ * Allowed collection apiIds for reference fields
84
127
  */
85
- allowed_mime_types?: Array<string>;
128
+ allowed_collections?: Array<string>;
86
129
  /**
87
- * Allowed model apiIds for reference fields
130
+ * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
88
131
  */
89
- allowed_models?: Array<string>;
132
+ allowed_mime_types?: Array<string>;
90
133
  /**
91
134
  * Allowed values for enum fields
92
135
  */
@@ -121,74 +164,32 @@ export declare namespace Field {
121
164
  unique?: boolean;
122
165
  }
123
166
  }
124
- /**
125
- * A content model defines the schema/structure for content entries. Each model has
126
- * fields that define what data entries can contain.
127
- */
128
- export interface Model {
129
- /**
130
- * Unique identifier for the content model
131
- */
132
- id: string;
133
- /**
134
- * API identifier for the model (camelCase, e.g., 'blogPost', 'product')
135
- */
136
- api_id: string;
137
- /**
138
- * Timestamp when the model was created
139
- */
140
- created: string;
141
- /**
142
- * Whether field modifications are locked (for production safety)
143
- */
144
- locked: boolean;
145
- /**
146
- * Display name for the model
147
- */
148
- name: string;
167
+ export interface CollectionCreateParams {
149
168
  /**
150
- * Timestamp when the model was last updated
151
- */
152
- updated: string;
153
- /**
154
- * Schema version number
155
- */
156
- version: number;
157
- /**
158
- * Description of the model
159
- */
160
- description?: string | null;
161
- /**
162
- * Fields defined in this model
163
- */
164
- fields?: Array<Field>;
165
- }
166
- export interface ModelCreateParams {
167
- /**
168
- * API identifier for the model (camelCase, e.g., 'blogPost')
169
+ * API identifier for the collection (camelCase, e.g., 'blogPost')
169
170
  */
170
171
  api_id: string;
171
172
  /**
172
- * Display name for the model
173
+ * Display name for the collection
173
174
  */
174
175
  name: string;
175
176
  /**
176
- * Optional custom ID for the model. Must start with 'cm\_'. If not provided, one
177
- * will be generated.
177
+ * Optional custom ID for the collection. Must start with 'cm\_'. If not provided,
178
+ * one will be generated.
178
179
  */
179
180
  id?: string;
180
181
  /**
181
- * Description of the model
182
+ * Description of the collection
182
183
  */
183
184
  description?: string;
184
185
  /**
185
- * Initial fields to create with the model
186
+ * Initial fields to create with the collection
186
187
  */
187
- fields?: Array<ModelCreateParams.Field>;
188
+ fields?: Array<CollectionCreateParams.Field>;
188
189
  }
189
- export declare namespace ModelCreateParams {
190
+ export declare namespace CollectionCreateParams {
190
191
  /**
191
- * Request to add a new field to a content model
192
+ * Request to add a new field to a content collection
192
193
  */
193
194
  interface Field {
194
195
  /**
@@ -213,7 +214,7 @@ export declare namespace ModelCreateParams {
213
214
  */
214
215
  description?: string;
215
216
  /**
216
- * Display order within the model
217
+ * Display order within the collection
217
218
  */
218
219
  display_order?: number;
219
220
  /**
@@ -231,13 +232,13 @@ export declare namespace ModelCreateParams {
231
232
  */
232
233
  interface Validation {
233
234
  /**
234
- * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
235
+ * Allowed collection apiIds for reference fields
235
236
  */
236
- allowed_mime_types?: Array<string>;
237
+ allowed_collections?: Array<string>;
237
238
  /**
238
- * Allowed model apiIds for reference fields
239
+ * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
239
240
  */
240
- allowed_models?: Array<string>;
241
+ allowed_mime_types?: Array<string>;
241
242
  /**
242
243
  * Allowed values for enum fields
243
244
  */
@@ -273,24 +274,24 @@ export declare namespace ModelCreateParams {
273
274
  }
274
275
  }
275
276
  }
276
- export interface ModelUpdateParams {
277
+ export interface CollectionUpdateParams {
277
278
  /**
278
- * Description of the model
279
+ * Description of the collection
279
280
  */
280
281
  description?: string;
281
282
  /**
282
- * Lock the model to prevent field modifications
283
+ * Lock the collection to prevent field modifications
283
284
  */
284
285
  locked?: boolean;
285
286
  /**
286
- * Display name for the model
287
+ * Display name for the collection
287
288
  */
288
289
  name?: string;
289
290
  }
290
- export interface ModelListParams extends CursorIDPageParams {
291
+ export interface CollectionListParams extends CursorIDPageParams {
291
292
  }
292
- export declare namespace Models {
293
- export { type Field as Field, type Model as Model, type ModelsCursorIDPage as ModelsCursorIDPage, type ModelCreateParams as ModelCreateParams, type ModelUpdateParams as ModelUpdateParams, type ModelListParams as ModelListParams, };
293
+ export declare namespace Collections {
294
+ export { type Collection as Collection, type Field as Field, type CollectionsCursorIDPage as CollectionsCursorIDPage, type CollectionCreateParams as CollectionCreateParams, type CollectionUpdateParams as CollectionUpdateParams, type CollectionListParams as CollectionListParams, };
294
295
  export { Fields as Fields, type FieldCreateParams as FieldCreateParams, type FieldUpdateParams as FieldUpdateParams, type FieldDeleteParams as FieldDeleteParams, };
295
296
  }
296
- //# sourceMappingURL=models.d.mts.map
297
+ //# sourceMappingURL=collections.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.d.mts","sourceRoot":"","sources":["../../../src/resources/content/collections/collections.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE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 -4,37 +4,80 @@ import { FieldCreateParams, FieldDeleteParams, FieldUpdateParams, Fields } from
4
4
  import { APIPromise } from "../../../core/api-promise.js";
5
5
  import { CursorIDPage, type CursorIDPageParams, PagePromise } from "../../../core/pagination.js";
6
6
  import { RequestOptions } from "../../../internal/request-options.js";
7
- export declare class Models extends APIResource {
7
+ export declare class Collections extends APIResource {
8
8
  fields: FieldsAPI.Fields;
9
9
  /**
10
- * Creates a new content model with optional initial fields. Content models define
11
- * the schema for entries. Example models: 'Blog Post', 'Product', 'Author'.
10
+ * Creates a new content collection with optional initial fields. Content
11
+ * collections define the schema for entries. Example collections: 'Blog Post',
12
+ * 'Product', 'Author'.
12
13
  */
13
- create(body: ModelCreateParams, options?: RequestOptions): APIPromise<Model>;
14
+ create(body: CollectionCreateParams, options?: RequestOptions): APIPromise<Collection>;
14
15
  /**
15
- * Updates an existing content model. Use this to modify the name, description, or
16
- * lock status. The api_id cannot be changed after creation.
16
+ * Updates an existing content collection. Use this to modify the name,
17
+ * description, or lock status. The api_id cannot be changed after creation.
17
18
  */
18
- update(modelID: string, body?: ModelUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Model>;
19
+ update(collectionID: string, body?: CollectionUpdateParams | null | undefined, options?: RequestOptions): APIPromise<Collection>;
19
20
  /**
20
- * Retrieves a paginated list of content models. Content models define the
21
- * schema/structure for content entries.
21
+ * Retrieves a paginated list of content collections. Content collections define
22
+ * the schema/structure for content entries.
22
23
  */
23
- list(query?: ModelListParams | null | undefined, options?: RequestOptions): PagePromise<ModelsCursorIDPage, Model>;
24
+ list(query?: CollectionListParams | null | undefined, options?: RequestOptions): PagePromise<CollectionsCursorIDPage, Collection>;
24
25
  /**
25
- * Archives a content model, hiding it from the API. Existing entries are
26
+ * Archives a content collection, hiding it from the API. Existing entries are
26
27
  * preserved. Use this instead of deletion to maintain data integrity.
27
28
  */
28
- archive(modelID: string, options?: RequestOptions): APIPromise<Model>;
29
+ archive(collectionID: string, options?: RequestOptions): APIPromise<Collection>;
29
30
  /**
30
- * Retrieves a content model by ID. Returns the model object including all field
31
- * definitions.
31
+ * Retrieves a content collection by ID. Returns the collection object including
32
+ * all field definitions.
32
33
  */
33
- get(modelID: string, options?: RequestOptions): APIPromise<Model>;
34
+ get(collectionID: string, options?: RequestOptions): APIPromise<Collection>;
34
35
  }
35
- export type ModelsCursorIDPage = CursorIDPage<Model>;
36
+ export type CollectionsCursorIDPage = CursorIDPage<Collection>;
36
37
  /**
37
- * A field definition within a content model
38
+ * A content collection defines the schema/structure for content entries. Each
39
+ * collection has fields that define what data entries can contain.
40
+ */
41
+ export interface Collection {
42
+ /**
43
+ * Unique identifier for the content collection
44
+ */
45
+ id: string;
46
+ /**
47
+ * API identifier for the collection (camelCase, e.g., 'blogPost', 'product')
48
+ */
49
+ api_id: string;
50
+ /**
51
+ * Timestamp when the collection was created
52
+ */
53
+ created: string;
54
+ /**
55
+ * Whether field modifications are locked (for production safety)
56
+ */
57
+ locked: boolean;
58
+ /**
59
+ * Display name for the collection
60
+ */
61
+ name: string;
62
+ /**
63
+ * Timestamp when the collection was last updated
64
+ */
65
+ updated: string;
66
+ /**
67
+ * Schema version number
68
+ */
69
+ version: number;
70
+ /**
71
+ * Description of the collection
72
+ */
73
+ description?: string | null;
74
+ /**
75
+ * Fields defined in this collection
76
+ */
77
+ fields?: Array<Field>;
78
+ }
79
+ /**
80
+ * A field definition within a content collection
38
81
  */
39
82
  export interface Field {
40
83
  /**
@@ -62,7 +105,7 @@ export interface Field {
62
105
  */
63
106
  description?: string | null;
64
107
  /**
65
- * Display order within the model
108
+ * Display order within the collection
66
109
  */
67
110
  display_order?: number;
68
111
  /**
@@ -80,13 +123,13 @@ export declare namespace Field {
80
123
  */
81
124
  interface Validation {
82
125
  /**
83
- * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
126
+ * Allowed collection apiIds for reference fields
84
127
  */
85
- allowed_mime_types?: Array<string>;
128
+ allowed_collections?: Array<string>;
86
129
  /**
87
- * Allowed model apiIds for reference fields
130
+ * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
88
131
  */
89
- allowed_models?: Array<string>;
132
+ allowed_mime_types?: Array<string>;
90
133
  /**
91
134
  * Allowed values for enum fields
92
135
  */
@@ -121,74 +164,32 @@ export declare namespace Field {
121
164
  unique?: boolean;
122
165
  }
123
166
  }
124
- /**
125
- * A content model defines the schema/structure for content entries. Each model has
126
- * fields that define what data entries can contain.
127
- */
128
- export interface Model {
129
- /**
130
- * Unique identifier for the content model
131
- */
132
- id: string;
133
- /**
134
- * API identifier for the model (camelCase, e.g., 'blogPost', 'product')
135
- */
136
- api_id: string;
137
- /**
138
- * Timestamp when the model was created
139
- */
140
- created: string;
141
- /**
142
- * Whether field modifications are locked (for production safety)
143
- */
144
- locked: boolean;
145
- /**
146
- * Display name for the model
147
- */
148
- name: string;
167
+ export interface CollectionCreateParams {
149
168
  /**
150
- * Timestamp when the model was last updated
151
- */
152
- updated: string;
153
- /**
154
- * Schema version number
155
- */
156
- version: number;
157
- /**
158
- * Description of the model
159
- */
160
- description?: string | null;
161
- /**
162
- * Fields defined in this model
163
- */
164
- fields?: Array<Field>;
165
- }
166
- export interface ModelCreateParams {
167
- /**
168
- * API identifier for the model (camelCase, e.g., 'blogPost')
169
+ * API identifier for the collection (camelCase, e.g., 'blogPost')
169
170
  */
170
171
  api_id: string;
171
172
  /**
172
- * Display name for the model
173
+ * Display name for the collection
173
174
  */
174
175
  name: string;
175
176
  /**
176
- * Optional custom ID for the model. Must start with 'cm\_'. If not provided, one
177
- * will be generated.
177
+ * Optional custom ID for the collection. Must start with 'cm\_'. If not provided,
178
+ * one will be generated.
178
179
  */
179
180
  id?: string;
180
181
  /**
181
- * Description of the model
182
+ * Description of the collection
182
183
  */
183
184
  description?: string;
184
185
  /**
185
- * Initial fields to create with the model
186
+ * Initial fields to create with the collection
186
187
  */
187
- fields?: Array<ModelCreateParams.Field>;
188
+ fields?: Array<CollectionCreateParams.Field>;
188
189
  }
189
- export declare namespace ModelCreateParams {
190
+ export declare namespace CollectionCreateParams {
190
191
  /**
191
- * Request to add a new field to a content model
192
+ * Request to add a new field to a content collection
192
193
  */
193
194
  interface Field {
194
195
  /**
@@ -213,7 +214,7 @@ export declare namespace ModelCreateParams {
213
214
  */
214
215
  description?: string;
215
216
  /**
216
- * Display order within the model
217
+ * Display order within the collection
217
218
  */
218
219
  display_order?: number;
219
220
  /**
@@ -231,13 +232,13 @@ export declare namespace ModelCreateParams {
231
232
  */
232
233
  interface Validation {
233
234
  /**
234
- * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
235
+ * Allowed collection apiIds for reference fields
235
236
  */
236
- allowed_mime_types?: Array<string>;
237
+ allowed_collections?: Array<string>;
237
238
  /**
238
- * Allowed model apiIds for reference fields
239
+ * Allowed MIME types for asset fields (e.g., 'image/\*', 'application/pdf')
239
240
  */
240
- allowed_models?: Array<string>;
241
+ allowed_mime_types?: Array<string>;
241
242
  /**
242
243
  * Allowed values for enum fields
243
244
  */
@@ -273,24 +274,24 @@ export declare namespace ModelCreateParams {
273
274
  }
274
275
  }
275
276
  }
276
- export interface ModelUpdateParams {
277
+ export interface CollectionUpdateParams {
277
278
  /**
278
- * Description of the model
279
+ * Description of the collection
279
280
  */
280
281
  description?: string;
281
282
  /**
282
- * Lock the model to prevent field modifications
283
+ * Lock the collection to prevent field modifications
283
284
  */
284
285
  locked?: boolean;
285
286
  /**
286
- * Display name for the model
287
+ * Display name for the collection
287
288
  */
288
289
  name?: string;
289
290
  }
290
- export interface ModelListParams extends CursorIDPageParams {
291
+ export interface CollectionListParams extends CursorIDPageParams {
291
292
  }
292
- export declare namespace Models {
293
- export { type Field as Field, type Model as Model, type ModelsCursorIDPage as ModelsCursorIDPage, type ModelCreateParams as ModelCreateParams, type ModelUpdateParams as ModelUpdateParams, type ModelListParams as ModelListParams, };
293
+ export declare namespace Collections {
294
+ export { type Collection as Collection, type Field as Field, type CollectionsCursorIDPage as CollectionsCursorIDPage, type CollectionCreateParams as CollectionCreateParams, type CollectionUpdateParams as CollectionUpdateParams, type CollectionListParams as CollectionListParams, };
294
295
  export { Fields as Fields, type FieldCreateParams as FieldCreateParams, type FieldUpdateParams as FieldUpdateParams, type FieldDeleteParams as FieldDeleteParams, };
295
296
  }
296
- //# sourceMappingURL=models.d.ts.map
297
+ //# sourceMappingURL=collections.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.d.ts","sourceRoot":"","sources":["../../../src/resources/content/collections/collections.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,SAAS;OACd,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,EAAE;OACnE,EAAE,UAAU,EAAE;OACd,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,WAAW,EAAE;OACtD,EAAE,cAAc,EAAE;AAGzB,qBAAa,WAAY,SAAQ,WAAW;IAC1C,MAAM,EAAE,SAAS,CAAC,MAAM,CAAsC;IAE9D;;;;OAIG;IACH,MAAM,CAAC,IAAI,EAAE,sBAAsB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAItF;;;OAGG;IACH,MAAM,CACJ,YAAY,EAAE,MAAM,EACpB,IAAI,GAAE,sBAAsB,GAAG,IAAI,GAAG,SAAc,EACpD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,UAAU,CAAC;IAIzB;;;OAGG;IACH,IAAI,CACF,KAAK,GAAE,oBAAoB,GAAG,IAAI,GAAG,SAAc,EACnD,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,uBAAuB,EAAE,UAAU,CAAC;IAOnD;;;OAGG;IACH,OAAO,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,UAAU,CAAC;IAI/E;;;OAGG;IACH,GAAG,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,G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,CAAC,OAAO,WAAW,WAAW,CAAC;IACnC,OAAO,EACL,KAAK,UAAU,IAAI,UAAU,EAC7B,KAAK,KAAK,IAAI,KAAK,EACnB,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,sBAAsB,IAAI,sBAAsB,EACrD,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;IAEF,OAAO,EACL,MAAM,IAAI,MAAM,EAChB,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,iBAAiB,IAAI,iBAAiB,GAC5C,CAAC;CACH"}
@@ -0,0 +1,58 @@
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.Collections = void 0;
5
+ const tslib_1 = require("../../../internal/tslib.js");
6
+ const resource_1 = require("../../../core/resource.js");
7
+ const FieldsAPI = tslib_1.__importStar(require("./fields.js"));
8
+ const fields_1 = require("./fields.js");
9
+ const pagination_1 = require("../../../core/pagination.js");
10
+ const path_1 = require("../../../internal/utils/path.js");
11
+ class Collections extends resource_1.APIResource {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.fields = new FieldsAPI.Fields(this._client);
15
+ }
16
+ /**
17
+ * Creates a new content collection with optional initial fields. Content
18
+ * collections define the schema for entries. Example collections: 'Blog Post',
19
+ * 'Product', 'Author'.
20
+ */
21
+ create(body, options) {
22
+ return this._client.post('/v1/content/collections', { body, ...options });
23
+ }
24
+ /**
25
+ * Updates an existing content collection. Use this to modify the name,
26
+ * description, or lock status. The api_id cannot be changed after creation.
27
+ */
28
+ update(collectionID, body = {}, options) {
29
+ return this._client.patch((0, path_1.path) `/v1/content/collections/${collectionID}`, { body, ...options });
30
+ }
31
+ /**
32
+ * Retrieves a paginated list of content collections. Content collections define
33
+ * the schema/structure for content entries.
34
+ */
35
+ list(query = {}, options) {
36
+ return this._client.getAPIList('/v1/content/collections', (pagination_1.CursorIDPage), {
37
+ query,
38
+ ...options,
39
+ });
40
+ }
41
+ /**
42
+ * Archives a content collection, hiding it from the API. Existing entries are
43
+ * preserved. Use this instead of deletion to maintain data integrity.
44
+ */
45
+ archive(collectionID, options) {
46
+ return this._client.delete((0, path_1.path) `/v1/content/collections/${collectionID}`, options);
47
+ }
48
+ /**
49
+ * Retrieves a content collection by ID. Returns the collection object including
50
+ * all field definitions.
51
+ */
52
+ get(collectionID, options) {
53
+ return this._client.get((0, path_1.path) `/v1/content/collections/${collectionID}`, options);
54
+ }
55
+ }
56
+ exports.Collections = Collections;
57
+ Collections.Fields = fields_1.Fields;
58
+ //# sourceMappingURL=collections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../../src/resources/content/collections/collections.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;AAEtF,wDAAqD;AACrD,+DAAsC;AACtC,wCAA2F;AAE3F,4DAA8F;AAE9F,0DAAoD;AAEpD,MAAa,WAAY,SAAQ,sBAAW;IAA5C;;QACE,WAAM,GAAqB,IAAI,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAoDhE,CAAC;IAlDC;;;;OAIG;IACH,MAAM,CAAC,IAA4B,EAAE,OAAwB;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,yBAAyB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC5E,CAAC;IAED;;;OAGG;IACH,MAAM,CACJ,YAAoB,EACpB,OAAkD,EAAE,EACpD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,2BAA2B,YAAY,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACjG,CAAC;IAED;;;OAGG;IACH,IAAI,CACF,QAAiD,EAAE,EACnD,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