This repository has been archived by the owner on Jun 2, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
279 lines (268 loc) · 15.2 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
NODE-BIN = ./node_modules/.bin
TMP = ./.tmp
DIST = ./dist
TEST = ./test
WSDLS = ./wsdls
TRANSFORMED = $(TMP)/transformed
XSL = ./xsl
SCRIPTS = ./scripts
all: test
clean:
@rm -rf $(DIST)
@rm -rf $(TMP)
lint:
@$(NODE-BIN)/jshint $(TEST)/*.js $(SCRIPTS)/*.js
test: lint clean
@saxonb-xslt \
-ext:on \
-s:$(TEST)/fixtures/downloads/FindingAPI/api.xml \
-xsl:$(XSL)/sdk.xsl \
service=FindingAPI \
destDirectory=$(TRANSFORMED)/FindingAPI/
@saxonb-xslt -ext:on \
-s:$(TEST)/fixtures/downloads/MerchantAPI/api.xml \
-xsl:$(XSL)/sdk.xsl \
service=MerchantAPI \
destDirectory=$(TRANSFORMED)/MerchantAPI/
@saxonb-xslt -ext:on \
-s:$(TEST)/fixtures/downloads/RestAPI/api.xml \
-xsl:$(XSL)/restSdk.xsl \
service=RestAPI \
destDirectory=$(TRANSFORMED)/RestAPI/
@$(NODE-BIN)/nodeunit $(TEST)/*_test.js
create_wsdls:
@node $(SCRIPTS)/create_rest_wsdls.js
download_wsdls:
@cd $(WSDLS) && cat ../services | xargs -n 1 curl -sO
@sed -i -e "s/<tns:version>.*<\/tns:version>//" $(WSDLS)/ProductService.wsdl
@sed -i -e "s/<version>.*<\/version>/<ver\/>/" $(WSDLS)/ProductMetadataService.wsdl
@sed -i -e "s/\t\t\t\t<Version>.*<\/Version>/\t\t\t\t<ver\/>/" $(WSDLS)/ProductMetadataService.wsdl
@sed -i -e "s/<xs:element name=\"getCompatibilitySearchNamesResponse\" type=\"tns:GetProductSearchNamesResponse\"\/>/<xs:element name=\"getCompatibilitySearchNamesResponse\" type=\"tns:GetCompatibilitySearchNamesResponse\"\/>/" $(WSDLS)/ProductMetadataService.wsdl
@sed -i -e "s/<xs:element name=\"getCompatibilitySearchValuesRequest\" type=\"tns:GetProductSearchValuesRequest\"\/>/<xs:element name=\"getCompatibilitySearchValuesRequest\" type=\"tns:GetCompatibilitySearchValuesRequest\"\/>/" $(WSDLS)/ProductMetadataService.wsdl
@sed -i -e "s/<xs:element name=\"getCompatibilitySearchValuesResponse\" type=\"tns:GetProductSearchValuesResponse\"\/>/<xs:element name=\"getCompatibilitySearchValuesResponse\" type=\"tns:GetCompatibilitySearchValuesResponse\"\/>/" $(WSDLS)/ProductMetadataService.wsdl
@sed -i -e "s/<xs:element name=\"getCompatibilitySearchValuesBulkRequest\" type=\"tns:GetProductSearchValuesBulkRequest\"\/>/<xs:element name=\"getCompatibilitySearchValuesBulkRequest\" type=\"tns:GetCompatibilitySearchValuesBulkRequest\"\/>/" $(WSDLS)/ProductMetadataService.wsdl
@sed -i -e "s/<xs:element name=\"getCompatibilitySearchDataVersionRequest\" type=\"tns:GetProductSearchDataVersionRequest\"\/>/<xs:element name=\"getCompatibilitySearchDataVersionRequest\" type=\"tns:GetCompatibilitySearchDataVersionRequest\"\/>/" $(WSDLS)/ProductMetadataService.wsdl
@sed -i -e "s/<xs:element name=\"getCompatibilitySearchDataVersionResponse\" type=\"tns:GetProductSearchDataVersionResponse\"\/>/<xs:element name=\"getCompatibilitySearchDataVersionResponse\" type=\"tns:GetCompatibilitySearchDataVersionResponse\"\/>/" $(WSDLS)/ProductMetadataService.wsdl
@sed -i -e "5036,5051 s/.*//" $(WSDLS)/ResolutionCaseManagementService.wsdl
@sed -i -e "5067,5083 s/.*//" $(WSDLS)/ResolutionCaseManagementService.wsdl
@sed -i -e "s/<\/xs:schema>/<xs:complexType name=\"appealRef\"><xs:attribute name=\"idref\" type=\"xs:string\"\/><\/xs:complexType><xs:complexType name=\"moneyMovementRef\"><xs:attribute name=\"idref\" type=\"xs:string\"\/><\/xs:complexType><\/xs:schema>/" $(WSDLS)/ResolutionCaseManagementService.wsdl
@echo "BulkDataExchange : `sed -rn 's/.*<version>(.*)<\/version>/\1/p' $(WSDLS)/BulkDataExchangeService.wsdl`"
@echo "BusinessPoliciesManagement : `sed -rn 's/.*<version>(.*)<\/version>/\1/p' $(WSDLS)/SellerProfilesManagementService.wsdl`"
@echo "Feedback : `sed -rn 's/.*<Version>(.*)<\/Version>/\1/p' $(WSDLS)/FeedbackService.wsdl`"
@echo "FileTransfer : `sed -rn 's/.*<Version>(.*)<\/Version>/\1/p' $(WSDLS)/FileTransferService.wsdl`"
@echo "Finding : `sed -rn 's/.*<Version>(.*)<\/Version>/\1/p' $(WSDLS)/FindingService.wsdl`"
@echo "HalfFinding : `sed -rn 's/.*<Version>(.*)<\/Version>/\1/p' $(WSDLS)/HalfFindingService.wsdl`"
@echo "Merchandising : `sed -rn 's/.*<Version>(.*)<\/Version>/\1/p' $(WSDLS)/MerchandisingService.wsdl`"
@echo "MerchantData : `sed -rn 's/<!-- Version ([[:digit:]]{3}).*/\1/p' $(WSDLS)/merchantdataservice.xsd`"
@echo "Product : `sed -rn 's/.*<Version>(.*)<\/Version>/\1/p' $(WSDLS)/ProductService.wsdl`"
@echo "ProductMetadata : `sed -rn 's/.*<Version>(.*)<\/Version>/\1/p' $(WSDLS)/ProductMetadataService.wsdl`"
@echo "Related Items Management : `sed -rn 's/.*<Version>(.*)<\/Version>/\1/p' $(WSDLS)/BundleManagementService.wsdl`"
@echo "Resolution Case Management : `sed -rn 's/.*<version>(.*)<\/version>/\1/p' $(WSDLS)/ResolutionCaseManagementService.wsdl`"
@echo "Return Management : `sed -rn 's/.*<version>(.*)<\/version>/\1/p' $(WSDLS)/ReturnManagementService.wsdl`"
@echo "Shopping : `sed -rn 's/.*<Version>(.*)<\/Version>/\1/p' $(WSDLS)/ShoppingService.wsdl`"
@echo "Trading : `sed -rn 's/.*<Version>(.*)<\/Version>/\1/p' $(WSDLS)/ebaySvc.wsdl`"
patch_wsdls:
@sed -i -e 's/<xs:element name="aspects" type="xs:string" maxOccurs="unbounded"\/>/<xs:element name="aspects" type="xs:any"\/>/g' $(WSDLS)/Inventory.wsdl
@sed -i -e 's/standardslevel/standardsLevel/g' $(WSDLS)/Analytics.wsdl
transform:
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Account.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Account \
destDirectory=$(TRANSFORMED)/Account/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Analytics.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Analytics \
destDirectory=$(TRANSFORMED)/Analytics/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/BulkDataExchangeService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=BulkDataExchange \
destDirectory=$(TRANSFORMED)/BulkDataExchange/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Browse.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Browse \
destDirectory=$(TRANSFORMED)/Browse/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Catalog.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Catalog \
destDirectory=$(TRANSFORMED)/Catalog/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Compliance.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Compliance \
destDirectory=$(TRANSFORMED)/Compliance/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/SellerProfilesManagementService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=BusinessPoliciesManagement \
destDirectory=$(TRANSFORMED)/BusinessPoliciesManagement/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Feed.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Feed \
destDirectory=$(TRANSFORMED)/Feed/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/FeedbackService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=Feedback \
destDirectory=$(TRANSFORMED)/Feedback/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/FileTransferService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=FileTransfer \
destDirectory=$(TRANSFORMED)/FileTransfer/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/FindingService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=Finding \
destDirectory=$(TRANSFORMED)/Finding/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Fulfillment.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Fulfillment \
destDirectory=$(TRANSFORMED)/Fulfillment/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/HalfFindingService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=HalfFinding \
destDirectory=$(TRANSFORMED)/HalfFinding/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Inventory.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Inventory \
destDirectory=$(TRANSFORMED)/Inventory/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Marketing.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Marketing \
destDirectory=$(TRANSFORMED)/Marketing/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/MerchandisingService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=Merchandising \
destDirectory=$(TRANSFORMED)/Merchandising/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/merchantdataservice.xsd \
-xsl:$(XSL)/sdk.xsl \
service=MerchantData \
destDirectory=$(TRANSFORMED)/MerchantData/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Metadata.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Metadata \
destDirectory=$(TRANSFORMED)/Metadata/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Order.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Order \
destDirectory=$(TRANSFORMED)/Order/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/Taxonomy.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=Taxonomy \
destDirectory=$(TRANSFORMED)/Taxonomy/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/PostOrder.wsdl \
-xsl:$(XSL)/restSdk.xsl \
service=PostOrder \
destDirectory=$(TRANSFORMED)/PostOrder/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/ProductService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=Product \
destDirectory=$(TRANSFORMED)/Product/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/ProductMetadataService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=ProductMetadata \
destDirectory=$(TRANSFORMED)/ProductMetadata/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/BundleManagementService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=RelatedItemsManagement \
destDirectory=$(TRANSFORMED)/RelatedItemsManagement/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/ResolutionCaseManagementService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=ResolutionCaseManagement \
destDirectory=$(TRANSFORMED)/ResolutionCaseManagement/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/ReturnManagementService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=ReturnManagement \
destDirectory=$(TRANSFORMED)/ReturnManagement/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/ShoppingService.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=Shopping \
destDirectory=$(TRANSFORMED)/Shopping/
@saxonb-xslt \
-ext:on \
-s:$(WSDLS)/ebaySvc.wsdl \
-xsl:$(XSL)/sdk.xsl \
service=Trading \
destDirectory=$(TRANSFORMED)/Trading/
@cp $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetProductSearchNamesResponse.php $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchNamesResponse.php
@sed -i -e "s/ProductSearchNamesResponse/CompatibilitySearchNamesResponse/" $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchNamesResponse.php
@cp $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetProductSearchNamesResponseTest.php $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchNamesResponseTest.php
@sed -i -e "s/ProductSearchNamesResponse/CompatibilitySearchNamesResponse/" $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchNamesResponseTest.php
@cp $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetProductSearchValuesRequest.php $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchValuesRequest.php
@sed -i -e "s/ProductSearchValuesRequest/CompatibilitySearchValuesRequest/" $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchValuesRequest.php
@cp $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetProductSearchValuesRequestTest.php $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchValuesRequestTest.php
@sed -i -e "s/ProductSearchValuesRequest/CompatibilitySearchValuesRequest/" $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchValuesRequestTest.php
@cp $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetProductSearchValuesResponse.php $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchValuesResponse.php
@sed -i -e "s/ProductSearchValuesResponse/CompatibilitySearchValuesResponse/" $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchValuesResponse.php
@cp $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetProductSearchValuesResponseTest.php $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchValuesResponseTest.php
@sed -i -e "s/ProductSearchValuesResponse/CompatibilitySearchValuesResponse/" $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchValuesResponseTest.php
@cp $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetProductSearchValuesBulkRequest.php $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchValuesBulkRequest.php
@sed -i -e "s/ProductSearchValuesBulkRequest/CompatibilitySearchValuesBulkRequest/" $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchValuesBulkRequest.php
@cp $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetProductSearchValuesBulkRequestTest.php $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchValuesBulkRequestTest.php
@sed -i -e "s/ProductSearchValuesBulkRequest/CompatibilitySearchValuesBulkRequest/" $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchValuesBulkRequestTest.php
@cp $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetProductSearchDataVersionRequest.php $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchDataVersionRequest.php
@sed -i -e "s/ProductSearchDataVersionRequest/CompatibilitySearchDataVersionRequest/" $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchDataVersionRequest.php
@cp $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetProductSearchDataVersionRequestTest.php $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchDataVersionRequestTest.php
@sed -i -e "s/ProductSearchDataVersionRequest/CompatibilitySearchDataVersionRequest/" $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchDataVersionRequestTest.php
@cp $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetProductSearchDataVersionResponse.php $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchDataVersionResponse.php
@sed -i -e "s/ProductSearchDataVersionResponse/CompatibilitySearchDataVersionResponse/" $(TRANSFORMED)/ProductMetadata/src/ProductMetadata/Types/GetCompatibilitySearchDataVersionResponse.php
@cp $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetProductSearchDataVersionResponseTest.php $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchDataVersionResponseTest.php
@sed -i -e "s/ProductSearchDataVersionResponse/CompatibilitySearchDataVersionResponse/" $(TRANSFORMED)/ProductMetadata/test/ProductMetadata/Types/GetCompatibilitySearchDataVersionResponseTest.php
wsdls: clean \
download_wsdls \
create_wsdls \
patch_wsdls
@find $(WSDLS) -type f -exec xmllint --format {} --output {} \;
build: clean \
transform
@cp -r $(TRANSFORMED) $(DIST)
.PHONY: test wsdls