@enonic-types/lib-content 8.0.0-A2 → 8.0.0-B1
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/content.d.ts +23 -20
- package/package.json +2 -2
package/content.d.ts
CHANGED
|
@@ -11,8 +11,8 @@ declare global {
|
|
|
11
11
|
'/lib/xp/content': typeof import('./content');
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
import { Aggregations, AggregationsResult, AggregationsToAggregationResults, Attachment, ByteSource, Content, ContentComponent, ContentComponentConstraint, ContentInheritValue, Filter, FormItem, Highlight, HighlightResult, Layout, LayoutComponent, Page, PageComponent, Part, PartComponent, PublishInfo, QueryDsl, SortDsl, UserKey, ValidationError, Workflow, WorkflowState } from '@enonic-types/core';
|
|
15
|
-
export type { Aggregation, Aggregations, AggregationsResult, Attachment, BooleanDslExpression, BooleanFilter, Bucket, BucketsAggregationResult, BucketsAggregationsUnion, ByteSource, Component, Content, ContentComponent, ContentComponentConstraint, DateBucket, DateHistogramAggregation, DateRange, DateRangeAggregation, DistanceUnit, DslOperator, DslQueryType, ExistsDslExpression, ExistsFilter, FieldSortDsl, Filter, FormItem, FormItemFormFragment, FormItemInput, FormItemLayout, FormItemOptionSet, FormItemSet, FulltextDslExpression, GeoDistanceAggregation, GeoDistanceSortDsl, GroupKey, HasValueFilter, Highlight, HighlightResult, HistogramAggregation, IdsFilter, InDslExpression, InputType, LikeDslExpression, MatchAllDslExpression, MaxAggregation, MinAggregation, NgramDslExpression, NotExistsFilter, NumericBucket, NumericRange, NumericRangeAggregation, PathMatchDslExpression, PublishInfo, QueryDsl, RangeDslExpression, Region, RoleKey, ScriptValue, SingleValueMetricAggregationResult, SingleValueMetricAggregationsUnion, SortDirection, SortDsl, StatsAggregation, StatsAggregationResult, StemmedDslExpression, TermDslExpression, TermsAggregation, UserKey, ValueCountAggregation, ValueType, } from '@enonic-types/core';
|
|
14
|
+
import { Aggregations, AggregationsResult, AggregationsToAggregationResults, Attachment, ByteSource, ConfigValue, Content, ContentComponent, ContentComponentConstraint, ContentInheritValue, Filter, FormItem, Highlight, HighlightResult, Layout, LayoutComponent, Page, PageComponent, Part, PartComponent, PublishInfo, QueryDsl, SortDsl, UserKey, ValidationError, Workflow, WorkflowState } from '@enonic-types/core';
|
|
15
|
+
export type { Aggregation, Aggregations, AggregationsResult, Attachment, BooleanDslExpression, BooleanFilter, Bucket, BucketsAggregationResult, BucketsAggregationsUnion, ByteSource, Component, Content, ContentComponent, ContentComponentConstraint, DateBucket, DateHistogramAggregation, DateRange, DateRangeAggregation, DistanceUnit, DslOperator, DslQueryType, ExistsDslExpression, ExistsFilter, FieldSortDsl, Filter, FormItem, FormItemFormFragment, FormItemInput, FormItemLayout, FormItemOptionSet, FormItemSet, FulltextDslExpression, GeoDistanceAggregation, GeoDistanceSortDsl, GroupKey, HasValueFilter, Highlight, HighlightResult, HistogramAggregation, IdsFilter, InDslExpression, InputType, LikeDslExpression, MatchAllDslExpression, MaxAggregation, MinAggregation, NgramDslExpression, NotExistsFilter, NumericBucket, NumericRange, NumericRangeAggregation, PathMatchDslExpression, PublishInfo, QueryDsl, RangeDslExpression, Region, RoleKey, ScriptValue, SingleValueMetricAggregationResult, SingleValueMetricAggregationsUnion, SortDirection, SortDsl, StatsAggregation, StatsAggregationResult, StemmedDslExpression, TermDslExpression, TermsAggregation, UserKey, ValueCountAggregation, ValueType, ConfigValue, } from '@enonic-types/core';
|
|
16
16
|
type Attachments = Content['attachments'];
|
|
17
17
|
export type PageComponentWhenAutomaticTemplate = Record<string, never>;
|
|
18
18
|
export interface PageComponentWhenSpecificTemplate {
|
|
@@ -349,7 +349,6 @@ export declare function update<Data extends Record<string, unknown> = Record<str
|
|
|
349
349
|
export declare function patch(params: PatchContentParams): PatchContentResult;
|
|
350
350
|
export interface EditableContentMetadata {
|
|
351
351
|
source: Content;
|
|
352
|
-
language?: string;
|
|
353
352
|
owner?: string;
|
|
354
353
|
variantOf?: string;
|
|
355
354
|
}
|
|
@@ -361,7 +360,7 @@ export interface UpdateMetadataResult<Data extends Record<string, unknown> = Rec
|
|
|
361
360
|
content: Content<Data, Type>;
|
|
362
361
|
}
|
|
363
362
|
/**
|
|
364
|
-
* This function updates metadata (
|
|
363
|
+
* This function updates metadata (owner and variantOf) for a content.
|
|
365
364
|
* The update is applied to both master and draft branches.
|
|
366
365
|
*
|
|
367
366
|
* @example-ref examples/content/updateMetadata.js
|
|
@@ -460,9 +459,13 @@ export declare function exists(params: ContentExistsParams): boolean;
|
|
|
460
459
|
export interface CreateMediaParams {
|
|
461
460
|
name: string;
|
|
462
461
|
parentPath?: string;
|
|
463
|
-
mimeType?: string;
|
|
464
462
|
focalX?: number;
|
|
465
463
|
focalY?: number;
|
|
464
|
+
artist?: string | string[];
|
|
465
|
+
tags?: string | string[];
|
|
466
|
+
caption?: string;
|
|
467
|
+
altText?: string;
|
|
468
|
+
copyright?: string;
|
|
466
469
|
data: ByteSource;
|
|
467
470
|
idGenerator?: (v: string) => string;
|
|
468
471
|
}
|
|
@@ -474,9 +477,13 @@ export interface CreateMediaParams {
|
|
|
474
477
|
* @param {object} params JSON with the parameters.
|
|
475
478
|
* @param {string} params.name Name of content.
|
|
476
479
|
* @param {string} [params.parentPath=/] Path to place content under.
|
|
477
|
-
* @param {
|
|
478
|
-
* @param {number} [params.
|
|
479
|
-
* @param {
|
|
480
|
+
* @param {number} [params.focalX] Focal point for X axis (if it's an image).
|
|
481
|
+
* @param {number} [params.focalY] Focal point for Y axis (if it's an image).
|
|
482
|
+
* @param {string|string[]} [params.artist] Artist of the media.
|
|
483
|
+
* @param {string|string[]} [params.tags] Tags of the media.
|
|
484
|
+
* @param {string} [params.caption] Caption of the media.
|
|
485
|
+
* @param {string} [params.altText] Alt text of the media.
|
|
486
|
+
* @param {string} [params.copyright] Copyright of the media.
|
|
480
487
|
* @param params.data Data (as stream) to use.
|
|
481
488
|
*
|
|
482
489
|
* @returns {object} Returns the created media content.
|
|
@@ -589,31 +596,31 @@ export interface Icon {
|
|
|
589
596
|
* @typedef ContentType
|
|
590
597
|
* @type Object
|
|
591
598
|
* @property {string} name Name of the content type.
|
|
592
|
-
* @property {string}
|
|
599
|
+
* @property {string} title Title of the content type.
|
|
593
600
|
* @property {string} description Description of the content type.
|
|
594
601
|
* @property {string} superType Name of the super type, or null if it has no super type.
|
|
595
602
|
* @property {boolean} abstract Whether or not content of this type may be instantiated.
|
|
596
603
|
* @property {boolean} final Whether or not it may be used as super type of other content types.
|
|
597
604
|
* @property {boolean} allowChildContent Whether or not allow creating child items on content of this type.
|
|
598
|
-
* @property {string} displayNameExpression ES6 string template for generating the content name based on values in the content form.
|
|
599
605
|
* @property {object} [icon] Icon of the content type.
|
|
600
606
|
* @property {object} [icon.data] Stream with the binary data for the icon.
|
|
601
607
|
* @property {string} [icon.mimeType] Mime type of the icon image.
|
|
602
608
|
* @property {string} [icon.modifiedTime] Modified time of the icon. May be used for caching.
|
|
603
609
|
* @property {object[]} form Form schema represented as an array of form items: Input, ItemSet, Layout, OptionSet.
|
|
610
|
+
* @property {object} config Custom schema configuration for the descriptor.
|
|
604
611
|
*/
|
|
605
612
|
export interface ContentType {
|
|
606
613
|
name: string;
|
|
607
|
-
|
|
614
|
+
title: string;
|
|
608
615
|
description: string;
|
|
609
616
|
superType: string;
|
|
610
617
|
abstract: boolean;
|
|
611
618
|
final: boolean;
|
|
612
619
|
allowChildContent: boolean;
|
|
613
|
-
displayNameExpression: string;
|
|
614
620
|
modifiedTime: string;
|
|
615
621
|
icon?: Icon;
|
|
616
622
|
form: FormItem[];
|
|
623
|
+
config: Record<string, ConfigValue>;
|
|
617
624
|
}
|
|
618
625
|
/**
|
|
619
626
|
* Returns the properties and icon of the specified content type.
|
|
@@ -674,7 +681,6 @@ export interface ModifyMediaParams {
|
|
|
674
681
|
copyright?: string;
|
|
675
682
|
focalX?: number;
|
|
676
683
|
focalY?: number;
|
|
677
|
-
mimeType?: string;
|
|
678
684
|
tags?: string | string[];
|
|
679
685
|
workflow?: Workflow;
|
|
680
686
|
}
|
|
@@ -687,7 +693,6 @@ export interface UpdateMediaParams {
|
|
|
687
693
|
copyright?: string;
|
|
688
694
|
focalX?: number;
|
|
689
695
|
focalY?: number;
|
|
690
|
-
mimeType?: string;
|
|
691
696
|
tags?: string | string[];
|
|
692
697
|
workflow?: Workflow;
|
|
693
698
|
}
|
|
@@ -699,14 +704,13 @@ export interface UpdateMediaParams {
|
|
|
699
704
|
* @param {string} params.key Path or id to the content.
|
|
700
705
|
* @param {string} params.name Name to the content.
|
|
701
706
|
* @param {function} params.data Data (as stream) to use.
|
|
702
|
-
* @param {string} [params.mimeType] Mime-type of the data.
|
|
703
707
|
* @param {string|string[]} [params.artist] Artist to the content.
|
|
704
708
|
* @param {string} [params.caption] Caption to the content.
|
|
705
709
|
* @param {string} [params.copyright] Copyright to the content.
|
|
706
710
|
* @param {string|string[]} [params.tags] Tags to the content.
|
|
707
711
|
* @param {object} [params.workflow] Workflow information to use. Default has state READY and empty check list.
|
|
708
|
-
* @param {number} [params.focalX
|
|
709
|
-
* @param {number} [params.focalY
|
|
712
|
+
* @param {number} [params.focalX] Focal point for X axis (if it's an image).
|
|
713
|
+
* @param {number} [params.focalY] Focal point for Y axis (if it's an image).
|
|
710
714
|
*
|
|
711
715
|
* @returns {object} Modified content as JSON.
|
|
712
716
|
*/
|
|
@@ -719,14 +723,13 @@ export declare function modifyMedia<Data = Record<string, unknown>, Type extends
|
|
|
719
723
|
* @param {string} params.key Path or id to the content.
|
|
720
724
|
* @param {string} params.name Name to the content.
|
|
721
725
|
* @param {function} params.data Data (as stream) to use.
|
|
722
|
-
* @param {string} [params.mimeType] Mime-type of the data.
|
|
723
726
|
* @param {string|string[]} [params.artist] Artist to the content.
|
|
724
727
|
* @param {string} [params.caption] Caption to the content.
|
|
725
728
|
* @param {string} [params.copyright] Copyright to the content.
|
|
726
729
|
* @param {string|string[]} [params.tags] Tags to the content.
|
|
727
730
|
* @param {object} [params.workflow] Workflow information to use. Default has state READY and empty check list.
|
|
728
|
-
* @param {number} [params.focalX
|
|
729
|
-
* @param {number} [params.focalY
|
|
731
|
+
* @param {number} [params.focalX] Focal point for X axis (if it's an image).
|
|
732
|
+
* @param {number} [params.focalY] Focal point for Y axis (if it's an image).
|
|
730
733
|
*
|
|
731
734
|
* @returns {object} Modified content as JSON.
|
|
732
735
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enonic-types/lib-content",
|
|
3
|
-
"version": "8.0.0-
|
|
3
|
+
"version": "8.0.0-B1",
|
|
4
4
|
"description": "Type definitions for lib-content.",
|
|
5
5
|
"types": "content.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
},
|
|
28
28
|
"homepage": "https://github.com/enonic/xp/tree/master#readme",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@enonic-types/core": "8.0.0-
|
|
30
|
+
"@enonic-types/core": "8.0.0-B1"
|
|
31
31
|
},
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|