Skip to content
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
94e1776
feat: add releaseSchema defaults to plain client creation [DX-184] (#…
elylucas Jun 24, 2025
2375cd8
feat(default): release-id (#2666)
ethan-ozelius-contentful Jun 24, 2025
56ab64c
Merge branch 'master' into release/releasesv2
elylucas Jun 27, 2025
b89221b
feat: add support for releaseSchemaVersion in create/query methods [D…
elylucas Jun 27, 2025
0be994d
feat: add support for release.entry.* pattern [DX-192] (#2667)
elylucas Jun 30, 2025
64c82a9
feat: release/update endpoint reflects schemaVersion param [DX-188] (…
tylerpina Jun 30, 2025
d7a768d
Dx 194 Add unit tests for release.entry.get (#2674)
michaelphamcf Jul 1, 2025
68e0ccc
feat(releases): release.entry.getMany() (#2673)
ethan-ozelius-contentful Jul 2, 2025
aa4a487
DX-202 Update entry.get to pass in releaseId (#2679)
michaelphamcf Jul 3, 2025
4419c0f
feat: update entry.getMany to include releasev2 params [DX-203] (#2685)
tylerpina Jul 3, 2025
dbd8275
feat: add release.entry.update method [DX-206] (#2692)
elylucas Jul 15, 2025
b6b8a3a
fix: delete entry2 as part of entry integration test cleanup [DX-258]…
whitelisab Jul 16, 2025
d95a921
chore: add canary build to release/releasev2 branch [DX-212] (#2696)
elylucas Jul 21, 2025
6ae62e2
Merge branch 'master' into release/releasesv2
elylucas Jul 21, 2025
9ab226c
chore: creating canary branch for canary prerelease builds
elylucas Jul 21, 2025
9266cf3
chore: add canary branch to release process in ci config
elylucas Jul 21, 2025
d419513
Merge branch 'master' into canary
whitelisab Aug 26, 2025
de873be
feat: add release.entry.createWithId method [DX-61] (#2724)
whitelisab Aug 28, 2025
a70b34c
feat: entry.patch handle releaseId [DX-209] (#2725)
michaelphamcf Sep 2, 2025
7c75270
feat: update entry.createWithId to accept releaseId [DX-208] (#2727)
whitelisab Sep 2, 2025
bed1b7d
feat: entry.update supports releaseId [DX-210] (#2728)
michaelphamcf Sep 3, 2025
dc13c9b
Merge branch 'master' into canary
michaelphamcf Sep 4, 2025
21b5295
feat: add release.entry.create method (#2730)
michaelphamcf Sep 5, 2025
d1c3427
feat: entry.create supports releaseId [DX-207] (#2732)
michaelphamcf Sep 5, 2025
8c71174
Merge branch 'master' into canary
whitelisab Sep 10, 2025
e1c7627
fix: remove startDate from releasev2 payload [DX-380] (#2739)
whitelisab Sep 10, 2025
3400cee
Merge branch 'master' into canary
whitelisab Sep 15, 2025
d9de954
feat: remove release[lte] endpoint [TOL-3408] (#2747)
MayaGillilan Sep 16, 2025
421f238
fix(types): add release to entitymetasysprops [] (#2749)
chrishelgert Sep 17, 2025
4392262
feat: add support for release asset endpoints [TOL-3357] (#2750)
chrishelgert Sep 18, 2025
744e073
fix(types): export ReleasePaylodV2 [] (#2754)
chrishelgert Sep 18, 2025
fcd2ae1
fix: update types, add tests, and cleanup [DX-397] (#2755)
whitelisab Sep 19, 2025
d16857b
Merge branch 'master' into canary
whitelisab Sep 19, 2025
fd218bb
Merge branch 'master' into canary
whitelisab Sep 22, 2025
e126f51
Merge branch 'master' into canary
whitelisab Sep 24, 2025
4e0edc3
chore: update experimental features in readme
whitelisab Sep 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,4 @@ workflows:
only:
- master
- beta
- canary
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,20 @@ This means that new versions are released automatically as fixes, features or br

You can check the changelog on the [releases](https://github.com/contentful/contentful-management.js/releases) page.

## Experimental features

To download a build that has features that are not yet released, you can use the `canary` channel. This is a pre-release version of the library that contains features that are still in development and may not be stable. To install a canary version, you can use the following command:

```bash
npm install contentful-management@canary
```

### Current experimental features

#### Timeline Preview / Releases v2

This feature allows you to schedule content changes in the future and preview them before they go live.

## Reach out to us

### You have questions about how to use this library?
Expand Down
66 changes: 59 additions & 7 deletions lib/adapters/REST/endpoints/asset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ import type { AxiosInstance } from 'contentful-sdk-core'
import { errorHandler } from 'contentful-sdk-core'
import copy from 'fast-copy'
import type { SetOptional } from 'type-fest'
import type { CollectionProp, GetSpaceEnvironmentParams, QueryParams } from '../../../common-types'
import type {
CollectionProp,
CreateReleaseAssetParams,
CreateWithFilesReleaseAssetParams,
CreateWithIdReleaseAssetParams,
GetReleaseAssetParams,
GetSpaceEnvironmentParams,
Link,
QueryParams,
UpdateReleaseAssetParams,
} from '../../../common-types'
import type {
AssetFileProp,
AssetProcessingForLocale,
Expand All @@ -15,13 +25,18 @@ import type { RestEndpoint } from '../types'
import * as raw from './raw'
import { create as createUpload } from './upload'
import { normalizeSelect } from './utils'
import * as releaseAsset from './release-asset'

export const get: RestEndpoint<'Asset', 'get'> = (
http: AxiosInstance,
params: GetSpaceEnvironmentParams & { assetId: string } & QueryParams,
params: GetSpaceEnvironmentParams & { assetId: string; releaseId?: string } & QueryParams,
rawData?: unknown,
headers?: RawAxiosRequestHeaders,
) => {
if (params.releaseId) {
return releaseAsset.get(http, params as GetReleaseAssetParams)
}

return raw.get<AssetProps>(
http,
`/spaces/${params.spaceId}/environments/${params.environmentId}/assets/${params.assetId}`,
Expand Down Expand Up @@ -50,10 +65,14 @@ export const getPublished: RestEndpoint<'Asset', 'getPublished'> = (

export const getMany: RestEndpoint<'Asset', 'getMany'> = (
http: AxiosInstance,
params: GetSpaceEnvironmentParams & QueryParams,
params: GetSpaceEnvironmentParams & QueryParams & { releaseId?: string },
rawData?: unknown,
headers?: RawAxiosRequestHeaders,
) => {
if (params.releaseId) {
return releaseAsset.getMany(http, params as GetReleaseAssetParams)
}

return raw.get<CollectionProp<AssetProps>>(
http,
`/spaces/${params.spaceId}/environments/${params.environmentId}/assets`,
Expand All @@ -66,10 +85,14 @@ export const getMany: RestEndpoint<'Asset', 'getMany'> = (

export const update: RestEndpoint<'Asset', 'update'> = (
http: AxiosInstance,
params: GetSpaceEnvironmentParams & { assetId: string },
params: GetSpaceEnvironmentParams & { assetId: string; releaseId?: string },
rawData: AssetProps,
headers?: RawAxiosRequestHeaders,
) => {
if (params.releaseId) {
return releaseAsset.update(http, params as UpdateReleaseAssetParams, rawData, headers ?? {})
}

const data: SetOptional<typeof rawData, 'sys'> = copy(rawData)
delete data.sys
return raw.put<AssetProps>(
Expand Down Expand Up @@ -161,9 +184,13 @@ export const unarchive: RestEndpoint<'Asset', 'unarchive'> = (

export const create: RestEndpoint<'Asset', 'create'> = (
http: AxiosInstance,
params: GetSpaceEnvironmentParams,
params: GetSpaceEnvironmentParams & { releaseId?: string },
rawData: CreateAssetProps,
) => {
if (params.releaseId) {
return releaseAsset.create(http, params as CreateReleaseAssetParams, rawData, {})
}

const data = copy(rawData)

return raw.post<AssetProps>(
Expand All @@ -175,9 +202,13 @@ export const create: RestEndpoint<'Asset', 'create'> = (

export const createWithId: RestEndpoint<'Asset', 'createWithId'> = (
http: AxiosInstance,
params: GetSpaceEnvironmentParams & { assetId: string },
params: GetSpaceEnvironmentParams & { assetId: string; releaseId?: string },
rawData: CreateAssetProps,
) => {
if (params.releaseId) {
return releaseAsset.createWithId(http, params as CreateWithIdReleaseAssetParams, rawData, {})
}

const data = copy(rawData)

return raw.put<AssetProps>(
Expand All @@ -189,9 +220,13 @@ export const createWithId: RestEndpoint<'Asset', 'createWithId'> = (

export const createFromFiles: RestEndpoint<'Asset', 'createFromFiles'> = async (
http: AxiosInstance,
params: GetSpaceEnvironmentParams & { uploadTimeout?: number },
params: GetSpaceEnvironmentParams & { uploadTimeout?: number; releaseId?: string },
data: Omit<AssetFileProp, 'sys'>,
) => {
if (params.releaseId) {
return releaseAsset.createFromFiles(http, params as CreateWithFilesReleaseAssetParams, data, {})
}

const httpUpload = getUploadHttpClient(http, { uploadTimeout: params.uploadTimeout })

const { file } = data.fields
Expand Down Expand Up @@ -293,6 +328,15 @@ export const processForLocale: RestEndpoint<'Asset', 'processForLocale'> = async
options?: AssetProcessingForLocale
},
) => {
if (asset.sys.release) {
return releaseAsset.processForLocale(http, {
asset: asset as AssetProps<{ release: Link<'Release'> }>,
locale,
options: { processingCheckRetries, processingCheckWait },
...params,
})
}

return raw
.put<AssetProps>(
http,
Expand Down Expand Up @@ -333,6 +377,14 @@ export const processForAllLocales: RestEndpoint<'Asset', 'processForAllLocales'>
...params
}: GetSpaceEnvironmentParams & { asset: AssetProps; options?: AssetProcessingForLocale },
) => {
if (asset.sys.release) {
return releaseAsset.processForAllLocales(http, {
asset: asset as AssetProps<{ release: Link<'Release'> }>,
options,
...params,
})
}

const locales = Object.keys(asset.fields.file || {})

let mostUpToDateAssetVersion: AssetProps = asset
Expand Down
46 changes: 40 additions & 6 deletions lib/adapters/REST/endpoints/entry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,32 @@ import type { OpPatch } from 'json-patch'
import type { SetOptional } from 'type-fest'
import type {
CollectionProp,
CreateReleaseEntryParams,
CreateWithIdReleaseEntryParams,
GetManyReleaseEntryParams,
GetReleaseEntryParams,
GetSpaceEnvironmentParams,
KeyValueMap,
PatchReleaseEntryParams,
QueryParams,
UpdateReleaseEntryParams,
} from '../../../common-types'
import type { CreateEntryProps, EntryProps, EntryReferenceProps } from '../../../entities/entry'
import type { RestEndpoint } from '../types'
import * as raw from './raw'
import * as releaseEntry from './release-entry'
import { normalizeSelect } from './utils'

export const get: RestEndpoint<'Entry', 'get'> = <T extends KeyValueMap = KeyValueMap>(
http: AxiosInstance,
params: GetSpaceEnvironmentParams & { entryId: string } & QueryParams,
params: GetSpaceEnvironmentParams & { entryId: string; releaseId?: string } & QueryParams,
rawData?: unknown,
headers?: RawAxiosRequestHeaders,
) => {
if (params.releaseId) {
return releaseEntry.get(http, params as GetReleaseEntryParams)
}

return raw.get<EntryProps<T>>(
http,
`/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}`,
Expand Down Expand Up @@ -50,10 +61,14 @@ export const getPublished: RestEndpoint<'Entry', 'getPublished'> = <

export const getMany: RestEndpoint<'Entry', 'getMany'> = <T extends KeyValueMap = KeyValueMap>(
http: AxiosInstance,
params: GetSpaceEnvironmentParams & QueryParams,
params: GetSpaceEnvironmentParams & QueryParams & { releaseId?: string },
rawData?: unknown,
headers?: RawAxiosRequestHeaders,
) => {
if (params.releaseId) {
return releaseEntry.getMany(http, params as GetManyReleaseEntryParams)
}

return raw.get<CollectionProp<EntryProps<T>>>(
http,
`/spaces/${params.spaceId}/environments/${params.environmentId}/entries`,
Expand All @@ -66,10 +81,14 @@ export const getMany: RestEndpoint<'Entry', 'getMany'> = <T extends KeyValueMap

export const patch: RestEndpoint<'Entry', 'patch'> = <T extends KeyValueMap = KeyValueMap>(
http: AxiosInstance,
params: GetSpaceEnvironmentParams & { entryId: string; version: number },
params: GetSpaceEnvironmentParams & { entryId: string; version: number; releaseId?: string },
data: OpPatch[],
headers?: RawAxiosRequestHeaders,
) => {
if (params.releaseId) {
return releaseEntry.patch(http, params as PatchReleaseEntryParams, data, headers ?? {})
}

return raw.patch<EntryProps<T>>(
http,
`/spaces/${params.spaceId}/environments/${params.environmentId}/entries/${params.entryId}`,
Expand All @@ -86,10 +105,14 @@ export const patch: RestEndpoint<'Entry', 'patch'> = <T extends KeyValueMap = Ke

export const update: RestEndpoint<'Entry', 'update'> = <T extends KeyValueMap = KeyValueMap>(
http: AxiosInstance,
params: GetSpaceEnvironmentParams & { entryId: string },
params: GetSpaceEnvironmentParams & { entryId: string; releaseId?: string },
rawData: EntryProps<T>,
headers?: RawAxiosRequestHeaders,
) => {
if (params.releaseId) {
return releaseEntry.update(http, params as UpdateReleaseEntryParams, rawData, headers ?? {})
}

const data: SetOptional<typeof rawData, 'sys'> = copy(rawData)
delete data.sys
return raw.put<EntryProps<T>>(
Expand Down Expand Up @@ -181,9 +204,13 @@ export const unarchive: RestEndpoint<'Entry', 'unarchive'> = <T extends KeyValue

export const create: RestEndpoint<'Entry', 'create'> = <T extends KeyValueMap = KeyValueMap>(
http: AxiosInstance,
params: GetSpaceEnvironmentParams & { contentTypeId: string },
params: GetSpaceEnvironmentParams & { contentTypeId: string; releaseId?: string },
rawData: CreateEntryProps<T>,
) => {
if (params.releaseId) {
return releaseEntry.create(http, params as CreateReleaseEntryParams, rawData, {})
}

const data = copy(rawData)

return raw.post<EntryProps<T>>(
Expand All @@ -202,9 +229,16 @@ export const createWithId: RestEndpoint<'Entry', 'createWithId'> = <
T extends KeyValueMap = KeyValueMap,
>(
http: AxiosInstance,
params: GetSpaceEnvironmentParams & { entryId: string; contentTypeId: string },
params: GetSpaceEnvironmentParams & {
entryId: string
contentTypeId: string
releaseId?: string
},
rawData: CreateEntryProps<T>,
) => {
if (params.releaseId) {
return releaseEntry.createWithId(http, params as CreateWithIdReleaseEntryParams, rawData, {})
}
const data = copy(rawData)

return raw.put<EntryProps<T>>(
Expand Down
4 changes: 4 additions & 0 deletions lib/adapters/REST/endpoints/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ import * as OAuthApplication from './oauth-application'
import * as PersonalAccessToken from './personal-access-token'
import * as PreviewApiKey from './preview-api-key'
import * as Release from './release'
import * as ReleaseAsset from './release-asset'
import * as ReleaseEntry from './release-entry'
import * as ReleaseAction from './release-action'
import * as Resource from './resource'
import * as ResourceProvider from './resource-provider'
Expand Down Expand Up @@ -107,6 +109,8 @@ export default {
AccessToken,
PreviewApiKey,
Release,
ReleaseAsset,
ReleaseEntry,
ReleaseAction,
Resource,
ResourceProvider,
Expand Down
Loading