@orchesty/connector-wix 1.0.0 → 2.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 (50) hide show
  1. package/README.md +83 -0
  2. package/dist/package.json +5 -2
  3. package/package.json +5 -2
  4. package/CHANGELOG.md +0 -7
  5. package/coverage/clover.xml +0 -125
  6. package/coverage/coverage-final.json +0 -7
  7. package/coverage/lcov-report/base.css +0 -224
  8. package/coverage/lcov-report/block-navigation.js +0 -87
  9. package/coverage/lcov-report/favicon.png +0 -0
  10. package/coverage/lcov-report/index.html +0 -146
  11. package/coverage/lcov-report/prettify.css +0 -1
  12. package/coverage/lcov-report/prettify.js +0 -2
  13. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  14. package/coverage/lcov-report/sorter.js +0 -210
  15. package/coverage/lcov-report/src/Connector/WixCreateOrderConnector.ts.html +0 -679
  16. package/coverage/lcov-report/src/Connector/WixCreateProductConnector.ts.html +0 -781
  17. package/coverage/lcov-report/src/Connector/WixGetOrderConnector.ts.html +0 -493
  18. package/coverage/lcov-report/src/Connector/WixUpdateProductConnector.ts.html +0 -574
  19. package/coverage/lcov-report/src/Connector/index.html +0 -161
  20. package/coverage/lcov-report/src/WixApplication.ts.html +0 -334
  21. package/coverage/lcov-report/src/index.html +0 -116
  22. package/coverage/lcov-report/test/dataProvider.ts.html +0 -268
  23. package/coverage/lcov-report/test/index.html +0 -116
  24. package/coverage/lcov.info +0 -189
  25. package/jest.config.js +0 -13
  26. package/src/Connector/WixCreateOrderConnector.ts +0 -198
  27. package/src/Connector/WixCreateProductConnector.ts +0 -232
  28. package/src/Connector/WixGetOrderConnector.ts +0 -136
  29. package/src/Connector/WixUpdateProductConnector.ts +0 -163
  30. package/src/Connector/__tests__/Data/WixCreateOrderConnector/input.json +0 -74
  31. package/src/Connector/__tests__/Data/WixCreateOrderConnector/mock.json +0 -109
  32. package/src/Connector/__tests__/Data/WixCreateOrderConnector/output.json +0 -110
  33. package/src/Connector/__tests__/Data/WixCreateProductConnector/input.json +0 -43
  34. package/src/Connector/__tests__/Data/WixCreateProductConnector/mock.json +0 -180
  35. package/src/Connector/__tests__/Data/WixCreateProductConnector/output.json +0 -181
  36. package/src/Connector/__tests__/Data/WixGetOrderConnector/input.json +0 -8
  37. package/src/Connector/__tests__/Data/WixGetOrderConnector/mock.json +0 -113
  38. package/src/Connector/__tests__/Data/WixGetOrderConnector/output.json +0 -114
  39. package/src/Connector/__tests__/Data/WixUpdateProductConnector/input.json +0 -36
  40. package/src/Connector/__tests__/Data/WixUpdateProductConnector/mock.json +0 -115
  41. package/src/Connector/__tests__/Data/WixUpdateProductConnector/output.json +0 -117
  42. package/src/Connector/__tests__/WixCreateOrderConnector.ts +0 -17
  43. package/src/Connector/__tests__/WixCreateProductConnector.ts +0 -17
  44. package/src/Connector/__tests__/WixGetOrderConnector.ts +0 -17
  45. package/src/Connector/__tests__/WixUpdateProductConnector.ts +0 -17
  46. package/src/WixApplication.ts +0 -83
  47. package/test/dataProvider.ts +0 -61
  48. package/tsconfig.json +0 -8
  49. package/tsconfig.prod.json +0 -13
  50. package/tsconfig.prod.tsbuildinfo +0 -1
