@wix/wix-data-items-common 1.0.311 → 1.0.312
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_BaseFieldModificationsBuilder","require","WixDataFieldModificationsBuilderImpl","BaseFieldModificationsBuilder","constructor","origin","copy","params","invalidArguments","ownInvalidArguments","fieldModifications","addFieldModification","build","FieldModificationsBuilder","exports"],"sources":["../../../src/api/WixDataFieldModificationsBuilder.ts"],"sourcesContent":["import type { FieldModification } from './FieldModification'\nimport { BaseFieldModificationsBuilder } from './impl/BaseFieldModificationsBuilder'\n\n/**\n * WixData FieldModificationsBuilder type.\n * @internal\n */\nexport interface FieldModificationsBuilder<Self> {\n /**\n * Refines a patch operation to increment the specified field value by the specified parameter.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is incremented. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param by - Value by which to increment the specified field. To decrement, specify a negative value.\n * @requiredField by\n * @returns Updated patch object.\n */\n incrementField(field: string, by: number): Self\n\n /**\n * Refines a patch operation to set the specified field to the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is set. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value to set for the specified field.\n * @requiredField value\n * @returns Updated patch object.\n */\n setField(field: string, value: any): Self\n\n /**\n * Refines a patch operation to append the specified value to the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to append the specified value to. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value to append to the specified array field.\n * @requiredField value\n * @returns Updated patch object.\n */\n appendToArray(field: string, value: any): Self\n\n /**\n * Refines a patch operation to remove the first instance of the specified value from the specified array field.\n * @public\n * @documentationMaturity preview\n * @param field - Array field to remove the specified value from. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value whose first instance is removed from the specified array field.\n * @requiredField value\n * @returns Updated patch object.\n */\n removeFromArray(field: string, value: any): Self\n\n /**\n * Refines a patch operation to clear the specified field.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is cleared. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @returns Updated patch object.\n */\n removeField(field: string): Self\n}\n\n/**\n * WixData field modifications builder.\n * @internal\n */\nexport interface WixDataFieldModificationsBuilder\n extends FieldModificationsBuilder<WixDataFieldModificationsBuilder> {\n /** Build the final array of field modifications */\n build(): FieldModification[]\n}\n\nclass WixDataFieldModificationsBuilderImpl\n extends BaseFieldModificationsBuilder<WixDataFieldModificationsBuilderImpl>\n implements WixDataFieldModificationsBuilder\n{\n constructor(origin?: {\n invalidArguments?: string[]\n fieldModifications?: FieldModification[]\n }) {\n super(origin ?? {})\n }\n\n protected copy(params: {\n invalidArguments?: string[]\n addFieldModification: FieldModification\n }): WixDataFieldModificationsBuilderImpl {\n return new WixDataFieldModificationsBuilderImpl({\n invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,\n fieldModifications: [\n ...this.fieldModifications,\n params.addFieldModification,\n ],\n })\n }\n\n build(): FieldModification[] {\n return [...this.fieldModifications]\n }\n}\n\n/**\n * Creates a new WixData field modifications builder.\n * @internal\n *\n * @example\n * ```ts\n * import { FieldModificationsBuilder } from '@wix/wix-data-items-common'\n *\n * const fieldModifications = FieldModificationsBuilder()\n * .setField('title', 'Updated title')\n * .incrementField('viewCount', 1)\n * .appendToArray('tags', 'featured')\n * .removeField('legacyField')\n * .build()\n *\n * const item = await wixData.patch('myCollection', 'itemId', fieldModifications)\n * ```\n */\nexport const FieldModificationsBuilder: () => WixDataFieldModificationsBuilder =\n () => new WixDataFieldModificationsBuilderImpl()\n"],"mappings":";;;;AACA,IAAAA,8BAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;;AA6DA;AACA;AACA;AACA;;AAOA,MAAMC,oCAAoC,SAChCC,4DAA6B,CAEvC;EACEC,WAAWA,CAACC,MAGX,EAAE;IACD,KAAK,CAACA,MAAM,IAAI,CAAC,CAAC,CAAC;EACrB;EAEUC,IAAIA,CAACC,MAGd,EAAwC;IACvC,OAAO,IAAIL,oCAAoC,CAAC;MAC9CM,gBAAgB,EAAED,MAAM,CAACC,gBAAgB,IAAI,IAAI,CAACC,mBAAmB;MACrEC,kBAAkB,EAAE,CAClB,GAAG,IAAI,CAACA,kBAAkB,EAC1BH,MAAM,CAACI,oBAAoB;IAE/B,CAAC,CAAC;EACJ;EAEAC,KAAKA,CAAA,EAAwB;IAC3B,OAAO,CAAC,GAAG,IAAI,CAACF,kBAAkB,CAAC;EACrC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,yBAAiE,GAC5EA,CAAA,KAAM,IAAIX,oCAAoC,CAAC,CAAC;AAAAY,OAAA,CAAAD,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_BaseFieldModificationsBuilder","require","WixDataFieldModificationsBuilderImpl","BaseFieldModificationsBuilder","constructor","origin","copy","params","invalidArguments","ownInvalidArguments","fieldModifications","addFieldModification","build","FieldModificationsBuilder","exports"],"sources":["../../../src/api/WixDataFieldModificationsBuilder.ts"],"sourcesContent":["import type { FieldModification } from './FieldModification'\nimport { BaseFieldModificationsBuilder } from './impl/BaseFieldModificationsBuilder'\n\n/**\n * WixData FieldModificationsBuilder type.\n * @internal\n */\nexport interface FieldModificationsBuilder<Self> {\n /**\n * Refines a patch operation to increment the specified field value by the specified parameter.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is incremented. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param by - Value by which to increment the specified field. To decrement, specify a negative value.\n * @requiredField by\n * @returns Updated patch object.\n */\n incrementField(field: string, by: number): Self\n\n /**\n * Refines a patch operation to set the specified field to the specified value.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is set. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value to set for the specified field.\n * @requiredField value\n * @returns Updated patch object.\n */\n setField(field: string, value: any): Self\n\n /**\n * Refines a patch operation to append the specified value to the specified array or multi-reference field.\n * @public\n * @documentationMaturity preview\n * @param field - Array or multi-reference field to append the specified value to. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value to append to the specified array or multi-reference field.\n * @requiredField value\n * @returns Updated patch object.\n */\n appendToArray(field: string, value: any): Self\n\n /**\n * Refines a patch operation to remove the first instance of the specified value from the specified array or multi-reference field.\n * @public\n * @documentationMaturity preview\n * @param field - Array or multi-reference field to remove the specified value from. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @param value - Value whose first instance is removed from the specified array or multi-reference field.\n * @requiredField value\n * @returns Updated patch object.\n */\n removeFromArray(field: string, value: any): Self\n\n /**\n * Refines a patch operation to clear the specified field.\n * @public\n * @documentationMaturity preview\n * @param field - Field whose value is cleared. Nested fields can be specified using dot notation. For example: `address.street`.\n * @requiredField field\n * @returns Updated patch object.\n */\n removeField(field: string): Self\n}\n\n/**\n * WixData field modifications builder.\n * @internal\n */\nexport interface WixDataFieldModificationsBuilder\n extends FieldModificationsBuilder<WixDataFieldModificationsBuilder> {\n /** Build the final array of field modifications */\n build(): FieldModification[]\n}\n\nclass WixDataFieldModificationsBuilderImpl\n extends BaseFieldModificationsBuilder<WixDataFieldModificationsBuilderImpl>\n implements WixDataFieldModificationsBuilder\n{\n constructor(origin?: {\n invalidArguments?: string[]\n fieldModifications?: FieldModification[]\n }) {\n super(origin ?? {})\n }\n\n protected copy(params: {\n invalidArguments?: string[]\n addFieldModification: FieldModification\n }): WixDataFieldModificationsBuilderImpl {\n return new WixDataFieldModificationsBuilderImpl({\n invalidArguments: params.invalidArguments ?? this.ownInvalidArguments,\n fieldModifications: [\n ...this.fieldModifications,\n params.addFieldModification,\n ],\n })\n }\n\n build(): FieldModification[] {\n return [...this.fieldModifications]\n }\n}\n\n/**\n * Creates a new WixData field modifications builder.\n * @internal\n *\n * @example\n * ```ts\n * import { FieldModificationsBuilder } from '@wix/wix-data-items-common'\n *\n * const fieldModifications = FieldModificationsBuilder()\n * .setField('title', 'Updated title')\n * .incrementField('viewCount', 1)\n * .appendToArray('tags', 'featured')\n * .removeField('legacyField')\n * .build()\n *\n * const item = await wixData.patch('myCollection', 'itemId', fieldModifications)\n * ```\n */\nexport const FieldModificationsBuilder: () => WixDataFieldModificationsBuilder =\n () => new WixDataFieldModificationsBuilderImpl()\n"],"mappings":";;;;AACA,IAAAA,8BAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACA;;AA6DA;AACA;AACA;AACA;;AAOA,MAAMC,oCAAoC,SAChCC,4DAA6B,CAEvC;EACEC,WAAWA,CAACC,MAGX,EAAE;IACD,KAAK,CAACA,MAAM,IAAI,CAAC,CAAC,CAAC;EACrB;EAEUC,IAAIA,CAACC,MAGd,EAAwC;IACvC,OAAO,IAAIL,oCAAoC,CAAC;MAC9CM,gBAAgB,EAAED,MAAM,CAACC,gBAAgB,IAAI,IAAI,CAACC,mBAAmB;MACrEC,kBAAkB,EAAE,CAClB,GAAG,IAAI,CAACA,kBAAkB,EAC1BH,MAAM,CAACI,oBAAoB;IAE/B,CAAC,CAAC;EACJ;EAEAC,KAAKA,CAAA,EAAwB;IAC3B,OAAO,CAAC,GAAG,IAAI,CAACF,kBAAkB,CAAC;EACrC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,yBAAiE,GAC5EA,CAAA,KAAM,IAAIX,oCAAoC,CAAC,CAAC;AAAAY,OAAA,CAAAD,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -27,23 +27,23 @@ export interface FieldModificationsBuilder<Self> {
|
|
|
27
27
|
*/
|
|
28
28
|
setField(field: string, value: any): Self;
|
|
29
29
|
/**
|
|
30
|
-
* Refines a patch operation to append the specified value to the specified array field.
|
|
30
|
+
* Refines a patch operation to append the specified value to the specified array or multi-reference field.
|
|
31
31
|
* @public
|
|
32
32
|
* @documentationMaturity preview
|
|
33
|
-
* @param field - Array field to append the specified value to. Nested fields can be specified using dot notation. For example: `address.street`.
|
|
33
|
+
* @param field - Array or multi-reference field to append the specified value to. Nested fields can be specified using dot notation. For example: `address.street`.
|
|
34
34
|
* @requiredField field
|
|
35
|
-
* @param value - Value to append to the specified array field.
|
|
35
|
+
* @param value - Value to append to the specified array or multi-reference field.
|
|
36
36
|
* @requiredField value
|
|
37
37
|
* @returns Updated patch object.
|
|
38
38
|
*/
|
|
39
39
|
appendToArray(field: string, value: any): Self;
|
|
40
40
|
/**
|
|
41
|
-
* Refines a patch operation to remove the first instance of the specified value from the specified array field.
|
|
41
|
+
* Refines a patch operation to remove the first instance of the specified value from the specified array or multi-reference field.
|
|
42
42
|
* @public
|
|
43
43
|
* @documentationMaturity preview
|
|
44
|
-
* @param field - Array field to remove the specified value from. Nested fields can be specified using dot notation. For example: `address.street`.
|
|
44
|
+
* @param field - Array or multi-reference field to remove the specified value from. Nested fields can be specified using dot notation. For example: `address.street`.
|
|
45
45
|
* @requiredField field
|
|
46
|
-
* @param value - Value whose first instance is removed from the specified array field.
|
|
46
|
+
* @param value - Value whose first instance is removed from the specified array or multi-reference field.
|
|
47
47
|
* @requiredField value
|
|
48
48
|
* @returns Updated patch object.
|
|
49
49
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/wix-data-items-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.312",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Rimvydas Gimbutas",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"wallaby": {
|
|
83
83
|
"autoDetect": true
|
|
84
84
|
},
|
|
85
|
-
"falconPackageHash": "
|
|
85
|
+
"falconPackageHash": "f253d50fc3256808c882ecacef757d28ea5bc3982d07e48fbc135160"
|
|
86
86
|
}
|