webflow-api 2.3.5 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (414) hide show
  1. package/api/errors/TooManyRequestsError.d.ts +2 -1
  2. package/api/errors/index.d.ts +1 -1
  3. package/api/errors/index.js +1 -1
  4. package/api/resources/accessGroups/client/Client.d.ts +1 -1
  5. package/api/resources/accessGroups/client/Client.js +12 -4
  6. package/api/resources/assets/client/Client.d.ts +8 -8
  7. package/api/resources/assets/client/Client.js +98 -34
  8. package/api/resources/collections/client/Client.d.ts +5 -5
  9. package/api/resources/collections/client/Client.js +59 -19
  10. package/api/resources/collections/resources/fields/client/Client.d.ts +3 -3
  11. package/api/resources/collections/resources/fields/client/Client.js +27 -11
  12. package/api/resources/collections/resources/fields/client/requests/FieldCreate.d.ts +1 -1
  13. package/api/resources/collections/resources/items/client/Client.d.ts +19 -19
  14. package/api/resources/collections/resources/items/client/Client.js +175 -57
  15. package/api/resources/collections/resources/items/client/requests/index.d.ts +0 -1
  16. package/api/resources/collections/resources/items/types/ItemsPublishItemResponse.d.ts +7 -0
  17. package/api/resources/collections/resources/items/types/index.d.ts +1 -1
  18. package/api/resources/collections/resources/items/types/index.js +1 -1
  19. package/api/resources/ecommerce/client/Client.d.ts +1 -1
  20. package/api/resources/ecommerce/client/Client.js +12 -4
  21. package/api/resources/forms/client/Client.d.ts +7 -6
  22. package/api/resources/forms/client/Client.js +72 -24
  23. package/api/resources/forms/client/requests/FormsListSubmissionsRequest.d.ts +17 -0
  24. package/api/resources/forms/client/requests/index.d.ts +1 -0
  25. package/api/resources/index.d.ts +3 -3
  26. package/api/resources/index.js +4 -4
  27. package/api/resources/inventory/client/Client.d.ts +3 -3
  28. package/api/resources/inventory/client/Client.js +26 -10
  29. package/api/resources/inventory/client/requests/InventoryUpdateRequest.d.ts +1 -1
  30. package/api/resources/orders/client/Client.d.ts +6 -6
  31. package/api/resources/orders/client/Client.js +75 -29
  32. package/api/resources/pages/client/Client.d.ts +24 -11
  33. package/api/resources/pages/client/Client.js +79 -26
  34. package/api/resources/pages/client/requests/PagesGetContentRequest.d.ts +3 -1
  35. package/api/resources/pages/client/requests/PagesGetMetadataRequest.d.ts +3 -1
  36. package/api/resources/pages/client/requests/PagesListRequest.d.ts +3 -1
  37. package/api/resources/pages/client/requests/UpdatePageSettingsRequest.d.ts +6 -3
  38. package/api/resources/pages/resources/scripts/client/Client.d.ts +5 -5
  39. package/api/resources/pages/resources/scripts/client/Client.js +38 -14
  40. package/api/resources/products/client/Client.d.ts +6 -6
  41. package/api/resources/products/client/Client.js +76 -28
  42. package/api/resources/scripts/client/Client.d.ts +3 -3
  43. package/api/resources/scripts/client/Client.js +38 -14
  44. package/api/resources/sites/client/Client.d.ts +5 -7
  45. package/api/resources/sites/client/Client.js +55 -23
  46. package/api/resources/sites/index.d.ts +1 -0
  47. package/api/resources/sites/index.js +1 -0
  48. package/api/resources/sites/resources/activityLogs/client/Client.d.ts +1 -1
  49. package/api/resources/sites/resources/activityLogs/client/Client.js +12 -4
  50. package/api/resources/sites/resources/scripts/client/Client.d.ts +6 -6
  51. package/api/resources/sites/resources/scripts/client/Client.js +50 -18
  52. package/api/resources/sites/types/SitesPublishResponse.d.ts +10 -0
  53. package/api/resources/sites/types/index.d.ts +1 -0
  54. package/{serialization/resources/webhooks/client → api/resources/sites/types}/index.js +1 -1
  55. package/api/resources/token/client/Client.js +8 -4
  56. package/api/resources/users/client/Client.d.ts +5 -5
  57. package/api/resources/users/client/Client.js +61 -21
  58. package/api/resources/webhooks/client/Client.d.ts +13 -8
  59. package/api/resources/webhooks/client/Client.js +56 -19
  60. package/api/resources/webhooks/client/index.d.ts +1 -1
  61. package/api/resources/webhooks/client/index.js +0 -15
  62. package/api/types/Asset.d.ts +10 -8
  63. package/api/{resources/collections/resources/items/client/requests → types}/BulkCollectionItem.d.ts +3 -6
  64. package/{dist/api/resources/collections/resources/items → api}/types/BulkCollectionItemFieldData.d.ts +2 -0
  65. package/api/types/CollectionItemFieldData.d.ts +2 -0
  66. package/api/types/ConflictErrorBody.d.ts +10 -1
  67. package/api/types/DuplicateUserEmail.d.ts +10 -1
  68. package/api/types/Form.d.ts +2 -0
  69. package/api/types/FormSubmissionList.d.ts +1 -1
  70. package/api/types/MissingScopes.d.ts +10 -1
  71. package/api/types/NotEnterprisePlanSite.d.ts +10 -1
  72. package/api/types/{OauthScope.d.ts → OAuthScope.d.ts} +9 -1
  73. package/{dist/api/types/OauthScope.js → api/types/OAuthScope.js} +2 -0
  74. package/api/types/Page.d.ts +5 -1
  75. package/api/types/TooManyRequestsErrorBody.d.ts +9 -0
  76. package/api/types/UserLimitReached.d.ts +10 -1
  77. package/api/types/UsersNotEnabled.d.ts +10 -1
  78. package/api/types/Webhook.d.ts +5 -5
  79. package/api/types/WebhookFilter.d.ts +10 -0
  80. package/api/types/index.d.ts +6 -5
  81. package/api/types/index.js +6 -5
  82. package/core/fetcher/Fetcher.d.ts +4 -1
  83. package/core/fetcher/Fetcher.js +19 -185
  84. package/core/fetcher/createRequestUrl.d.ts +1 -0
  85. package/core/fetcher/createRequestUrl.js +13 -0
  86. package/core/fetcher/getFetchFn.d.ts +4 -0
  87. package/core/fetcher/getFetchFn.js +59 -0
  88. package/core/fetcher/getRequestBody.d.ts +7 -0
  89. package/core/fetcher/getRequestBody.js +23 -0
  90. package/core/fetcher/getResponseBody.d.ts +1 -0
  91. package/core/fetcher/getResponseBody.js +52 -0
  92. package/core/fetcher/makeRequest.d.ts +1 -0
  93. package/core/fetcher/makeRequest.js +42 -0
  94. package/core/fetcher/requestWithRetries.d.ts +1 -0
  95. package/core/fetcher/requestWithRetries.js +32 -0
  96. package/core/fetcher/signals.d.ts +12 -0
  97. package/core/fetcher/signals.js +37 -0
  98. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  99. package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  100. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  101. package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  102. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  103. package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  104. package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  105. package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
  106. package/core/runtime/runtime.d.ts +1 -0
  107. package/core/runtime/runtime.js +1 -0
  108. package/core/schemas/Schema.d.ts +8 -4
  109. package/core/schemas/Schema.js +1 -0
  110. package/core/schemas/builders/bigint/bigint.d.ts +2 -0
  111. package/core/schemas/builders/bigint/bigint.js +50 -0
  112. package/core/schemas/builders/bigint/index.d.ts +1 -0
  113. package/core/schemas/builders/bigint/index.js +5 -0
  114. package/core/schemas/builders/index.d.ts +1 -0
  115. package/core/schemas/builders/index.js +1 -0
  116. package/core/schemas/builders/lazy/lazy.d.ts +2 -2
  117. package/core/schemas/builders/lazy/lazy.js +8 -19
  118. package/core/schemas/builders/lazy/lazyObject.js +1 -10
  119. package/core/schemas/builders/list/list.js +31 -44
  120. package/core/schemas/builders/object/object.js +90 -111
  121. package/core/schemas/builders/object/types.d.ts +2 -2
  122. package/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  123. package/core/schemas/builders/record/record.js +49 -60
  124. package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  125. package/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  126. package/core/schemas/builders/set/set.js +6 -15
  127. package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  128. package/core/schemas/builders/union/union.js +51 -62
  129. package/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
  130. package/core/schemas/utils/maybeSkipValidation.js +3 -12
  131. package/dist/api/errors/TooManyRequestsError.d.ts +2 -1
  132. package/dist/api/errors/index.d.ts +1 -1
  133. package/dist/api/errors/index.js +1 -1
  134. package/dist/api/resources/accessGroups/client/Client.d.ts +1 -1
  135. package/dist/api/resources/accessGroups/client/Client.js +12 -4
  136. package/dist/api/resources/assets/client/Client.d.ts +8 -8
  137. package/dist/api/resources/assets/client/Client.js +98 -34
  138. package/dist/api/resources/collections/client/Client.d.ts +5 -5
  139. package/dist/api/resources/collections/client/Client.js +59 -19
  140. package/dist/api/resources/collections/resources/fields/client/Client.d.ts +3 -3
  141. package/dist/api/resources/collections/resources/fields/client/Client.js +27 -11
  142. package/dist/api/resources/collections/resources/fields/client/requests/FieldCreate.d.ts +1 -1
  143. package/dist/api/resources/collections/resources/items/client/Client.d.ts +19 -19
  144. package/dist/api/resources/collections/resources/items/client/Client.js +175 -57
  145. package/dist/api/resources/collections/resources/items/client/requests/index.d.ts +0 -1
  146. package/dist/api/resources/collections/resources/items/types/ItemsPublishItemResponse.d.ts +7 -0
  147. package/dist/api/resources/collections/resources/items/types/index.d.ts +1 -1
  148. package/dist/api/resources/collections/resources/items/types/index.js +1 -1
  149. package/dist/api/resources/ecommerce/client/Client.d.ts +1 -1
  150. package/dist/api/resources/ecommerce/client/Client.js +12 -4
  151. package/dist/api/resources/forms/client/Client.d.ts +7 -6
  152. package/dist/api/resources/forms/client/Client.js +72 -24
  153. package/dist/api/resources/forms/client/requests/FormsListSubmissionsRequest.d.ts +17 -0
  154. package/dist/api/resources/forms/client/requests/index.d.ts +1 -0
  155. package/dist/api/resources/index.d.ts +3 -3
  156. package/dist/api/resources/index.js +4 -4
  157. package/dist/api/resources/inventory/client/Client.d.ts +3 -3
  158. package/dist/api/resources/inventory/client/Client.js +26 -10
  159. package/dist/api/resources/inventory/client/requests/InventoryUpdateRequest.d.ts +1 -1
  160. package/dist/api/resources/orders/client/Client.d.ts +6 -6
  161. package/dist/api/resources/orders/client/Client.js +75 -29
  162. package/dist/api/resources/pages/client/Client.d.ts +24 -11
  163. package/dist/api/resources/pages/client/Client.js +79 -26
  164. package/dist/api/resources/pages/client/requests/PagesGetContentRequest.d.ts +3 -1
  165. package/dist/api/resources/pages/client/requests/PagesGetMetadataRequest.d.ts +3 -1
  166. package/dist/api/resources/pages/client/requests/PagesListRequest.d.ts +3 -1
  167. package/dist/api/resources/pages/client/requests/UpdatePageSettingsRequest.d.ts +6 -3
  168. package/dist/api/resources/pages/resources/scripts/client/Client.d.ts +5 -5
  169. package/dist/api/resources/pages/resources/scripts/client/Client.js +38 -14
  170. package/dist/api/resources/products/client/Client.d.ts +6 -6
  171. package/dist/api/resources/products/client/Client.js +76 -28
  172. package/dist/api/resources/scripts/client/Client.d.ts +3 -3
  173. package/dist/api/resources/scripts/client/Client.js +38 -14
  174. package/dist/api/resources/sites/client/Client.d.ts +5 -7
  175. package/dist/api/resources/sites/client/Client.js +55 -23
  176. package/dist/api/resources/sites/index.d.ts +1 -0
  177. package/dist/api/resources/sites/index.js +1 -0
  178. package/dist/api/resources/sites/resources/activityLogs/client/Client.d.ts +1 -1
  179. package/dist/api/resources/sites/resources/activityLogs/client/Client.js +12 -4
  180. package/dist/api/resources/sites/resources/scripts/client/Client.d.ts +6 -6
  181. package/dist/api/resources/sites/resources/scripts/client/Client.js +50 -18
  182. package/dist/api/resources/sites/types/SitesPublishResponse.d.ts +10 -0
  183. package/dist/api/resources/sites/types/index.d.ts +1 -0
  184. package/{serialization/resources/webhooks → dist/api/resources/sites/types}/index.js +1 -1
  185. package/dist/api/resources/token/client/Client.js +8 -4
  186. package/dist/api/resources/users/client/Client.d.ts +5 -5
  187. package/dist/api/resources/users/client/Client.js +61 -21
  188. package/dist/api/resources/webhooks/client/Client.d.ts +13 -8
  189. package/dist/api/resources/webhooks/client/Client.js +56 -19
  190. package/dist/api/resources/webhooks/client/index.d.ts +1 -1
  191. package/dist/api/resources/webhooks/client/index.js +0 -15
  192. package/dist/api/types/Asset.d.ts +10 -8
  193. package/dist/api/{resources/collections/resources/items/client/requests → types}/BulkCollectionItem.d.ts +3 -6
  194. package/{api/resources/collections/resources/items → dist/api}/types/BulkCollectionItemFieldData.d.ts +2 -0
  195. package/dist/api/types/CollectionItemFieldData.d.ts +2 -0
  196. package/dist/api/types/ConflictErrorBody.d.ts +10 -1
  197. package/dist/api/types/DuplicateUserEmail.d.ts +10 -1
  198. package/dist/api/types/Form.d.ts +2 -0
  199. package/dist/api/types/FormSubmissionList.d.ts +1 -1
  200. package/dist/api/types/MissingScopes.d.ts +10 -1
  201. package/dist/api/types/NotEnterprisePlanSite.d.ts +10 -1
  202. package/dist/api/types/{OauthScope.d.ts → OAuthScope.d.ts} +9 -1
  203. package/{api/types/OauthScope.js → dist/api/types/OAuthScope.js} +2 -0
  204. package/dist/api/types/Page.d.ts +5 -1
  205. package/dist/api/types/TooManyRequestsErrorBody.d.ts +9 -0
  206. package/dist/api/types/TooManyRequestsErrorBody.js +5 -0
  207. package/dist/api/types/UserLimitReached.d.ts +10 -1
  208. package/dist/api/types/UsersNotEnabled.d.ts +10 -1
  209. package/dist/api/types/Webhook.d.ts +5 -5
  210. package/dist/api/types/WebhookFilter.d.ts +10 -0
  211. package/dist/api/types/WebhookFilter.js +5 -0
  212. package/dist/api/types/index.d.ts +6 -5
  213. package/dist/api/types/index.js +6 -5
  214. package/dist/core/fetcher/Fetcher.d.ts +4 -1
  215. package/dist/core/fetcher/Fetcher.js +19 -185
  216. package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
  217. package/dist/core/fetcher/createRequestUrl.js +13 -0
  218. package/dist/core/fetcher/getFetchFn.d.ts +4 -0
  219. package/dist/core/fetcher/getFetchFn.js +59 -0
  220. package/dist/core/fetcher/getRequestBody.d.ts +7 -0
  221. package/dist/core/fetcher/getRequestBody.js +23 -0
  222. package/dist/core/fetcher/getResponseBody.d.ts +1 -0
  223. package/dist/core/fetcher/getResponseBody.js +52 -0
  224. package/dist/core/fetcher/makeRequest.d.ts +1 -0
  225. package/dist/core/fetcher/makeRequest.js +42 -0
  226. package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
  227. package/dist/core/fetcher/requestWithRetries.js +32 -0
  228. package/dist/core/fetcher/signals.d.ts +12 -0
  229. package/dist/core/fetcher/signals.js +37 -0
  230. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
  231. package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
  232. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
  233. package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
  234. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
  235. package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
  236. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
  237. package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
  238. package/dist/core/runtime/runtime.d.ts +1 -0
  239. package/dist/core/runtime/runtime.js +1 -0
  240. package/dist/core/schemas/Schema.d.ts +8 -4
  241. package/dist/core/schemas/Schema.js +1 -0
  242. package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
  243. package/dist/core/schemas/builders/bigint/bigint.js +50 -0
  244. package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
  245. package/dist/core/schemas/builders/bigint/index.js +5 -0
  246. package/dist/core/schemas/builders/index.d.ts +1 -0
  247. package/dist/core/schemas/builders/index.js +1 -0
  248. package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
  249. package/dist/core/schemas/builders/lazy/lazy.js +8 -19
  250. package/dist/core/schemas/builders/lazy/lazyObject.js +1 -10
  251. package/dist/core/schemas/builders/list/list.js +31 -44
  252. package/dist/core/schemas/builders/object/object.js +90 -111
  253. package/dist/core/schemas/builders/object/types.d.ts +2 -2
  254. package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +3 -12
  255. package/dist/core/schemas/builders/record/record.js +49 -60
  256. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
  257. package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +18 -21
  258. package/dist/core/schemas/builders/set/set.js +6 -15
  259. package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +21 -32
  260. package/dist/core/schemas/builders/union/union.js +51 -62
  261. package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +4 -0
  262. package/dist/core/schemas/utils/maybeSkipValidation.js +3 -12
  263. package/dist/serialization/resources/collections/resources/items/client/requests/index.d.ts +0 -1
  264. package/dist/serialization/resources/collections/resources/items/client/requests/index.js +1 -3
  265. package/dist/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.d.ts +13 -0
  266. package/dist/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.js +34 -0
  267. package/dist/serialization/resources/collections/resources/items/types/index.d.ts +1 -1
  268. package/dist/serialization/resources/collections/resources/items/types/index.js +1 -1
  269. package/dist/serialization/resources/index.d.ts +3 -4
  270. package/dist/serialization/resources/index.js +4 -5
  271. package/dist/serialization/resources/sites/index.d.ts +1 -0
  272. package/dist/serialization/resources/sites/index.js +1 -0
  273. package/dist/serialization/resources/sites/types/SitesPublishResponse.d.ts +14 -0
  274. package/dist/serialization/resources/sites/types/SitesPublishResponse.js +35 -0
  275. package/dist/serialization/resources/sites/types/index.d.ts +1 -0
  276. package/dist/serialization/resources/{webhooks/client → sites/types}/index.js +1 -1
  277. package/dist/serialization/types/Asset.d.ts +5 -4
  278. package/dist/serialization/types/Asset.js +5 -4
  279. package/dist/serialization/{resources/collections/resources/items/client/requests → types}/BulkCollectionItem.d.ts +5 -5
  280. package/dist/serialization/{resources/collections/resources/items/client/requests → types}/BulkCollectionItem.js +2 -2
  281. package/dist/serialization/types/BulkCollectionItemFieldData.d.ts +14 -0
  282. package/dist/serialization/{resources/collections/resources/items/types → types}/BulkCollectionItemFieldData.js +1 -1
  283. package/dist/serialization/types/CollectionItemFieldData.d.ts +1 -0
  284. package/dist/serialization/types/ConflictErrorBody.d.ts +8 -4
  285. package/dist/serialization/types/ConflictErrorBody.js +7 -3
  286. package/dist/serialization/types/DuplicateUserEmail.d.ts +7 -2
  287. package/dist/serialization/types/DuplicateUserEmail.js +31 -2
  288. package/dist/serialization/types/Form.d.ts +1 -0
  289. package/dist/serialization/types/Form.js +1 -0
  290. package/dist/serialization/types/FormSubmissionList.d.ts +1 -1
  291. package/dist/serialization/types/FormSubmissionList.js +1 -1
  292. package/dist/serialization/types/MissingScopes.d.ts +7 -2
  293. package/dist/serialization/types/MissingScopes.js +31 -2
  294. package/dist/serialization/types/NotEnterprisePlanSite.d.ts +7 -2
  295. package/dist/serialization/types/NotEnterprisePlanSite.js +31 -2
  296. package/dist/serialization/types/Page.d.ts +3 -1
  297. package/dist/serialization/types/Page.js +3 -1
  298. package/dist/serialization/types/TooManyRequestsErrorBody.d.ts +15 -0
  299. package/{serialization/types/PageDetailsOpenGraph.js → dist/serialization/types/TooManyRequestsErrorBody.js} +6 -6
  300. package/dist/serialization/types/UserLimitReached.d.ts +7 -2
  301. package/dist/serialization/types/UserLimitReached.js +31 -2
  302. package/dist/serialization/types/UsersNotEnabled.d.ts +7 -2
  303. package/dist/serialization/types/UsersNotEnabled.js +31 -2
  304. package/dist/serialization/types/Webhook.d.ts +4 -3
  305. package/dist/serialization/types/Webhook.js +4 -3
  306. package/dist/serialization/types/WebhookFilter.d.ts +12 -0
  307. package/{serialization/types/PageDetailsSeo.js → dist/serialization/types/WebhookFilter.js} +3 -4
  308. package/dist/serialization/types/index.d.ts +5 -5
  309. package/dist/serialization/types/index.js +5 -5
  310. package/dist/version.d.ts +1 -0
  311. package/dist/{api/resources/webhooks/client/requests/index.js → version.js} +2 -0
  312. package/dist/wrapper/ItemsClient.d.ts +49 -1
  313. package/dist/wrapper/ItemsClient.js +219 -6
  314. package/package.json +7 -2
  315. package/reference.md +5790 -0
  316. package/serialization/resources/collections/resources/items/client/requests/index.d.ts +0 -1
  317. package/serialization/resources/collections/resources/items/client/requests/index.js +1 -3
  318. package/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.d.ts +13 -0
  319. package/serialization/resources/collections/resources/items/types/ItemsPublishItemResponse.js +34 -0
  320. package/serialization/resources/collections/resources/items/types/index.d.ts +1 -1
  321. package/serialization/resources/collections/resources/items/types/index.js +1 -1
  322. package/serialization/resources/index.d.ts +3 -4
  323. package/serialization/resources/index.js +4 -5
  324. package/serialization/resources/sites/index.d.ts +1 -0
  325. package/serialization/resources/sites/index.js +1 -0
  326. package/serialization/resources/sites/types/SitesPublishResponse.d.ts +14 -0
  327. package/serialization/resources/sites/types/SitesPublishResponse.js +35 -0
  328. package/serialization/resources/sites/types/index.d.ts +1 -0
  329. package/{dist/serialization/resources/webhooks → serialization/resources/sites/types}/index.js +1 -1
  330. package/serialization/types/Asset.d.ts +5 -4
  331. package/serialization/types/Asset.js +5 -4
  332. package/serialization/{resources/collections/resources/items/client/requests → types}/BulkCollectionItem.d.ts +5 -5
  333. package/serialization/{resources/collections/resources/items/client/requests → types}/BulkCollectionItem.js +2 -2
  334. package/serialization/types/BulkCollectionItemFieldData.d.ts +14 -0
  335. package/serialization/{resources/collections/resources/items/types → types}/BulkCollectionItemFieldData.js +1 -1
  336. package/serialization/types/CollectionItemFieldData.d.ts +1 -0
  337. package/serialization/types/ConflictErrorBody.d.ts +8 -4
  338. package/serialization/types/ConflictErrorBody.js +7 -3
  339. package/serialization/types/DuplicateUserEmail.d.ts +7 -2
  340. package/serialization/types/DuplicateUserEmail.js +31 -2
  341. package/serialization/types/Form.d.ts +1 -0
  342. package/serialization/types/Form.js +1 -0
  343. package/serialization/types/FormSubmissionList.d.ts +1 -1
  344. package/serialization/types/FormSubmissionList.js +1 -1
  345. package/serialization/types/MissingScopes.d.ts +7 -2
  346. package/serialization/types/MissingScopes.js +31 -2
  347. package/serialization/types/NotEnterprisePlanSite.d.ts +7 -2
  348. package/serialization/types/NotEnterprisePlanSite.js +31 -2
  349. package/serialization/types/Page.d.ts +3 -1
  350. package/serialization/types/Page.js +3 -1
  351. package/serialization/types/TooManyRequestsErrorBody.d.ts +15 -0
  352. package/{dist/serialization/types/PageDetailsOpenGraph.js → serialization/types/TooManyRequestsErrorBody.js} +6 -6
  353. package/serialization/types/UserLimitReached.d.ts +7 -2
  354. package/serialization/types/UserLimitReached.js +31 -2
  355. package/serialization/types/UsersNotEnabled.d.ts +7 -2
  356. package/serialization/types/UsersNotEnabled.js +31 -2
  357. package/serialization/types/Webhook.d.ts +4 -3
  358. package/serialization/types/Webhook.js +4 -3
  359. package/serialization/types/WebhookFilter.d.ts +12 -0
  360. package/{dist/serialization/types/PageDetailsSeo.js → serialization/types/WebhookFilter.js} +3 -4
  361. package/serialization/types/index.d.ts +5 -5
  362. package/serialization/types/index.js +5 -5
  363. package/version.d.ts +1 -0
  364. package/{api/resources/webhooks/client/requests/index.js → version.js} +2 -0
  365. package/wrapper/ItemsClient.d.ts +49 -1
  366. package/wrapper/ItemsClient.js +219 -6
  367. package/api/resources/webhooks/client/requests/WebhooksCreateRequest.d.ts +0 -25
  368. package/api/resources/webhooks/client/requests/index.d.ts +0 -1
  369. package/api/types/PageDetails.d.ts +0 -41
  370. package/api/types/PageDetailsOpenGraph.d.ts +0 -16
  371. package/api/types/PageDetailsSeo.d.ts +0 -12
  372. package/dist/api/resources/webhooks/client/requests/WebhooksCreateRequest.d.ts +0 -25
  373. package/dist/api/resources/webhooks/client/requests/index.d.ts +0 -1
  374. package/dist/api/types/PageDetails.d.ts +0 -41
  375. package/dist/api/types/PageDetailsOpenGraph.d.ts +0 -16
  376. package/dist/api/types/PageDetailsSeo.d.ts +0 -12
  377. package/dist/serialization/resources/collections/resources/items/types/BulkCollectionItemFieldData.d.ts +0 -13
  378. package/dist/serialization/resources/webhooks/client/index.d.ts +0 -1
  379. package/dist/serialization/resources/webhooks/client/requests/WebhooksCreateRequest.d.ts +0 -15
  380. package/dist/serialization/resources/webhooks/client/requests/WebhooksCreateRequest.js +0 -36
  381. package/dist/serialization/resources/webhooks/client/requests/index.d.ts +0 -1
  382. package/dist/serialization/resources/webhooks/client/requests/index.js +0 -5
  383. package/dist/serialization/resources/webhooks/index.d.ts +0 -1
  384. package/dist/serialization/types/OauthScope.d.ts +0 -10
  385. package/dist/serialization/types/OauthScope.js +0 -52
  386. package/dist/serialization/types/PageDetails.d.ts +0 -29
  387. package/dist/serialization/types/PageDetails.js +0 -50
  388. package/dist/serialization/types/PageDetailsOpenGraph.d.ts +0 -15
  389. package/dist/serialization/types/PageDetailsSeo.d.ts +0 -13
  390. package/serialization/resources/collections/resources/items/types/BulkCollectionItemFieldData.d.ts +0 -13
  391. package/serialization/resources/webhooks/client/index.d.ts +0 -1
  392. package/serialization/resources/webhooks/client/requests/WebhooksCreateRequest.d.ts +0 -15
  393. package/serialization/resources/webhooks/client/requests/WebhooksCreateRequest.js +0 -36
  394. package/serialization/resources/webhooks/client/requests/index.d.ts +0 -1
  395. package/serialization/resources/webhooks/client/requests/index.js +0 -5
  396. package/serialization/resources/webhooks/index.d.ts +0 -1
  397. package/serialization/types/OauthScope.d.ts +0 -10
  398. package/serialization/types/OauthScope.js +0 -52
  399. package/serialization/types/PageDetails.d.ts +0 -29
  400. package/serialization/types/PageDetails.js +0 -50
  401. package/serialization/types/PageDetailsOpenGraph.d.ts +0 -15
  402. package/serialization/types/PageDetailsSeo.d.ts +0 -13
  403. /package/api/resources/collections/resources/items/{client/requests/BulkCollectionItem.js → types/ItemsPublishItemResponse.js} +0 -0
  404. /package/api/resources/{collections/resources/items/types/BulkCollectionItemFieldData.js → forms/client/requests/FormsListSubmissionsRequest.js} +0 -0
  405. /package/api/resources/{webhooks/client/requests/WebhooksCreateRequest.js → sites/types/SitesPublishResponse.js} +0 -0
  406. /package/{dist/api/resources/collections/resources/items/client/requests → api/types}/BulkCollectionItem.js +0 -0
  407. /package/{dist/api/resources/collections/resources/items → api}/types/BulkCollectionItemFieldData.js +0 -0
  408. /package/api/types/{PageDetails.js → TooManyRequestsErrorBody.js} +0 -0
  409. /package/api/types/{PageDetailsOpenGraph.js → WebhookFilter.js} +0 -0
  410. /package/{api/types/PageDetailsSeo.js → dist/api/resources/collections/resources/items/types/ItemsPublishItemResponse.js} +0 -0
  411. /package/dist/api/resources/{webhooks/client/requests/WebhooksCreateRequest.js → forms/client/requests/FormsListSubmissionsRequest.js} +0 -0
  412. /package/dist/api/{types/PageDetails.js → resources/sites/types/SitesPublishResponse.js} +0 -0
  413. /package/dist/api/types/{PageDetailsOpenGraph.js → BulkCollectionItem.js} +0 -0
  414. /package/dist/api/types/{PageDetailsSeo.js → BulkCollectionItemFieldData.js} +0 -0
