contentful-management 12.5.0 → 12.6.0-dev.1

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 (57) hide show
  1. package/README.md +3 -3
  2. package/dist/browser/index.js +1070 -737
  3. package/dist/browser/index.js.map +1 -1
  4. package/dist/browser/index.min.js +1 -1
  5. package/dist/browser/index.min.js.map +1 -1
  6. package/dist/cjs/index.cjs +1062 -729
  7. package/dist/cjs/index.cjs.map +1 -1
  8. package/dist/esm/adapters/REST/endpoints/component-type.mjs +43 -3
  9. package/dist/esm/adapters/REST/endpoints/component-type.mjs.map +1 -1
  10. package/dist/esm/adapters/REST/endpoints/data-assembly.mjs +62 -0
  11. package/dist/esm/adapters/REST/endpoints/data-assembly.mjs.map +1 -0
  12. package/dist/esm/adapters/REST/endpoints/experience.mjs +52 -0
  13. package/dist/esm/adapters/REST/endpoints/experience.mjs.map +1 -0
  14. package/dist/esm/adapters/REST/endpoints/fragment.mjs +50 -0
  15. package/dist/esm/adapters/REST/endpoints/fragment.mjs.map +1 -0
  16. package/dist/esm/adapters/REST/endpoints/index.mjs +8 -0
  17. package/dist/esm/adapters/REST/endpoints/index.mjs.map +1 -1
  18. package/dist/esm/adapters/REST/endpoints/template.mjs +50 -0
  19. package/dist/esm/adapters/REST/endpoints/template.mjs.map +1 -0
  20. package/dist/esm/common-types.mjs.map +1 -1
  21. package/dist/esm/plain/plain-client.mjs +44 -0
  22. package/dist/esm/plain/plain-client.mjs.map +1 -1
  23. package/dist/types/adapters/REST/endpoints/component-type.d.ts +6 -0
  24. package/dist/types/adapters/REST/endpoints/component-type.js +43 -3
  25. package/dist/types/adapters/REST/endpoints/component-type.js.map +1 -1
  26. package/dist/types/adapters/REST/endpoints/data-assembly.d.ts +10 -0
  27. package/dist/types/adapters/REST/endpoints/data-assembly.js +62 -0
  28. package/dist/types/adapters/REST/endpoints/data-assembly.js.map +1 -0
  29. package/dist/types/adapters/REST/endpoints/experience.d.ts +8 -0
  30. package/dist/types/adapters/REST/endpoints/experience.js +52 -0
  31. package/dist/types/adapters/REST/endpoints/experience.js.map +1 -0
  32. package/dist/types/adapters/REST/endpoints/fragment.d.ts +8 -0
  33. package/dist/types/adapters/REST/endpoints/fragment.js +50 -0
  34. package/dist/types/adapters/REST/endpoints/fragment.js.map +1 -0
  35. package/dist/types/adapters/REST/endpoints/index.d.ts +8 -0
  36. package/dist/types/adapters/REST/endpoints/index.js +8 -0
  37. package/dist/types/adapters/REST/endpoints/index.js.map +1 -1
  38. package/dist/types/adapters/REST/endpoints/template.d.ts +8 -0
  39. package/dist/types/adapters/REST/endpoints/template.js +50 -0
  40. package/dist/types/adapters/REST/endpoints/template.js.map +1 -0
  41. package/dist/types/common-types.d.ts +330 -5
  42. package/dist/types/common-types.js.map +1 -1
  43. package/dist/types/entities/component-type.d.ts +89 -45
  44. package/dist/types/entities/data-assembly.d.ts +119 -0
  45. package/dist/types/entities/experience.d.ts +89 -0
  46. package/dist/types/entities/fragment.d.ts +52 -0
  47. package/dist/types/entities/template.d.ts +48 -0
  48. package/dist/types/export-types.d.ts +5 -0
  49. package/dist/types/plain/entities/component-type.d.ts +119 -7
  50. package/dist/types/plain/entities/data-assembly.d.ts +178 -0
  51. package/dist/types/plain/entities/experience.d.ts +165 -0
  52. package/dist/types/plain/entities/fragment.d.ts +134 -0
  53. package/dist/types/plain/entities/template.d.ts +139 -0
  54. package/dist/types/plain/plain-client-types.d.ts +8 -0
  55. package/dist/types/plain/plain-client.js +44 -0
  56. package/dist/types/plain/plain-client.js.map +1 -1
  57. package/package.json +1 -1
