@orchesty/connector-wix 1.0.0

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/LICENSE +190 -0
  3. package/coverage/clover.xml +125 -0
  4. package/coverage/coverage-final.json +7 -0
  5. package/coverage/lcov-report/base.css +224 -0
  6. package/coverage/lcov-report/block-navigation.js +87 -0
  7. package/coverage/lcov-report/favicon.png +0 -0
  8. package/coverage/lcov-report/index.html +146 -0
  9. package/coverage/lcov-report/prettify.css +1 -0
  10. package/coverage/lcov-report/prettify.js +2 -0
  11. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  12. package/coverage/lcov-report/sorter.js +210 -0
  13. package/coverage/lcov-report/src/Connector/WixCreateOrderConnector.ts.html +679 -0
  14. package/coverage/lcov-report/src/Connector/WixCreateProductConnector.ts.html +781 -0
  15. package/coverage/lcov-report/src/Connector/WixGetOrderConnector.ts.html +493 -0
  16. package/coverage/lcov-report/src/Connector/WixUpdateProductConnector.ts.html +574 -0
  17. package/coverage/lcov-report/src/Connector/index.html +161 -0
  18. package/coverage/lcov-report/src/WixApplication.ts.html +334 -0
  19. package/coverage/lcov-report/src/index.html +116 -0
  20. package/coverage/lcov-report/test/dataProvider.ts.html +268 -0
  21. package/coverage/lcov-report/test/index.html +116 -0
  22. package/coverage/lcov.info +189 -0
  23. package/dist/Connector/WixCreateOrderConnector.d.ts +181 -0
  24. package/dist/Connector/WixCreateOrderConnector.js +21 -0
  25. package/dist/Connector/WixCreateProductConnector.d.ts +217 -0
  26. package/dist/Connector/WixCreateProductConnector.js +21 -0
  27. package/dist/Connector/WixGetOrderConnector.d.ts +119 -0
  28. package/dist/Connector/WixGetOrderConnector.js +22 -0
  29. package/dist/Connector/WixUpdateProductConnector.d.ts +147 -0
  30. package/dist/Connector/WixUpdateProductConnector.js +22 -0
  31. package/dist/WixApplication.d.ts +19 -0
  32. package/dist/WixApplication.js +97 -0
  33. package/dist/package.json +22 -0
  34. package/jest.config.js +13 -0
  35. package/package.json +22 -0
  36. package/src/Connector/WixCreateOrderConnector.ts +198 -0
  37. package/src/Connector/WixCreateProductConnector.ts +232 -0
  38. package/src/Connector/WixGetOrderConnector.ts +136 -0
  39. package/src/Connector/WixUpdateProductConnector.ts +163 -0
  40. package/src/Connector/__tests__/Data/WixCreateOrderConnector/input.json +74 -0
  41. package/src/Connector/__tests__/Data/WixCreateOrderConnector/mock.json +109 -0
  42. package/src/Connector/__tests__/Data/WixCreateOrderConnector/output.json +110 -0
  43. package/src/Connector/__tests__/Data/WixCreateProductConnector/input.json +43 -0
  44. package/src/Connector/__tests__/Data/WixCreateProductConnector/mock.json +180 -0
  45. package/src/Connector/__tests__/Data/WixCreateProductConnector/output.json +181 -0
  46. package/src/Connector/__tests__/Data/WixGetOrderConnector/input.json +8 -0
  47. package/src/Connector/__tests__/Data/WixGetOrderConnector/mock.json +113 -0
  48. package/src/Connector/__tests__/Data/WixGetOrderConnector/output.json +114 -0
  49. package/src/Connector/__tests__/Data/WixUpdateProductConnector/input.json +36 -0
  50. package/src/Connector/__tests__/Data/WixUpdateProductConnector/mock.json +115 -0
  51. package/src/Connector/__tests__/Data/WixUpdateProductConnector/output.json +117 -0
  52. package/src/Connector/__tests__/WixCreateOrderConnector.ts +17 -0
  53. package/src/Connector/__tests__/WixCreateProductConnector.ts +17 -0
  54. package/src/Connector/__tests__/WixGetOrderConnector.ts +17 -0
  55. package/src/Connector/__tests__/WixUpdateProductConnector.ts +17 -0
  56. package/src/WixApplication.ts +83 -0
  57. package/test/dataProvider.ts +61 -0
  58. package/tsconfig.json +8 -0
  59. package/tsconfig.prod.json +13 -0
  60. package/tsconfig.prod.tsbuildinfo +1 -0