@@ -2,7 +2,36 @@
2
2
  /**
3
3
  * This file was auto-generated by Fern from our API Definition.
4
4
  */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
5
28
  Object.defineProperty(exports, "__esModule", { value: true });
6
29
  exports.UsersNotEnabled = void 0;
7
- const Error_1 = require("./Error_");
8
- exports.UsersNotEnabled = Error_1.Error_;
30
+ const core = __importStar(require("../../core"));
31
+ const ErrorDetailsItem_1 = require("./ErrorDetailsItem");
32
+ exports.UsersNotEnabled = core.serialization.object({
33
+ code: core.serialization.string().optional(),
34
+ message: core.serialization.string().optional(),
35
+ externalReference: core.serialization.string().optional(),
36
+ details: core.serialization.list(ErrorDetailsItem_1.ErrorDetailsItem).optional(),
37
+ });
@@ -5,16 +5,17 @@ import * as serializers from "../index";
5
5
  import * as Webflow from "../../api/index";
6
6
  import * as core from "../../core";
7
7
  import { TriggerType } from "./TriggerType";
8
+ import { WebhookFilter } from "./WebhookFilter";
8
9
  export declare const Webhook: core.serialization.ObjectSchema<serializers.Webhook.Raw, Webflow.Webhook>;
9
10
  export declare namespace Webhook {
10
11
  interface Raw {
11
12
  id?: string | null;
13
+ triggerType?: TriggerType.Raw | null;
14
+ url?: string | null;
12
15
  workspaceId?: string | null;
13
16
  siteId?: string | null;
14
- triggerType?: TriggerType.Raw | null;
15
- filter?: Record<string, unknown> | null;
17
+ filter?: WebhookFilter.Raw | null;
16
18
  lastTriggered?: string | null;
17
19
  createdOn?: string | null;
18
- url?: string | null;
19
20
  }
20
21
  }
