@unimaze/billing 0.10.0 → 0.10.1

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.
@@ -32,10 +32,28 @@ var initialiseMessageApi = function (mapiBaseUrl) {
32
32
  return new api_clients_1.mapi.MessageApi(initiatedConfig);
33
33
  };
34
34
  var submitDocument = function (data, attachDocument, mapiBaseUrl, apiKey) {
35
- var messageApi = initialiseMessageApi(mapiBaseUrl);
36
35
  var messageId = attachDocument.messageId, name = attachDocument.name, contentType = attachDocument.contentType, more = attachDocument.more;
37
- var options = createOptionsData(data, apiKey);
38
- return messageApi.addDocuments(messageId, name, contentType, more, undefined, undefined, undefined, options);
36
+ return axios_1.default.post(mapiBaseUrl + "/api/v1/messages/" + messageId + "/documents", data, {
37
+ params: {
38
+ name: name,
39
+ contentType: contentType,
40
+ more: more
41
+ },
42
+ headers: __assign({}, (apiKey && { Authorization: "Bearer " + window.btoa(apiKey) }), { "Content-Type": "application/octet-stream" })
43
+ });
44
+ // const messageApi = initialiseMessageApi(mapiBaseUrl);
45
+ //
46
+ // const options = createOptionsData(data, apiKey)
47
+ // return messageApi.addDocuments(
48
+ // messageId,
49
+ // name,
50
+ // contentType,
51
+ // more,
52
+ // undefined,
53
+ // undefined,
54
+ // undefined,
55
+ // options
56
+ // )
39
57
  };
40
58
  exports.submitDocument = submitDocument;
41
59
  var submitInvoice = function (createSubmitInvoice, mapiBaseUrl, apiKey, callName, language) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unimaze/billing",
3
- "version": "0.10.0",
3
+ "version": "0.10.1",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",