@contentful/field-editor-reference 4.4.0 → 4.5.0

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.5.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.4.0...@contentful/field-editor-reference@4.5.0) (2022-07-11)
7
+
8
+ ### Features
9
+
10
+ - add simple fetching for resources ([#1179](https://github.com/contentful/field-editors/issues/1179)) ([b29daac](https://github.com/contentful/field-editors/commit/b29daac6460f93a4350bf45f90ae938f65de96ee))
11
+
6
12
  # [4.4.0](https://github.com/contentful/field-editors/compare/@contentful/field-editor-reference@4.3.11...@contentful/field-editor-reference@4.4.0) (2022-07-06)
7
13
 
8
14
  ### Features
@@ -2,145 +2,8 @@ import { FieldAPI, Link } from '@contentful/app-sdk';
2
2
  export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
3
3
  field: FieldAPI;
4
4
  locales: import("@contentful/app-sdk").LocalesAPI;
5
+ cmaAdapter: import("contentful-management").Adapter;
5
6
  space: {
6
- getAsset: (id: string) => Promise<{
7
- sys: {
8
- space: {
9
- sys: {
10
- type: string;
11
- linkType: string;
12
- id: string;
13
- };
14
- };
15
- id: string;
16
- type: string;
17
- createdAt: string;
18
- updatedAt: string;
19
- environment: {
20
- sys: {
21
- id: string;
22
- type: string;
23
- linkType: string;
24
- };
25
- };
26
- createdBy: {
27
- sys: {
28
- type: string;
29
- linkType: string;
30
- id: string;
31
- };
32
- };
33
- updatedBy: {
34
- sys: {
35
- type: string;
36
- linkType: string;
37
- id: string;
38
- };
39
- };
40
- publishedCounter: number;
41
- version: number;
42
- };
43
- fields: {};
44
- }>;
45
- getEntry: (id: string) => Promise<{
46
- sys: {
47
- space: {
48
- sys: {
49
- type: string;
50
- linkType: string;
51
- id: string;
52
- };
53
- };
54
- id: string;
55
- type: string;
56
- createdAt: string;
57
- updatedAt: string;
58
- environment: {
59
- sys: {
60
- id: string;
61
- type: string;
62
- linkType: string;
63
- };
64
- };
65
- createdBy: {
66
- sys: {
67
- type: string;
68
- linkType: string;
69
- id: string;
70
- };
71
- };
72
- updatedBy: {
73
- sys: {
74
- type: string;
75
- linkType: string;
76
- id: string;
77
- };
78
- };
79
- publishedCounter: number;
80
- version: number;
81
- contentType: {
82
- sys: {
83
- type: string;
84
- linkType: string;
85
- id: string;
86
- };
87
- };
88
- };
89
- fields: {};
90
- } | {
91
- sys: {
92
- space: {
93
- sys: {
94
- type: string;
95
- linkType: string;
96
- id: string;
97
- };
98
- };
99
- id: string;
100
- type: string;
101
- createdAt: string;
102
- updatedAt: string;
103
- environment: {
104
- sys: {
105
- id: string;
106
- type: string;
107
- linkType: string;
108
- };
109
- };
110
- firstPublishedAt: string;
111
- createdBy: {
112
- sys: {
113
- type: string;
114
- linkType: string;
115
- id: string;
116
- };
117
- };
118
- updatedBy: {
119
- sys: {
120
- type: string;
121
- linkType: string;
122
- id: string;
123
- };
124
- };
125
- publishedVersion: number;
126
- version: number;
127
- contentType: {
128
- sys: {
129
- type: string;
130
- linkType: string;
131
- id: string;
132
- };
133
- };
134
- };
135
- fields: {
136
- exField: {
137
- en: string;
138
- };
139
- exDesc: {
140
- en: string;
141
- };
142
- };
143
- }>;
144
7
  getEntityScheduledActions(): Promise<never[]>;
145
8
  getCachedContentTypes: () => import("@contentful/app-sdk").ContentType[];
146
9
  getContentType: (id: string) => Promise<import("@contentful/app-sdk").ContentType>;
@@ -148,7 +11,8 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
148
11
  createContentType: (data: import("@contentful/app-sdk").WithOptionalId<import("@contentful/app-sdk").ContentType>) => Promise<import("@contentful/app-sdk").ContentType>;
149
12
  updateContentType: (data: import("@contentful/app-sdk").ContentType) => Promise<import("@contentful/app-sdk").ContentType>;
150
13
  deleteContentType: (contentTypeId: string) => Promise<void>;
151
- getEntrySnapshots: <Fields extends Record<string, any> = Record<string, any>>(id: string) => Promise<import("@contentful/app-sdk").CollectionResponse<{
14
+ getEntry: <Fields extends Record<string, any> = Record<string, any>>(id: string) => Promise<import("@contentful/app-sdk").Entry<Fields>>;
15
+ getEntrySnapshots: <Fields_1 extends Record<string, any> = Record<string, any>>(id: string) => Promise<import("@contentful/app-sdk").CollectionResponse<{
152
16
  sys: {
153
17
  space?: Link<string, string> | undefined;
154
18
  status?: Link<string, string> | undefined;
@@ -162,17 +26,18 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
162
26
  snapshotType: string;
163
27
  snapshotEntityType: string;
164
28
  };
165
- snapshot: import("@contentful/app-sdk").Entry<Fields>;
29
+ snapshot: import("@contentful/app-sdk").Entry<Fields_1>;
166
30
  }>>;
167
- getEntries: <Fields_1, Query_1 extends import("@contentful/app-sdk").SearchQuery = import("@contentful/app-sdk").SearchQuery>(query?: Query_1 | undefined) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Entry<Fields_1>>>;
168
- createEntry: <Fields_2>(contentTypeId: string, data: import("@contentful/app-sdk").WithOptionalId<import("@contentful/app-sdk").Entry<Fields_2>>) => Promise<import("@contentful/app-sdk").Entry<Fields_2>>;
169
- updateEntry: <Fields_3 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_3>) => Promise<import("@contentful/app-sdk").Entry<Fields_3>>;
170
- publishEntry: <Fields_4 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_4>) => Promise<import("@contentful/app-sdk").Entry<Fields_4>>;
171
- unpublishEntry: <Fields_5 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_5>) => Promise<import("@contentful/app-sdk").Entry<Fields_5>>;
172
- archiveEntry: <Fields_6 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_6>) => Promise<import("@contentful/app-sdk").Entry<Fields_6>>;
173
- unarchiveEntry: <Fields_7 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_7>) => Promise<import("@contentful/app-sdk").Entry<Fields_7>>;
174
- deleteEntry: <Fields_8 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_8>) => Promise<void>;
175
- getPublishedEntries: <Fields_9, Query_2 extends import("@contentful/app-sdk").SearchQuery = import("@contentful/app-sdk").SearchQuery>(query?: Query_2 | undefined) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Entry<Fields_9>>>;
31
+ getEntries: <Fields_2, Query_1 extends import("@contentful/app-sdk").SearchQuery = import("@contentful/app-sdk").SearchQuery>(query?: Query_1 | undefined) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Entry<Fields_2>>>;
32
+ createEntry: <Fields_3>(contentTypeId: string, data: import("@contentful/app-sdk").WithOptionalId<import("@contentful/app-sdk").Entry<Fields_3>>) => Promise<import("@contentful/app-sdk").Entry<Fields_3>>;
33
+ updateEntry: <Fields_4 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_4>) => Promise<import("@contentful/app-sdk").Entry<Fields_4>>;
34
+ publishEntry: <Fields_5 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_5>) => Promise<import("@contentful/app-sdk").Entry<Fields_5>>;
35
+ unpublishEntry: <Fields_6 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_6>) => Promise<import("@contentful/app-sdk").Entry<Fields_6>>;
36
+ archiveEntry: <Fields_7 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_7>) => Promise<import("@contentful/app-sdk").Entry<Fields_7>>;
37
+ unarchiveEntry: <Fields_8 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_8>) => Promise<import("@contentful/app-sdk").Entry<Fields_8>>;
38
+ deleteEntry: <Fields_9 extends Record<string, any> = Record<string, any>>(data: import("@contentful/app-sdk").Entry<Fields_9>) => Promise<void>;
39
+ getPublishedEntries: <Fields_10, Query_2 extends import("@contentful/app-sdk").SearchQuery = import("@contentful/app-sdk").SearchQuery>(query?: Query_2 | undefined) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Entry<Fields_10>>>;
40
+ getAsset: (id: string) => Promise<import("@contentful/app-sdk").Asset>;
176
41
  getAssets: <Query_3 extends import("@contentful/app-sdk").SearchQuery = import("@contentful/app-sdk").SearchQuery>(query?: Query_3 | undefined) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Asset>>;
