Skip to content

Commit d2bb550

Browse files
committed
2.0.0
1 parent c962666 commit d2bb550

File tree

578 files changed

+65957
-9912
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

578 files changed

+65957
-9912
lines changed

CHANGELOG

+162
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,165 @@
1+
v2.0.0
2+
- Minimum Merchant version required is now 10.x. For 9.x use the 1.x release.
3+
- MMAPI-25 - Added the follwing API functions introduced in Miva Merchant 10.01.00:
4+
Attribute_Delete
5+
Attribute_Insert
6+
Attribute_Load_Code
7+
Attribute_Update
8+
AttributeAndOptionList_Load_Product
9+
AttributeTemplate_Delete
10+
AttributeTemplate_Insert
11+
AttributeTemplate_Update
12+
AttributeTemplateAttribute_Delete
13+
AttributeTemplateAttribute_Insert
14+
AttributeTemplateAttribute_Update
15+
AttributeTemplateAttributeList_Load_Query
16+
AttributeTemplateList_Load_Query
17+
AttributeTemplateOption_Delete
18+
AttributeTemplateOption_Insert
19+
AttributeTemplateOption_Set_Default
20+
AttributeTemplateOption_Update
21+
AttributeTemplateOptionList_Load_Attribute
22+
AttributeTemplateProduct_Update_Assigned
23+
AttributeTemplateProductList_Load_Query
24+
AvailabilityGroup_Delete
25+
AvailabilityGroup_Insert
26+
AvailabilityGroup_Update
27+
AvailabilityGroupBusinessAccountList_Load_Query
28+
AvailabilityGroupCategory_Update_Assigned
29+
AvailabilityGroupCategoryList_Load_Query
30+
AvailabilityGroupCustomerList_Load_Query
31+
AvailabilityGroupProductList_Load_Query
32+
AvailabilityGroupShippingMethodList_Load_Query
33+
Branch_SetPrimary
34+
Branch_Update
35+
BusinessAccount_Insert
36+
BusinessAccount_Update
37+
BusinessAccountCustomer_Update_Assigned
38+
BusinessAccountCustomerList_Load_Query
39+
BusinessAccountList_Delete
40+
BusinessAccountList_Load_Query
41+
CategoryURI_Insert
42+
CategoryURI_Redirect
43+
CategoryURI_Update
44+
CategoryURIList_Delete
45+
CategoryURIList_Load_Query
46+
ChildCategoryList_Load_Query
47+
CouponCustomer_Update_Assigned
48+
CouponCustomerList_Load_Query
49+
CustomerAddress_Delete
50+
CustomerAddress_Insert
51+
CustomerAddress_Update
52+
CustomerAddress_Update_Residential
53+
CustomerAddressList_Delete
54+
FeedURI_Insert
55+
FeedURI_Update
56+
FeedURIList_Delete
57+
FeedURIList_Load_Query
58+
ImageTypeList_Load_Query
59+
InventoryProductSettings_Update
60+
Option_Delete
61+
Option_Insert
62+
Option_Load_Code
63+
Option_Set_Default
64+
Option_Update
65+
OptionList_Load_Attribute
66+
OrderItem_Split
67+
OrderItemList_RemoveFromShipment
68+
OrderShipmentList_Load_Query
69+
PageURI_Insert
70+
PageURI_Redirect
71+
PageURI_Update
72+
PageURIList_Delete
73+
PageURIList_Load_Query
74+
PriceGroup_Delete
75+
PriceGroup_Insert
76+
PriceGroup_Update
77+
PriceGroupBusinessAccount_Update_Assigned
78+
PriceGroupBusinessAccountList_Load_Query
79+
PriceGroupCategory_Update_Assigned
80+
PriceGroupCategoryList_Load_Query
81+
PriceGroupExcludedCategory_Update_Assigned
82+
PriceGroupExcludedCategoryList_Load_Query
83+
PriceGroupExcludedProduct_Update_Assigned
84+
PriceGroupExcludedProductList_Load_Query
85+
PriceGroupQualifyingProduct_Update_Assigned
86+
PriceGroupQualifyingProductList_Load_Query
87+
ProductImage_Update_Type
88+
ProductKit_Generate_Variants
89+
ProductKit_Update_Parts
90+
ProductKit_Variant_Count
91+
ProductKitList_Load_Query
92+
ProductURI_Insert
93+
ProductURI_Redirect
94+
ProductURI_Update
95+
ProductURIList_Delete
96+
ProductURIList_Load_Query
97+
ProductVariant_Generate
98+
ProductVariant_Generate_Delimiter
99+
ProductVariant_Insert
100+
ProductVariant_Update
101+
ProductVariantList_Delete
102+
ProductVariantList_Load_Query
103+
RelatedProduct_Update_Assigned
104+
RelatedProductList_Load_Query
105+
Store_Load
106+
StoreList_Load_Query
107+
URI_Delete
108+
URI_Insert
109+
URI_Update
110+
URIList_Delete
111+
URIList_Load_Query
112+
- Added the following API functions introduced in 10.00.00:
113+
Branch_Copy
114+
Branch_Create
115+
Branch_Delete
116+
BranchCSSResourceVersionList_Load_Query
117+
BranchJavaScriptResourceVersionList_Load_Query
118+
BranchList_Load_Query
119+
BranchPropertyVersionList_Load_Query
120+
BranchTemplateVersionList_Load_Query
121+
Changeset_Create
122+
ChangesetChangeList_Load_Query
123+
ChangesetCSSResourceVersionList_Load_Query
124+
ChangesetJavaScriptResourceVersionList_Load_Query
125+
ChangesetList_Load_Query
126+
ChangesetList_Merge
127+
ChangesetPropertyVersionList_Load_Query
128+
ChangesetTemplateVersionList_Load_Query
129+
CustomerCreditHistory_Delete
130+
CustomerCreditHistory_Insert
131+
CustomerCreditHistoryList_Load_Query
132+
MivaMerchantVersion
133+
OrderCoupon_Update_Assigned
134+
OrderCouponList_Load_Query
135+
OrderItemList_CreateReturn
136+
OrderPriceGroup_Update_Assigned
137+
OrderPriceGroupList_Load_Query
138+
OrderReturnList_Received
139+
ResourceGroupList_Load_Query
140+
- OrderItemOption model no longer has the attribute property. It has been renamed to attribute_code.
141+
- Removed fields from OrderItemOption model:
142+
- attribute (now use attribute_code)
143+
- New fields on OrderItemOption model:
144+
- attribute_id (attr_code)
145+
- attribute_code (attr_id)
146+
- attribute_template_attribute_id (attmpat_id)
147+
- New client option `operation_timeout` allows the control of the timeout for multicall operations
148+
- New MultiCallRequest option, auto_timeout_continue
149+
- All Request objects can now set header data in the underlying request with `Request::processRequestHeaders`
150+
- All Response objects now include the underlying HTTP Response object
151+
- Other Bugs Fixed:
152+
- Fixed an issue where MultiCallRequest instances were serializing the same function name for all requests
153+
- New Request option, binaryEncoding allows specifying the exchange of binary information for supported requests.
154+
- Client now supports logging. See Client.setLogger()
155+
- MMAPI-6 - All date time fields now support native Date object
156+
- Client now accept an optional URLSession argument, defaults to its own internal session
157+
- Added support for SSH Private Key authentication
158+
- See SSHClient
159+
- See Examples/SSHClientExample.swift
160+
- Added support for SSH Private Key authentication via a local SSH Agent (allows for authentication via security keys)
161+
- See SSHAgentClient
162+
- See Examples/SSHAgentClientExample.swift
1163
v1.1.0
2164
- Added support for PriceGroupCustomer_ListLoad_Query
3165
- Fixed base64 decoding issues when no padding exists