@@ -0,0 +1,119 @@
1
+ import type { CursorPaginationParams, ExoCursorPaginatedCollectionProp, Link, MetadataProps, ResourceLink } from '../common-types';
2
+ export type DataAssemblyPrimitiveDataTypeField = {
3
+ id: string;
4
+ name: string;
5
+ type: string;
6
+ required: boolean;
7
+ source?: string;
8
+ };
9
+ export type DataAssemblyTypeRefDataTypeField = {
10
+ id: string;
11
+ name: string;
12
+ type: 'TypeRef';
13
+ ref: ResourceLink<'Contentful:DataAssembly'>;
14
+ required: boolean;
15
+ };
16
+ export type DataAssemblyDataTypeField = DataAssemblyPrimitiveDataTypeField | DataAssemblyTypeRefDataTypeField;
17
+ export type DataAssemblyLinkParameter = {
18
+ name?: string;
19
+ description?: string;
20
+ type: 'Link';
21
+ linkType: string;
22
+ allowedContentTypes: string[];
23
+ };
24
+ export type DataAssemblyResourceLinkParameter = {
25
+ name?: string;
26
+ description?: string;
27
+ type: 'ResourceLink';
28
+ linkType: string;
29
+ allowedResources: Array<{
30
+ type: string;
31
+ source: string;
32
+ allowedTypes: string[];
33
+ }>;
34
+ };
35
+ export type DataAssemblyParameterConfig = Record<string, DataAssemblyLinkParameter | DataAssemblyResourceLinkParameter>;
36
+ export type DataAssemblyGraphQLResolver = {
37
+ source: 'Contentful:GraphQL';
38
+ query: string;
39
+ parameters?: Record<string, unknown>;
40
+ };
41
+ export type DataAssemblyNestedResolver = {
42
+ source: 'Contentful:DataAssembly';
43
+ dataAssembly: ResourceLink<'Contentful:DataAssembly'>;
44
+ parameters?: Record<string, unknown>;
45
+ };
46
+ export type DataAssemblyResolverDefinition = DataAssemblyGraphQLResolver | DataAssemblyNestedResolver;
47
+ export type DataAssemblyResolverConfig = Record<string, DataAssemblyResolverDefinition>;
48
+ export type DataAssemblyReturnMappingSelectValue = string | {
49
+ $on: {
50
+ type: Record<string, DataAssemblyReturnMappingSelectValue>;
51
+ default?: DataAssemblyReturnMappingSelectValue;
52
+ };
53
+ } | {
54
+ [key: string]: DataAssemblyReturnMappingSelectValue;
55
+ };
56
+ export type DataAssemblyReturnMappingFromObject = {
57
+ $from: {
58
+ source: string;
59
+ select?: DataAssemblyReturnMappingSelectValue;
60
+ };
61
+ };
62
+ export type DataAssemblyReturnMappingValue = string | DataAssemblyReturnMappingFromObject | {
63
+ [key: string]: DataAssemblyReturnMappingValue;
64
+ };
65
+ export type DataAssemblyReturnMappingConfig = Record<string, DataAssemblyReturnMappingValue>;
66
+ export type DataAssemblySys = {
67
+ id: string;
68
+ type: 'DataAssembly';
69
+ dataType: DataAssemblyDataTypeField[];
70
+ version: number;
71
+ space: Link<'Space'>;
72
+ environment: Link<'Environment'>;
73
+ createdBy: Link<'User'>;
74
+ createdAt: string | Date;
75
+ updatedAt: string | Date;
76
+ updatedBy?: Link<'User'>;
77
+ publishedAt?: string | Date;
78
+ publishedVersion?: number;
79
+ publishedCounter?: number;
80
+ firstPublishedAt?: string | Date;
81
+ publishedBy?: Link<'User'> | Link<'AppDefinition'>;
82
+ variant?: string;
83
+ };
84
+ type DataAssemblyCommonProps = {
85
+ metadata: Pick<MetadataProps, 'tags'>;
86
+ name: string;
87
+ description: string;
88
+ parameters: DataAssemblyParameterConfig;
89
+ resolvers: DataAssemblyResolverConfig;
90
+ return: DataAssemblyReturnMappingConfig;
91
+ };
92
+ export type DataAssemblyProps = DataAssemblyCommonProps & {
93
+ sys: DataAssemblySys;
94
+ };
95
+ export type CreateDataAssemblyProps = DataAssemblyCommonProps & {
96
+ sys: {
97
+ type: 'DataAssembly';
98
+ variant?: string;
99
+ dataType: DataAssemblyDataTypeField[];
100
+ };
101
+ };
102
+ export type UpdateDataAssemblyProps = DataAssemblyCommonProps & {
103
+ sys: {
104
+ id: string;
105
+ type: 'DataAssembly';
106
+ variant?: string;
107
+ version: number;
108
+ dataType: DataAssemblyDataTypeField[];
109
+ };
110
+ };
111
+ export type DataAssemblyQueryOptions = CursorPaginationParams & {
112
+ 'sys.id[in]'?: string;
113
+ };
114
+ export type DataAssemblyCollection = ExoCursorPaginatedCollectionProp<DataAssemblyProps> & {
115
+ errors?: {
116
+ notFoundIds: string[];
117
+ };
118
+ };
119
+ export {};
@@ -0,0 +1,89 @@
1
+ import type { CursorPaginationParams, ExoCursorPaginatedCollectionProp, ExperienceMetadataProps, ExoQueryFilters, Link } from '../common-types';
2
+ import type { ComponentTypeViewport, DimensionedDesignPropertyValue, FragmentNode } from './component-type';
3
+ export type ExperienceDimensionKeyMap = {
4
+ designProperties: Record<string, {
5
+ breakpoint: string;
6
+ }>;
7
+ };
8
+ export type ExperienceContentBindings = {
9
+ sys: {
10
+ type: 'Link';
11
+ id: string;
12
+ linkType: 'DataAssembly';
13
+ };
14
+ parameters: Record<string, Link<string>>;
15
+ };
16
+ export type ExperienceSys = {
17
+ id: string;
18
+ type: 'Experience';
19
+ version: number;
20
+ space: Link<'Space'>;
21
+ environment: Link<'Environment'>;
22
+ template?: Link<'Template'>;
23
+ createdAt: string;
24
+ updatedAt: string;
25
+ createdBy: Link<'User'>;
26
+ updatedBy: Link<'User'>;
27
+ archivedAt?: string;
28
+ archivedBy?: Link<'User'>;
29
+ archivedVersion?: number;
30
+ variant?: string;
31
+ variantType?: string;
32
+ variantDimension?: string;
33
+ publishedAt?: string;
34
+ publishedVersion?: number;
35
+ publishedCounter?: number;
36
+ firstPublishedAt?: string;
37
+ publishedBy?: Link<'User'> | Link<'AppDefinition'>;
38
+ localeStatus?: Record<string, 'draft' | 'published' | 'changed'>;
39
+ };
40
+ type ExperienceCommonProps = {
41
+ name: string;
42
+ description: string;
43
+ viewports: ComponentTypeViewport[];
44
+ contentProperties: Record<string, unknown>;
45
+ designProperties: Record<string, DimensionedDesignPropertyValue>;
46
+ dimensionKeyMap: ExperienceDimensionKeyMap;
47
+ contentBindings?: ExperienceContentBindings;
48
+ metadata?: ExperienceMetadataProps;
49
+ slots?: Record<string, Array<FragmentNode | InlineFragmentNode>>;
50
+ };
51
+ export type ExperienceProps = ExperienceCommonProps & {
52
+ sys: ExperienceSys;
53
+ };
54
+ export type ExperienceQueryOptions = CursorPaginationParams & ExoQueryFilters & {
55
+ order?: string;
56
+ };
57
+ export type ExperienceLocalePublishPayload = {
58
+ add: string[];
59
+ } | {
60
+ remove: string[];
61
+ };
62
+ export type CreateExperienceProps = ExperienceCommonProps & {
63
+ template: Link<'Template'>;
64
+ };
65
+ export type UpsertExperienceProps = ExperienceCommonProps & {
66
+ sys: {
67
+ id: string;
68
+ type: 'Experience';
69
+ version?: number;
70
+ };
71
+ template?: Link<'Template'>;
72
+ };
73
+ export type InlineFragmentNode = {
74
+ id: string;
75
+ nodeType: 'InlineFragment';
76
+ componentTypeId: string;
77
+ designProperties: Record<string, DimensionedDesignPropertyValue>;
78
+ contentBindings?: ExperienceContentBindings;
79
+ slots?: Record<string, Array<FragmentNode | InlineFragmentNode>>;
80
+ };
81
+ export type ExperienceCollection = ExoCursorPaginatedCollectionProp<ExperienceProps>;
82
+ export type ReleaseExperienceSys = Omit<ExperienceSys, 'variant' | 'variantType' | 'variantDimension'> & {
83
+ release: Link<'Release'>;
84
+ };
85
+ export type ReleaseExperience = Omit<ExperienceProps, 'sys'> & {
86
+ sys: ReleaseExperienceSys;
87
+ };
88
+ export type ReleaseExperienceCollection = ExoCursorPaginatedCollectionProp<ReleaseExperience>;
89
+ export {};
@@ -0,0 +1,52 @@
1
+ import type { Except } from 'type-fest';
2
+ import type { CursorPaginationParams, ExoCursorPaginatedCollectionProp, ExoQueryFilters, ExperienceMetadataProps, Link } from '../common-types';
3
+ import type { ComponentTypeViewport, DimensionedDesignPropertyValue, FragmentNode } from './component-type';
4
+ import type { ExperienceContentBindings, ExperienceDimensionKeyMap, InlineFragmentNode } from './experience';
5
+ export type FragmentSys = {
6
+ id: string;
7
+ type: 'Fragment';
8
+ version: number;
9
+ space: Link<'Space'>;
10
+ environment: Link<'Environment'>;
11
+ componentType: Link<'ComponentType'>;
12
+ archivedAt?: string;
13
+ archivedBy?: Link<'User'>;
14
+ archivedVersion?: number;
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ createdBy: Link<'User'>;
18
+ updatedBy: Link<'User'>;
19
+ variant?: string;
20
+ variantType?: string;
21
+ variantDimension?: string;
22
+ publishedAt?: string;
23
+ publishedVersion?: number;
24
+ publishedCounter?: number;
25
+ firstPublishedAt?: string;
26
+ publishedBy?: Link<'User'> | Link<'AppDefinition'>;
27
+ };
28
+ export type FragmentProps = {
29
+ sys: FragmentSys;
30
+ name: string;
31
+ description: string;
32
+ viewports: ComponentTypeViewport[];
33
+ designProperties: Record<string, DimensionedDesignPropertyValue>;
34
+ dimensionKeyMap: ExperienceDimensionKeyMap;
35
+ contentBindings?: ExperienceContentBindings;
36
+ metadata?: ExperienceMetadataProps;
37
+ slots?: Record<string, Array<FragmentNode | InlineFragmentNode>>;
38
+ };
39
+ export type CreateFragmentProps = Except<FragmentProps, 'sys'> & {
40
+ componentType: Link<'ComponentType'>;
41
+ };
42
+ export type UpdateFragmentProps = Omit<FragmentProps, 'sys'> & {
43
+ sys: {
44
+ id: string;
45
+ type: 'Fragment';
46
+ version: number;
47
+ };
48
+ };
49
+ export type FragmentQueryOptions = CursorPaginationParams & ExoQueryFilters & {
50
+ order?: string;
51
+ };
52
+ export type FragmentCollection = ExoCursorPaginatedCollectionProp<FragmentProps>;
@@ -0,0 +1,48 @@
1
+ import type { Except } from 'type-fest';
2
+ import type { CursorPaginationParams, ExoCursorPaginatedCollectionProp, ExoMetadataProps, ExoQueryFilters, Link } from '../common-types';
3
+ import type { ComponentTypeContentProperty, ComponentTypeDesignProperty, ComponentTypeDimensionKeyMap, ComponentTypeSlotDefinition, ComponentTypeViewport, DataAssemblyLink, TreeNode } from './component-type';
4
+ export type TemplateSys = {
5
+ id: string;
6
+ type: 'Template';
7
+ version: number;
8
+ space: Link<'Space'>;
9
+ environment: Link<'Environment'>;
10
+ fieldStatus?: Record<string, Record<string, 'draft' | 'published' | 'changed'>>;
11
+ publishedAt?: string;
12
+ publishedVersion?: number;
13
+ publishedCounter?: number;
14
+ firstPublishedAt?: string;
15
+ publishedBy?: Link<'User'> | Link<'AppDefinition'>;
16
+ variant?: string;
17
+ variantType?: string;
18
+ variantDimension?: string;
19
+ createdAt: string;
20
+ createdBy: Link<'User'>;
21
+ updatedAt: string;
22
+ updatedBy: Link<'User'>;
23
+ };
24
+ export type TemplateProps = {
25
+ sys: TemplateSys;
26
+ name: string;
27
+ description: string;
28
+ viewports: ComponentTypeViewport[];
29
+ contentProperties: ComponentTypeContentProperty[];
30
+ designProperties: ComponentTypeDesignProperty[];
31
+ dimensionKeyMap: ComponentTypeDimensionKeyMap;
32
+ componentTree?: TreeNode[];
33
+ slots?: ComponentTypeSlotDefinition[];
34
+ metadata?: ExoMetadataProps;
35
+ dataAssemblies?: DataAssemblyLink[];
36
+ };
37
+ export type CreateTemplateProps = Except<TemplateProps, 'sys'>;
38
+ export type UpsertTemplateProps = Except<TemplateProps, 'sys'> & {
39
+ sys: {
40
+ id: string;
41
+ type: 'Template';
42
+ version?: number;
43
+ };
44
+ };
45
+ export type TemplateQueryOptions = CursorPaginationParams & ExoQueryFilters & {
46
+ order?: string;
47
+ };
48
+ export type TemplateCollection = ExoCursorPaginatedCollectionProp<TemplateProps>;
@@ -85,3 +85,8 @@ export type { SemanticSearchProps, SemanticSearch } from './entities/semantic-se
85
85
  export type { DefinedParameters, FreeFormParameters, InstallationParameterType, ParameterDefinition, ParameterOption, ParameterType, } from './entities/widget-parameters';
