webflow-api 2.5.0 → 3.0.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 (56) hide show
  1. package/MIGRATION.md +37 -0
  2. package/api/resources/accessGroups/client/Client.js +1 -1
  3. package/api/resources/assets/client/Client.js +8 -8
  4. package/api/resources/collections/client/Client.js +4 -4
  5. package/api/resources/collections/resources/fields/client/Client.js +3 -3
  6. package/api/resources/collections/resources/items/client/Client.js +16 -16
  7. package/api/resources/ecommerce/client/Client.js +1 -1
  8. package/api/resources/forms/client/Client.js +5 -5
  9. package/api/resources/inventory/client/Client.js +2 -2
  10. package/api/resources/orders/client/Client.js +6 -6
  11. package/api/resources/pages/client/Client.js +5 -5
  12. package/api/resources/pages/resources/scripts/client/Client.js +3 -3
  13. package/api/resources/products/client/Client.js +6 -6
  14. package/api/resources/scripts/client/Client.js +3 -3
  15. package/api/resources/sites/client/Client.js +4 -4
  16. package/api/resources/sites/resources/activityLogs/client/Client.js +1 -1
  17. package/api/resources/sites/resources/scripts/client/Client.js +4 -4
  18. package/api/resources/token/client/Client.js +2 -2
  19. package/api/resources/users/client/Client.js +5 -5
  20. package/api/resources/webhooks/client/Client.js +4 -4
  21. package/dist/api/resources/accessGroups/client/Client.js +1 -1
  22. package/dist/api/resources/assets/client/Client.js +8 -8
  23. package/dist/api/resources/collections/client/Client.js +4 -4
  24. package/dist/api/resources/collections/resources/fields/client/Client.js +3 -3
  25. package/dist/api/resources/collections/resources/items/client/Client.js +16 -16
  26. package/dist/api/resources/ecommerce/client/Client.js +1 -1
  27. package/dist/api/resources/forms/client/Client.js +5 -5
  28. package/dist/api/resources/inventory/client/Client.js +2 -2
  29. package/dist/api/resources/orders/client/Client.js +6 -6
  30. package/dist/api/resources/pages/client/Client.js +5 -5
  31. package/dist/api/resources/pages/resources/scripts/client/Client.js +3 -3
  32. package/dist/api/resources/products/client/Client.js +6 -6
  33. package/dist/api/resources/scripts/client/Client.js +3 -3
  34. package/dist/api/resources/sites/client/Client.js +4 -4
  35. package/dist/api/resources/sites/resources/activityLogs/client/Client.js +1 -1
  36. package/dist/api/resources/sites/resources/scripts/client/Client.js +4 -4
  37. package/dist/api/resources/token/client/Client.js +2 -2
  38. package/dist/api/resources/users/client/Client.js +5 -5
  39. package/dist/api/resources/webhooks/client/Client.js +4 -4
  40. package/dist/version.d.ts +1 -1
  41. package/dist/version.js +1 -1
  42. package/dist/wrapper/WebflowClient.d.ts +0 -3
  43. package/dist/wrapper/WebflowClient.js +0 -5
  44. package/package.json +1 -1
  45. package/version.d.ts +1 -1
  46. package/version.js +1 -1
  47. package/wrapper/WebflowClient.d.ts +0 -3
  48. package/wrapper/WebflowClient.js +0 -5
  49. package/dist/wrapper/CollectionsClient.d.ts +0 -8
  50. package/dist/wrapper/CollectionsClient.js +0 -18
  51. package/dist/wrapper/ItemsClient.d.ts +0 -52
  52. package/dist/wrapper/ItemsClient.js +0 -185
  53. package/wrapper/CollectionsClient.d.ts +0 -8
  54. package/wrapper/CollectionsClient.js +0 -18
  55. package/wrapper/ItemsClient.d.ts +0 -52
  56. package/wrapper/ItemsClient.js +0 -185