177
42
  createAsset: (data: import("@contentful/app-sdk").WithOptionalId<import("@contentful/app-sdk").Asset>) => Promise<import("@contentful/app-sdk").Asset>;
178
43
  updateAsset: (data: import("@contentful/app-sdk").Asset) => Promise<import("@contentful/app-sdk").Asset>;
@@ -183,7 +48,7 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
183
48
  processAsset: (data: import("@contentful/app-sdk").Asset, locale: string) => Promise<import("@contentful/app-sdk").Asset>;
184
49
  unarchiveAsset: (data: import("@contentful/app-sdk").Asset) => Promise<import("@contentful/app-sdk").Asset>;
185
50
  getPublishedAssets: <Query_4 extends import("@contentful/app-sdk").SearchQuery = import("@contentful/app-sdk").SearchQuery>(query?: Query_4 | undefined) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Asset>>;
186
- createUpload: (base64data: string) => Promise<import("contentful-management/types").UploadProps>;
51
+ createUpload: (base64data: string) => Promise<import("contentful-management").UploadProps>;
187
52
  waitUntilAssetProcessed: (assetId: string, locale: string) => Promise<import("@contentful/app-sdk").Asset>;
188
53
  getUsers: () => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").User>>;
189
54
  getEditorInterface: (contentTypeId: string) => Promise<import("@contentful/app-sdk").EditorInterface>;