86
86
  export type { CreateWorkflowProps, DeleteWorkflowParams, UpdateWorkflowProps, Workflow, WorkflowProps, WorkflowQueryOptions, } from './entities/workflow';
87
87
  export type { WorkflowsChangelogEntry, WorkflowsChangelogEntryProps, WorkflowsChangelogQueryOptions, } from './entities/workflows-changelog-entry';
88
+ export type { ComponentTypeCollection } from './entities/component-type';
89
+ export type { TemplateCollection } from './entities/template';
90
+ export type { ExperienceCollection, ReleaseExperience, ReleaseExperienceCollection, ReleaseExperienceSys, } from './entities/experience';
91
+ export type { FragmentCollection } from './entities/fragment';
92
+ export type { DataAssemblyCollection, DataAssemblyResourceLinkParameter, DataAssemblyReturnMappingFromObject, DataAssemblyReturnMappingSelectValue, } from './entities/data-assembly';
@@ -1,13 +1,13 @@
1
- import type { GetSpaceEnvironmentParams, CollectionProp } from '../../common-types';
2
- import type { ComponentTypeQueryOptions, ComponentTypeProps } from '../../entities/component-type';
1
+ import type { GetSpaceEnvironmentParams, GetComponentTypeParams, ExoCursorPaginatedCollectionProp } from '../../common-types';
2
+ import type { ComponentTypeQueryOptions, ComponentTypeProps, CreateComponentTypeProps, UpsertComponentTypeProps } from '../../entities/component-type';
3
3
  import type { OptionalDefaults } from '../wrappers/wrap';