@@ -29,13 +29,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.Webhook = void 0;
30
30
  const core = __importStar(require("../../core"));
31
31
  const TriggerType_1 = require("./TriggerType");
32
+ const WebhookFilter_1 = require("./WebhookFilter");
32
33
  exports.Webhook = core.serialization.object({
33
34
  id: core.serialization.string().optional(),
35
+ triggerType: TriggerType_1.TriggerType.optional(),
36
+ url: core.serialization.string().optional(),
34
37
  workspaceId: core.serialization.string().optional(),
35
38
  siteId: core.serialization.string().optional(),
36
- triggerType: TriggerType_1.TriggerType.optional(),
37
- filter: core.serialization.record(core.serialization.string(), core.serialization.unknown()).optional(),
39
+ filter: WebhookFilter_1.WebhookFilter.optional(),
38
40
  lastTriggered: core.serialization.date().optional(),
39
41
  createdOn: core.serialization.date().optional(),
40
- url: core.serialization.string().optional(),
41
42
  });
@@ -0,0 +1,12 @@
1
+ /**
2
+ * This file was auto-generated by Fern from our API Definition.
3
+ */
4
+ import * as serializers from "../index";
5
+ import * as Webflow from "../../api/index";
6
+ import * as core from "../../core";
7
+ export declare const WebhookFilter: core.serialization.ObjectSchema<serializers.WebhookFilter.Raw, Webflow.WebhookFilter>;
8
+ export declare namespace WebhookFilter {
9
+ interface Raw {
10
+ name?: string | null;
11
+ }
12
+ }
@@ -26,9 +26,8 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  return result;
27
27
  };
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
- exports.PageDetailsSeo = void 0;
29
+ exports.WebhookFilter = void 0;
30
30
  const core = __importStar(require("../../core"));
