@imbricate/core 3.20.0 → 3.20.2

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.
@@ -5,7 +5,9 @@
5
5
  */
6
6
  import { ImbricateCommonQueryOriginActionsOutcome, ImbricateCommonQueryOriginActionsQuery, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../../common/action";
7
7
  import { ImbricatePropertyKey } from "../../property/definition";
8
+ import { IImbricateProperty } from "../../property/interface";
8
9
  import { ImbricatePropertyRecord } from "../../property/map";
10
+ import { IMBRICATE_PROPERTY_TYPE, ImbricatePropertyValueObject } from "../../property/type";
9
11
  import { DocumentAnnotationValue, DocumentAnnotations, DocumentEditRecord, ImbricateDocumentAuditOptions } from "../definition";
10
12
  import { IMBRICATE_DOCUMENT_FEATURE } from "../feature";
11
13
  import { IImbricateDocument } from "../interface";
@@ -17,8 +19,10 @@ export declare abstract class ImbricateDocumentFullFeatureWithActionBase impleme
17
19
  readonly supportedFeatures: IMBRICATE_DOCUMENT_FEATURE[];
18
20
  abstract getProperties(): ImbricateDocumentGetPropertiesOutcome;
19
21
  abstract getProperty(key: ImbricatePropertyKey): ImbricateDocumentGetPropertyOutcome;
22
+ abstract putProperty<T extends IMBRICATE_PROPERTY_TYPE>(property: IImbricateProperty<T>, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
20
23
  abstract mergeProperties(properties: ImbricatePropertyRecord, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
21
24
  abstract replaceProperties(properties: ImbricatePropertyRecord, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutPropertyOutcome>;
25
+ abstract createProperty<T extends IMBRICATE_PROPERTY_TYPE>(propertyKey: ImbricatePropertyKey, propertyType: T, propertyValue: ImbricatePropertyValueObject<T>): IImbricateProperty<T>;
22
26
  abstract putAnnotation(namespace: string, identifier: string, value: DocumentAnnotationValue, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentPutAnnotationOutcome>;
23
27
  abstract deleteAnnotation(namespace: string, identifier: string, auditOptions?: ImbricateDocumentAuditOptions): Promise<ImbricateDocumentDeleteAnnotationOutcome>;
24
28
  abstract addEditRecords(records: DocumentEditRecord[]): Promise<ImbricateDocumentAddEditRecordsOutcome>;
@@ -5,7 +5,9 @@
5
5
  */
6
6
  import { ImbricateCommonQueryOriginActionsOutcome, ImbricateCommonQueryOriginActionsQuery, ImbricateOriginActionInput, ImbricateOriginActionOutcome } from "../common/action";
7
7
  import { ImbricatePropertyKey } from "../property/definition";
8
+ import { IImbricateProperty } from "../property/interface";
8
9
  import { ImbricatePropertyRecord } from "../property/map";
10
+ import { IMBRICATE_PROPERTY_TYPE, ImbricatePropertyValueObject } from "../property/type";
9
11
  import { DocumentAnnotationValue, DocumentAnnotations, DocumentEditRecord, ImbricateDocumentAuditOptions } from "./definition";
10
12
  import { IMBRICATE_DOCUMENT_FEATURE } from "./feature";
11
13
  import { ImbricateDocumentAddEditRecordsOutcome, ImbricateDocumentDeleteAnnotationOutcome, ImbricateDocumentGetEditRecordsOutcome, ImbricateDocumentGetPropertiesOutcome, ImbricateDocumentGetPropertyOutcome, ImbricateDocumentPutAnnotationOutcome, ImbricateDocumentPutPropertyOutcome } from "./outcome";
@@ -38,6 +40,18 @@ export interface IImbricateDocument {
38
40
  * @returns the property of the document
39
41
  */
40
42
  getProperty(propertyKey: ImbricatePropertyKey): ImbricateDocumentGetPropertyOutcome;
43
+ /**
44
+ * Put a property to the document
45
+ *
46
+ * RequireFeature: DOCUMENT_PUT_PROPERTY
47
+ *
48
+ * @param property the property to put
49
+ * @param auditOptions audit options of the document
50
+ *
51
+ * @returns a promise of the outcome of the put property
52
+ * Symbol: S_Document_PutProperty_InvalidKey - if the key is invalid
53
+ */
54
+ putProperty<T extends IMBRICATE_PROPERTY_TYPE>(property: IImbricateProperty<T>, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<ImbricateDocumentPutPropertyOutcome>;
41
55
  /**
42
56
  * Merge a property to the document
43
57
  *
@@ -62,6 +76,15 @@ export interface IImbricateDocument {
62
76
  * Symbol: S_Document_PutProperty_InvalidKey - if the key is invalid
63
77
  */
64
78
  replaceProperties(properties: ImbricatePropertyRecord, auditOptions?: ImbricateDocumentAuditOptions): PromiseLike<ImbricateDocumentPutPropertyOutcome>;
79
+ /**
80
+ * Create a property of the document
81
+ *
82
+ * @param propertyKey the key of the property
83
+ * @param propertyType the type of the property
84
+ *
85
+ * @returns the property of the document
86
+ */
87
+ createProperty<T extends IMBRICATE_PROPERTY_TYPE>(propertyKey: ImbricatePropertyKey, propertyType: T, propertyValue: ImbricatePropertyValueObject<T>): IImbricateProperty<T>;
65
88
  /**
66
89
  * Put annotation to the document, optional
67
90
  *
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@imbricate/core",
3
3
  "main": "index.js",
4
- "version": "3.20.0",
4
+ "version": "3.20.2",
5
5
  "description": "Imbricate Core, Notebook for Engineers",
6
6
  "repository": {
7
7
  "type": "git",
@@ -13,6 +13,7 @@ export declare abstract class ImbricatePropertyFullFeatureWithActionBase<T exten
13
13
  abstract readonly propertyType: T;
14
14
  abstract readonly propertyValue: ImbricatePropertyValueObject<T>;
15
15
  readonly supportedFeatures: IMBRICATE_PROPERTY_FEATURE[];
16
+ abstract cloneWithValue(value: ImbricatePropertyValueObject<T>): IImbricateProperty<T>;
16
17
  abstract queryOriginActions(query: ImbricateCommonQueryOriginActionsQuery): PromiseLike<ImbricateCommonQueryOriginActionsOutcome>;
17
18
  abstract executeOriginAction(input: ImbricateOriginActionInput): PromiseLike<ImbricateOriginActionOutcome>;
18
19
  }
@@ -24,6 +24,14 @@ export interface IImbricateProperty<T extends IMBRICATE_PROPERTY_TYPE> {
24
24
  * Supported features of the property
25
25
  */
26
26
  readonly supportedFeatures: IMBRICATE_PROPERTY_FEATURE[];
27
+ /**
28
+ * Clone the property with the new value
29
+ *
30
+ * @param value the new value
31
+ *
32
+ * @returns the cloned property
33
+ */
34
+ cloneWithValue(value: ImbricatePropertyValueObject<T>): IImbricateProperty<T>;
27
35
  /**
28
36
  * Query the property actions
29
37
  *