@@ -194,7 +59,7 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
194
59
  readTags: (skip: number, limit: number) => Promise<import("@contentful/app-sdk").CollectionResponse<import("@contentful/app-sdk").Tag>>;
195
60
  updateTag: (id: string, name: string, version: number) => Promise<import("@contentful/app-sdk").Tag>;
196
61
  deleteTag: (id: string, version: number) => Promise<boolean>;
197
- getTeams: (query: import("contentful-management/types").QueryOptions) => Promise<import("@contentful/app-sdk").CollectionResponse<import("contentful-management/types").TeamProps>>;
62
+ getTeams: (query: import("contentful-management").QueryOptions) => Promise<import("@contentful/app-sdk").CollectionResponse<import("contentful-management").TeamProps>>;
198
63
  };
199
64
  dialogs: {
200
65
  selectSingleAsset: () => Promise<Link<string, string>>;
@@ -216,4 +81,8 @@ export declare function newReferenceEditorFakeSdk(): (import("mitt").Emitter | {
216
81
  access: {
217
82
  can: () => Promise<boolean>;
218
83
  };
84
+ ids: {
85
+ space: string;
86
+ environment: string;
87
+ };
219
88
  })[];
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { Action, FieldExtensionSDK, ViewType, RenderDragFn } from '../../types';
3
2
  import { CustomCardRenderer, RenderCustomMissingEntityCard } from '../../common/customCardTypes';
3
+ import { Action, FieldExtensionSDK, ViewType, RenderDragFn } from '../../types';
4
4
  declare type FetchingWrappedAssetCardProps = {
5
5
  assetId: string;
6
6
  isDisabled: boolean;
@@ -1,5 +1,11 @@
1
1
  import * as React from 'react';
2
- import { BaseExtensionSDK } from '../types';
2
+ import { BaseExtensionSDK, ContentType, Resource, Space } from '../types';
3
+ export declare type ResourceInfo<R extends Resource = Resource> = {
4
+ resource: R;
5
+ defaultLocaleCode: string;
6
+ contentType: ContentType;
7
+ space: Space;
8
+ };
3
9
  declare const EntityProvider: React.FC<{
4
10
  sdk: BaseExtensionSDK;
5
11
  }>, useEntities: any;
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { ContentType, ReferenceValue } from '../types';
3
2
  import { ReferenceEditorProps } from '../common/ReferenceEditor';
3
+ import { ContentType, ReferenceValue } from '../types';
4
4
  export declare const SortableLinkList: React.ComponentClass<ReferenceEditorProps & {
5
5
  items: ReferenceValue[];
6
6
  setValue: (value: ReferenceValue[]) => void;
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { ContentType, RenderDragFn } from '../../types';
3
- import { ReferenceEditorProps } from '../../common/ReferenceEditor';
4
2
  import { RenderCustomMissingEntityCard } from '../../common/customCardTypes';
3
+ import { ReferenceEditorProps } from '../../common/ReferenceEditor';
4
+ import { ContentType, RenderDragFn } from '../../types';
5
5
  export declare type EntryCardReferenceEditorProps = ReferenceEditorProps & {
6
6
  entryId: string;
7
7
  index?: number;