Skip to content

Commit 96620d3

Browse files
committed
add migration guide back in and add to fernignore
1 parent d1ad2d5 commit 96620d3

File tree

2 files changed

+55
-0
lines changed

2 files changed

+55
-0
lines changed

.fernignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Specify files that shouldn't be modified by Fern
22

33
README.md
4+
MIGRATION.md
45

56
# Oauth Helpers
67
src/api/types/OAuthScope.ts

MIGRATION.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Migration
2+
3+
When migrating to a new major version of this SDK, please consult the notes here for breaking changes, new features, and related fixes.
4+
5+
## v2.x.x -> v3.0.0
6+
7+
There are a few breaking changes with v3.0.0 of the Webflow JS SDK. Please see the `Breaking` section below for more details and consult our [API Docs](https://developers.webflow.com/data/reference/rest-introduction) for examples of usage.
8+
9+
### Breaking
10+
11+
#### CMS APIs
12+
13+
- **CHANGED**: Deleting a Collection is now achieved through `client.collections.delete()`, which was previously an API used to delete a Collection field.
14+
- To delete a Collection, use `client.collections.delete()`
15+
- e.g., `client.collections.delete(collectionId)`
16+
- **NEW**: To delete a Collection field, use `client.collections.fields.delete()`
17+
- e.g., `client.collections.fields.delete(collectionId, fieldId)`
18+
- **REMOVED**: `client.collections.deleteCollection()`
19+
- **CHANGED**: Creating bulk CMS Items in multiple locales is now achieved through `client.collections.createItems()`
20+
- e.g.,
21+
```ts
22+
const newItems = client.collections.items.createItems(collectionId, {
23+
cmsLocaleIds: [primaryCmsLocaleId, secondaryCmsLocaleId],
24+
isArchived: false,
25+
isDraft: false,
26+
fieldData: {
27+
name: "My Item For Multiple Locales",
28+
slug: "my-item",
29+
"plain-text": "foo",
30+
},
31+
});
32+
```
33+
- **REMOVED**: `client.collections.createItemForMultipleLocales()`
34+
35+
#### Pages APIs
36+
37+
- **CHANGED**: The `locale` query parameter is now `localeId`
38+
- e.g., `client.pages.list(siteId, { localeId: "65427cf400e02b306eaa04a0" })`
39+
40+
### New Features
41+
42+
#### CMS APIs
43+
44+
- **NEW**: Bulk CMS Item API support, with the ability to specify one or many locales to manage the CMS Item in. See [docs](https://developers.webflow.com/data/reference/cms/collection-items/bulk-items/create-items) for more on usage.
45+
- `collections.items.createItems()` - Create a single CMS Item or multiple CMS Items in a Collection
46+
- `collections.items.updateItems()` - Update multiple CMS Item(s) in a Collection
47+
- `collections.items.updateItemsLive()` - Update multiple live CMS Item(s) in a Collection
48+
- `collections.items.deleteItems()` - Unpublish/delete multiple CMS Item(s) in a Collection
49+
- `collections.items.deleteItemsLive()` - Unpublish/delete multiple live CMS Item(s) in a Colllection
50+
51+
### Fixes
52+
53+
- Some APIs that created resources (i.e. `collections.items.createItem()`) had request payload types that required an `id`, which is not possible to provide. This is no longer required.
54+
- `fieldData` type in CMS Items now allows arbitrary extra key/value pairs

0 commit comments

Comments
 (0)