Examples/CallingModuleApiFunctionsExample.swift

+6-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
*
44
* For the full copyright and license information, please view the LICENSE
55
* file that was distributed with this source code.
6-
*
7-
* $Id: CallingModuleApiFunctionsExample.swift 73830 2019-03-05 23:40:40Z gidriss $
86
*/
97

108
import MerchantAPI
@@ -47,9 +45,14 @@ try request.send() { response, error in
4745
/// Handle Error
4846
return
4947
}
50-
48+
5149
if (!response.isSuccess()) {
5250
print(String(format: "Error: %@: %@", response.getErrorCode(), response.getErrorMessage()))
51+
52+
// accessing the data from the module response can be done by iterating through a VariableValue instance
53+
if let moduleResponseData = response.getData() {
54+
// iterate over the value
55+
}
5356
} else {
5457
print("Success");
5558
}

Examples/ClientExample.swift

+15-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
*
44
* For the full copyright and license information, please view the LICENSE
55
* file that was distributed with this source code.
6-
*
7-
* $Id: ClientExample.swift 73172 2019-02-01 22:05:55Z gidriss $
86
*/
97

108
import MerchantAPI
@@ -18,3 +16,18 @@ let client = Client(
1816
requireTimestamps: true,
1917
defaultStoreCode : "STORE_CODE"
2018
)
19+
20+
/// Request Logging can be enabled by assigning a Logger instance to the client
21+
22+
/// Currently, we provide two logger types:
23+
// FileLogger - logs to a local file
24+
// ConsoleLogger - logs to std out/err
25+
26+
// Setting up a FileLogger
27+
client.setLogger(ConsoleLogger(filePath: "/path/to/my/logfile.log"))
28+
29+
// Setting up a ConsoleLogger to log to stdout
30+
client.setLogger(ConsoleLogger(destination: ConsoleLogger.OutputDestination.StdOut))
31+
32+
// Setting up a ConsoleLogger to log to stderr
33+
client.setLogger(ConsoleLogger(destination: ConsoleLogger.OutputDestination.StdErr))