31
- exports.PageDetailsSeo = core.serialization.object({
32
- title: core.serialization.string().optional(),
33
- description: core.serialization.string().optional(),
31
+ exports.WebhookFilter = core.serialization.object({
32
+ name: core.serialization.string().optional(),
34
33
  });
@@ -1,7 +1,8 @@
1
- export * from "./OauthScope";
2
1
  export * from "./ForbiddenErrorBody";
2
+ export * from "./TooManyRequestsErrorBody";
3
3
  export * from "./BadRequestErrorBody";
4
4
  export * from "./ConflictErrorBody";
5
+ export * from "./ErrorDetailsItem";
5
6
  export * from "./AuthorizedUser";
6
7
  export * from "./Application";
7
8
  export * from "./AuthorizationAuthorizationAuthorizedTo";
@@ -20,7 +21,6 @@ export * from "./SiteActivityLogItemUser";
20
21
  export * from "./SiteActivityLogItem";
21
22
  export * from "./Pagination";
22
23
  export * from "./SiteActivityLogResponse";
23
- export * from "./ErrorDetailsItem";
24
24
  export * from "./Error_";
25
25
  export * from "./MissingScopes";
26
26
  export * from "./NotEnterprisePlanSite";
@@ -33,13 +33,12 @@ export * from "./CollectionItemFieldData";
33
33
  export * from "./CollectionItem";
34
34
  export * from "./CollectionItemListPagination";
35
35
  export * from "./CollectionItemList";
36
+ export * from "./BulkCollectionItemFieldData";
37
+ export * from "./BulkCollectionItem";
36
38
  export * from "./PageSeo";
37
39
  export * from "./PageOpenGraph";
38
40
  export * from "./Page";
39
41
  export * from "./PageList";
40
- export * from "./PageDetailsSeo";
41
- export * from "./PageDetailsOpenGraph";
42
- export * from "./PageDetails";
43
42
  export * from "./TextNode";
44
43
  export * from "./ImageNode";
45
44
  export * from "./NodeType";
@@ -63,6 +62,7 @@ export * from "./AssetUpload";
63
62
  export * from "./AssetFolder";
64
63
  export * from "./AssetFolderList";
65
64
  export * from "./TriggerType";
65
+ export * from "./WebhookFilter";
66
66
  export * from "./Webhook";
67
67
  export * from "./WebhookList";
68
68
  export * from "./FormFieldValueType";
@@ -14,10 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./OauthScope"), exports);
18
17
  __exportStar(require("./ForbiddenErrorBody"), exports);
18
+ __exportStar(require("./TooManyRequestsErrorBody"), exports);
19
19
  __exportStar(require("./BadRequestErrorBody"), exports);
20
20
  __exportStar(require("./ConflictErrorBody"), exports);
21
+ __exportStar(require("./ErrorDetailsItem"), exports);
21
22
  __exportStar(require("./AuthorizedUser"), exports);
22
23
  __exportStar(require("./Application"), exports);
23
24
  __exportStar(require("./AuthorizationAuthorizationAuthorizedTo"), exports);
@@ -36,7 +37,6 @@ __exportStar(require("./SiteActivityLogItemUser"), exports);
36
37
  __exportStar(require("./SiteActivityLogItem"), exports);
37
38
  __exportStar(require("./Pagination"), exports);
38
39
  __exportStar(require("./SiteActivityLogResponse"), exports);
39
- __exportStar(require("./ErrorDetailsItem"), exports);
40
40
  __exportStar(require("./Error_"), exports);
41
41
  __exportStar(require("./MissingScopes"), exports);
42
42
  __exportStar(require("./NotEnterprisePlanSite"), exports);
@@ -49,13 +49,12 @@ __exportStar(require("./CollectionItemFieldData"), exports);
49
49
  __exportStar(require("./CollectionItem"), exports);
50
50
  __exportStar(require("./CollectionItemListPagination"), exports);
51
51
  __exportStar(require("./CollectionItemList"), exports);
52
+ __exportStar(require("./BulkCollectionItemFieldData"), exports);
53
+ __exportStar(require("./BulkCollectionItem"), exports);
52
54
  __exportStar(require("./PageSeo"), exports);
53
55
  __exportStar(require("./PageOpenGraph"), exports);
54
56
  __exportStar(require("./Page"), exports);
55
57
  __exportStar(require("./PageList"), exports);
56
- __exportStar(require("./PageDetailsSeo"), exports);
57
- __exportStar(require("./PageDetailsOpenGraph"), exports);
58
- __exportStar(require("./PageDetails"), exports);
59
58
  __exportStar(require("./TextNode"), exports);
60
59
  __exportStar(require("./ImageNode"), exports);
61
60
  __exportStar(require("./NodeType"), exports);
@@ -79,6 +78,7 @@ __exportStar(require("./AssetUpload"), exports);
79
78
  __exportStar(require("./AssetFolder"), exports);
80
79
  __exportStar(require("./AssetFolderList"), exports);
81
80
  __exportStar(require("./TriggerType"), exports);
81
+ __exportStar(require("./WebhookFilter"), exports);
82
82
  __exportStar(require("./Webhook"), exports);
83
83
  __exportStar(require("./WebhookList"), exports);
84
84
  __exportStar(require("./FormFieldValueType"), exports);
@@ -0,0 +1 @@
1
+ export declare const SDK_VERSION = "2.4.0";
@@ -1,2 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SDK_VERSION = void 0;
4
+ exports.SDK_VERSION = "2.4.0";
@@ -26,5 +26,53 @@ export declare class Client extends Items {
26
26
  * }
27
27
  * })