@@ -74,7 +74,7 @@ class Scripts {
74
74
  const _response = yield core.fetcher({
75
75
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/custom_code`),
76
76
  method: "GET",
77
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
77
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
78
78
  contentType: "application/json",
79
79
  requestType: "json",
80
80
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -191,7 +191,7 @@ class Scripts {
191
191
  const _response = yield core.fetcher({
192
192
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/custom_code`),
193
193
  method: "PUT",
194
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
194
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
195
195
  contentType: "application/json",
196
196
  requestType: "json",
197
197
  body: serializers.ScriptApplyList.jsonOrThrow(request, {
@@ -295,7 +295,7 @@ class Scripts {
295
295
  const _response = yield core.fetcher({
296
296
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/custom_code`),
297
297
  method: "DELETE",
298
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
298
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
299
299
  contentType: "application/json",
300
300
  requestType: "json",
301
301
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -397,7 +397,7 @@ class Scripts {
397
397
  const _response = yield core.fetcher({
398
398
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/custom_code/blocks`),
399
399
  method: "GET",
400
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
400
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
401
401
  contentType: "application/json",
402
402
  queryParameters: _queryParams,
403
403
  requestType: "json",
@@ -68,7 +68,7 @@ class Token {
68
68
  const _response = yield core.fetcher({
69
69
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, "token/authorized_by"),
70
70
  method: "GET",
71
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
71
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
72
72
  contentType: "application/json",
73
73
  requestType: "json",
74
74
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -135,7 +135,7 @@ class Token {
135
135
  const _response = yield core.fetcher({
136
136
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, "token/introspect"),
137
137
  method: "GET",
138
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
138
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
139
139
  contentType: "application/json",
140
140
  requestType: "json",
141
141
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -85,7 +85,7 @@ class Users {
85
85
  const _response = yield core.fetcher({
86
86
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/users`),
87
87
  method: "GET",
88
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
88
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
89
89
  contentType: "application/json",
90
90
  queryParameters: _queryParams,
91
91
  requestType: "json",
@@ -187,7 +187,7 @@ class Users {
187
187
  const _response = yield core.fetcher({
188
188
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}`),
189
189
  method: "GET",
190
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
190
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
191
191
  contentType: "application/json",
192
192
  requestType: "json",
193
193
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -288,7 +288,7 @@ class Users {
288
288
  const _response = yield core.fetcher({
289
289
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}`),
290
290
  method: "DELETE",
291
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
291
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
292
292
  contentType: "application/json",
293
293
  requestType: "json",
294
294
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -394,7 +394,7 @@ class Users {
394
394
  const _response = yield core.fetcher({
395
395
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/users/${encodeURIComponent(userId)}`),
396
396
  method: "PATCH",
397
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
397
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
398
398
  contentType: "application/json",
399
399
  requestType: "json",
400
400
  body: serializers.UsersUpdateRequest.jsonOrThrow(request, {
@@ -506,7 +506,7 @@ class Users {
506
506
  const _response = yield core.fetcher({
507
507
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/users/invite`),
508
508
  method: "POST",
509
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
509
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
510
510
  contentType: "application/json",
511
511
  requestType: "json",
512
512
  body: serializers.UsersInviteRequest.jsonOrThrow(request, {
@@ -72,7 +72,7 @@ class Webhooks {
72
72
  const _response = yield core.fetcher({
73
73
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/webhooks`),
74
74
  method: "GET",
75
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
75
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
76
76
  contentType: "application/json",
77
77
  requestType: "json",
78
78
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -181,7 +181,7 @@ class Webhooks {
181
181
  const _response = yield core.fetcher({
182
182
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `sites/${encodeURIComponent(siteId)}/webhooks`),
183
183
  method: "POST",
184
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
184
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
185
185
  contentType: "application/json",
186
186
  requestType: "json",
187
187
  body: serializers.Webhook.jsonOrThrow(request, {
@@ -283,7 +283,7 @@ class Webhooks {
283
283
  const _response = yield core.fetcher({
284
284
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `webhooks/${encodeURIComponent(webhookId)}`),
285
285
  method: "GET",
286
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
286
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
287
287
  contentType: "application/json",
288
288
  requestType: "json",
289
289
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -380,7 +380,7 @@ class Webhooks {
380
380
  const _response = yield core.fetcher({
381
381
  url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.WebflowEnvironment.Default, `webhooks/${encodeURIComponent(webhookId)}`),
382
382
  method: "DELETE",
383
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "2.5.0", "User-Agent": "webflow-api/2.5.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
383
+ headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": "3.0.0", "User-Agent": "webflow-api/3.0.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
384
384
  contentType: "application/json",
385
385
  requestType: "json",
386
386
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.5.0";
1
+ export declare const SDK_VERSION = "3.0.0";
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.5.0";
4
+ exports.SDK_VERSION = "3.0.0";
@@ -1,11 +1,8 @@
1
1
  import { WebflowClient as FernClient } from "../Client";
2
2
  import { OauthScope } from "../api/types/OAuthScope";
3
- import { Client as Collections } from "./CollectionsClient";
4
3
  export declare class WebflowClient extends FernClient {
5
4
  protected readonly _options: FernClient.Options;
6
5
  constructor(_options: FernClient.Options);
7
- protected _collections: Collections | undefined;
8
- get collections(): Collections;
9
6
  /**
10
7
  * @param clientId The OAuth client ID
11
8
  * @param state The state
@@ -40,17 +40,12 @@ const qs_1 = __importDefault(require("qs"));
40
40
  const Client_1 = require("../Client");
41
41
  const core = __importStar(require("../core"));
42
42
  const errors = __importStar(require("../errors"));
43
- const CollectionsClient_1 = require("./CollectionsClient");
44
43
  const version_1 = require("../version");
45
44
  class WebflowClient extends Client_1.WebflowClient {
46
45
  constructor(_options) {
47
46
  super(_options);
48
47
  this._options = _options;
49
48
  }
50
- get collections() {
51
- var _a;
52
- return ((_a = this._collections) !== null && _a !== void 0 ? _a : (this._collections = new CollectionsClient_1.Client(this._options)));
53
- }
54
49
  /**
55
50
  * @param clientId The OAuth client ID
56
51
  * @param state The state
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webflow-api",
3
- "version": "2.5.0",
3
+ "version": "3.0.0",
4
4
  "private": false,
5
5
  "repository": "https://github.com/webflow/js-webflow-api",
6
6
  "main": "./index.js",
package/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.5.0";
1
+ export declare const SDK_VERSION = "3.0.0";
package/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "2.5.0";
4
+ exports.SDK_VERSION = "3.0.0";
@@ -1,11 +1,8 @@
1
1
  import { WebflowClient as FernClient } from "../Client";
2
2
  import { OauthScope } from "../api/types/OAuthScope";
3
- import { Client as Collections } from "./CollectionsClient";
4
3
  export declare class WebflowClient extends FernClient {
5
4
  protected readonly _options: FernClient.Options;
6
5
  constructor(_options: FernClient.Options);
7
- protected _collections: Collections | undefined;
8
- get collections(): Collections;
9
6
  /**
10
7
  * @param clientId The OAuth client ID
11
8
  * @param state The state
@@ -40,17 +40,12 @@ const qs_1 = __importDefault(require("qs"));
40
40
  const Client_1 = require("../Client");
41
41
  const core = __importStar(require("../core"));
42
42
  const errors = __importStar(require("../errors"));
43
- const CollectionsClient_1 = require("./CollectionsClient");
44
43
  const version_1 = require("../version");
45
44
  class WebflowClient extends Client_1.WebflowClient {
46
45
  constructor(_options) {
47
46
  super(_options);
48
47
  this._options = _options;
49
48
  }
50
- get collections() {
51
- var _a;
52
- return ((_a = this._collections) !== null && _a !== void 0 ? _a : (this._collections = new CollectionsClient_1.Client(this._options)));
53
- }
54
49
  /**
55
50
  * @param clientId The OAuth client ID
56
51
  * @param state The state
@@ -1,8 +0,0 @@
1
- import { Collections } from "../api/resources/collections/client/Client";
2
- import { Client as Items } from "./ItemsClient";
3
- export declare class Client extends Collections {
4
- protected readonly _options: Collections.Options;
5
- constructor(_options: Collections.Options);
6
- protected _items: Items | undefined;
7
- get items(): Items;
8
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Client = void 0;
4
- const Client_1 = require("../api/resources/collections/client/Client");
5
- const ItemsClient_1 = require("./ItemsClient");
6
- // Client adapts the base client to permit extra properties in
7
- // the client.Collections.Items.createItem request.
8
- class Client extends Client_1.Collections {
9
- constructor(_options) {
10
- super(_options);
11
- this._options = _options;
12
- }
13
- get items() {
14
- var _a;
15
- return ((_a = this._items) !== null && _a !== void 0 ? _a : (this._items = new ItemsClient_1.Client(this._options)));
16
- }
17
- }
18
- exports.Client = Client;
@@ -1,52 +0,0 @@
1
- import * as Webflow from "../api";
2
- import { Items } from "../api/resources/collections/resources/items/client/Client";
3
- export declare class Client extends Items {
4
- protected readonly _options: Items.Options;
5
- constructor(_options: Items.Options);
6
- /**
7
- * Create an item or multiple items in a CMS Collection across multiple corresponding locales.
8
- *
9
- * **Notes:**
10
- *
11
- * - This endpoint can create up to 100 items in a request.
12
- * - If the `cmsLocaleIds` parameter is undefined or empty and localization is enabled, items will only be created in the primary locale.
13
- *
14
- * Required scope | `CMS:write`
15
- *
16
- * @param {string} collectionId - Unique identifier for a Collection
17
- * @param {Webflow.collections.CreateBulkCollectionItemRequestBody} request
18
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
19
- *
20
- * @throws {@link Webflow.BadRequestError}
21
- * @throws {@link Webflow.UnauthorizedError}
22
- * @throws {@link Webflow.NotFoundError}
23
- * @throws {@link Webflow.TooManyRequestsError}
24
- * @throws {@link Webflow.InternalServerError}
25
- *
26
- * @example
27
- * await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b8b745", {
28
- * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"],
29
- * isArchived: false,
30
- * isDraft: false,
31
- * fieldData: {
32
- * name: "Don\u2019t Panic",
33
- * slug: "dont-panic"
34
- * }
35
- * })
36
- *
37
- * @example
38
- * await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b8b745", {
39
- * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4"],
40
- * isArchived: false,
41
- * isDraft: false,
42
- * fieldData: [{
43
- * name: "Don\u2019t Panic",
44
- * slug: "dont-panic"
45
- * }, {
46
- * name: "So Long and Thanks for All the Fish",
47
- * slug: "so-long-and-thanks"
48
- * }]
49
- * })
50
- */
51
- createItemForMultipleLocales(collectionId: string, request?: Webflow.collections.CreateBulkCollectionItemRequestBody, requestOptions?: Items.RequestOptions): Promise<Webflow.BulkCollectionItem>;
52
- }
@@ -1,185 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- exports.Client = void 0;
39
- const url_join_1 = __importDefault(require("url-join"));
40
- const Webflow = __importStar(require("../api"));
41
- const Client_1 = require("../api/resources/collections/resources/items/client/Client");
42
- const core = __importStar(require("../core"));
43
- const environments = __importStar(require("../environments"));
44
- const errors = __importStar(require("../errors"));
45
- const serializers = __importStar(require("../serialization"));
46
- const version_1 = require("../version");
47
- // Temporary wrapper for backwards compatibility keeping the createItemForMultipleLocales method
48
- // a mirror of the createItems API
49
- class Client extends Client_1.Items {
50
- constructor(_options) {
51
- super(_options);
52
- this._options = _options;
53
- }
54
- /**
55
- * Create an item or multiple items in a CMS Collection across multiple corresponding locales.
56
- *
57
- * **Notes:**
58
- *
59
- * - This endpoint can create up to 100 items in a request.
60
- * - If the `cmsLocaleIds` parameter is undefined or empty and localization is enabled, items will only be created in the primary locale.
61
- *
62
- * Required scope | `CMS:write`
63
- *
64
- * @param {string} collectionId - Unique identifier for a Collection
65
- * @param {Webflow.collections.CreateBulkCollectionItemRequestBody} request
66
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
67
- *
68
- * @throws {@link Webflow.BadRequestError}
69
- * @throws {@link Webflow.UnauthorizedError}
70
- * @throws {@link Webflow.NotFoundError}
71
- * @throws {@link Webflow.TooManyRequestsError}
72
- * @throws {@link Webflow.InternalServerError}
73
- *
74
- * @example
75
- * await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b8b745", {
76
- * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"],
77
- * isArchived: false,
78
- * isDraft: false,
79
- * fieldData: {
80
- * name: "Don\u2019t Panic",
81
- * slug: "dont-panic"
82
- * }
83
- * })
84
- *
85
- * @example
86
- * await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b8b745", {
87
- * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4"],
88
- * isArchived: false,
89
- * isDraft: false,
90
- * fieldData: [{
91
- * name: "Don\u2019t Panic",
92
- * slug: "dont-panic"
93
- * }, {
94
- * name: "So Long and Thanks for All the Fish",
95
- * slug: "so-long-and-thanks"
96
- * }]
97
- * })
98
- */
99
- createItemForMultipleLocales(collectionId, request = {}, requestOptions) {
100
- var _a;
101
- return __awaiter(this, void 0, void 0, function* () {
102
- const _response = yield core.fetcher({
103
- 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`),
104
- method: "POST",
105
- headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "webflow-api", "X-Fern-SDK-Version": version_1.SDK_VERSION, "User-Agent": `webflow-api/${version_1.SDK_VERSION}`, "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
106
- contentType: "application/json",
107
- requestType: "json",
108
- body: serializers.collections.CreateBulkCollectionItemRequestBody.jsonOrThrow(request, {
109
- unrecognizedObjectKeys: "passthrough",
110
- allowUnrecognizedUnionMembers: true,
111
- allowUnrecognizedEnumValues: true,
112
- }),
113
- timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
114
- maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
115
- abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
116
- });
117
- if (_response.ok) {
118
- return serializers.BulkCollectionItem.parseOrThrow(_response.body, {
119
- unrecognizedObjectKeys: "passthrough",
120
- allowUnrecognizedUnionMembers: true,
121
- allowUnrecognizedEnumValues: true,
122
- skipValidation: true,
123
- breadcrumbsPrefix: ["response"],
124
- });
125
- }
126
- if (_response.error.reason === "status-code") {
127
- switch (_response.error.statusCode) {
128
- case 400:
129
- throw new Webflow.BadRequestError(_response.error.body);
130
- case 401:
131
- throw new Webflow.UnauthorizedError(serializers.Error_.parseOrThrow(_response.error.body, {
132
- unrecognizedObjectKeys: "passthrough",
133
- allowUnrecognizedUnionMembers: true,
134
- allowUnrecognizedEnumValues: true,
135
- skipValidation: true,
136
- breadcrumbsPrefix: ["response"],
137
- }));
138
- case 404:
139
- throw new Webflow.NotFoundError(serializers.Error_.parseOrThrow(_response.error.body, {
140
- unrecognizedObjectKeys: "passthrough",
141
- allowUnrecognizedUnionMembers: true,
142
- allowUnrecognizedEnumValues: true,
143
- skipValidation: true,
144
- breadcrumbsPrefix: ["response"],
145
- }));
146
- case 429:
147
- throw new Webflow.TooManyRequestsError(serializers.Error_.parseOrThrow(_response.error.body, {
148
- unrecognizedObjectKeys: "passthrough",
149
- allowUnrecognizedUnionMembers: true,
150
- allowUnrecognizedEnumValues: true,
151
- skipValidation: true,
152
- breadcrumbsPrefix: ["response"],
153
- }));
154
- case 500:
155
- throw new Webflow.InternalServerError(serializers.Error_.parseOrThrow(_response.error.body, {
156
- unrecognizedObjectKeys: "passthrough",
157
- allowUnrecognizedUnionMembers: true,
158
- allowUnrecognizedEnumValues: true,
159
- skipValidation: true,
160
- breadcrumbsPrefix: ["response"],
161
- }));
162
- default:
163
- throw new errors.WebflowError({
164
- statusCode: _response.error.statusCode,
165
- body: _response.error.body,
166
- });
167
- }
168
- }
169
- switch (_response.error.reason) {
170
- case "non-json":
171
- throw new errors.WebflowError({
172
- statusCode: _response.error.statusCode,
173
- body: _response.error.rawBody,
174
- });
175
- case "timeout":
176
- throw new errors.WebflowTimeoutError("Timeout exceeded when calling POST /collections/{collection_id}/items/bulk.");
177
- case "unknown":
178
- throw new errors.WebflowError({
179
- message: _response.error.errorMessage,
180
- });
181
- }
182
- });
183
- }
184
- }
185
- exports.Client = Client;
@@ -1,8 +0,0 @@
1
- import { Collections } from "../api/resources/collections/client/Client";
2
- import { Client as Items } from "./ItemsClient";
3
- export declare class Client extends Collections {
4
- protected readonly _options: Collections.Options;
5
- constructor(_options: Collections.Options);
6
- protected _items: Items | undefined;
7
- get items(): Items;
8
- }
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Client = void 0;
4
- const Client_1 = require("../api/resources/collections/client/Client");
5
- const ItemsClient_1 = require("./ItemsClient");
6
- // Client adapts the base client to permit extra properties in
7
- // the client.Collections.Items.createItem request.
8
- class Client extends Client_1.Collections {
9
- constructor(_options) {
10
- super(_options);
11
- this._options = _options;
12
- }
13
- get items() {
14
- var _a;
15
- return ((_a = this._items) !== null && _a !== void 0 ? _a : (this._items = new ItemsClient_1.Client(this._options)));
16
- }
17
- }
18
- exports.Client = Client;
@@ -1,52 +0,0 @@
1
- import * as Webflow from "../api";
2
- import { Items } from "../api/resources/collections/resources/items/client/Client";
3
- export declare class Client extends Items {
4
- protected readonly _options: Items.Options;
5
- constructor(_options: Items.Options);
6
- /**
7
- * Create an item or multiple items in a CMS Collection across multiple corresponding locales.
8
- *
9
- * **Notes:**
10
- *
11
- * - This endpoint can create up to 100 items in a request.
12
- * - If the `cmsLocaleIds` parameter is undefined or empty and localization is enabled, items will only be created in the primary locale.
13
- *
14
- * Required scope | `CMS:write`
15
- *
16
- * @param {string} collectionId - Unique identifier for a Collection
17
- * @param {Webflow.collections.CreateBulkCollectionItemRequestBody} request
18
- * @param {Items.RequestOptions} requestOptions - Request-specific configuration.
19
- *
20
- * @throws {@link Webflow.BadRequestError}
21
- * @throws {@link Webflow.UnauthorizedError}
22
- * @throws {@link Webflow.NotFoundError}
23
- * @throws {@link Webflow.TooManyRequestsError}
24
- * @throws {@link Webflow.InternalServerError}
25
- *
26
- * @example
27
- * await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b8b745", {
28
- * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4", "66f6e966c9e1dc700a857ca5"],
29
- * isArchived: false,
30
- * isDraft: false,
31
- * fieldData: {
32
- * name: "Don\u2019t Panic",
33
- * slug: "dont-panic"
34
- * }
35
- * })
36
- *
37
- * @example
38
- * await client.collections.items.createItemForMultipleLocales("580e63fc8c9a982ac9b8b745", {
39
- * cmsLocaleIds: ["66f6e966c9e1dc700a857ca3", "66f6e966c9e1dc700a857ca4"],
40
- * isArchived: false,
41
- * isDraft: false,
42
- * fieldData: [{
43
- * name: "Don\u2019t Panic",
44
- * slug: "dont-panic"
45
- * }, {
46
- * name: "So Long and Thanks for All the Fish",
47
- * slug: "so-long-and-thanks"
48
- * }]
49
- * })
50
- */
51
- createItemForMultipleLocales(collectionId: string, request?: Webflow.collections.CreateBulkCollectionItemRequestBody, requestOptions?: Items.RequestOptions): Promise<Webflow.BulkCollectionItem>;
52
- }