4
4
  export type ComponentTypePlainClientAPI = {
5
5
  /**
6
6
  * Fetches all component types for a space and environment
7
7
  * @param params the space and environment IDs and query parameters
8
- * @param params.query.experienceCtId the experience component type ID
9
8
  * @param params.query.limit the maximum number of component types to return
10
- * @param params.query.skip the number of component types to skip
9
+ * @param params.query.pageNext cursor token for the next page
10
+ * @param params.query.pagePrev cursor token for the previous page
11
11
  * @returns a collection of component types
12
12
  * @throws if the request fails, or the space, environment, or experience component type is not found
13
13
  * @internal - Experimental endpoint, subject to breaking changes without notice
@@ -17,14 +17,126 @@ export type ComponentTypePlainClientAPI = {
17
17
  * spaceId: '<space_id>',
18
18
  * environmentId: '<environment_id>',
19
19
  * query: {
20
- * _experienceCtId: '<experience_ct_id>',
21
20
  * limit: 10,
22
- * skip: 0,
23
21
  * },
24
22
  * });
25
23
  * ```
26
24
  */
27
25
  getMany(params: OptionalDefaults<GetSpaceEnvironmentParams & {
28
26
  query: ComponentTypeQueryOptions;
29
- }>): Promise<CollectionProp<ComponentTypeProps>>;
27
+ }>): Promise<ExoCursorPaginatedCollectionProp<ComponentTypeProps>>;
28
+ /**
29
+ * Fetches a single component type by ID
30
+ * @param params the space, environment, and component type IDs
31
+ * @returns the component type
32
+ * @throws if the request fails, or the space, environment, or component type is not found
33
+ * @internal - Experimental endpoint, subject to breaking changes without notice
34
+ * @example
35
+ * ```javascript
36
+ * const componentType = await client.componentType.get({
37
+ * spaceId: '<space_id>',
38
+ * environmentId: '<environment_id>',
39
+ * componentTypeId: '<component_id>',
40
+ * });
41
+ * ```
42
+ */
43
+ get(params: OptionalDefaults<GetComponentTypeParams>): Promise<ComponentTypeProps>;
44
+ /**
45
+ * Creates a new component type
46
+ * @param params the space and environment IDs
47
+ * @param rawData the component type data to create
48
+ * @returns the created component type
49
+ * @throws if the request fails
50
+ * @internal - Experimental endpoint, subject to breaking changes without notice
51
+ * @example
52
+ * ```javascript
53
+ * const componentType = await client.componentType.create({
54
+ * spaceId: '<space_id>',
55
+ * environmentId: '<environment_id>',
56
+ * }, {
57
+ * name: 'My Component',
58
+ * description: 'A new component type',
59
+ * viewports: [],
60
+ * contentProperties: [],
61
+ * designProperties: [],
62
+ * dimensionKeyMap: { designProperties: {} },
63
+ * });
64
+ * ```
65
+ */
66
+ create(params: OptionalDefaults<GetSpaceEnvironmentParams>, rawData: CreateComponentTypeProps): Promise<ComponentTypeProps>;
67
+ /**
68
+ * Upserts a component type (creates or updates via PUT)
69
+ * @param params the space, environment, and component type IDs
70
+ * @param rawData the component type data to upsert (include sys.version for updates, omit for creates)
71
+ * @returns the upserted component type
72
+ * @throws if the request fails
73
+ * @internal - Experimental endpoint, subject to breaking changes without notice
74
+ * @example
75
+ * ```javascript
76
+ * const current = await client.componentType.get({ componentTypeId: '<component_id>' });
77
+ * const updated = await client.componentType.upsert({
78
+ * spaceId: '<space_id>',
79
+ * environmentId: '<environment_id>',
80
+ * componentTypeId: '<component_id>',
81
+ * }, {
82
+ * sys: { id: current.sys.id, type: 'ComponentType', version: current.sys.version },
83
+ * name: 'Updated Component',
84
+ * ...otherFields,
85
+ * });
86
+ * ```
87
+ */
88
+ upsert(params: OptionalDefaults<GetComponentTypeParams>, rawData: UpsertComponentTypeProps): Promise<ComponentTypeProps>;
89
+ /**
90
+ * Deletes a single component type
91
+ * @param params the space, environment, and component type IDs
92
+ * @throws if the request fails, or the component type is not found
93
+ * @internal - Experimental endpoint, subject to breaking changes without notice
94
+ * @example
95
+ * ```javascript
96
+ * await client.componentType.delete({
97
+ * spaceId: '<space_id>',
98
+ * environmentId: '<environment_id>',
99
+ * componentTypeId: '<component_id>',
100
+ * });
101
+ * ```
102
+ */
103
+ delete(params: OptionalDefaults<GetComponentTypeParams>): Promise<void>;
104
+ /**
105
+ * Publishes a component type
106
+ * @param params the space, environment, and component type IDs, and the version number
107
+ * @returns the published component type
108
+ * @throws if the request fails, or the component type is not found
109
+ * @internal - Experimental endpoint, subject to breaking changes without notice
110
+ * @example
111
+ * ```javascript
112
+ * const componentType = await client.componentType.publish({
113
+ * spaceId: '<space_id>',
114
+ * environmentId: '<environment_id>',
115
+ * componentTypeId: '<component_type_id>',
116
+ * version: <version>,
117
+ * });
118
+ * ```
119
+ */
120
+ publish(params: OptionalDefaults<GetComponentTypeParams & {
121
+ version: number;
122
+ }>): Promise<ComponentTypeProps>;
123
+ /**
124
+ * Unpublishes a component type
125
+ * @param params the space, environment, and component type IDs, and the version number
126
+ * @returns the unpublished component type
127
+ * @throws if the request fails, or the component type is not found
128
+ * @internal - Experimental endpoint, subject to breaking changes without notice
129
+ * @example
130
+ * ```javascript
131
+ * const componentType = await client.componentType.unpublish({
132
+ * spaceId: '<space_id>',
133
+ * environmentId: '<environment_id>',
134
+ * componentTypeId: '<component_type_id>',
135
+ * version: <version>,
136
+ * });
137
+ * ```
138
+ */
139
+ unpublish(params: OptionalDefaults<GetComponentTypeParams & {
140
+ version: number;
141
+ }>): Promise<ComponentTypeProps>;
30
142
  };
