@faststore/api 1.8.39 → 1.8.42
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/CHANGELOG.md +30 -0
- package/dist/__generated__/schema.d.ts +2 -0
- package/dist/api.cjs.development.js +7 -11
- package/dist/api.cjs.development.js.map +1 -1
- package/dist/api.cjs.production.min.js +1 -1
- package/dist/api.cjs.production.min.js.map +1 -1
- package/dist/api.esm.js +7 -11
- package/dist/api.esm.js.map +1 -1
- package/package.json +2 -3
- package/src/__generated__/schema.ts +2 -0
- package/src/platforms/vtex/resolvers/validateCart.ts +10 -6
- package/src/typeDefs/propertyValue.graphql +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,36 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 1.8.42 (2022-05-30)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* github release ([194413b](https://github.com/vtex/faststore/commit/194413ba0087c8283942108ab5fdd25964b8901b))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 1.8.41 (2022-05-30)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @faststore/api
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## 1.8.40 (2022-05-30)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* Cart item with additionalProperty ([#1325](https://github.com/vtex/faststore/issues/1325)) ([8fa6aa1](https://github.com/vtex/faststore/commit/8fa6aa1a88d3e3702a017e581cbcff4281c47f4f))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
6
36
|
## 1.8.39 (2022-05-27)
|
|
7
37
|
|
|
8
38
|
**Note:** Version bump only for package @faststore/api
|
|
@@ -70,6 +70,8 @@ export declare type IStoreProduct = {
|
|
|
70
70
|
export declare type IStorePropertyValue = {
|
|
71
71
|
/** Property name. */
|
|
72
72
|
name: Scalars['String'];
|
|
73
|
+
/** Property id. This propert changes according to the content of the object. */
|
|
74
|
+
propertyID?: Maybe<Scalars['String']>;
|
|
73
75
|
/** Property value. May hold a string or the string representation of an object. */
|
|
74
76
|
value: Scalars['ObjectOrString'];
|
|
75
77
|
/** Specifies the nature of the value */
|
|
@@ -659,16 +659,12 @@ function getPropertyId(item) {
|
|
|
659
659
|
return md5(`${item.name}:${JSON.stringify(item.value)}:${item.valueReference}`);
|
|
660
660
|
}
|
|
661
661
|
|
|
662
|
-
const
|
|
663
|
-
var _item$itemOffered$add;
|
|
664
|
-
|
|
665
|
-
return (_item$itemOffered$add = item.itemOffered.additionalProperty) == null ? void 0 : _item$itemOffered$add.filter(i => i.valueReference === VALUE_REFERENCES.attachment);
|
|
666
|
-
};
|
|
662
|
+
const isAttachment = value => value.valueReference === VALUE_REFERENCES.attachment;
|
|
667
663
|
|
|
668
664
|
const getId = item => {
|
|
669
|
-
var _item$itemOffered$
|
|
665
|
+
var _item$itemOffered$add;
|
|
670
666
|
|
|
671
|
-
return [item.itemOffered.sku, item.seller.identifier, item.price, (_item$itemOffered$
|
|
667
|
+
return [item.itemOffered.sku, item.seller.identifier, item.price, (_item$itemOffered$add = item.itemOffered.additionalProperty) == null ? void 0 : _item$itemOffered$add.filter(isAttachment).map(getPropertyId).join('-')].filter(Boolean).join('::');
|
|
672
668
|
};
|
|
673
669
|
|
|
674
670
|
const orderFormItemToOffer = (item, index) => ({
|
|
@@ -688,14 +684,14 @@ const orderFormItemToOffer = (item, index) => ({
|
|
|
688
684
|
});
|
|
689
685
|
|
|
690
686
|
const offerToOrderItemInput = offer => {
|
|
691
|
-
var
|
|
687
|
+
var _offer$itemOffered$ad, _offer$itemOffered$ad2;
|
|
692
688
|
|
|
693
689
|
return {
|
|
694
690
|
quantity: offer.quantity,
|
|
695
691
|
seller: offer.seller.identifier,
|
|
696
692
|
id: offer.itemOffered.sku,
|
|
697
693
|
index: offer.index,
|
|
698
|
-
attachments: ((
|
|
694
|
+
attachments: ((_offer$itemOffered$ad = (_offer$itemOffered$ad2 = offer.itemOffered.additionalProperty) == null ? void 0 : _offer$itemOffered$ad2.filter(isAttachment)) != null ? _offer$itemOffered$ad : []).map(attachment => ({
|
|
699
695
|
name: attachment.name,
|
|
700
696
|
content: attachment.value
|
|
701
697
|
}))
|
|
@@ -1708,8 +1704,8 @@ var doc$i = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","de
|
|
|
1708
1704
|
var doc$j = {"kind":"Document","definitions":[{"kind":"EnumTypeDefinition","description":{"kind":"StringValue","value":"Status used to indicate type of message. For instance, in shopping cart messages.","block":true},"name":{"kind":"Name","value":"StoreStatus"},"directives":[],"values":[{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"INFO"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"WARNING"},"directives":[]},{"kind":"EnumValueDefinition","name":{"kind":"Name","value":"ERROR"},"directives":[]}]}],"loc":{"start":0,"end":136}};
|
|
1709
1705
|
doc$j.loc.source = {"body":"\"\"\"\nStatus used to indicate type of message. For instance, in shopping cart messages.\n\"\"\"\nenum StoreStatus {\n INFO\n WARNING\n ERROR\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
|
|
1710
1706
|
|
|
1711
|
-
var doc$k = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Properties that can be associated with products and products groups.","block":true},"name":{"kind":"Name","value":"StorePropertyValue"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Property id. This propert changes according to the content of the object.","block":true},"name":{"kind":"Name","value":"propertyID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Property value. May hold a string or the string representation of an object.","block":true},"name":{"kind":"Name","value":"value"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectOrString"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Property name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Specifies the nature of the value","block":true},"name":{"kind":"Name","value":"valueReference"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","name":{"kind":"Name","value":"IStorePropertyValue"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Property value. May hold a string or the string representation of an object.","block":true},"name":{"kind":"Name","value":"value"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectOrString"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Property name.","block":true},"name":{"kind":"Name","value":"name"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Specifies the nature of the value","block":true},"name":{"kind":"Name","value":"valueReference"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":
|
|
1712
|
-
doc$k.loc.source = {"body":"\"\"\"\nProperties that can be associated with products and products groups.\n\"\"\"\ntype StorePropertyValue {\n \"\"\"\n Property id. This propert changes according to the content of the object.\n \"\"\"\n propertyID: String!\n \"\"\"\n Property value. May hold a string or the string representation of an object.\n \"\"\"\n value: ObjectOrString!\n \"\"\"\n Property name.\n \"\"\"\n name: String!\n \"\"\"\n Specifies the nature of the value\n \"\"\"\n valueReference: String!\n}\n\ninput IStorePropertyValue {\n \"\"\"\n Property value. May hold a string or the string representation of an object.\n \"\"\"\n value: ObjectOrString!\n \"\"\"\n Property name.\n \"\"\"\n name: String!\n \"\"\"\n Specifies the nature of the value\n \"\"\"\n valueReference: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
|
|
1707
|
+
var doc$k = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Properties that can be associated with products and products groups.","block":true},"name":{"kind":"Name","value":"StorePropertyValue"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Property id. This propert changes according to the content of the object.","block":true},"name":{"kind":"Name","value":"propertyID"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Property value. May hold a string or the string representation of an object.","block":true},"name":{"kind":"Name","value":"value"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectOrString"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Property name.","block":true},"name":{"kind":"Name","value":"name"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Specifies the nature of the value","block":true},"name":{"kind":"Name","value":"valueReference"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]},{"kind":"InputObjectTypeDefinition","name":{"kind":"Name","value":"IStorePropertyValue"},"directives":[],"fields":[{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Property id. This propert changes according to the content of the object.","block":true},"name":{"kind":"Name","value":"propertyID"},"type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Property value. May hold a string or the string representation of an object.","block":true},"name":{"kind":"Name","value":"value"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ObjectOrString"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Property name.","block":true},"name":{"kind":"Name","value":"name"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"InputValueDefinition","description":{"kind":"StringValue","value":"Specifies the nature of the value","block":true},"name":{"kind":"Name","value":"valueReference"},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":825}};
|
|
1708
|
+
doc$k.loc.source = {"body":"\"\"\"\nProperties that can be associated with products and products groups.\n\"\"\"\ntype StorePropertyValue {\n \"\"\"\n Property id. This propert changes according to the content of the object.\n \"\"\"\n propertyID: String!\n \"\"\"\n Property value. May hold a string or the string representation of an object.\n \"\"\"\n value: ObjectOrString!\n \"\"\"\n Property name.\n \"\"\"\n name: String!\n \"\"\"\n Specifies the nature of the value\n \"\"\"\n valueReference: String!\n}\n\ninput IStorePropertyValue {\n \"\"\"\n Property id. This propert changes according to the content of the object.\n \"\"\"\n propertyID: String\n \"\"\"\n Property value. May hold a string or the string representation of an object.\n \"\"\"\n value: ObjectOrString!\n \"\"\"\n Property name.\n \"\"\"\n name: String!\n \"\"\"\n Specifies the nature of the value\n \"\"\"\n valueReference: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
|
|
1713
1709
|
|
|
1714
1710
|
var doc$l = {"kind":"Document","definitions":[{"kind":"ObjectTypeDefinition","description":{"kind":"StringValue","value":"Client profile data.","block":true},"name":{"kind":"Name","value":"StorePerson"},"interfaces":[],"directives":[],"fields":[{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Client ID.","block":true},"name":{"kind":"Name","value":"id"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Client email.","block":true},"name":{"kind":"Name","value":"email"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Client first name.","block":true},"name":{"kind":"Name","value":"givenName"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]},{"kind":"FieldDefinition","description":{"kind":"StringValue","value":"Client last name.","block":true},"name":{"kind":"Name","value":"familyName"},"arguments":[],"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"String"}}},"directives":[]}]}],"loc":{"start":0,"end":242}};
|
|
1715
1711
|
doc$l.loc.source = {"body":"\"\"\"\nClient profile data.\n\"\"\"\ntype StorePerson {\n \"\"\"\n Client ID.\n \"\"\"\n id: String!\n \"\"\"\n Client email.\n \"\"\"\n email: String!\n \"\"\"\n Client first name.\n \"\"\"\n givenName: String!\n \"\"\"\n Client last name.\n \"\"\"\n familyName: String!\n}\n","name":"GraphQL request","locationOffset":{"line":1,"column":1}};
|