28
28
  */
29
- createItem(collectionId: string, request: Webflow.CollectionItem, requestOptions?: Items.RequestOptions): Promise<void>;
29
+ createItem(collectionId: string, request: Webflow.CollectionItem, requestOptions?: Items.RequestOptions): Promise<Webflow.CollectionItem>;
30
+ /**
31
+ * Create live Item in a Collection. This Item will be published to the live site. </br></br> To create items across multiple locales, <a href="https://developers.webflow.com/data/reference/create-item-for-multiple-locales"> please use this endpoint.</a> </br></br> Required scope | `CMS:write`
32
+ *
33
+ * @param {string} collectionId - Unique identifier for a Collection
34
+ * @param {Webflow.CollectionItem} request
35
+ * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
36
+ *
37
+ * @throws {@link Webflow.BadRequestError}
38
+ * @throws {@link Webflow.UnauthorizedError}
39
+ * @throws {@link Webflow.NotFoundError}
40
+ * @throws {@link Webflow.TooManyRequestsError}
41
+ * @throws {@link Webflow.InternalServerError}
42
+ *
43
+ * @example
44
+ * await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
45
+ * id: "42b720ef280c7a7a3be8cabe",
46
+ * cmsLocaleId: "653ad57de882f528b32e810e",
47
+ * lastPublished: "2022-11-29T16:22:43.159Z",
48
+ * lastUpdated: "2022-11-17T17:19:43.282Z",
49
+ * createdOn: "2022-11-17T17:11:57.148Z",
50
+ * isArchived: false,
51
+ * isDraft: false,
52
+ * fieldData: {
53
+ * name: "Pan Galactic Gargle Blaster Recipe",
54
+ * slug: "pan-galactic-gargle-blaster"
55
+ * }
56
+ * })
57
+ */
58
+ createItemLive(collectionId: string, request: Webflow.CollectionItem, requestOptions?: Items.RequestOptions): Promise<Webflow.CollectionItem>;
59
+ /**
60
+ * Create single Item in a Collection with multiple corresponding locales. </br></br> Required scope | `CMS:write`
61
+ *
62
+ * @param {string} collectionId - Unique identifier for a Collection
63
+ * @param {Webflow.BulkCollectionItem} request
64
+ * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
65
+ *
66
+ * @throws {@link Webflow.BadRequestError}
67
+ * @throws {@link Webflow.UnauthorizedError}
68
+ * @throws {@link Webflow.NotFoundError}
69
+ * @throws {@link Webflow.TooManyRequestsError}
70
+ * @throws {@link Webflow.InternalServerError}
71
+ *
72
+ * @example
73
+ * await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b8b745", {
74
+ * id: "580e64008c9a982ac9b8b754"
75
+ * })
76
+ */
77
+ createItemForMultipleLocales(collectionId: string, request: Webflow.BulkCollectionItem, requestOptions?: Items.RequestOptions): Promise<Webflow.BulkCollectionItem>;
30
78
  }
