@axinom/mosaic-managed-workflow-integration 0.17.0-rc.1 → 0.17.0-rc.10
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/hosting/get-object-storages.d.ts +1 -3
- package/dist/hosting/get-object-storages.d.ts.map +1 -1
- package/dist/hosting/get-object-storages.js +7 -9
- package/dist/hosting/get-object-storages.js.map +1 -1
- package/dist/image/image-extensions.d.ts +3 -0
- package/dist/image/image-extensions.d.ts.map +1 -1
- package/dist/image/image-extensions.js +3 -0
- package/dist/image/image-extensions.js.map +1 -1
- package/dist/image/thumbnail-renderer.d.ts +33 -11
- package/dist/image/thumbnail-renderer.d.ts.map +1 -1
- package/dist/image/thumbnail-renderer.js +46 -24
- package/dist/image/thumbnail-renderer.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/initialize.d.ts +8 -0
- package/dist/initialize.d.ts.map +1 -0
- package/dist/initialize.js +13 -0
- package/dist/initialize.js.map +1 -0
- package/dist/localization/helpers/localization-generator.d.ts +12 -8
- package/dist/localization/helpers/localization-generator.d.ts.map +1 -1
- package/dist/localization/helpers/localization-generator.js +17 -8
- package/dist/localization/helpers/localization-generator.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/video/video-cue-points.d.ts +5 -5
- package/dist/video/video-cue-points.d.ts.map +1 -1
- package/dist/video/video-cue-points.js +13 -7
- package/dist/video/video-cue-points.js.map +1 -1
- package/dist/video/video-extensions.d.ts +3 -0
- package/dist/video/video-extensions.d.ts.map +1 -1
- package/dist/video/video-extensions.js +3 -0
- package/dist/video/video-extensions.js.map +1 -1
- package/package.json +4 -4
- package/src/hosting/get-object-storages.tsx +8 -10
- package/src/image/image-extensions.tsx +3 -0
- package/src/image/thumbnail-renderer.tsx +50 -35
- package/src/index.ts +1 -0
- package/src/initialize.ts +11 -0
- package/src/localization/helpers/localization-generator.ts +18 -9
- package/src/video/video-cue-points.ts +16 -10
- package/src/video/video-extensions.tsx +3 -0
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PiletApi } from '@axinom/mosaic-portal';
|
|
2
1
|
import { ID, Maybe } from '../common';
|
|
3
2
|
import { EncodingState } from './types';
|
|
4
3
|
export interface VideoServiceCuePoints {
|
|
@@ -16,10 +15,11 @@ export interface VideoData {
|
|
|
16
15
|
nodes: VideoServiceCuePoints[];
|
|
17
16
|
};
|
|
18
17
|
}
|
|
19
|
-
export declare let getVideoCuePointsData: () => (id: ID[], cuePointTypeKeys?: string[]) => Promise<VideoData[]>;
|
|
20
18
|
/**
|
|
21
|
-
*
|
|
22
|
-
*
|
|
19
|
+
* Returns the video cue points data for the given video IDs.
|
|
20
|
+
* This method depends on the `initializeIntegrationLib` function being called before.
|
|
21
|
+
* @param id The video IDs for which to fetch the cue points data.
|
|
22
|
+
* @param cuePointTypeKeys Optional array of cue point type keys that will be used as filter for the returend cue points. If not set, will return all cue points.
|
|
23
23
|
*/
|
|
24
|
-
export declare
|
|
24
|
+
export declare const getVideoCuePointsData: (id: ID[], cuePointTypeKeys?: string[]) => Promise<VideoData[]>;
|
|
25
25
|
//# sourceMappingURL=video-cue-points.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-cue-points.d.ts","sourceRoot":"","sources":["../../src/video/video-cue-points.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"video-cue-points.d.ts","sourceRoot":"","sources":["../../src/video/video-cue-points.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAEtC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,MAAM,WAAW,qBAAqB;IACpC,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,EAAE,EAAE,EAAE,CAAC;IACP,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,EAAE,EAAE,EAAE,CAAC;IACP,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAChC,aAAa,EAAE,aAAa,CAAC;IAC7B,SAAS,EAAE;QACT,UAAU,CAAC,EAAE,qBAAqB,CAAC;QACnC,KAAK,EAAE,qBAAqB,EAAE,CAAC;KAChC,CAAC;CACH;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,CAClC,EAAE,EAAE,EAAE,EAAE,EACR,gBAAgB,CAAC,EAAE,MAAM,EAAE,KACxB,OAAO,CAAC,SAAS,EAAE,CAQvB,CAAC"}
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getVideoCuePointsData = void 0;
|
|
4
|
+
const initialize_1 = require("../initialize");
|
|
4
5
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
6
|
+
* Returns the video cue points data for the given video IDs.
|
|
7
|
+
* This method depends on the `initializeIntegrationLib` function being called before.
|
|
8
|
+
* @param id The video IDs for which to fetch the cue points data.
|
|
9
|
+
* @param cuePointTypeKeys Optional array of cue point type keys that will be used as filter for the returend cue points. If not set, will return all cue points.
|
|
7
10
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
const getVideoCuePointsData = (id, cuePointTypeKeys) => {
|
|
12
|
+
if (initialize_1.piletApi === undefined) {
|
|
13
|
+
throw new Error('The pilet API is not initialized. Please call `initializeIntegrationLib` before using this function.');
|
|
14
|
+
}
|
|
15
|
+
return initialize_1.piletApi.getData('video-cue-points-data')(id, cuePointTypeKeys);
|
|
16
|
+
};
|
|
17
|
+
exports.getVideoCuePointsData = getVideoCuePointsData;
|
|
12
18
|
//# sourceMappingURL=video-cue-points.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-cue-points.js","sourceRoot":"","sources":["../../src/video/video-cue-points.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"video-cue-points.js","sourceRoot":"","sources":["../../src/video/video-cue-points.ts"],"names":[],"mappings":";;;AACA,8CAAyC;AAoBzC;;;;;GAKG;AACI,MAAM,qBAAqB,GAGN,CAAC,EAAE,EAAE,gBAAgB,EAAE,EAAE;IACnD,IAAI,qBAAQ,KAAK,SAAS,EAAE;QAC1B,MAAM,IAAI,KAAK,CACb,sGAAsG,CACvG,CAAC;KACH;IAED,OAAO,qBAAQ,CAAC,OAAO,CAAC,uBAAuB,CAAC,CAAC,EAAE,EAAE,gBAAgB,CAAC,CAAC;AACzE,CAAC,CAAC;AAXW,QAAA,qBAAqB,yBAWhC"}
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { PiletApi } from '@axinom/mosaic-portal';
|
|
2
2
|
import { VideoExtensions } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Returns an object containing Extension components for the shared extensions provided by the video service.
|
|
5
|
+
*/
|
|
3
6
|
export declare const bindVideoExtensions: (app: PiletApi) => VideoExtensions;
|
|
4
7
|
//# sourceMappingURL=video-extensions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-extensions.d.ts","sourceRoot":"","sources":["../../src/video/video-extensions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,OAAO,EACL,eAAe,EAGhB,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,mBAAmB,QAAS,QAAQ,KAAG,eAqBnD,CAAC"}
|
|
1
|
+
{"version":3,"file":"video-extensions.d.ts","sourceRoot":"","sources":["../../src/video/video-extensions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGjD,OAAO,EACL,eAAe,EAGhB,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,mBAAmB,QAAS,QAAQ,KAAG,eAqBnD,CAAC"}
|
|
@@ -6,6 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.bindVideoExtensions = void 0;
|
|
7
7
|
const react_1 = __importDefault(require("react"));
|
|
8
8
|
const common_1 = require("../common");
|
|
9
|
+
/**
|
|
10
|
+
* Returns an object containing Extension components for the shared extensions provided by the video service.
|
|
11
|
+
*/
|
|
9
12
|
const bindVideoExtensions = (app) => {
|
|
10
13
|
const VideoSelectExplorer = (props) => (react_1.default.createElement(app.Extension, { name: "video-select-explorer", empty: common_1.extensionDefaultValue, params: props }));
|
|
11
14
|
const VideoSelectField = (props) => (react_1.default.createElement(app.Extension, { name: "video-select-field", empty: common_1.extensionDefaultValue, params: props }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"video-extensions.js","sourceRoot":"","sources":["../../src/video/video-extensions.tsx"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAC1B,sCAAkD;
|
|
1
|
+
{"version":3,"file":"video-extensions.js","sourceRoot":"","sources":["../../src/video/video-extensions.tsx"],"names":[],"mappings":";;;;;;AACA,kDAA0B;AAC1B,sCAAkD;AAOlD;;GAEG;AACI,MAAM,mBAAmB,GAAG,CAAC,GAAa,EAAmB,EAAE;IACpE,MAAM,mBAAmB,GAAuC,CAAC,KAAK,EAAE,EAAE,CAAC,CACzE,8BAAC,GAAG,CAAC,SAAS,IACZ,IAAI,EAAC,uBAAuB,EAC5B,KAAK,EAAE,8BAAqB,EAC5B,MAAM,EAAE,KAAK,GACb,CACH,CAAC;IAEF,MAAM,gBAAgB,GAAoC,CAAC,KAAK,EAAE,EAAE,CAAC,CACnE,8BAAC,GAAG,CAAC,SAAS,IACZ,IAAI,EAAC,oBAAoB,EACzB,KAAK,EAAE,8BAAqB,EAC5B,MAAM,EAAE,KAAK,GACb,CACH,CAAC;IAEF,OAAO;QACL,mBAAmB;QACnB,gBAAgB;KACjB,CAAC;AACJ,CAAC,CAAC;AArBW,QAAA,mBAAmB,uBAqB9B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-managed-workflow-integration",
|
|
3
|
-
"version": "0.17.0-rc.
|
|
3
|
+
"version": "0.17.0-rc.10",
|
|
4
4
|
"description": "Shared types and helpers for integrating functionality provided by managed service workflows",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"lint": "eslint . --ext .ts,.tsx,.js --color --cache"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@axinom/mosaic-portal": "^0.33.0-rc.
|
|
27
|
-
"@axinom/mosaic-ui": "^0.49.0-rc.
|
|
26
|
+
"@axinom/mosaic-portal": "^0.33.0-rc.10",
|
|
27
|
+
"@axinom/mosaic-ui": "^0.49.0-rc.10",
|
|
28
28
|
"@types/react": "^17",
|
|
29
29
|
"@types/react-dom": "^17",
|
|
30
30
|
"eslint": "^8.35.0",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"publishConfig": {
|
|
43
43
|
"access": "public"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "130dddd0b1efabb2f50d5cf5455e4f48f7309b34"
|
|
46
46
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { piletApi } from '../initialize';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Represents an object storage.
|
|
@@ -12,15 +12,13 @@ export interface ObjectStorage {
|
|
|
12
12
|
* Get enabled Object Storages
|
|
13
13
|
* @returns
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export const getObjectStorages = async (): Promise<
|
|
16
16
|
ObjectStorage[] | undefined
|
|
17
17
|
> => {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
getObjectStorages = () =>
|
|
25
|
-
app.getData('getObjectStorages')() ?? getObjectStorages;
|
|
18
|
+
if (piletApi === undefined) {
|
|
19
|
+
throw new Error(
|
|
20
|
+
'The pilet API is not initialized. Please call `initializeIntegrationLib` before using this function.',
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
return piletApi.getData('getObjectStorages')();
|
|
26
24
|
};
|
|
@@ -9,6 +9,9 @@ import {
|
|
|
9
9
|
ImageSelectFieldProps,
|
|
10
10
|
} from './types';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Returns an object containing Extension components for the shared extensions provided by the image service.
|
|
14
|
+
*/
|
|
12
15
|
export const bindImageExtensions = (app: PiletApi): ImageExtensions => {
|
|
13
16
|
const ImageCover: React.FC<ImageCoverProps> = (props) => (
|
|
14
17
|
<app.Extension
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { PiletApi } from '@axinom/mosaic-portal';
|
|
2
1
|
import { ColumnMap, ColumnRenderer, Data } from '@axinom/mosaic-ui';
|
|
3
2
|
import React from 'react';
|
|
3
|
+
import { piletApi } from '../initialize';
|
|
4
4
|
import {
|
|
5
5
|
ThumbnailProperty,
|
|
6
6
|
ThumbnailResolver,
|
|
@@ -8,41 +8,56 @@ import {
|
|
|
8
8
|
} from './types';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
11
|
+
* This function simplifies access to the shared functionality provided by the image workflow in the PiletApi object.
|
|
12
|
+
* In case the shared functionality is not available, a fallback renderer is returned.
|
|
13
|
+
*
|
|
14
|
+
* Make sure to initialize the integration library by calling the `initializeIntegrationLib` function,
|
|
15
|
+
* otherwise it will always return the fallback renderer.
|
|
16
|
+
*
|
|
17
|
+
* The renderer expects that the column is bound to the property containing the state. The thumbnail property is passed as an argument.
|
|
18
|
+
*
|
|
19
|
+
* @param thumbnailPropertyOrResolver
|
|
20
|
+
* Either the name of a property on the `data` object that has the following shape:
|
|
21
|
+
* ```ts
|
|
22
|
+
* {
|
|
23
|
+
* nodes: [{
|
|
24
|
+
* imageId: 'b437056b-c28e-46fa-ad9d-8bd16e7609fa'
|
|
25
|
+
* }]
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
* This reflects the shape a typical postgraphile response would have.
|
|
29
|
+
* The renderer will pick the fist imageId from the nodes array.
|
|
30
|
+
*
|
|
31
|
+
* Alternatively a callback function can be passed that resolves to a url location.
|
|
32
|
+
* The row data is passed as an argument.
|
|
33
|
+
* The method can either return the full url of the image or the uuid of the image.
|
|
34
|
+
* If the uuid is returned, the `resolverType` argument needs to be set to 'uuid'.
|
|
35
|
+
* @param stateMap An object of key/value pairs mapping column values to CSS colors. If an empty object is passed, no state will be rendered.
|
|
36
|
+
* ```ts
|
|
37
|
+
* {
|
|
38
|
+
* 'PUBLISHED': '#95C842',
|
|
39
|
+
* 'CHANGED': '#FFC81A',
|
|
40
|
+
* 'NOT_PUBLISHED': '#DDDDDD',
|
|
41
|
+
* }
|
|
42
|
+
* ```
|
|
43
|
+
* @param resolverType either 'url' or 'uuid', depending on what your resolver is returning.
|
|
44
|
+
* @returns A thumbnail and state column renderer
|
|
12
45
|
*/
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
46
|
+
export const createThumbnailAndStateRenderer = <T extends Data>(
|
|
47
|
+
thumbnailPropertyOrResolver: ThumbnailProperty<T> | ThumbnailResolver<T>,
|
|
48
|
+
stateMap?: ColumnMap,
|
|
49
|
+
resolverType?: ThumbnailResolverType,
|
|
17
50
|
): ColumnRenderer<T> => {
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
51
|
+
const Renderer: ColumnRenderer<T> = (value, data) => {
|
|
52
|
+
if (piletApi?.getData('thumbnailAndStateRenderer')) {
|
|
53
|
+
return piletApi?.getData('thumbnailAndStateRenderer')(
|
|
54
|
+
thumbnailPropertyOrResolver,
|
|
55
|
+
stateMap,
|
|
56
|
+
resolverType,
|
|
57
|
+
)(value, data);
|
|
58
|
+
} else {
|
|
59
|
+
return <span title="No Renderer">No Renderer</span>;
|
|
60
|
+
}
|
|
23
61
|
};
|
|
24
|
-
return
|
|
62
|
+
return Renderer;
|
|
25
63
|
};
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* A function that returns thumbnail and state renderer function.
|
|
29
|
-
* @returns A thumbnail and state column renderer
|
|
30
|
-
*/
|
|
31
|
-
export let getThumbnailAndStateRenderer = <T extends Data>(): ((
|
|
32
|
-
_thumbnailPropertyOrResolver: ThumbnailProperty<T> | ThumbnailResolver<T>,
|
|
33
|
-
_map?: ColumnMap,
|
|
34
|
-
_resolverType?: ThumbnailResolverType,
|
|
35
|
-
) => ColumnRenderer<T>) => thumbnailFallback;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Sets the `getThumbnailAndStateRenderer` utility function from the PiletApi object.
|
|
39
|
-
*
|
|
40
|
-
* The `getThumbnailAndStateRenderer` function simplifies access to shared functionality provided by the image workflow in the PiletApi object.
|
|
41
|
-
* It is used to retrieve the thumbnail renderer function, which is supplied by the image pilet.
|
|
42
|
-
*
|
|
43
|
-
* @param app The PiletApi object.
|
|
44
|
-
*/
|
|
45
|
-
export function setGetThumbnailAndStateRenderer(app: PiletApi): void {
|
|
46
|
-
getThumbnailAndStateRenderer = () =>
|
|
47
|
-
app.getData('thumbnailAndStateRenderer') ?? thumbnailFallback;
|
|
48
|
-
}
|
package/src/index.ts
CHANGED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { PiletApi } from '@axinom/mosaic-portal';
|
|
2
|
+
|
|
3
|
+
export let piletApi: PiletApi | undefined = undefined;
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Initializes the integration library with the provided Pilet API.
|
|
7
|
+
* @param app the PiletAPI object
|
|
8
|
+
*/
|
|
9
|
+
export const initializeIntegrationLib = (app: PiletApi): void => {
|
|
10
|
+
piletApi = app;
|
|
11
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { piletApi } from '../../initialize';
|
|
2
2
|
import { LocalizationGenerator, LocalizationGeneratorParams } from '../types';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -29,9 +29,13 @@ export const getLocalizationEntryPoint = (
|
|
|
29
29
|
): string | undefined => localizationEntryPoints[entityType];
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
33
|
-
* to register localization entry points
|
|
34
|
-
*
|
|
32
|
+
* Instead of using this function directly, it is recommended to use `registerLocalizationEntryPoints` function instead.
|
|
33
|
+
* `registerLocalizationEntryPoints` is a wrapper around this function that provides a more convenient way to register localization entry points.
|
|
34
|
+
*
|
|
35
|
+
* This function is designed to be used as callback of the `app.getDataHelper('localization-registration', callback)` call.
|
|
36
|
+
*
|
|
37
|
+
* The function returns a function that can be called with a `LocalizationGenerator` function. When this function is called,
|
|
38
|
+
* it will register the localization entry points that were provided as `data`.
|
|
35
39
|
* @param data Data containing the information needed to register the localization station paths for the entity using the localization generator
|
|
36
40
|
* @returns A function that will register the localization entry points using provided `data`
|
|
37
41
|
* @example
|
|
@@ -68,10 +72,10 @@ export function generateLocalizationEntryPoints(
|
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
/**
|
|
71
|
-
*
|
|
72
|
-
*
|
|
75
|
+
* This function can be used to register embedded localization worklfows for entites.
|
|
76
|
+
* The localization service will register all required stations to provide an embedded localization workflow for the entity.
|
|
77
|
+
* To query then entry point for a specific entity, to e.g. create a details page action that links to the sub-workflow, use `getLocalizationEntryPoint` function.
|
|
73
78
|
* @param data Data containing the information needed to register the localization station paths for the entity using the localization generator
|
|
74
|
-
* @param app Pilet API instance
|
|
75
79
|
* @example
|
|
76
80
|
* ```ts
|
|
77
81
|
* registerLocalizationEntryPoints([
|
|
@@ -85,12 +89,17 @@ export function generateLocalizationEntryPoints(
|
|
|
85
89
|
* entityType: 'playlist'
|
|
86
90
|
* }
|
|
87
91
|
* ]
|
|
92
|
+
* ```
|
|
88
93
|
*/
|
|
89
94
|
export function registerLocalizationEntryPoints(
|
|
90
95
|
data: LocalizationGeneratorParams[],
|
|
91
|
-
app: PiletApi,
|
|
92
96
|
): void {
|
|
93
|
-
|
|
97
|
+
if (piletApi === undefined) {
|
|
98
|
+
throw new Error(
|
|
99
|
+
'The pilet API is not initialized. Please call `initializeIntegrationLib` before using this function or pass the API object as 2nd parameter.',
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
piletApi.getDataHelper(
|
|
94
103
|
'localization-registration',
|
|
95
104
|
generateLocalizationEntryPoints(data),
|
|
96
105
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { PiletApi } from '@axinom/mosaic-portal';
|
|
2
1
|
import { ID, Maybe } from '../common';
|
|
2
|
+
import { piletApi } from '../initialize';
|
|
3
3
|
import { EncodingState } from './types';
|
|
4
4
|
|
|
5
5
|
export interface VideoServiceCuePoints {
|
|
@@ -19,15 +19,21 @@ export interface VideoData {
|
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Returns the video cue points data for the given video IDs.
|
|
24
|
+
* This method depends on the `initializeIntegrationLib` function being called before.
|
|
25
|
+
* @param id The video IDs for which to fetch the cue points data.
|
|
26
|
+
* @param cuePointTypeKeys Optional array of cue point type keys that will be used as filter for the returend cue points. If not set, will return all cue points.
|
|
27
|
+
*/
|
|
28
|
+
export const getVideoCuePointsData: (
|
|
23
29
|
id: ID[],
|
|
24
30
|
cuePointTypeKeys?: string[],
|
|
25
|
-
) => Promise<VideoData[]
|
|
31
|
+
) => Promise<VideoData[]> = (id, cuePointTypeKeys) => {
|
|
32
|
+
if (piletApi === undefined) {
|
|
33
|
+
throw new Error(
|
|
34
|
+
'The pilet API is not initialized. Please call `initializeIntegrationLib` before using this function.',
|
|
35
|
+
);
|
|
36
|
+
}
|
|
26
37
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* @param app The PiletApi object.
|
|
30
|
-
*/
|
|
31
|
-
export function setGetVideoCuePointsData(app: PiletApi): void {
|
|
32
|
-
getVideoCuePointsData = () => app.getData('video-cue-points-data');
|
|
33
|
-
}
|
|
38
|
+
return piletApi.getData('video-cue-points-data')(id, cuePointTypeKeys);
|
|
39
|
+
};
|
|
@@ -7,6 +7,9 @@ import {
|
|
|
7
7
|
VideoSelectFieldProps,
|
|
8
8
|
} from './types';
|
|
9
9
|
|
|
10
|
+
/**
|
|
11
|
+
* Returns an object containing Extension components for the shared extensions provided by the video service.
|
|
12
|
+
*/
|
|
10
13
|
export const bindVideoExtensions = (app: PiletApi): VideoExtensions => {
|
|
11
14
|
const VideoSelectExplorer: React.FC<VideoSelectExplorerProps> = (props) => (
|
|
12
15
|
<app.Extension
|