Examples/CreateProductExample.swift

+5-7
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,18 @@
33
*
44
* For the full copyright and license information, please view the LICENSE
55
* file that was distributed with this source code.
6-
*
7-
* $Id: CreateProductExample.swift 73830 2019-03-05 23:40:40Z gidriss $
86
*/
97

108
import MerchantAPI
119

1210
/* Initialize a client */
1311
let client = Client(
14-
url : "https://www.mystore.com/mm5/json.mvc",
15-
apiToken : "MY_API_TOKEN",
16-
signingKey : "MY_SIGNING_KEY",
12+
url : "https://www.mystore.com/mm5/json.mvc",
13+
apiToken : "MY_API_TOKEN",
14+
signingKey : "MY_SIGNING_KEY",
1715
signingType : MerchantAPI.ClientSignType.SHA256,
18-
requireTimestamps: true,
19-
defaultStoreCode : "STORE_CODE"
16+
requireTimestamps: true,
17+
defaultStoreCode : "STORE_CODE"
2018
)
2119

2220
/* Create a ProductInsert request instance, passing client to the constructor */

Examples/LoadAndEditProductExample.swift

+11-13
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
*
44
* For the full copyright and license information, please view the LICENSE
55
* file that was distributed with this source code.
6-
*
7-
* $Id: LoadAndEditProductExample.swift 73950 2019-03-07 21:14:58Z gidriss $
86
*/
97

