contentful-ui-extensions-sdk 4.17.0 → 4.17.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.
- package/dist/api.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/initialize.d.ts +2 -2
- package/dist/types/api.types.d.ts +27 -9
- package/dist/types/index.d.ts +1 -1
- package/package.json +1 -1
package/dist/api.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConnectMessage, KnownAppSDK } from './types';
|
|
2
2
|
import { Channel } from './channel';
|
|
3
|
-
export default function createAPI(channel: Channel, data: ConnectMessage, currentGlobal: typeof globalThis):
|
|
3
|
+
export default function createAPI(channel: Channel, data: ConnectMessage, currentGlobal: typeof globalThis): KnownAppSDK;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { KnownAppSDK } from './types';
|
|
2
2
|
export * from './types';
|
|
3
3
|
export { default as locations } from './locations';
|
|
4
|
-
type Init = <T extends
|
|
4
|
+
type Init = <T extends KnownAppSDK = KnownAppSDK>(initCallback: (sdk: T) => any, options?: {
|
|
5
5
|
supressIframeWarning?: boolean;
|
|
6
6
|
}) => void;
|
|
7
7
|
export declare const init: Init;
|
package/dist/initialize.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ConnectMessage,
|
|
1
|
+
import { ConnectMessage, KnownAppSDK } from './types';
|
|
2
2
|
import { Channel } from './channel';
|
|
3
|
-
export declare function createInitializer(currentGlobal: typeof globalThis, apiCreator: (channel: Channel, data: ConnectMessage, currentGlobal: typeof globalThis) =>
|
|
3
|
+
export declare function createInitializer(currentGlobal: typeof globalThis, apiCreator: (channel: Channel, data: ConnectMessage, currentGlobal: typeof globalThis) => KnownAppSDK): (initCb: (sdk: KnownAppSDK, customSdk: any) => any, { makeCustomApi, supressIframeWarning, }?: {
|
|
4
4
|
makeCustomApi?: Function | undefined;
|
|
5
5
|
supressIframeWarning?: boolean | undefined;
|
|
6
6
|
}) => void;
|
|
@@ -162,7 +162,7 @@ export interface AccessAPI {
|
|
|
162
162
|
canEditAppConfig: () => Promise<boolean>;
|
|
163
163
|
}
|
|
164
164
|
type EntryScopedIds = 'field' | 'entry' | 'contentType';
|
|
165
|
-
export interface
|
|
165
|
+
export interface BaseAppSDK {
|
|
166
166
|
/** @deprecated since version 4.0.0 consider using the CMA instead
|
|
167
167
|
* See https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/#using-the-contentful-management-library for more details
|
|
168
168
|
*/
|
|
@@ -188,17 +188,17 @@ export interface BaseExtensionSDK {
|
|
|
188
188
|
/** Adapter to be injected in contentful-management client */
|
|
189
189
|
cmaAdapter: Adapter;
|
|
190
190
|
}
|
|
191
|
-
export type
|
|
191
|
+
export type EditorAppSDK = Omit<BaseAppSDK, 'ids'> & SharedEditorSDK & {
|
|
192
192
|
/** A set of IDs for the app */
|
|
193
193
|
ids: Omit<IdsAPI, 'field'>;
|
|
194
194
|
};
|
|
195
|
-
export type
|
|
195
|
+
export type SidebarAppSDK = Omit<BaseAppSDK, 'ids'> & SharedEditorSDK & {
|
|
196
196
|
/** A set of IDs for the app */
|
|
197
197
|
ids: Omit<IdsAPI, 'field'>;
|
|
198
198
|
/** Methods to update the size of the iframe the app is contained within. */
|
|
199
199
|
window: WindowAPI;
|
|
200
200
|
};
|
|
201
|
-
export type
|
|
201
|
+
export type FieldAppSDK = BaseAppSDK & SharedEditorSDK & {
|
|
202
202
|
/** A set of IDs for the app */
|
|
203
203
|
ids: IdsAPI;
|
|
204
204
|
/** Gives you access to the value and metadata of the field the app is attached to. */
|
|
@@ -206,7 +206,7 @@ export type FieldExtensionSDK = BaseExtensionSDK & SharedEditorSDK & {
|
|
|
206
206
|
/** Methods to update the size of the iframe the app is contained within. */
|
|
207
207
|
window: WindowAPI;
|
|
208
208
|
};
|
|
209
|
-
export type
|
|
209
|
+
export type DialogAppSDK = Omit<BaseAppSDK, 'ids'> & {
|
|
210
210
|
/** A set of IDs for the app */
|
|
211
211
|
ids: Omit<IdsAPI, EntryScopedIds>;
|
|
212
212
|
/** Closes the dialog and resolves openCurrentApp promise with data */
|
|
@@ -214,21 +214,39 @@ export type DialogExtensionSDK = Omit<BaseExtensionSDK, 'ids'> & {
|
|
|
214
214
|
/** Methods to update the size of the iframe the app is contained within. */
|
|
215
215
|
window: WindowAPI;
|
|
216
216
|
};
|
|
217
|
-
export type
|
|
217
|
+
export type PageAppSDK = Omit<BaseAppSDK, 'ids'> & {
|
|
218
218
|
/** A set of IDs actual for the app */
|
|
219
219
|
ids: Omit<IdsAPI, EntryScopedIds>;
|
|
220
220
|
};
|
|
221
|
-
export type
|
|
221
|
+
export type HomeAppSDK = Omit<BaseAppSDK, 'ids'> & {
|
|
222
222
|
ids: Omit<IdsAPI, EntryScopedIds>;
|
|
223
223
|
};
|
|
224
|
-
export type
|
|
224
|
+
export type ConfigAppSDK = Omit<BaseAppSDK, 'ids'> & {
|
|
225
225
|
/** A set of IDs actual for the app */
|
|
226
226
|
ids: Omit<IdsAPI, EntryScopedIds | 'extension' | 'app'> & {
|
|
227
227
|
app: string;
|
|
228
228
|
};
|
|
229
229
|
app: AppConfigAPI;
|
|
230
230
|
};
|
|
231
|
-
export type
|
|
231
|
+
export type KnownAppSDK = FieldAppSDK | SidebarAppSDK | DialogAppSDK | EditorAppSDK | PageAppSDK | ConfigAppSDK | HomeAppSDK;
|
|
232
|
+
/** @deprecated consider using {@link BaseAppSDK} */
|
|
233
|
+
export type BaseExtensionSDK = BaseAppSDK;
|
|
234
|
+
/** @deprecated consider using {@link EditorAppSDK} */
|
|
235
|
+
export type EditorExtensionSDK = EditorAppSDK;
|
|
236
|
+
/** @deprecated consider using {@link SidebarAppSDK} */
|
|
237
|
+
export type SidebarExtensionSDK = SidebarAppSDK;
|
|
238
|
+
/** @deprecated consider using {@link FieldAppSDK} */
|
|
239
|
+
export type FieldExtensionSDK = FieldAppSDK;
|
|
240
|
+
/** @deprecated consider using {@link DialogAppSDK} */
|
|
241
|
+
export type DialogExtensionSDK = DialogAppSDK;
|
|
242
|
+
/** @deprecated consider using {@link PageAppSDK} */
|
|
243
|
+
export type PageExtensionSDK = PageAppSDK;
|
|
244
|
+
/** @deprecated consider using {@link HomeAppSDK} */
|
|
245
|
+
export type HomeExtensionSDK = HomeAppSDK;
|
|
246
|
+
/** @deprecated consider using {@link ConfigAppSDK} */
|
|
247
|
+
export type AppExtensionSDK = ConfigAppSDK;
|
|
248
|
+
/** @deprecated consider using {@link KnownAppSDK} */
|
|
249
|
+
export type KnownSDK = KnownAppSDK;
|
|
232
250
|
export interface Locations {
|
|
233
251
|
LOCATION_ENTRY_FIELD: 'entry-field';
|
|
234
252
|
LOCATION_ENTRY_FIELD_SIDEBAR: 'entry-field-sidebar';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { AppExtensionSDK, BaseExtensionSDK, DialogExtensionSDK, EditorExtensionSDK, FieldExtensionSDK, HomeExtensionSDK, KnownSDK, PageExtensionSDK, SidebarExtensionSDK, ConfigAppSDK, BaseAppSDK, DialogAppSDK, EditorAppSDK, FieldAppSDK, HomeAppSDK, KnownAppSDK, PageAppSDK, SidebarAppSDK, AccessAPI, ArchiveableAction, ConnectMessage, ContentTypeAPI, CrudAction, EditorLocaleSettings, IdsAPI, LocalesAPI, LocationAPI, Locations, NotifierAPI, ParametersAPI, PublishableAction, SharedEditorSDK, UserAPI, JSONPatchItem, } from './api.types';
|
|
2
2
|
export type { AppConfigAPI, AppState, OnConfigureHandler, OnConfigureHandlerReturn, } from './app.types';
|
|
3
3
|
export type { DialogsAPI, EntityDialogOptions, OpenAlertOptions, OpenConfirmOptions, OpenCustomWidgetOptions, } from './dialogs.types';
|
|
4
4
|
export type { Asset, CanonicalRequest, ContentType, ContentTypeField, EditorInterface, Entry, Metadata, Role, ScheduledAction, SpaceMembership, Tag, TagVisibility, Task, Team, User, WorkflowDefinition, } from './entities';
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"contentful-ui-extensions-sdk","description":"A JavaScript library to develop custom apps for Contentful","version":"4.17.
|
|
1
|
+
{"name":"contentful-ui-extensions-sdk","description":"A JavaScript library to develop custom apps for Contentful","version":"4.17.1","author":"Contentful GmbH","license":"MIT","sideEffects":true,"repository":{"url":"https://github.com/contentful/ui-extensions-sdk.git","type":"git"},"homepage":"https://www.contentful.com/developers/docs/extensibility/app-framework/sdk/","main":"dist/cf-extension-api.js","types":"dist/index.d.ts","files":["dist/cf-extension-api.js","dist/cf-extension-api.js.map","dist/cf-extension.css","dist/**/*.d.ts"],"scripts":{"test":"ts-mocha -p tsconfig.test.json 'test/unit/*.[jt]s' --reporter mocha-multi-reporters --reporter-options configFile=mocha.unit-reporters.json","lint":"eslint '{lib,test}/**/*.{t,j}s'","lint:fix":"npm run lint -- --fix","build":"npm run check-types && rollup -c --compact","build:debug":"npm run build -- --sourcemap","prepublishOnly":"npm run build","size":"echo \"Gzipped, estimate: $(gzip -9 -c dist/cf-extension-api.js | wc -c) bytes\"","semantic-release":"semantic-release","publish-all":"node ./scripts/publish.js","verify":"node ./scripts/verify.js","check-types":"tsc --noEmit -m commonjs","prepare":"husky install","lint-staged":"lint-staged"},"devDependencies":{"@semantic-release/changelog":"6.0.3","@semantic-release/exec":"6.0.3","@semantic-release/git":"10.0.1","@testing-library/dom":"9.2.0","@types/chai-as-promised":"7.1.5","@types/cross-spawn":"6.0.2","@types/fs-extra":"11.0.1","@types/jsdom":"21.1.1","@types/mocha":"10.0.1","@types/nanoid":"3.0.0","@types/sinon":"^10.0.0","@types/sinon-chai":"^3.2.5","@typescript-eslint/eslint-plugin":"4.33.0","@typescript-eslint/parser":"4.33.0","babel-eslint":"10.1.0","chai":"4.3.7","chai-as-promised":"7.1.1","contentful-management":"10.31.5","cross-spawn":"7.0.3","eslint":"7.32.0","eslint-config-prettier":"8.8.0","eslint-config-standard":"16.0.3","eslint-plugin-import":"2.27.5","eslint-plugin-node":"11.1.0","eslint-plugin-prettier":"4.2.1","eslint-plugin-promise":"6.1.1","eslint-plugin-react":"7.32.2","eslint-plugin-standard":"5.0.0","fs-extra":"11.1.1","husky":"8.0.3","jsdom":"21.1.1","lint-staged":"13.2.0","mocha":"10.2.0","mocha-junit-reporter":"2.2.0","mocha-multi-reporters":"1.5.1","mochawesome":"7.1.3","mochawesome-merge":"4.3.0","mochawesome-report-generator":"6.2.0","prettier":"2.8.7","rollup":"2.79.1","rollup-plugin-terser":"7.0.2","rollup-plugin-typescript2":"0.34.1","semantic-release":"19.0.5","sinon":"15.0.3","sinon-chai":"3.7.0","ts-mocha":"10.0.0","tslib":"2.5.0","typescript":"5.0.3"},"lint-staged":{"*.ts":["prettier --write","eslint --fix","git add"],"*.md":["prettier --write","git add"]},"release":{"branches":["master",{"name":"canary","channel":"canary","prerelease":"alpha"}],"plugins":["@semantic-release/commit-analyzer","@semantic-release/release-notes-generator","@semantic-release/changelog",["@semantic-release/npm",{"npmPublish":false}],["@semantic-release/exec",{"verifyConditionsCmd":"node ./scripts/verify.js","publishCmd":"npm run publish-all"}],["@semantic-release/git",{"message":"chore: ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}","assets":["CHANGELOG.md","package.json","package-lock.json"]}],"@semantic-release/github"]},"peerDependencies":{"contentful-management":">=7.30.0"}}
|