Skip to content

Commit a882a6b

Browse files
committed
Merge branch 'feat/exo' into dx-987-split-exo-metadata-props
2 parents 3c53123 + 62685cb commit a882a6b

5 files changed

Lines changed: 38 additions & 6 deletions

File tree

lib/adapters/REST/endpoints/experience.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,9 @@ export const update: RestEndpoint<'Experience', 'update'> = (
5858
headers?: RawAxiosRequestHeaders,
5959
) => {
6060
const data: SetOptional<typeof rawData, 'sys'> & { componentTypeId?: string } = copy(rawData)
61-
data.componentTypeId = rawData.sys.componentType.sys.id
61+
if (rawData.sys.componentType) {
62+
data.componentTypeId = rawData.sys.componentType.sys.id
63+
}
6264
delete data.sys
6365
return raw.put<ExperienceProps>(http, getBaseUrl(params) + `/${params.experienceId}`, data, {
6466
headers: {

lib/entities/component-type.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type { Except } from 'type-fest'
2-
import type { CursorPaginationParams, ExoMetadataProps, Link } from '../common-types'
2+
import type {
3+
CursorPaginatedCollectionProp,
4+
CursorPaginationParams,
5+
ExoMetadataProps,
6+
Link,
7+
} from '../common-types'
38

49
// Query options for getMany - cursor-based pagination with mutual exclusivity & query filters
510
export type ComponentTypeQueryOptions = CursorPaginationParams & {
@@ -184,3 +189,5 @@ export type ComponentTypeProps = {
184189
export type CreateComponentTypeProps = Except<ComponentTypeProps, 'sys'>
185190

186191
export type UpdateComponentTypeProps = ComponentTypeProps
192+
193+
export type ComponentTypeCollection = CursorPaginatedCollectionProp<ComponentTypeProps>

lib/entities/experience.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import type { CursorPaginationParams, ExperienceMetadataProps, Link } from '../common-types'
1+
import type {
2+
CursorPaginatedCollectionProp,
3+
CursorPaginationParams,
4+
ExperienceMetadataProps,
5+
Link,
6+
} from '../common-types'
27
import type {
38
ComponentTypeViewport,
49
DimensionedDesignPropertyValue,
@@ -24,7 +29,7 @@ export type ExperienceSys = {
2429
version: number
2530
space: Link<'Space'>
2631
environment: Link<'Environment'>
27-
componentType: Link<'ComponentType'>
32+
componentType?: Link<'ComponentType'>
2833
template?: Link<'Template'>
2934
createdAt: string
3035
updatedAt: string
@@ -82,3 +87,5 @@ export type InlineFragmentNode = {
8287
contentBindings?: ExperienceContentBindings
8388
slots?: Record<string, Array<FragmentNode | InlineFragmentNode>>
8489
}
90+
91+
export type ExperienceCollection = CursorPaginatedCollectionProp<ExperienceProps>

lib/entities/template.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import type { Except } from 'type-fest'
2-
import type { CursorPaginationParams, ExoMetadataProps, Link } from '../common-types'
2+
import type {
3+
CursorPaginatedCollectionProp,
4+
CursorPaginationParams,
5+
ExoMetadataProps,
6+
Link,
7+
} from '../common-types'
38
import type {
49
ComponentTypeContentProperty,
510
ComponentTypeDesignProperty,
@@ -49,10 +54,18 @@ export type TemplateProps = {
4954

5055
export type CreateTemplateProps = Except<TemplateProps, 'sys'>
5156

52-
export type UpdateTemplateProps = TemplateProps
57+
export type UpdateTemplateProps = Omit<TemplateProps, 'sys'> & {
58+
sys: {
59+
id: string
60+
type: 'Template'
61+
version: number
62+
}
63+
}
5364

5465
// Query options for getMany - cursor-based pagination with filter support
5566
export type TemplateQueryOptions = CursorPaginationParams & {
5667
order?: string
5768
[key: string]: unknown
5869
}
70+
71+
export type TemplateCollection = CursorPaginatedCollectionProp<TemplateProps>

lib/export-types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,3 +357,6 @@ export type {
357357
WorkflowsChangelogEntryProps,
358358
WorkflowsChangelogQueryOptions,
359359
} from './entities/workflows-changelog-entry'
360+
export type { ComponentTypeCollection } from './entities/component-type'
361+
export type { TemplateCollection } from './entities/template'
362+
export type { ExperienceCollection } from './entities/experience'

0 commit comments

Comments
 (0)