Skip to content

Commit b4c1074

Browse files
authored
Merge pull request #186 from webflow/update-migration-guide-3.0
docs: Update MIGRATION.md guide
2 parents d7c27d9 + 26d7d3f commit b4c1074

File tree

1 file changed

+31
-14
lines changed

1 file changed

+31
-14
lines changed

MIGRATION.md

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,51 @@ When migrating to a new major version of this SDK, please consult the notes here
44

55
## v2.x.x -> v3.0.0
66

7-
There are a few breaking changes with v3.0.0 of the Webflow JS SDK
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.
88

99
### Breaking
1010

1111
#### CMS APIs
1212

13-
- CHANGED: Deleting a Collection is now achieved through `client.collections.delete()`, which was previously an API used to delete a Collection field.
14-
- We've removed `client.collections.deleteCollection()`
15-
- To delete a Collection field, use `client.collections.fields.delete()`
16-
- CHANGED: Creating bulk CMS Items in multiple locales is now achieved through `client.collections.createItems()`
17-
- We've removed `client.collections.createItemForMultipleLocales()`
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()`
1834

1935
#### Pages APIs
2036

21-
- CHANGED: The `locale` query parameter is now `localeId`
37+
- **CHANGED**: The `locale` query parameter is now `localeId`
38+
- e.g., `client.pages.list(siteId, { localeId: "65427cf400e02b306eaa04a0" })`
2239

2340
### New Features
2441

2542
#### CMS APIs
2643

27-
- We've added Bulk API support. See [docs](https://developers.webflow.com/data/reference/cms/collection-items/bulk-items/create-items) for more on usage.
28-
- `createItems()`
29-
- `updateItems()`
30-
- `updateItemsLive()`
31-
- `deleteItems()`
32-
- `deleteItemsLive()`
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
3350

3451
### Fixes
3552

36-
- Some APIs that created resources (i.e. `collections.items.createItem()`) had types that required an `id`, which is not possible to provide. This is no longer required.
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.
3754
- `fieldData` type in CMS Items now allows arbitrary extra key/value pairs

0 commit comments

Comments
 (0)