@@ -44,7 +44,7 @@ const environments = __importStar(require("../environments"));
44
44
  const errors = __importStar(require("../errors"));
45
45
  const serializers = __importStar(require("../serialization"));
46
46
  // Client adapts the base client to permit extra properties in
47
- // the client.Collections.Items.createItem request.
47
+ // the client.Collections.Items.createItem, createItemLive, and createItemForMultipleLocales request.
48
48
  class Client extends Client_1.Items {
49
49
  constructor(_options) {
50
50
  super(_options);
@@ -77,18 +77,20 @@ class Client extends Client_1.Items {
77
77
  var _a;
78
78
  return __awaiter(this, void 0, void 0, function* () {
79
79
  const _response = yield core.fetcher({
80
- url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${collectionId}/items`),
80
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items`),
81
81
  method: "POST",
82
82
  headers: {
83
83
  Authorization: yield this._getAuthorizationHeader(),
84
84
  "X-Fern-Language": "JavaScript",
85
85
  "X-Fern-SDK-Name": "webflow-api",
86
- "X-Fern-SDK-Version": "v2.2.1",
86
+ "X-Fern-SDK-Version": "2.4.0",
87
+ "User-Agent": "webflow-api/2.4.0",
87
88
  "X-Fern-Runtime": core.RUNTIME.type,
88
89
  "X-Fern-Runtime-Version": core.RUNTIME.version,
89
90
  },
90
91
  contentType: "application/json",
91
- body: yield serializers.CollectionItem.jsonOrThrow(request, {
92
+ requestType: "json",
93
+ body: serializers.CollectionItem.jsonOrThrow(request, {
92
94
  unrecognizedObjectKeys: "passthrough",
93
95
  allowUnrecognizedUnionMembers: true,
94
96
  allowUnrecognizedEnumValues: true,
@@ -96,9 +98,214 @@ class Client extends Client_1.Items {
96
98
  }),
97
99
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
98
100
  maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
101
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
99
102
  });
100
103
  if (_response.ok) {
101
- return;
104
+ return serializers.CollectionItem.parseOrThrow(_response.body, {
105
+ unrecognizedObjectKeys: "passthrough",
106
+ allowUnrecognizedUnionMembers: true,
107
+ allowUnrecognizedEnumValues: true,
108
+ skipValidation: true,
109
+ breadcrumbsPrefix: ["response"],
110
+ });
111
+ }
112
+ if (_response.error.reason === "status-code") {
113
+ switch (_response.error.statusCode) {
114
+ case 400:
115
+ throw new Webflow.BadRequestError(_response.error.body);
116
+ case 401:
117
+ throw new Webflow.UnauthorizedError(_response.error.body);
118
+ case 404:
119
+ throw new Webflow.NotFoundError(_response.error.body);
120
+ case 429:
121
+ throw new Webflow.TooManyRequestsError(serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, {
122
+ unrecognizedObjectKeys: "passthrough",
123
+ allowUnrecognizedUnionMembers: true,
124
+ allowUnrecognizedEnumValues: true,
125
+ skipValidation: true,
126
+ breadcrumbsPrefix: ["response"],
127
+ }));
128
+ case 500:
129
+ throw new Webflow.InternalServerError(_response.error.body);
130
+ default:
131
+ throw new errors.WebflowError({
132
+ statusCode: _response.error.statusCode,
133
+ body: _response.error.body,
134
+ });
135
+ }
136
+ }
137
+ switch (_response.error.reason) {
138
+ case "non-json":
139
+ throw new errors.WebflowError({
140
+ statusCode: _response.error.statusCode,
141
+ body: _response.error.rawBody,
142
+ });
143
+ case "timeout":
144
+ throw new errors.WebflowTimeoutError();
145
+ case "unknown":
146
+ throw new errors.WebflowError({
147
+ message: _response.error.errorMessage,
148
+ });
149
+ }
150
+ });
151
+ }
152
+ /**
153
+ * Create live Item in a Collection. This Item will be published to the live site. </br></br> To create items across multiple locales, <a href="https://developers.webflow.com/data/reference/create-item-for-multiple-locales"> please use this endpoint.</a> </br></br> Required scope | `CMS:write`
154
+ *
155
+ * @param {string} collectionId - Unique identifier for a Collection
156
+ * @param {Webflow.CollectionItem} request
157
+ * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
158
+ *
159
+ * @throws {@link Webflow.BadRequestError}
160
+ * @throws {@link Webflow.UnauthorizedError}
161
+ * @throws {@link Webflow.NotFoundError}
162
+ * @throws {@link Webflow.TooManyRequestsError}
163
+ * @throws {@link Webflow.InternalServerError}
164
+ *
165
+ * @example
166
+ * await client.collections.items.createItemLive("580e63fc8c9a982ac9b8b745", {
167
+ * id: "42b720ef280c7a7a3be8cabe",
168
+ * cmsLocaleId: "653ad57de882f528b32e810e",
169
+ * lastPublished: "2022-11-29T16:22:43.159Z",
170
+ * lastUpdated: "2022-11-17T17:19:43.282Z",
171
+ * createdOn: "2022-11-17T17:11:57.148Z",
172
+ * isArchived: false,
173
+ * isDraft: false,
174
+ * fieldData: {
175
+ * name: "Pan Galactic Gargle Blaster Recipe",
176
+ * slug: "pan-galactic-gargle-blaster"
177
+ * }
178
+ * })
179
+ */
180
+ createItemLive(collectionId, request, requestOptions) {
181
+ var _a;
182
+ return __awaiter(this, void 0, void 0, function* () {
183
+ const _response = yield core.fetcher({
184
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/live`),
185
+ method: "POST",
186
+ headers: {
187
+ Authorization: yield this._getAuthorizationHeader(),
188
+ "X-Fern-Language": "JavaScript",
189
+ "X-Fern-SDK-Name": "webflow-api",
190
+ "X-Fern-SDK-Version": "2.4.0",
191
+ "User-Agent": "webflow-api/2.4.0",
192
+ "X-Fern-Runtime": core.RUNTIME.type,
193
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
194
+ },
195
+ contentType: "application/json",
196
+ requestType: "json",
197
+ body: serializers.CollectionItem.jsonOrThrow(request, {
198
+ unrecognizedObjectKeys: "passthrough",
199
+ allowUnrecognizedUnionMembers: true,
200
+ allowUnrecognizedEnumValues: true,
201
+ skipValidation: true,
202
+ }),
203
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
204
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
205
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
206
+ });
207
+ if (_response.ok) {
208
+ return serializers.CollectionItem.parseOrThrow(_response.body, {
209
+ unrecognizedObjectKeys: "passthrough",
210
+ allowUnrecognizedUnionMembers: true,
211
+ allowUnrecognizedEnumValues: true,
212
+ skipValidation: true,
213
+ breadcrumbsPrefix: ["response"],
214
+ });
215
+ }
216
+ if (_response.error.reason === "status-code") {
217
+ switch (_response.error.statusCode) {
218
+ case 400:
219
+ throw new Webflow.BadRequestError(_response.error.body);
220
+ case 401:
221
+ throw new Webflow.UnauthorizedError(_response.error.body);
222
+ case 404:
223
+ throw new Webflow.NotFoundError(_response.error.body);
224
+ case 429:
225
+ throw new Webflow.TooManyRequestsError(serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, {
226
+ unrecognizedObjectKeys: "passthrough",
227
+ allowUnrecognizedUnionMembers: true,
228
+ allowUnrecognizedEnumValues: true,
229
+ skipValidation: true,
230
+ breadcrumbsPrefix: ["response"],
231
+ }));
232
+ case 500:
233
+ throw new Webflow.InternalServerError(_response.error.body);
234
+ default:
235
+ throw new errors.WebflowError({
236
+ statusCode: _response.error.statusCode,
237
+ body: _response.error.body,
238
+ });
239
+ }
240
+ }
241
+ switch (_response.error.reason) {
242
+ case "non-json":
243
+ throw new errors.WebflowError({
244
+ statusCode: _response.error.statusCode,
245
+ body: _response.error.rawBody,
246
+ });
247
+ case "timeout":
248
+ throw new errors.WebflowTimeoutError();
249
+ case "unknown":
250
+ throw new errors.WebflowError({
251
+ message: _response.error.errorMessage,
252
+ });
253
+ }
254
+ });
255
+ }
256
+ /**
257
+ * Create single Item in a Collection with multiple corresponding locales. </br></br> Required scope | `CMS:write`
258
+ *
259
+ * @param {string} collectionId - Unique identifier for a Collection
260
+ * @param {Webflow.BulkCollectionItem} request
261
+ * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
262
+ *
263
+ * @throws {@link Webflow.BadRequestError}
264
+ * @throws {@link Webflow.UnauthorizedError}
265
+ * @throws {@link Webflow.NotFoundError}
266
+ * @throws {@link Webflow.TooManyRequestsError}
267
+ * @throws {@link Webflow.InternalServerError}
268
+ *
269
+ * @example
270
+ * await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b8b745", {
271
+ * id: "580e64008c9a982ac9b8b754"
272
+ * })
273
+ */
274
+ createItemForMultipleLocales(collectionId, request, requestOptions) {
275
+ var _a;
276
+ return __awaiter(this, void 0, void 0, function* () {
277
+ const _response = yield core.fetcher({
278
+ url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `collections/${encodeURIComponent(collectionId)}/items/bulk`),
279
+ method: "POST",
280
+ headers: {
281
+ Authorization: yield this._getAuthorizationHeader(),
282
+ "X-Fern-Language": "JavaScript",
283
+ "X-Fern-SDK-Name": "webflow-api",
284
+ "X-Fern-SDK-Version": "2.4.0",
285
+ "User-Agent": "webflow-api/2.4.0",
286
+ "X-Fern-Runtime": core.RUNTIME.type,
287
+ "X-Fern-Runtime-Version": core.RUNTIME.version,
288
+ },
289
+ contentType: "application/json",
290
+ requestType: "json",
291
+ body: serializers.CollectionItem.jsonOrThrow(request, {
292
+ unrecognizedObjectKeys: "passthrough",
293
+ allowUnrecognizedUnionMembers: true,
294
+ allowUnrecognizedEnumValues: true,
295
+ skipValidation: true,
296
+ }),
297
+ timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
298
+ maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
299
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
300
+ });
301
+ if (_response.ok) {
302
+ return serializers.BulkCollectionItem.parseOrThrow(_response.body, {
303
+ unrecognizedObjectKeys: "passthrough",
304
+ allowUnrecognizedUnionMembers: true,
305
+ allowUnrecognizedEnumValues: true,
306
+ skipValidation: true,
307
+ breadcrumbsPrefix: ["response"],
308
+ });
102
309
  }
103
310
  if (_response.error.reason === "status-code") {
104
311
  switch (_response.error.statusCode) {
@@ -109,7 +316,13 @@ class Client extends Client_1.Items {
109
316
  case 404:
110
317
  throw new Webflow.NotFoundError(_response.error.body);
111
318
  case 429:
112
- throw new Webflow.TooManyRequestsError(_response.error.body);
319
+ throw new Webflow.TooManyRequestsError(serializers.TooManyRequestsErrorBody.parseOrThrow(_response.error.body, {
320
+ unrecognizedObjectKeys: "passthrough",
321
+ allowUnrecognizedUnionMembers: true,
322
+ allowUnrecognizedEnumValues: true,
323
+ skipValidation: true,
324
+ breadcrumbsPrefix: ["response"],
325
+ }));
113
326
  case 500:
114
327
  throw new Webflow.InternalServerError(_response.error.body);
115
328
  default:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webflow-api",
3
- "version": "2.3.5",
3
+ "version": "2.4.0",
4
4
  "private": false,
5
5
  "repository": "https://github.com/webflow/js-webflow-api",
6
6
  "main": "./index.js",
@@ -13,16 +13,21 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "url-join": "4.0.1",
16
- "form-data": "4.0.0",
16
+ "form-data": "^4.0.0",
17
17
  "formdata-node": "^6.0.3",
18
18
  "node-fetch": "2.7.0",
19
19
  "qs": "6.11.2",
20
+ "readable-stream": "^4.5.2",
20
21
  "js-base64": "3.7.2"
21
22
  },
22
23
  "devDependencies": {
23
24
  "@types/url-join": "4.0.1",
24
25
  "@types/qs": "6.9.8",
25
26
  "@types/node-fetch": "2.6.9",
27
+ "@types/readable-stream": "^4.0.15",
28
+ "fetch-mock-jest": "^1.5.1",
29
+ "webpack": "^5.94.0",
30
+ "ts-loader": "^9.3.1",
26
31
  "jest": "29.7.0",
27
32
  "@types/jest": "29.5.5",
28
33
  "ts-jest": "29.1.1",