@@ -1,198 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
-
5
- export const NAME = 'wix-create-order-connector';
6
-
7
- export default class WixCreateOrderConnector extends AConnector {
8
-
9
- public getName(): string {
10
- return NAME;
11
- }
12
-
13
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>> {
14
- const appInstall = await this.getApplicationInstallFromProcess(dto);
15
- const req = await this.getApplication().getRequestDto(
16
- dto,
17
- appInstall,
18
- HttpMethods.POST,
19
- 'v2/orders',
20
- { data: dto.getJsonData() },
21
- );
22
- const resp = await this.getSender().send<IOutput>(req, [200]);
23
-
24
- return dto.setNewJsonData(resp.getJsonBody());
25
- }
26
-
27
- }
28
-
29
- export interface IOutput {
30
- order: {
31
- id: string;
32
- number: number;
33
- dateCreated: string;
34
- currency: string;
35
- weightUnit: string;
36
- totals: {
37
- subtotal: string;
38
- shipping: string;
39
- tax: string;
40
- discount: string;
41
- total: string;
42
- weight: string;
43
- quantity: number;
44
- };
45
- billingInfo: {
46
- paymentMethod: string;
47
- externalTransactionId: string;
48
- paymentProviderTransactionId: string;
49
- address: {
50
- fullName: {
51
- firstName: string;
52
- lastName: string;
53
- };
54
- country: string;
55
- city: string;
56
- zipCode: string;
57
- phone: string;
58
- email: string;
59
- };
60
- paidDate: string;
61
- };
62
- shippingInfo: {
63
- deliveryOption: string;
64
- estimatedDeliveryTime: string;
65
- shipmentDetails: {
66
- address: {
67
- fullName: {
68
- firstName: string;
69
- lastName: string;
70
- };
71
- country: string;
72
- city: string;
73
- zipCode: string;
74
- phone: string;
75
- email: string;
76
- };
77
- discount: string;
78
- tax: string;
79
- priceData: {
80
- taxIncludedInPrice: boolean;
81
- price: string;
82
- };
83
- };
84
- };
85
- read: boolean;
86
- archived: boolean;
87
- paymentStatus: string;
88
- fulfillmentStatus: string;
89
- lineItems: [{
90
- index: number;
91
- quantity: number;
92
- name: string;
93
- productId: string;
94
- lineItemType: string;
95
- options: [];
96
- customTextFields: [];
97
- weight: string;
98
- sku: string;
99
- discount: string;
100
- tax: string;
101
- priceData: {
102
- taxIncludedInPrice: boolean;
103
- price: string;
104
- totalPrice: string;
105
- };
106
- }];
107
- activities: [
108
- {
109
- type: string;
110
- timestamp: string;
111
- },
112
- {
113
- type: string;
114
- timestamp: string;
115
- },
116
- ];
117
- fulfillments: [];
118
- discount: { value: string };
119
- buyerLanguage: string;
120
- channelInfo: { type: string };
121
- enteredBy: {
122
- id: string;
123
- identityType: string;
124
- };
125
- lastUpdated: string;
126
- };
127
- }
128
-
129
- export interface IInput {
130
-
131
- order: {
132
- totals: {
133
- subtotal: string;
134
- shipping: string;
135
- tax: string;
136
- discount: string;
137
- total: string;
138
- };
139
- billingInfo: {
140
- paymentMethod: string;
141
- paymentProviderTransactionId: string;
142
- address: {
143
- fullName: {
144
- firstName: string;
145
- lastName: string;
146
- };
147
- country: string;
148
- city: string;
149
- zipCode: string;
150
- phone: string;
151
- email: string;
152
- };
153
- };
154
- shippingInfo: {
155
- deliveryOption: string;
156
- estimatedDeliveryTime: string;
157
- shippingRegion: string;
158
- shipmentDetails: {
159
- address: {
160
- fullName: {
161
- firstName: string;
162
- lastName: string;
163
- };
164
- country: string;
165
- city: string;
166
- zipCode: string;
167
- phone: string;
168
- email: string;
169
- };
170
- tax: string;
171
- priceData: {
172
- taxIncludedInPrice: boolean;
173
- price: string;
174
- };
175
- };
176
- };
177
- paymentStatus: string;
178
- lineItems: [
179
- {
180
- quantity: number;
181
- discount: string;
182
- tax: string;
183
- name: string;
184
- productId: string;
185
- lineItemType: string;
186
- weight: string;
187
- sku: string;
188
- priceData: {
189
- taxIncludedInPrice: boolean;
190
- price: string;
191
- };
192
- },
193
- ];
194
- channelInfo: {
195
- type: string;
196
- };
197
- };
198
- }
@@ -1,232 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
-
5
- export const NAME = 'wix-create-product-connector';
6
-
7
- export default class WixCreateProductConnector extends AConnector {
8
-
9
- public getName(): string {
10
- return NAME;
11
- }
12
-
13
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>> {
14
- const appInstall = await this.getApplicationInstallFromProcess(dto);
15
- const req = await this.getApplication().getRequestDto(
16
- dto,
17
- appInstall,
18
- HttpMethods.POST,
19
- 'v1/products',
20
- { data: dto.getJsonData() },
21
- );
22
- const resp = await this.getSender().send<IOutput>(req, [200]);
23
-
24
- return dto.setNewJsonData(resp.getJsonBody());
25
- }
26
-
27
- }
28
-
29
- /* eslint-disable @typescript-eslint/naming-convention */
30
- export interface IInput {
31
- product: {
32
- name: string;
33
- productType: string;
34
- priceData: {
35
- price: number;
36
- };
37
- costAndProfitData: {
38
- itemCost: number;
39
- };
40
- description: string;
41
- sku: string;
42
- visible: boolean;
43
- ribbon: string;
44
- brand: string;
45
- weight: number;
46
- discount: {
47
- type: string;
48
- value: number;
49
- };
50
- manageVariants: boolean;
51
- productOptions: [
52
- {
53
- name: string;
54
- choices: [
55
- {
56
- value: string;
57
- description: string;
58
- },
59
- {
60
- value: string;
61
- description: string;
62
- },
63
- ];
64
- },
65
- ];
66
- };
67
- }
68
-
69
- export interface IOutput {
70
- product: {
71
- id: string;
72
- name: string;
73
- slug: string;
74
- visible: boolean;
75
- productType: string;
76
- description: string;
77
- weightRange: {
78
- minValue: number;
79
- maxValue: number;
80
- };
81
- stock: {
82
- trackInventory: boolean;
83
- inStock: boolean;
84
- inventoryStatus: string;
85
- };
86
- price: {
87
- currency: string;
88
- price: number;
89
- discountedPrice: number;
90
- formatted: {
91
- price: string;
92
- discountedPrice: string;
93
- };
94
- };
95
- priceData: {
96
- currency: string;
97
- price: number;
98
- discountedPrice: number;
99
- formatted: {
100
- price: string;
101
- discountedPrice: string;
102
- };
103
- };
104
- convertedPriceData: {
105
- currency: string;
106
- price: number;
107
- discountedPrice: number;
108
- formatted: {
109
- price: string;
110
- discountedPrice: string;
111
- };
112
- };
113
- priceRange: {
114
- minValue: number;
115
- maxValue: number;
116
- };
117
- costRange: {
118
- minValue: number;
119
- maxValue: number;
120
- };
121
- additionalInfoSections: [];
122
- ribbons: { text: string }[];
123
- media: { items: [] };
124
- customTextFields: [];
125
- manageVariants: boolean;
126
- productOptions: [{
127
- optionType: string;
128
- name: string;
129
- choices: [
130
- {
131
- value: string;
132
- description: string;
133
- inStock: boolean;
134
- visible: boolean;
135
- },
136
- {
137
- value: string;
138
- description: string;
139
- inStock: boolean;
140
- visible: boolean;
141
- },
142
- ];
143
- }];
144
- productPageUrl: {
145
- base: string;
146
- path: string;
147
- };
148
- numericId: string;
149
- inventoryItemId: string;
150
- discount: {
151
- type: string;
152
- value: number;
153
- };
154
- collectionIds: string[];
155
- variants: [
156
- {
157
- id: string;
158
- choices: { Size: string };
159
- variant: {
160
- priceData: {
161
- currency: string;
162
- price: number;
163
- discountedPrice: number;
164
- formatted: {
165
- price: string;
166
- discountedPrice: string;
167
- };
168
- };
169
- convertedPriceData: {
170
- currency: string;
171
- price: number;
172
- discountedPrice: number;
173
- formatted: {
174
- price: string;
175
- discountedPrice: string;
176
- };
177
- };
178
- costAndProfitData: {
179
- itemCost: number;
180
- formattedItemCost: string;
181
- profit: number;
182
- formattedProfit: string;
183
- profitMargin: number;
184
- };
185
- weight: number;
186
- sku: string;
187
- visible: boolean;
188
- };
189
- },
190
- {
191
- id: string;
192
- choices: { Size: string };
193
- variant: {
194
- priceData: {
195
- currency: string;
196
- price: number;
197
- discountedPrice: number;
198
- formatted: {
199
- price: string;
200
- discountedPrice: string;
201
- };
202
- };
203
- convertedPriceData: {
204
- currency: string;
205
- price: number;
206
- discountedPrice: number;
207
- formatted: {
208
- price: string;
209
- discountedPrice: string;
210
- };
211
- };
212
- costAndProfitData: {
213
- itemCost: number;
214
- formattedItemCost: string;
215
- profit: number;
216
- formattedProfit: string;
217
- profitMargin: number;
218
- };
219
- weight: number;
220
- sku: string;
221
- visible: boolean;
222
- };
223
- },
224
- ];
225
- lastUpdated: string;
226
- createdDate: string;
227
- ribbon: string;
228
- brand: string;
229
- };
230
- }
231
-
232
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,136 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
-
5
- export const NAME = 'wix-get-order-connector';
6
-
7
- export default class WixGetOrderConnector extends AConnector {
8
-
9
- public getName(): string {
10
- return NAME;
11
- }
12
-
13
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>> {
14
- const { id } = dto.getJsonData();
15
-
16
- const appInstall = await this.getApplicationInstallFromProcess(dto);
17
- const req = await this.getApplication().getRequestDto(
18
- dto,
19
- appInstall,
20
- HttpMethods.GET,
21
- `v2/orders/${id}`,
22
- );
23
- const resp = await this.getSender().send<IOutput>(req, [200]);
24
-
25
- return dto.setNewJsonData(resp.getJsonBody());
26
- }
27
-
28
- }
29
-
30
- export interface IInput {
31
- id: string;
32
- }
33
-
34
- export interface IOutput {
35
- order: {
36
- id: string;
37
- number: number;
38
- dateCreated: string;
39
- currency: string;
40
- weightUnit: string;
41
- totals: {
42
- subtotal: string;
43
- shipping: string;
44
- tax: string;
45
- discount: string;
46
- total: string;
47
- weight: string;
48
- quantity: number;
49
- };
50
- billingInfo: {
51
- paymentMethod: string;
52
- externalTransactionId: string;
53
- paymentProviderTransactionId: string;
54
- address: {
55
- fullName: {
56
- firstName: string;
57
- lastName: string;
58
- };
59
- country: string;
60
- city: string;
61
- zipCode: string;
62
- phone: string;
63
- email: string;
64
- };
65
- paidDate: string;
66
- };
67
- shippingInfo: {
68
- deliveryOption: string;
69
- shippingRegion: string;
70
- estimatedDeliveryTime: string;
71
- shipmentDetails: {
72
- address: {
73
- fullName: {
74
- firstName: string;
75
- lastName: string;
76
- };
77
- country: string;
78
- city: string;
79
- zipCode: string;
80
- phone: string;
81
- email: string;
82
- };
83
- discount: string;
84
- tax: string;
85
- priceData: {
86
- taxIncludedInPrice: boolean;
87
- price: string;
88
- };
89
- };
90
- };
91
- read: boolean;
92
- archived: boolean;
93
- paymentStatus: string;
94
- fulfillmentStatus: string;
95
- lineItems: [{
96
- index: number;
97
- quantity: number;
98
- price: string;
99
- name: string;
100
- productId: string;
101
- totalPrice: string;
102
- lineItemType: string;
103
- options: [];
104
- customTextFields: [];
105
- weight: string;
106
- sku: string;
107
- discount: string;
108
- tax: string;
109
- taxIncludedInPrice: boolean;
110
- priceData: {
111
- taxIncludedInPrice: boolean;
112
- price: string;
113
- totalPrice: string;
114
- };
115
- }];
116
- activities: [
117
- {
118
- type: string;
119
- timestamp: string;
120
- },
121
- {
122
- type: string;
123
- timestamp: string;
124
- },
125
- ];
126
- fulfillments: [];
127
- discount: { value: string };
128
- buyerLanguage: string;
129
- channelInfo: { type: string };
130
- enteredBy: {
131
- id: string;
132
- identityType: string;
133
- };
134
- lastUpdated: string;
135
- };
136
- }