@tillhub/javascript-sdk 4.127.0 → 4.128.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.
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [4.128.0](https://github.com/tillhub/tillhub-sdk-javascript/compare/v4.127.0...v4.128.0) (2024-02-23)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* **transactions:** add export to v3 ([b55ccf1](https://github.com/tillhub/tillhub-sdk-javascript/commit/b55ccf1bfa582dec0744b56914971a47104a57cc))
|
|
7
|
+
|
|
1
8
|
# [4.127.0](https://github.com/tillhub/tillhub-sdk-javascript/compare/v4.126.0...v4.127.0) (2024-02-22)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -23,6 +23,14 @@ export interface TransactionResponse {
|
|
|
23
23
|
msg?: string;
|
|
24
24
|
errors?: ErrorObject[];
|
|
25
25
|
}
|
|
26
|
+
export interface TransactionExportCorrelation {
|
|
27
|
+
correlationId: string;
|
|
28
|
+
}
|
|
29
|
+
export interface TransactionExportResponse {
|
|
30
|
+
data: TransactionExportCorrelation;
|
|
31
|
+
msg?: string;
|
|
32
|
+
errors?: ErrorObject[];
|
|
33
|
+
}
|
|
26
34
|
export interface ErrorObject {
|
|
27
35
|
id: string;
|
|
28
36
|
label: string;
|
|
@@ -38,6 +46,20 @@ export interface TransactionsQuery extends TransactionEntity {
|
|
|
38
46
|
deleted?: boolean;
|
|
39
47
|
active?: boolean;
|
|
40
48
|
}
|
|
49
|
+
export interface TransactionsExportQueryHandler extends TransactionsQuery {
|
|
50
|
+
exportMetaData: {
|
|
51
|
+
columnNames: boolean;
|
|
52
|
+
columns: string[] | null;
|
|
53
|
+
delimiter: string;
|
|
54
|
+
documentType: string;
|
|
55
|
+
enclosure: '\'' | '"';
|
|
56
|
+
email: string;
|
|
57
|
+
emailTemplate?: string;
|
|
58
|
+
format: 'CSV' | 'XLS';
|
|
59
|
+
recurringInterval?: string | null;
|
|
60
|
+
recurringStartDate?: string | null;
|
|
61
|
+
};
|
|
62
|
+
}
|
|
41
63
|
declare type CommerceTypes = 'eCommerce' | 'moto' | 'pos' | 'undefined' | 'unknown';
|
|
42
64
|
declare type PaymentMethodCodeTypes = 'undefined' | 'alipay' | 'applepay' | 'bancontact' | 'bank_transfer' | 'billpay_installment' | 'billpay_invoice' | 'credit_card' | 'debit_card' | 'easycredit_installment' | 'eps' | 'fleetcard' | 'girocard' | 'giropay' | 'googlepay' | 'ideal' | 'installment' | 'invoice' | 'klarna' | 'klarna_installment' | 'klarna_invoice' | 'loyalty' | 'monthly_invoice' | 'paypal' | 'paypal_express' | 'paysafecard' | 'paysafecash' | 'post_finance_card' | 'post_finance_efinance' | 'prepayment' | 'przelewy24' | 'santander_installment' | 'santander_purchase_on_account' | 'sepa_direct_debit' | 'sofort' | 'wechatpay' | 'unknown';
|
|
43
65
|
declare type PaymentMethodBrandCodeTypes = 'undefined' | 'amex' | 'avs' | 'bancontact' | 'bsw' | 'cartasi' | 'cartebancaire' | 'cartebleue' | 'cup' | 'dankort' | 'diners' | 'discover' | 'dkv' | 'euro6000' | 'four_b' | 'girocard' | 'jcb' | 'maestro' | 'mastercard' | 'postepay' | 'servired' | 'uta' | 'visa' | 'visa_debit' | 'visa_electron' | 'vpay' | 'unknown';
|
|
@@ -102,8 +124,8 @@ export interface TransactionEntity {
|
|
|
102
124
|
frontendLanguageId?: string | null;
|
|
103
125
|
frontendResponseUrl?: string | null;
|
|
104
126
|
frontendSessionId?: string | null;
|
|
105
|
-
identificationContractId
|
|
106
|
-
identificationContractOwner
|
|
127
|
+
identificationContractId?: string | null;
|
|
128
|
+
identificationContractOwner?: string | null;
|
|
107
129
|
identificationCreditorId?: string | null;
|
|
108
130
|
identificationCutoverId?: string | null;
|
|
109
131
|
identificationExtMerchantId?: string | null;
|
|
@@ -266,6 +288,7 @@ export declare class Transactions extends ThBaseHandler {
|
|
|
266
288
|
uriHelper: UriHelper;
|
|
267
289
|
constructor(options: TransactionsOptions, http: Client);
|
|
268
290
|
getAll(query?: TransactionsQueryHandler | undefined): Promise<TransactionsResponse>;
|
|
291
|
+
export(query: TransactionsExportQueryHandler): Promise<TransactionExportResponse>;
|
|
269
292
|
meta(query?: TransactionsQueryHandler | undefined): Promise<TransactionsMetaResponse>;
|
|
270
293
|
get(transactionId: string): Promise<TransactionResponse>;
|
|
271
294
|
}
|
|
@@ -279,6 +302,11 @@ export declare class TransactionsFetchFailed extends BaseError {
|
|
|
279
302
|
name: string;
|
|
280
303
|
constructor(message?: string, properties?: Record<string, unknown>);
|
|
281
304
|
}
|
|
305
|
+
export declare class TransactionsExportFetchFailed extends BaseError {
|
|
306
|
+
message: string;
|
|
307
|
+
name: string;
|
|
308
|
+
constructor(message?: string, properties?: Record<string, unknown>);
|
|
309
|
+
}
|
|
282
310
|
export declare class TransactionFetchFailed extends BaseError {
|
|
283
311
|
message: string;
|
|
284
312
|
name: string;
|
package/dist/v3/transactions.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TransactionFetchFailed = exports.TransactionsFetchFailed = exports.TransactionsGetMetaFailed = exports.Transactions = void 0;
|
|
3
|
+
exports.TransactionFetchFailed = exports.TransactionsExportFetchFailed = exports.TransactionsFetchFailed = exports.TransactionsGetMetaFailed = exports.Transactions = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var errors_1 = require("../errors");
|
|
6
6
|
var uri_helper_1 = require("../uri-helper");
|
|
@@ -55,10 +55,39 @@ var Transactions = (function (_super) {
|
|
|
55
55
|
});
|
|
56
56
|
});
|
|
57
57
|
};
|
|
58
|
+
Transactions.prototype.export = function (query) {
|
|
59
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
60
|
+
var base, uri, response, error_2;
|
|
61
|
+
return tslib_1.__generator(this, function (_a) {
|
|
62
|
+
switch (_a.label) {
|
|
63
|
+
case 0:
|
|
64
|
+
base = this.uriHelper.generateBaseUri();
|
|
65
|
+
uri = this.uriHelper.generateUriWithQuery(base + "/export", query);
|
|
66
|
+
_a.label = 1;
|
|
67
|
+
case 1:
|
|
68
|
+
_a.trys.push([1, 3, , 4]);
|
|
69
|
+
return [4, this.http.getClient().get(uri)];
|
|
70
|
+
case 2:
|
|
71
|
+
response = _a.sent();
|
|
72
|
+
if (response.status !== 200) {
|
|
73
|
+
throw new TransactionsExportFetchFailed(undefined, { status: response.status });
|
|
74
|
+
}
|
|
75
|
+
return [2, {
|
|
76
|
+
data: response.data.results[0],
|
|
77
|
+
msg: response.data.msg
|
|
78
|
+
}];
|
|
79
|
+
case 3:
|
|
80
|
+
error_2 = _a.sent();
|
|
81
|
+
throw new TransactionsExportFetchFailed(error_2.message, { error: error_2 });
|
|
82
|
+
case 4: return [2];
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
};
|
|
58
87
|
Transactions.prototype.meta = function (query) {
|
|
59
88
|
var _a;
|
|
60
89
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
61
|
-
var base, uri, response,
|
|
90
|
+
var base, uri, response, error_3;
|
|
62
91
|
return tslib_1.__generator(this, function (_b) {
|
|
63
92
|
switch (_b.label) {
|
|
64
93
|
case 0:
|
|
@@ -78,8 +107,8 @@ var Transactions = (function (_super) {
|
|
|
78
107
|
metadata: { count: ((_a = response.data.results[0]) === null || _a === void 0 ? void 0 : _a.count) || 0 }
|
|
79
108
|
}];
|
|
80
109
|
case 3:
|
|
81
|
-
|
|
82
|
-
throw new TransactionsFetchFailed(
|
|
110
|
+
error_3 = _b.sent();
|
|
111
|
+
throw new TransactionsFetchFailed(error_3.message, { error: error_3 });
|
|
83
112
|
case 4: return [2];
|
|
84
113
|
}
|
|
85
114
|
});
|
|
@@ -87,7 +116,7 @@ var Transactions = (function (_super) {
|
|
|
87
116
|
};
|
|
88
117
|
Transactions.prototype.get = function (transactionId) {
|
|
89
118
|
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
90
|
-
var base, uri, response,
|
|
119
|
+
var base, uri, response, error_4;
|
|
91
120
|
return tslib_1.__generator(this, function (_a) {
|
|
92
121
|
switch (_a.label) {
|
|
93
122
|
case 0:
|
|
@@ -108,8 +137,8 @@ var Transactions = (function (_super) {
|
|
|
108
137
|
metadata: { count: response.data.count }
|
|
109
138
|
}];
|
|
110
139
|
case 3:
|
|
111
|
-
|
|
112
|
-
throw new TransactionFetchFailed(
|
|
140
|
+
error_4 = _a.sent();
|
|
141
|
+
throw new TransactionFetchFailed(error_4.message, { error: error_4 });
|
|
113
142
|
case 4: return [2];
|
|
114
143
|
}
|
|
115
144
|
});
|
|
@@ -145,6 +174,19 @@ var TransactionsFetchFailed = (function (_super) {
|
|
|
145
174
|
return TransactionsFetchFailed;
|
|
146
175
|
}(errors_1.BaseError));
|
|
147
176
|
exports.TransactionsFetchFailed = TransactionsFetchFailed;
|
|
177
|
+
var TransactionsExportFetchFailed = (function (_super) {
|
|
178
|
+
tslib_1.__extends(TransactionsExportFetchFailed, _super);
|
|
179
|
+
function TransactionsExportFetchFailed(message, properties) {
|
|
180
|
+
if (message === void 0) { message = 'Could not export transactions'; }
|
|
181
|
+
var _this = _super.call(this, message, properties) || this;
|
|
182
|
+
_this.message = message;
|
|
183
|
+
_this.name = 'TransactionsExportFetchFailed';
|
|
184
|
+
Object.setPrototypeOf(_this, TransactionsExportFetchFailed.prototype);
|
|
185
|
+
return _this;
|
|
186
|
+
}
|
|
187
|
+
return TransactionsExportFetchFailed;
|
|
188
|
+
}(errors_1.BaseError));
|
|
189
|
+
exports.TransactionsExportFetchFailed = TransactionsExportFetchFailed;
|
|
148
190
|
var TransactionFetchFailed = (function (_super) {
|
|
149
191
|
tslib_1.__extends(TransactionFetchFailed, _super);
|
|
150
192
|
function TransactionFetchFailed(message, properties) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/v3/transactions.ts"],"names":[],"mappings":";;;;AACA,oCAAqC;AACrC,4CAAyC;AACzC,gCAAuC;
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../src/v3/transactions.ts"],"names":[],"mappings":";;;;AACA,oCAAqC;AACrC,4CAAyC;AACzC,gCAAuC;AAuSvC;IAAkC,wCAAa;IAO7C,sBAAa,OAA4B,EAAE,IAAY;;QAAvD,YACE,kBAAM,IAAI,EAAE;YACV,QAAQ,EAAE,YAAY,CAAC,YAAY;YACnC,IAAI,QAAE,OAAO,CAAC,IAAI,mCAAI,yBAAyB;SAChD,CAAC,SAOH;QANC,KAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,KAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAEhB,KAAI,CAAC,QAAQ,GAAG,YAAY,CAAC,YAAY,CAAA;QACzC,KAAI,CAAC,OAAO,CAAC,IAAI,SAAG,KAAI,CAAC,OAAO,CAAC,IAAI,mCAAI,yBAAyB,CAAA;QAClE,KAAI,CAAC,SAAS,GAAG,IAAI,sBAAS,CAAC,KAAI,CAAC,QAAQ,EAAE,KAAI,CAAC,OAAO,CAAC,CAAA;;IAC7D,CAAC;IAEK,6BAAM,GAAZ,UAAc,KAA4C;;;;;;;;wBAElD,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,EAAE,CAAA;wBACvC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,oBAAoB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;;;;wBAGzC,WAAM,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAA;;wBAA/C,aAAW,SAAoC;wBACrD,IAAI,UAAQ,CAAC,MAAM,KAAK,GAAG,EAAE;4BAC3B,MAAM,IAAI,uBAAuB,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,UAAQ,CAAC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