@contentful/app-sdk 4.16.0 → 4.17.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/dist/api.d.ts +3 -3
- package/dist/app.d.ts +3 -3
- package/dist/channel.d.ts +13 -13
- package/dist/cmaAdapter.d.ts +3 -3
- package/dist/dialogs.d.ts +3 -3
- package/dist/editor.d.ts +4 -4
- package/dist/entry.d.ts +3 -3
- package/dist/field-locale.d.ts +26 -26
- package/dist/field.d.ts +22 -22
- package/dist/index.d.ts +7 -7
- package/dist/initialize.d.ts +6 -6
- package/dist/locations.d.ts +3 -3
- package/dist/navigator.d.ts +3 -3
- package/dist/signal.d.ts +15 -15
- package/dist/space.d.ts +3 -3
- package/dist/types/api.types.d.ts +263 -263
- package/dist/types/app.types.d.ts +44 -44
- package/dist/types/cmaClient.types.d.ts +35 -31
- package/dist/types/dialogs.types.d.ts +69 -69
- package/dist/types/entities.d.ts +7 -7
- package/dist/types/entry.types.d.ts +45 -45
- package/dist/types/field-locale.types.d.ts +55 -55
- package/dist/types/field.types.d.ts +70 -70
- package/dist/types/index.d.ts +13 -13
- package/dist/types/navigator.types.d.ts +63 -63
- package/dist/types/space.types.d.ts +272 -272
- package/dist/types/utils.d.ts +74 -74
- package/dist/types/validation-error.d.ts +63 -63
- package/dist/types/window.types.d.ts +17 -17
- package/dist/utils/deferred.d.ts +6 -6
- package/dist/window.d.ts +3 -3
- package/package.json +1 -1
package/dist/types/utils.d.ts
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { ContentTypeFieldValidation } from './entities';
|
|
2
|
-
type Sys = {
|
|
3
|
-
id: string;
|
|
4
|
-
type: string;
|
|
5
|
-
[key: string]: any;
|
|
6
|
-
};
|
|
7
|
-
type Entity = {
|
|
8
|
-
sys: Sys;
|
|
9
|
-
[key: string]: any;
|
|
10
|
-
};
|
|
11
|
-
type Optional<Type, Keys extends keyof Type> = Partial<Type> & Omit<Type, Keys>;
|
|
12
|
-
export type WithSysWithAtLeastId = {
|
|
13
|
-
sys: {
|
|
14
|
-
id: string;
|
|
15
|
-
[key: string]: any;
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
export type WithId<Type extends Entity> = Omit<Type, 'sys'> & WithSysWithAtLeastId;
|
|
19
|
-
export type WithOptionalId<Type extends Entity> = Optional<Type, 'sys'> | WithId<Type>;
|
|
20
|
-
export interface Link<LinkType = string, Type = string> {
|
|
21
|
-
sys: {
|
|
22
|
-
id: string;
|
|
23
|
-
type: Type;
|
|
24
|
-
linkType: LinkType;
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
export interface CollectionResponse<T> {
|
|
28
|
-
items: T[];
|
|
29
|
-
total: number;
|
|
30
|
-
skip: number;
|
|
31
|
-
limit: number;
|
|
32
|
-
sys: {
|
|
33
|
-
type: string;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
export type ContentEntityType = 'Entry' | 'Asset';
|
|
37
|
-
export type ContentEntitySys = {
|
|
38
|
-
space: Link;
|
|
39
|
-
id: string;
|
|
40
|
-
type: ContentEntityType;
|
|
41
|
-
createdAt: string;
|
|
42
|
-
updatedAt: string;
|
|
43
|
-
environment: Link;
|
|
44
|
-
publishedVersion?: number;
|
|
45
|
-
deletedVersion?: number;
|
|
46
|
-
archivedVersion?: number;
|
|
47
|
-
publishedAt?: string;
|
|
48
|
-
firstPublishedAt?: string;
|
|
49
|
-
createdBy?: Link;
|
|
50
|
-
updatedBy?: Link;
|
|
51
|
-
publishedCounter?: number;
|
|
52
|
-
version: number;
|
|
53
|
-
publishedBy?: Link;
|
|
54
|
-
contentType: Link;
|
|
55
|
-
};
|
|
56
|
-
export interface EntrySys extends ContentEntitySys {
|
|
57
|
-
type: 'Entry';
|
|
58
|
-
automationTags: Link<'Tag'>[];
|
|
59
|
-
}
|
|
60
|
-
export interface Items {
|
|
61
|
-
type: string;
|
|
62
|
-
linkType?: string;
|
|
63
|
-
validations?: ContentTypeFieldValidation[];
|
|
64
|
-
}
|
|
65
|
-
export interface SearchQuery {
|
|
66
|
-
order?: string;
|
|
67
|
-
skip?: number;
|
|
68
|
-
limit?: number;
|
|
69
|
-
[key: string]: any;
|
|
70
|
-
}
|
|
71
|
-
export type SerializedJSONValue = null | string | number | boolean | Array<SerializedJSONValue> | {
|
|
72
|
-
[key: string]: SerializedJSONValue;
|
|
73
|
-
};
|
|
74
|
-
export {};
|
|
1
|
+
import { ContentTypeFieldValidation } from './entities';
|
|
2
|
+
type Sys = {
|
|
3
|
+
id: string;
|
|
4
|
+
type: string;
|
|
5
|
+
[key: string]: any;
|
|
6
|
+
};
|
|
7
|
+
type Entity = {
|
|
8
|
+
sys: Sys;
|
|
9
|
+
[key: string]: any;
|
|
10
|
+
};
|
|
11
|
+
type Optional<Type, Keys extends keyof Type> = Partial<Type> & Omit<Type, Keys>;
|
|
12
|
+
export type WithSysWithAtLeastId = {
|
|
13
|
+
sys: {
|
|
14
|
+
id: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type WithId<Type extends Entity> = Omit<Type, 'sys'> & WithSysWithAtLeastId;
|
|
19
|
+
export type WithOptionalId<Type extends Entity> = Optional<Type, 'sys'> | WithId<Type>;
|
|
20
|
+
export interface Link<LinkType = string, Type = string> {
|
|
21
|
+
sys: {
|
|
22
|
+
id: string;
|
|
23
|
+
type: Type;
|
|
24
|
+
linkType: LinkType;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface CollectionResponse<T> {
|
|
28
|
+
items: T[];
|
|
29
|
+
total: number;
|
|
30
|
+
skip: number;
|
|
31
|
+
limit: number;
|
|
32
|
+
sys: {
|
|
33
|
+
type: string;
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export type ContentEntityType = 'Entry' | 'Asset';
|
|
37
|
+
export type ContentEntitySys = {
|
|
38
|
+
space: Link;
|
|
39
|
+
id: string;
|
|
40
|
+
type: ContentEntityType;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
environment: Link;
|
|
44
|
+
publishedVersion?: number;
|
|
45
|
+
deletedVersion?: number;
|
|
46
|
+
archivedVersion?: number;
|
|
47
|
+
publishedAt?: string;
|
|
48
|
+
firstPublishedAt?: string;
|
|
49
|
+
createdBy?: Link;
|
|
50
|
+
updatedBy?: Link;
|
|
51
|
+
publishedCounter?: number;
|
|
52
|
+
version: number;
|
|
53
|
+
publishedBy?: Link;
|
|
54
|
+
contentType: Link;
|
|
55
|
+
};
|
|
56
|
+
export interface EntrySys extends ContentEntitySys {
|
|
57
|
+
type: 'Entry';
|
|
58
|
+
automationTags: Link<'Tag'>[];
|
|
59
|
+
}
|
|
60
|
+
export interface Items {
|
|
61
|
+
type: string;
|
|
62
|
+
linkType?: string;
|
|
63
|
+
validations?: ContentTypeFieldValidation[];
|
|
64
|
+
}
|
|
65
|
+
export interface SearchQuery {
|
|
66
|
+
order?: string;
|
|
67
|
+
skip?: number;
|
|
68
|
+
limit?: number;
|
|
69
|
+
[key: string]: any;
|
|
70
|
+
}
|
|
71
|
+
export type SerializedJSONValue = null | string | number | boolean | Array<SerializedJSONValue> | {
|
|
72
|
+
[key: string]: SerializedJSONValue;
|
|
73
|
+
};
|
|
74
|
+
export {};
|
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import { Link } from './utils';
|
|
2
|
-
export interface BaseValidationError {
|
|
3
|
-
name: string;
|
|
4
|
-
message?: string;
|
|
5
|
-
details?: string;
|
|
6
|
-
value?: any;
|
|
7
|
-
customMessage?: string;
|
|
8
|
-
path: string[];
|
|
9
|
-
}
|
|
10
|
-
export interface SizeValidationError extends BaseValidationError {
|
|
11
|
-
name: 'size';
|
|
12
|
-
max: number;
|
|
13
|
-
min: number;
|
|
14
|
-
}
|
|
15
|
-
export interface RangeValidationError extends BaseValidationError {
|
|
16
|
-
name: 'range';
|
|
17
|
-
min?: number;
|
|
18
|
-
max?: number;
|
|
19
|
-
}
|
|
20
|
-
export interface InValidationError extends BaseValidationError {
|
|
21
|
-
name: 'in';
|
|
22
|
-
expected: string[];
|
|
23
|
-
}
|
|
24
|
-
export interface RequiredValidationError extends BaseValidationError {
|
|
25
|
-
name: 'required';
|
|
26
|
-
}
|
|
27
|
-
export interface UniqueValidationError extends BaseValidationError {
|
|
28
|
-
name: 'unique';
|
|
29
|
-
conflicting: Link<'Entry', 'Link'>[];
|
|
30
|
-
}
|
|
31
|
-
export interface ProhibitRegexpValidationError extends BaseValidationError {
|
|
32
|
-
name: 'prohibitRegexp';
|
|
33
|
-
}
|
|
34
|
-
export interface RegexpValidationError extends BaseValidationError {
|
|
35
|
-
name: 'regexp';
|
|
36
|
-
}
|
|
37
|
-
export interface LinkMimetypeGroupValidationError extends BaseValidationError {
|
|
38
|
-
name: 'linkMimetypeGroup';
|
|
39
|
-
mimetypeGroupName: string[];
|
|
40
|
-
}
|
|
41
|
-
export interface LinkContentTypeValidationError extends BaseValidationError {
|
|
42
|
-
name: 'linkContentType';
|
|
43
|
-
contentTypeId: string[];
|
|
44
|
-
}
|
|
45
|
-
export interface DateRangeValidationError extends BaseValidationError {
|
|
46
|
-
name: 'dateRange';
|
|
47
|
-
min: number;
|
|
48
|
-
max: number;
|
|
49
|
-
}
|
|
50
|
-
export interface NotResolvableValidationError extends BaseValidationError {
|
|
51
|
-
name: 'notResolvable';
|
|
52
|
-
link: {
|
|
53
|
-
linkType: string;
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
export interface UnknownValidationError extends BaseValidationError {
|
|
57
|
-
name: 'unknown';
|
|
58
|
-
}
|
|
59
|
-
export interface TypeValidationError extends BaseValidationError {
|
|
60
|
-
name: 'type';
|
|
61
|
-
type: string;
|
|
62
|
-
}
|
|
63
|
-
export type ValidationError = SizeValidationError | RangeValidationError | InValidationError | RequiredValidationError | UniqueValidationError | RegexpValidationError | ProhibitRegexpValidationError | LinkMimetypeGroupValidationError | LinkContentTypeValidationError | DateRangeValidationError | NotResolvableValidationError | UnknownValidationError | TypeValidationError | BaseValidationError;
|
|
1
|
+
import { Link } from './utils';
|
|
2
|
+
export interface BaseValidationError {
|
|
3
|
+
name: string;
|
|
4
|
+
message?: string;
|
|
5
|
+
details?: string;
|
|
6
|
+
value?: any;
|
|
7
|
+
customMessage?: string;
|
|
8
|
+
path: string[];
|
|
9
|
+
}
|
|
10
|
+
export interface SizeValidationError extends BaseValidationError {
|
|
11
|
+
name: 'size';
|
|
12
|
+
max: number;
|
|
13
|
+
min: number;
|
|
14
|
+
}
|
|
15
|
+
export interface RangeValidationError extends BaseValidationError {
|
|
16
|
+
name: 'range';
|
|
17
|
+
min?: number;
|
|
18
|
+
max?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface InValidationError extends BaseValidationError {
|
|
21
|
+
name: 'in';
|
|
22
|
+
expected: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface RequiredValidationError extends BaseValidationError {
|
|
25
|
+
name: 'required';
|
|
26
|
+
}
|
|
27
|
+
export interface UniqueValidationError extends BaseValidationError {
|
|
28
|
+
name: 'unique';
|
|
29
|
+
conflicting: Link<'Entry', 'Link'>[];
|
|
30
|
+
}
|
|
31
|
+
export interface ProhibitRegexpValidationError extends BaseValidationError {
|
|
32
|
+
name: 'prohibitRegexp';
|
|
33
|
+
}
|
|
34
|
+
export interface RegexpValidationError extends BaseValidationError {
|
|
35
|
+
name: 'regexp';
|
|
36
|
+
}
|
|
37
|
+
export interface LinkMimetypeGroupValidationError extends BaseValidationError {
|
|
38
|
+
name: 'linkMimetypeGroup';
|
|
39
|
+
mimetypeGroupName: string[];
|
|
40
|
+
}
|
|
41
|
+
export interface LinkContentTypeValidationError extends BaseValidationError {
|
|
42
|
+
name: 'linkContentType';
|
|
43
|
+
contentTypeId: string[];
|
|
44
|
+
}
|
|
45
|
+
export interface DateRangeValidationError extends BaseValidationError {
|
|
46
|
+
name: 'dateRange';
|
|
47
|
+
min: number;
|
|
48
|
+
max: number;
|
|
49
|
+
}
|
|
50
|
+
export interface NotResolvableValidationError extends BaseValidationError {
|
|
51
|
+
name: 'notResolvable';
|
|
52
|
+
link: {
|
|
53
|
+
linkType: string;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export interface UnknownValidationError extends BaseValidationError {
|
|
57
|
+
name: 'unknown';
|
|
58
|
+
}
|
|
59
|
+
export interface TypeValidationError extends BaseValidationError {
|
|
60
|
+
name: 'type';
|
|
61
|
+
type: string;
|
|
62
|
+
}
|
|
63
|
+
export type ValidationError = SizeValidationError | RangeValidationError | InValidationError | RequiredValidationError | UniqueValidationError | RegexpValidationError | ProhibitRegexpValidationError | LinkMimetypeGroupValidationError | LinkContentTypeValidationError | DateRangeValidationError | NotResolvableValidationError | UnknownValidationError | TypeValidationError | BaseValidationError;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
export interface WindowAPI {
|
|
2
|
-
/** Sets the iframe height to the given value in pixels or using scrollHeight if value is not passed */
|
|
3
|
-
updateHeight: (height?: number) => void;
|
|
4
|
-
/**
|
|
5
|
-
* Listens for DOM changes and updates height when the size changes.
|
|
6
|
-
*
|
|
7
|
-
* When passing absoluteElements true, an infinite loop can happen if elements are always rendered below the height of the window.
|
|
8
|
-
* e.g. transformed elements or absolute elements with negative bottom
|
|
9
|
-
* @param {Object} opts - Options to be passed to auto resize
|
|
10
|
-
* @param {Boolean} opts.absoluteElements - Defines if auto resize should consider absolut elements
|
|
11
|
-
*/
|
|
12
|
-
startAutoResizer: ({ absoluteElements }?: {
|
|
13
|
-
absoluteElements?: boolean;
|
|
14
|
-
}) => void;
|
|
15
|
-
/** Stops resizing the iframe automatically. */
|
|
16
|
-
stopAutoResizer: () => void;
|
|
17
|
-
}
|
|
1
|
+
export interface WindowAPI {
|
|
2
|
+
/** Sets the iframe height to the given value in pixels or using scrollHeight if value is not passed */
|
|
3
|
+
updateHeight: (height?: number) => void;
|
|
4
|
+
/**
|
|
5
|
+
* Listens for DOM changes and updates height when the size changes.
|
|
6
|
+
*
|
|
7
|
+
* When passing absoluteElements true, an infinite loop can happen if elements are always rendered below the height of the window.
|
|
8
|
+
* e.g. transformed elements or absolute elements with negative bottom
|
|
9
|
+
* @param {Object} opts - Options to be passed to auto resize
|
|
10
|
+
* @param {Boolean} opts.absoluteElements - Defines if auto resize should consider absolut elements
|
|
11
|
+
*/
|
|
12
|
+
startAutoResizer: ({ absoluteElements }?: {
|
|
13
|
+
absoluteElements?: boolean;
|
|
14
|
+
}) => void;
|
|
15
|
+
/** Stops resizing the iframe automatically. */
|
|
16
|
+
stopAutoResizer: () => void;
|
|
17
|
+
}
|
package/dist/utils/deferred.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface Deferred<T> {
|
|
2
|
-
promise: Promise<T>;
|
|
3
|
-
resolve: (value: T | PromiseLike<T>) => void;
|
|
4
|
-
isFulfilled: boolean;
|
|
5
|
-
}
|
|
6
|
-
export declare function createDeferred<T = unknown>(): Deferred<T>;
|
|
1
|
+
export interface Deferred<T> {
|
|
2
|
+
promise: Promise<T>;
|
|
3
|
+
resolve: (value: T | PromiseLike<T>) => void;
|
|
4
|
+
isFulfilled: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function createDeferred<T = unknown>(): Deferred<T>;
|
package/dist/window.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Channel } from './channel';
|
|
2
|
-
import { WindowAPI } from './types/window.types';
|
|
3
|
-
export default function createWindow(currentGlobal: typeof globalThis, channel: Channel): WindowAPI;
|
|
1
|
+
import { Channel } from './channel';
|
|
2
|
+
import { WindowAPI } from './types/window.types';
|
|
3
|
+
export default function createWindow(currentGlobal: typeof globalThis, channel: Channel): WindowAPI;
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@contentful/app-sdk","description":"A JavaScript library to develop custom apps for Contentful","version":"4.
|
|
1
|
+
{"name":"@contentful/app-sdk","description":"A JavaScript library to develop custom apps for Contentful","version":"4.17.0","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.3","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.2"},"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"}}
|