@@ -0,0 +1,178 @@
1
+ import type { RawAxiosRequestHeaders } from 'axios';
2
+ import type { GetDataAssemblyParams, GetSpaceEnvironmentParams } from '../../common-types';
3
+ import type { CreateDataAssemblyProps, DataAssemblyProps, DataAssemblyQueryOptions, UpdateDataAssemblyProps, DataAssemblyCollection } from '../../entities/data-assembly';
4
+ import type { OptionalDefaults } from '../wrappers/wrap';
5
+ export type DataAssemblyPlainClientAPI = {
6
+ /**
7
+ * Fetches all data assemblies for a space and environment
8
+ * @param params the space, environment IDs and query options (see {@link DataAssemblyQueryOptions})
9
+ * @returns a collection of data assemblies
10
+ * @throws if the request fails, or the space or environment is not found
11
+ * @internal - Experimental endpoint, subject to breaking changes without notice
12
+ * @example
13
+ * ```javascript
14
+ * const dataAssemblies = await client.dataAssembly.getMany({
15
+ * spaceId: '<space_id>',
16
+ * environmentId: '<environment_id>',
17
+ * query: {
18
+ * limit: 10,
19
+ * },
20
+ * });
21
+ * ```
22
+ */
23
+ getMany(params: OptionalDefaults<GetSpaceEnvironmentParams & {
24
+ query: DataAssemblyQueryOptions;
25
+ }>): Promise<DataAssemblyCollection>;
26
+ /**
27
+ * Fetches a single data assembly by ID
28
+ * @param params the space, environment, and data assembly IDs
29
+ * @returns the data assembly
30
+ * @throws if the request fails, or the data assembly is not found
31
+ * @internal - Experimental endpoint, subject to breaking changes without notice
32
+ * @example
33
+ * ```javascript
34
+ * const dataAssembly = await client.dataAssembly.get({
35
+ * spaceId: '<space_id>',
36
+ * environmentId: '<environment_id>',
37
+ * dataAssemblyId: '<data_assembly_id>',
38
+ * });
39
+ * ```
40
+ */
41
+ get(params: OptionalDefaults<GetDataAssemblyParams>): Promise<DataAssemblyProps>;
42
+ /**
43
+ * Creates a new data assembly
44
+ * @param params the space and environment IDs
45
+ * @param rawData the data assembly data to create
46
+ * @param headers optional custom headers
47
+ * @returns the created data assembly
48
+ * @throws if the request fails
49
+ * @internal - Experimental endpoint, subject to breaking changes without notice
50
+ * @example
51
+ * ```javascript
52
+ * const dataAssembly = await client.dataAssembly.create({
53
+ * spaceId: '<space_id>',
54
+ * environmentId: '<environment_id>',
55
+ * }, {
56
+ * sys: { type: 'DataAssembly', dataType: [] },
57
+ * metadata: { tags: [] },
58
+ * name: 'My Assembly',
59
+ * description: 'A data assembly',
60
+ * parameters: {},
61
+ * resolvers: {},
62
+ * return: {},
63
+ * });
64
+ * ```
65
+ */
66
+ create(params: OptionalDefaults<GetSpaceEnvironmentParams>, rawData: CreateDataAssemblyProps, headers?: RawAxiosRequestHeaders): Promise<DataAssemblyProps>;
67
+ /**
68
+ * Updates a data assembly with PUT
69
+ * @param params the space, environment, and data assembly IDs
70
+ * @param rawData the data assembly data to update (must include sys.version)
71
+ * @param headers optional custom headers
72
+ * @returns the updated data assembly
73
+ * @throws if the request fails, or the data assembly is not found
74
+ * @internal - Experimental endpoint, subject to breaking changes without notice
75
+ * @example
76
+ * ```javascript
77
+ * const updated = await client.dataAssembly.update(
78
+ * {
79
+ * spaceId: '<space_id>',
80
+ * environmentId: '<environment_id>',
81
+ * dataAssemblyId: '<data_assembly_id>',
82
+ * },
83
+ * { ...dataAssembly, name: 'Updated Name' },
84
+ * );
85
+ * ```
86
+ */
87
+ update(params: OptionalDefaults<GetDataAssemblyParams>, rawData: UpdateDataAssemblyProps, headers?: RawAxiosRequestHeaders): Promise<DataAssemblyProps>;
88
+ /**
89
+ * Deletes a data assembly
90
+ * @param params the space, environment, and data assembly IDs
91
+ * @returns void
92
+ * @throws if the request fails, or the data assembly is not found
93
+ * @internal - Experimental endpoint, subject to breaking changes without notice
94
+ * @example
95
+ * ```javascript
96
+ * await client.dataAssembly.delete({
97
+ * spaceId: '<space_id>',
98
+ * environmentId: '<environment_id>',
99
+ * dataAssemblyId: '<data_assembly_id>',
100
+ * });
101
+ * ```
102
+ */
103
+ delete(params: OptionalDefaults<GetDataAssemblyParams>): Promise<void>;
104
+ /**
105
+ * Publishes a data assembly
106
+ * @param params the space, environment, and data assembly IDs, and the version number
107
+ * @returns the published data assembly
108
+ * @throws if the request fails, or the data assembly is not found
109
+ * @internal - Experimental endpoint, subject to breaking changes without notice
110
+ * @example
111
+ * ```javascript
112
+ * const dataAssembly = await client.dataAssembly.publish({
113
+ * spaceId: '<space_id>',
114
+ * environmentId: '<environment_id>',
115
+ * dataAssemblyId: '<data_assembly_id>',
116
+ * version: 1,
117
+ * });
118
+ * ```
119
+ */
120
+ publish(params: OptionalDefaults<GetDataAssemblyParams & {
121
+ version: number;
122
+ }>): Promise<DataAssemblyProps>;
123
+ /**
124
+ * Unpublishes a data assembly
125
+ * @param params the space, environment, and data assembly IDs, and the version number
126
+ * @returns the unpublished data assembly
127
+ * @throws if the request fails, or the data assembly is not found
128
+ * @internal - Experimental endpoint, subject to breaking changes without notice
129
+ * @example
130
+ * ```javascript
131
+ * const dataAssembly = await client.dataAssembly.unpublish({
132
+ * spaceId: '<space_id>',
133
+ * environmentId: '<environment_id>',
134
+ * dataAssemblyId: '<data_assembly_id>',
135
+ * version: 1,
136
+ * });
137
+ * ```
138
+ */
139
+ unpublish(params: OptionalDefaults<GetDataAssemblyParams & {
140
+ version: number;
141
+ }>): Promise<DataAssemblyProps>;
142
+ /**
143
+ * Fetches all published data assemblies for a space and environment
144
+ * @param params the space, environment IDs and query options (see {@link DataAssemblyQueryOptions})
145
+ * @returns a collection of published data assemblies
146
+ * @throws if the request fails, or the space or environment is not found
147
+ * @internal - Experimental endpoint, subject to breaking changes without notice
148
+ * @example
149
+ * ```javascript
150
+ * const dataAssemblies = await client.dataAssembly.getManyPublished({
151
+ * spaceId: '<space_id>',
152
+ * environmentId: '<environment_id>',
153
+ * query: {
154
+ * limit: 10,
155
+ * },
156
+ * });
157
+ * ```
158
+ */
159
+ getManyPublished(params: OptionalDefaults<GetSpaceEnvironmentParams & {
160
+ query: DataAssemblyQueryOptions;
161
+ }>): Promise<DataAssemblyCollection>;
162
+ /**
163
+ * Fetches a single published data assembly by ID
164
+ * @param params the space, environment, and data assembly IDs
165
+ * @returns the published data assembly
166
+ * @throws if the request fails, or the data assembly is not found
167
+ * @internal - Experimental endpoint, subject to breaking changes without notice
168
+ * @example
169
+ * ```javascript
170
+ * const dataAssembly = await client.dataAssembly.getPublished({
171
+ * spaceId: '<space_id>',
172
+ * environmentId: '<environment_id>',
173
+ * dataAssemblyId: '<data_assembly_id>',
174
+ * });
175
+ * ```
176
+ */
177
+ getPublished(params: OptionalDefaults<GetDataAssemblyParams>): Promise<DataAssemblyProps>;
178
+ };