@@ -0,0 +1,109 @@
1
+ {
2
+ "http": "POST https://www.wixapis.com/stores/v2/orders",
3
+ "code": 200,
4
+ "body": {
5
+ "order": {
6
+ "id": "fedb19f5-bd4c-4bfc-b2d1-212538319611",
7
+ "number": 10096,
8
+ "dateCreated": "2020-03-18T16:47:59.222Z",
9
+ "currency": "USD",
10
+ "weightUnit": "LB",
11
+ "totals": {
12
+ "subtotal": "10",
13
+ "shipping": "3",
14
+ "tax": "3",
15
+ "discount": "1",
16
+ "total": "15",
17
+ "weight": "30",
18
+ "quantity": 2
19
+ },
20
+ "billingInfo": {
21
+ "paymentMethod": "PayPal",
22
+ "externalTransactionId": "tx_1806",
23
+ "paymentProviderTransactionId": "tx_1806",
24
+ "address": {
25
+ "fullName": {
26
+ "firstName": "John",
27
+ "lastName": "Smith"
28
+ },
29
+ "country": "US",
30
+ "city": "New York",
31
+ "zipCode": "92544",
32
+ "phone": "+972 555234555",
33
+ "email": "Ivanushka@example.com"
34
+ },
35
+ "paidDate": "2020-03-18T16:47:59.244Z"
36
+ },
37
+ "shippingInfo": {
38
+ "deliveryOption": "Express",
39
+ "estimatedDeliveryTime": "Today",
40
+ "shipmentDetails": {
41
+ "address": {
42
+ "fullName": {
43
+ "firstName": "John",
44
+ "lastName": "Smith"
45
+ },
46
+ "country": "US",
47
+ "city": "New York",
48
+ "zipCode": "92544",
49
+ "phone": "+972 555234555",
50
+ "email": "Ivanushka@example.com"
51
+ },
52
+ "discount": "0",
53
+ "tax": "1",
54
+ "priceData": {
55
+ "taxIncludedInPrice": false,
56
+ "price": "3"
57
+ }
58
+ }
59
+ },
60
+ "read": false,
61
+ "archived": false,
62
+ "paymentStatus": "PAID",
63
+ "fulfillmentStatus": "NOT_FULFILLED",
64
+ "lineItems": [
65
+ {
66
+ "index": 1,
67
+ "quantity": 2,
68
+ "name": "my product",
69
+ "productId": "a1f9d337-f831-4529-31e6-67db8fd4e1aa",
70
+ "lineItemType": "PHYSICAL",
71
+ "options": [],
72
+ "customTextFields": [],
73
+ "weight": "15",
74
+ "sku": "12345678",
75
+ "discount": "1",
76
+ "tax": "1",
77
+ "priceData": {
78
+ "taxIncludedInPrice": false,
79
+ "price": "5",
80
+ "totalPrice": "10"
81
+ }
82
+ }
83
+ ],
84
+ "activities": [
85
+ {
86
+ "type": "ORDER_PLACED",
87
+ "timestamp": "2020-03-18T16:47:59.222Z"
88
+ },
89
+ {
90
+ "type": "ORDER_PAID",
91
+ "timestamp": "2020-03-18T16:47:59.244Z"
92
+ }
93
+ ],
94
+ "fulfillments": [],
95
+ "discount": {
96
+ "value": "1"
97
+ },
98
+ "buyerLanguage": "en",
99
+ "channelInfo": {
100
+ "type": "WEB"
101
+ },
102
+ "enteredBy": {
103
+ "id": "e85274cf-047a-4989-baff-dac5e0c3971d",
104
+ "identityType": "USER"
105
+ },
106
+ "lastUpdated": "2020-03-18T16:47:59.244Z"
107
+ }
108
+ }
109
+ }
@@ -0,0 +1,110 @@
1
+ {
2
+ "headers": {
3
+ "user": "TestUser"
4
+ },
5
+ "data": {
6
+ "order": {
7
+ "id": "fedb19f5-bd4c-4bfc-b2d1-212538319611",
8
+ "number": 10096,
9
+ "dateCreated": "2020-03-18T16:47:59.222Z",
10
+ "currency": "USD",
11
+ "weightUnit": "LB",
12
+ "totals": {
13
+ "subtotal": "10",
14
+ "shipping": "3",
15
+ "tax": "3",
16
+ "discount": "1",
17
+ "total": "15",
18
+ "weight": "30",
19
+ "quantity": 2
20
+ },
21
+ "billingInfo": {
22
+ "paymentMethod": "PayPal",
23
+ "externalTransactionId": "tx_1806",
24
+ "paymentProviderTransactionId": "tx_1806",
25
+ "address": {
26
+ "fullName": {
27
+ "firstName": "John",
28
+ "lastName": "Smith"
29
+ },
30
+ "country": "US",
31
+ "city": "New York",
32
+ "zipCode": "92544",
33
+ "phone": "+972 555234555",
34
+ "email": "Ivanushka@example.com"
35
+ },
36
+ "paidDate": "2020-03-18T16:47:59.244Z"
37
+ },
38
+ "shippingInfo": {
39
+ "deliveryOption": "Express",
40
+ "estimatedDeliveryTime": "Today",
41
+ "shipmentDetails": {
42
+ "address": {
43
+ "fullName": {
44
+ "firstName": "John",
45
+ "lastName": "Smith"
46
+ },
47
+ "country": "US",
48
+ "city": "New York",
49
+ "zipCode": "92544",
50
+ "phone": "+972 555234555",
51
+ "email": "Ivanushka@example.com"
52
+ },
53
+ "discount": "0",
54
+ "tax": "1",
55
+ "priceData": {
56
+ "taxIncludedInPrice": false,
57
+ "price": "3"
58
+ }
59
+ }
60
+ },
61
+ "read": false,
62
+ "archived": false,
63
+ "paymentStatus": "PAID",
64
+ "fulfillmentStatus": "NOT_FULFILLED",
65
+ "lineItems": [
66
+ {
67
+ "index": 1,
68
+ "quantity": 2,
69
+ "name": "my product",
70
+ "productId": "a1f9d337-f831-4529-31e6-67db8fd4e1aa",
71
+ "lineItemType": "PHYSICAL",
72
+ "options": [],
73
+ "customTextFields": [],
74
+ "weight": "15",
75
+ "sku": "12345678",
76
+ "discount": "1",
77
+ "tax": "1",
78
+ "priceData": {
79
+ "taxIncludedInPrice": false,
80
+ "price": "5",
81
+ "totalPrice": "10"
82
+ }
83
+ }
84
+ ],
85
+ "activities": [
86
+ {
87
+ "type": "ORDER_PLACED",
88
+ "timestamp": "2020-03-18T16:47:59.222Z"
89
+ },
90
+ {
91
+ "type": "ORDER_PAID",
92
+ "timestamp": "2020-03-18T16:47:59.244Z"
93
+ }
94
+ ],
95
+ "fulfillments": [],
96
+ "discount": {
97
+ "value": "1"
98
+ },
99
+ "buyerLanguage": "en",
100
+ "channelInfo": {
101
+ "type": "WEB"
102
+ },
103
+ "enteredBy": {
104
+ "id": "e85274cf-047a-4989-baff-dac5e0c3971d",
105
+ "identityType": "USER"
106
+ },
107
+ "lastUpdated": "2020-03-18T16:47:59.244Z"
108
+ }
109
+ }
110
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "headers": {
3
+ "user": "TestUser"
4
+ },
5
+ "data": {
6
+ "product": {
7
+ "name": "T-shirt",
8
+ "productType": "physical",
9
+ "priceData": {
10
+ "price": 10.5
11
+ },
12
+ "costAndProfitData": {
13
+ "itemCost": 7
14
+ },
15
+ "description": "nice summer t-shirt",
16
+ "sku": "123df",
17
+ "visible": false,
18
+ "ribbon": "Sale",
19
+ "brand": "Nice",
20
+ "weight": 0.2,
21
+ "discount": {
22
+ "type": "AMOUNT",
23
+ "value": 1
24
+ },
25
+ "manageVariants": true,
26
+ "productOptions": [
27
+ {
28
+ "name": "Size",
29
+ "choices": [
30
+ {
31
+ "value": "S",
32
+ "description": "S"
33
+ },
34
+ {
35
+ "value": "L",
36
+ "description": "L"
37
+ }
38
+ ]
39
+ }
40
+ ]
41
+ }
42
+ }
43
+ }
@@ -0,0 +1,180 @@
1
+ {
2
+ "http": "POST https://www.wixapis.com/stores/v1/products",
3
+ "code": 200,
4
+ "body": {
5
+ "product": {
6
+ "id": "4224c24b-5a58-4d14-8793-623e812fa377",
7
+ "name": "T-shirt",
8
+ "slug": "t-shirt",
9
+ "visible": false,
10
+ "productType": "physical",
11
+ "description": "nice summer t-shirt",
12
+ "weightRange": {
13
+ "minValue": 0,
14
+ "maxValue": 0.2
15
+ },
16
+ "stock": {
17
+ "trackInventory": false,
18
+ "inStock": true,
19
+ "inventoryStatus": "IN_STOCK"
20
+ },
21
+ "price": {
22
+ "currency": "USD",
23
+ "price": 10.5,
24
+ "discountedPrice": 9.5,
25
+ "formatted": {
26
+ "price": "$10.50",
27
+ "discountedPrice": "$9.50"
28
+ }
29
+ },
30
+ "priceData": {
31
+ "currency": "USD",
32
+ "price": 10.5,
33
+ "discountedPrice": 9.5,
34
+ "formatted": {
35
+ "price": "$10.50",
36
+ "discountedPrice": "$9.50"
37
+ }
38
+ },
39
+ "convertedPriceData": {
40
+ "currency": "USD",
41
+ "price": 10.5,
42
+ "discountedPrice": 9.5,
43
+ "formatted": {
44
+ "price": "$10.50",
45
+ "discountedPrice": "$9.50"
46
+ }
47
+ },
48
+ "priceRange": {
49
+ "minValue": 10.5,
50
+ "maxValue": 10.5
51
+ },
52
+ "costRange": {
53
+ "minValue": 0,
54
+ "maxValue": 7
55
+ },
56
+ "additionalInfoSections": [],
57
+ "ribbons": [
58
+ {
59
+ "text": "Sale"
60
+ }
61
+ ],
62
+ "media": {
63
+ "items": []
64
+ },
65
+ "customTextFields": [],
66
+ "manageVariants": true,
67
+ "productOptions": [
68
+ {
69
+ "optionType": "drop_down",
70
+ "name": "Size",
71
+ "choices": [
72
+ {
73
+ "value": "S",
74
+ "description": "S",
75
+ "inStock": true,
76
+ "visible": true
77
+ },
78
+ {
79
+ "value": "L",
80
+ "description": "L",
81
+ "inStock": true,
82
+ "visible": true
83
+ }
84
+ ]
85
+ }
86
+ ],
87
+ "productPageUrl": {
88
+ "base": "https://wixsite.com/examplestore",
89
+ "path": "/product-page/t-shirt"
90
+ },
91
+ "numericId": "1657626871550000",
92
+ "inventoryItemId": "bddb3db4-a5a7-b2eb-786c-9dc17ed05c88",
93
+ "discount": {
94
+ "type": "AMOUNT",
95
+ "value": 1
96
+ },
97
+ "collectionIds": [
98
+ "00000000-000000-000000-000000000001"
99
+ ],
100
+ "variants": [
101
+ {
102
+ "id": "05519a6e-222b-413a-957c-0ef7a32779b5",
103
+ "choices": {
104
+ "Size": "S"
105
+ },
106
+ "variant": {
107
+ "priceData": {
108
+ "currency": "USD",
109
+ "price": 10.5,
110
+ "discountedPrice": 9.5,
111
+ "formatted": {
112
+ "price": "$10.50",
113
+ "discountedPrice": "$9.50"
114
+ }
115
+ },
116
+ "convertedPriceData": {
117
+ "currency": "USD",
118
+ "price": 10.5,
119
+ "discountedPrice": 9.5,
120
+ "formatted": {
121
+ "price": "$10.50",
122
+ "discountedPrice": "$9.50"
123
+ }
124
+ },
125
+ "costAndProfitData": {
126
+ "itemCost": 7,
127
+ "formattedItemCost": "$7.00",
128
+ "profit": 2.5,
129
+ "formattedProfit": "$2.50",
130
+ "profitMargin": 0.2632
131
+ },
132
+ "weight": 0.2,
133
+ "sku": "123df",
134
+ "visible": false
135
+ }
136
+ },
137
+ {
138
+ "id": "0318a3d8-f31c-4ba3-98c7-387571a2eac4",
139
+ "choices": {
140
+ "Size": "L"
141
+ },
142
+ "variant": {
143
+ "priceData": {
144
+ "currency": "USD",
145
+ "price": 10.5,
146
+ "discountedPrice": 9.5,
147
+ "formatted": {
148
+ "price": "$10.50",
149
+ "discountedPrice": "$9.50"
150
+ }
151
+ },
152
+ "convertedPriceData": {
153
+ "currency": "USD",
154
+ "price": 10.5,
155
+ "discountedPrice": 9.5,
156
+ "formatted": {
157
+ "price": "$10.50",
158
+ "discountedPrice": "$9.50"
159
+ }
160
+ },
161
+ "costAndProfitData": {
162
+ "itemCost": 7,
163
+ "formattedItemCost": "$7.00",
164
+ "profit": 2.5,
165
+ "formattedProfit": "$2.50",
166
+ "profitMargin": 0.2632
167
+ },
168
+ "weight": 0.2,
169
+ "sku": "123df",
170
+ "visible": false
171
+ }
172
+ }
173
+ ],
174
+ "lastUpdated": "2022-07-12T11:54:31.550Z",
175
+ "createdDate": "2022-07-12T11:54:31.550Z",
176
+ "ribbon": "Sale",
177
+ "brand": "Nice"
178
+ }
179
+ }
180
+ }
@@ -0,0 +1,181 @@
1
+ {
2
+ "headers": {
3
+ "user": "TestUser"
4
+ },
5
+ "data": {
6
+ "product": {
7
+ "id": "4224c24b-5a58-4d14-8793-623e812fa377",
8
+ "name": "T-shirt",
9
+ "slug": "t-shirt",
10
+ "visible": false,
11
+ "productType": "physical",
12
+ "description": "nice summer t-shirt",
13
+ "weightRange": {
14
+ "minValue": 0,
15
+ "maxValue": 0.2
16
+ },
17
+ "stock": {
18
+ "trackInventory": false,
19
+ "inStock": true,
20
+ "inventoryStatus": "IN_STOCK"
21
+ },
22
+ "price": {
23
+ "currency": "USD",
24
+ "price": 10.5,
25
+ "discountedPrice": 9.5,
26
+ "formatted": {
27
+ "price": "$10.50",
28
+ "discountedPrice": "$9.50"
29
+ }
30
+ },
31
+ "priceData": {
32
+ "currency": "USD",
33
+ "price": 10.5,
34
+ "discountedPrice": 9.5,
35
+ "formatted": {
36
+ "price": "$10.50",
37
+ "discountedPrice": "$9.50"
38
+ }
39
+ },
40
+ "convertedPriceData": {
41
+ "currency": "USD",
42
+ "price": 10.5,
43
+ "discountedPrice": 9.5,
44
+ "formatted": {
45
+ "price": "$10.50",
46
+ "discountedPrice": "$9.50"
47
+ }
48
+ },
49
+ "priceRange": {
50
+ "minValue": 10.5,
51
+ "maxValue": 10.5
52
+ },
53
+ "costRange": {
54
+ "minValue": 0,
55
+ "maxValue": 7
56
+ },
57
+ "additionalInfoSections": [],
58
+ "ribbons": [
59
+ {
60
+ "text": "Sale"
61
+ }
62
+ ],
63
+ "media": {
64
+ "items": []
65
+ },
66
+ "customTextFields": [],
67
+ "manageVariants": true,
68
+ "productOptions": [
69
+ {
70
+ "optionType": "drop_down",
71
+ "name": "Size",
72
+ "choices": [
73
+ {
74
+ "value": "S",
75
+ "description": "S",
76
+ "inStock": true,
77
+ "visible": true
78
+ },
79
+ {
80
+ "value": "L",
81
+ "description": "L",
82
+ "inStock": true,
83
+ "visible": true
84
+ }
85
+ ]
86
+ }
87
+ ],
88
+ "productPageUrl": {
89
+ "base": "https://wixsite.com/examplestore",
90
+ "path": "/product-page/t-shirt"
91
+ },
92
+ "numericId": "1657626871550000",
93
+ "inventoryItemId": "bddb3db4-a5a7-b2eb-786c-9dc17ed05c88",
94
+ "discount": {
95
+ "type": "AMOUNT",
96
+ "value": 1
97
+ },
98
+ "collectionIds": [
99
+ "00000000-000000-000000-000000000001"
100
+ ],
101
+ "variants": [
102
+ {
103
+ "id": "05519a6e-222b-413a-957c-0ef7a32779b5",
104
+ "choices": {
105
+ "Size": "S"
106
+ },
107
+ "variant": {
108
+ "priceData": {
109
+ "currency": "USD",
110
+ "price": 10.5,
111
+ "discountedPrice": 9.5,
112
+ "formatted": {
113
+ "price": "$10.50",
114
+ "discountedPrice": "$9.50"
115
+ }
116
+ },
117
+ "convertedPriceData": {
118
+ "currency": "USD",
119
+ "price": 10.5,
120
+ "discountedPrice": 9.5,
121
+ "formatted": {
122
+ "price": "$10.50",
123
+ "discountedPrice": "$9.50"
124
+ }
125
+ },
126
+ "costAndProfitData": {
127
+ "itemCost": 7,
128
+ "formattedItemCost": "$7.00",
129
+ "profit": 2.5,
130
+ "formattedProfit": "$2.50",
131
+ "profitMargin": 0.2632
132
+ },
133
+ "weight": 0.2,
134
+ "sku": "123df",
135
+ "visible": false
136
+ }
137
+ },
138
+ {
139
+ "id": "0318a3d8-f31c-4ba3-98c7-387571a2eac4",
140
+ "choices": {
141
+ "Size": "L"
142
+ },
143
+ "variant": {
144
+ "priceData": {
145
+ "currency": "USD",
146
+ "price": 10.5,
147
+ "discountedPrice": 9.5,
148
+ "formatted": {
149
+ "price": "$10.50",
150
+ "discountedPrice": "$9.50"
151
+ }
152
+ },
153
+ "convertedPriceData": {
154
+ "currency": "USD",
155
+ "price": 10.5,
156
+ "discountedPrice": 9.5,
157
+ "formatted": {
158
+ "price": "$10.50",
159
+ "discountedPrice": "$9.50"
160
+ }
161
+ },
162
+ "costAndProfitData": {
163
+ "itemCost": 7,
164
+ "formattedItemCost": "$7.00",
165
+ "profit": 2.5,
166
+ "formattedProfit": "$2.50",
167
+ "profitMargin": 0.2632
168
+ },
169
+ "weight": 0.2,
170
+ "sku": "123df",
171
+ "visible": false
172
+ }
173
+ }
174
+ ],
175
+ "lastUpdated": "2022-07-12T11:54:31.550Z",
176
+ "createdDate": "2022-07-12T11:54:31.550Z",
177
+ "ribbon": "Sale",
178
+ "brand": "Nice"
179
+ }
180
+ }
181
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "headers": {
3
+ "user": "TestUser"
4
+ },
5
+ "data": {
6
+ "id": "id"
7
+ }
8
+ }