108
import MerchantAPI
@@ -38,58 +36,58 @@ try loadProductRequest.send() { loadProductResponse, error in
3836
/// Handle Error
3937
return
4038
}
41-
39+
4240
if !loadProductResponse.isSuccess() {
4341
print(String(format: "Load Product Error", loadProductResponse.getErrorCode(), loadProductResponse.getErrorMessage()))
4442
return
4543
} else if loadProductResponse.getProducts().count == 0 {
4644
print("Product Not Found")
4745
return
4846
}
49-
47+
5048
var product = loadProductResponse.getProducts().first
51-
49+
5250
print(String(format: "Loaded Product %s Code %s Name %s", product.getId(), product.getCode(), product.getName()))
53-
51+
5452
/*
5553
* You can access the custom fields of the product from the CustomFieldValues model
5654
*/
5755
let myCustomFieldValue = product.getCustomFieldValues().getValue("MyField")
58-
56+
5957
/*
6058
* to get a specific module field, specify the optional 2rd argument with the module code.
6159
*/
6260
let myModuleCustomFieldValue = product.getCustomFieldValues().getValue("MyField", "MyModule");
63-
61+
6462
/*
6563
* Some requests accept a Model object in their constructor
6664
* which will allow the Request object to inherit data from.
6765
* ProductUpdate accepts a Product model.
6866
*/
6967
var request = ProductUpdateRequest(client: client, product: product)
70-
68+
7169
request.setProductName("The New Product Name")
7270
.setProductDescription("New Product Description")
7371
.setProductPrice(39.99)
7472
.setProductCost(29.99)
7573
.setProductWeight(2.5);
76-
74+
7775
/*
7876
* You can update custom field values using the CustomFieldValues model.
7977
*/
8078
request.getCustomFieldValues().addValue("MyField", "MyValue");
81-
79+
8280
/*
8381
* to update a specific module field, specify the optional 3rd argument with the module code.
8482
*/
8583
request.getCustomFieldValues().addValue("MyField", "MyValue", "MyModule");
86-
84+
8785
try request.send() { response, error in
8886
guard let response = response, error == nil else {
8987
/// Handle Error
9088
return
9189
}
92-
90+
9391
if !response.isSuccess() {
9492
print(String(format: "Load Product Error", response.getErrorCode(), response.getErrorMessage()))
9593
} else {

Examples/LoadOrdersExample.swift

+1-3
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
*
44
* For the full copyright and license information, please view the LICENSE
55
* file that was distributed with this source code.
6-
*
7-
* $Id: LoadOrdersExample.swift 73830 2019-03-05 23:40:40Z gidriss $
86
*/
97

108
import MerchantAPI
@@ -54,7 +52,7 @@ try request.send() { response, error in
5452
/// Handle Error
5553
return
5654
}
57-
55+
5856
if (!response.isSuccess()) {
5957
print(String(format: "Error Loading Order List", response.getErrorCode(), response.getErrorMessage()))
6058
} else {

Examples/LoadQueryExample.swift

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*
55
* For the full copyright and license information, please view the LICENSE
66
* file that was distributed with this source code.
7-
*
8-
* $Id: LoadQueryExample.swift 73830 2019-03-05 23:40:40Z gidriss $
97
*/
108

119
import MerchantAPI
@@ -126,20 +124,20 @@ try request.send() { response, error in
126124
/// Handle Error
127125
return
128126
}
129-
127+
130128
if (!response.isSuccess()) {
131129
print(String(format: "Error Loading Order List", response.getErrorCode(), response.getErrorMessage()))
132130
} else {
133131
for product in response.getProducts() {
134132
print(String(format: "Product ID: %d Code: %s Name: %s", product.getId(), product.getCode(), product.getName()))
135-
133+
136134
/*
137135
* Custom Field Values can be accessed via the CustomFieldValues model object
138136
* @see CustomFieldValues
139137
*/
140-
138+
141139
var myCustomField = product.getCustomFieldValues().getValue("MyFieldCode");
142-
140+
143141
var myModuleCustomField = product.getCustomFieldValues().getValue("MyModuleFieldCode", "MyModule");
144142
}
145143
}

0 commit comments

Comments
 (0)