@houlak/plexo-sdk 0.1.6 → 0.1.7-fx
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/lib/handler/PlexoHandler.d.ts +21 -10
- package/lib/handler/PlexoHandler.js +179 -29
- package/lib/index.d.ts +1 -0
- package/lib/index.js +4 -1
- package/lib/lib/logger.lib.js +3 -3
- package/lib/sdk/IPaymentGatewayClient.d.ts +8 -7
- package/lib/sdk/PaymentGatewayClient.d.ts +8 -7
- package/lib/sdk/PaymentGatewayClient.js +45 -45
- package/lib/sdk/PaymentGatewayMock.d.ts +2 -2
- package/lib/sdk/PaymentGatewayMock.js +5 -11
- package/lib/sdk/enums/plexo-error-enum.d.ts +1 -0
- package/lib/sdk/enums/plexo-error-enum.js +1 -0
- package/lib/sdk/helpers/signature/signatureHelper.d.ts +3 -7
- package/lib/sdk/helpers/signature/signatureHelper.js +74 -205
- package/lib/sdk/helpers/signature/signatureUtils.d.ts +10 -0
- package/lib/sdk/helpers/signature/signatureUtils.js +155 -0
- package/lib/sdk/helpers/signature/stringifyWithFloats.js +2 -0
- package/lib/sdk/mocks/mocks.js +24 -21
- package/lib/sdk/models/Authorization.d.ts +4 -5
- package/lib/sdk/models/Authorization.js +8 -2
- package/lib/sdk/models/AuthorizationInfo.d.ts +3 -2
- package/lib/sdk/models/AuthorizationInfo.js +24 -5
- package/lib/sdk/models/BuiltInPagesOptions.d.ts +5 -0
- package/lib/sdk/models/BuiltInPagesOptions.js +11 -0
- package/lib/sdk/models/CancelRequest.d.ts +1 -1
- package/lib/sdk/models/CancelRequest.js +2 -2
- package/lib/sdk/models/CodeRequest.d.ts +4 -2
- package/lib/sdk/models/CodeRequest.js +28 -0
- package/lib/sdk/models/CommerceIdRequest.d.ts +4 -2
- package/lib/sdk/models/CommerceIdRequest.js +27 -0
- package/lib/sdk/models/CommerceIssuerIdRequest.d.ts +4 -2
- package/lib/sdk/models/CommerceIssuerIdRequest.js +28 -0
- package/lib/sdk/models/CommerceModifyRequest.d.ts +4 -2
- package/lib/sdk/models/CommerceModifyRequest.js +28 -0
- package/lib/sdk/models/CommerceRequest.d.ts +4 -2
- package/lib/sdk/models/CommerceRequest.js +27 -0
- package/lib/sdk/models/CreateBankInstrumentRequest.d.ts +4 -2
- package/lib/sdk/models/CreateBankInstrumentRequest.js +29 -0
- package/lib/sdk/models/DeleteInstrumentRequest.d.ts +1 -1
- package/lib/sdk/models/DeleteInstrumentRequest.js +2 -2
- package/lib/sdk/models/DisplayOptions.d.ts +8 -0
- package/lib/sdk/models/DisplayOptions.js +14 -0
- package/lib/sdk/models/ExpressCheckoutSettings.d.ts +7 -0
- package/lib/sdk/models/ExpressCheckoutSettings.js +11 -0
- package/lib/sdk/models/FieldType.d.ts +6 -0
- package/lib/sdk/models/FieldType.js +6 -0
- package/lib/sdk/models/FixedCustomData.d.ts +6 -0
- package/lib/sdk/models/FixedCustomData.js +12 -0
- package/lib/sdk/models/GenericSignedObject.d.ts +3 -3
- package/lib/sdk/models/GenericSignedObject.js +3 -3
- package/lib/sdk/models/GenericStateObject.d.ts +2 -2
- package/lib/sdk/models/GenericStateObject.js +3 -3
- package/lib/sdk/models/IndexSDK.d.ts +8 -6
- package/lib/sdk/models/IndexSDK.js +32 -14
- package/lib/sdk/models/InstrumentCallback.d.ts +5 -5
- package/lib/sdk/models/InstrumentCallback.js +5 -5
- package/lib/sdk/models/InstrumentWithMetadata.d.ts +3 -3
- package/lib/sdk/models/InstrumentWithMetadata.js +3 -3
- package/lib/sdk/models/IssuerData.d.ts +6 -2
- package/lib/sdk/models/IssuerData.js +31 -0
- package/lib/sdk/models/PaymentInstrument.d.ts +11 -11
- package/lib/sdk/models/PaymentRequest.d.ts +3 -2
- package/lib/sdk/models/PaymentRequest.js +33 -14
- package/lib/sdk/models/Reference.d.ts +4 -2
- package/lib/sdk/models/Reference.js +25 -5
- package/lib/sdk/models/Reserve.d.ts +1 -1
- package/lib/sdk/models/Reserve.js +2 -2
- package/lib/sdk/models/ReserveRequest.d.ts +1 -1
- package/lib/sdk/models/ReserveRequest.js +2 -2
- package/lib/sdk/models/SignedObject.d.ts +3 -3
- package/lib/sdk/models/SignedObject.js +3 -3
- package/lib/sdk/models/StateObject.d.ts +2 -2
- package/lib/sdk/models/StateObject.js +2 -2
- package/lib/sdk/models/TokenizationSettings.d.ts +5 -0
- package/lib/sdk/models/TokenizationSettings.js +10 -0
- package/lib/sdk/models/TransactionCallback.d.ts +4 -4
- package/lib/sdk/models/TransactionCallback.js +3 -3
- package/lib/sdk/models/TransactionQuery.d.ts +4 -2
- package/lib/sdk/models/TransactionQuery.js +30 -1
- package/lib/sdk/models/TransactionsCSV.d.ts +3 -0
- package/lib/sdk/models/TransactionsCSV.js +2 -0
- package/lib/sdk/models/UIOptions.d.ts +8 -0
- package/lib/sdk/models/UIOptions.js +13 -0
- package/lib/sdk/models/WebFormSettings.d.ts +9 -0
- package/lib/sdk/models/WebFormSettings.js +12 -0
- package/lib/sdk/models/webhook/Address.d.ts +9 -0
- package/lib/sdk/models/webhook/Address.js +15 -0
- package/lib/sdk/models/webhook/CancellationInfo.d.ts +11 -0
- package/lib/sdk/models/webhook/CancellationInfo.js +17 -0
- package/lib/sdk/models/webhook/Client.d.ts +9 -0
- package/lib/sdk/models/webhook/Client.js +14 -0
- package/lib/sdk/models/webhook/Commerce.d.ts +6 -0
- package/lib/sdk/models/webhook/Commerce.js +12 -0
- package/lib/sdk/models/webhook/Currency.d.ts +8 -0
- package/lib/sdk/models/webhook/Currency.js +14 -0
- package/lib/sdk/models/webhook/Customer.d.ts +17 -0
- package/lib/sdk/models/webhook/Customer.js +22 -0
- package/lib/sdk/models/webhook/Document.d.ts +5 -0
- package/lib/sdk/models/webhook/Document.js +11 -0
- package/lib/sdk/models/webhook/IndexWebhook.d.ts +21 -0
- package/lib/sdk/models/webhook/IndexWebhook.js +45 -0
- package/lib/sdk/models/webhook/Instrument.d.ts +17 -0
- package/lib/sdk/models/webhook/Instrument.js +21 -0
- package/lib/sdk/models/webhook/Issuer.d.ts +8 -0
- package/lib/sdk/models/webhook/Issuer.js +14 -0
- package/lib/sdk/models/webhook/IssuerData.d.ts +8 -0
- package/lib/sdk/models/webhook/IssuerData.js +13 -0
- package/lib/sdk/models/webhook/IssuerDto.d.ts +5 -0
- package/lib/sdk/models/webhook/IssuerDto.js +11 -0
- package/lib/sdk/models/webhook/Item.d.ts +14 -0
- package/lib/sdk/models/webhook/Item.js +19 -0
- package/lib/sdk/models/webhook/PartialRefundsInfo.d.ts +12 -0
- package/lib/sdk/models/webhook/PartialRefundsInfo.js +18 -0
- package/lib/sdk/models/webhook/PaymentFacilitator.d.ts +8 -0
- package/lib/sdk/models/webhook/PaymentFacilitator.js +13 -0
- package/lib/sdk/models/webhook/PaymentProcessor.d.ts +5 -0
- package/lib/sdk/models/webhook/PaymentProcessor.js +11 -0
- package/lib/sdk/models/webhook/PurchaseInfo.d.ts +16 -0
- package/lib/sdk/models/webhook/PurchaseInfo.js +22 -0
- package/lib/sdk/models/webhook/RefundInfo.d.ts +12 -0
- package/lib/sdk/models/webhook/RefundInfo.js +18 -0
- package/lib/sdk/models/webhook/ReserveInfo.d.ts +13 -0
- package/lib/sdk/models/webhook/ReserveInfo.js +19 -0
- package/lib/sdk/models/webhook/Shipping.d.ts +7 -0
- package/lib/sdk/models/webhook/Shipping.js +12 -0
- package/lib/sdk/models/webhook/Transaction.d.ts +31 -0
- package/lib/sdk/models/webhook/Transaction.js +36 -0
- package/lib/sdk/models/webhook/TransactionResult.d.ts +5 -0
- package/lib/sdk/models/webhook/TransactionResult.js +10 -0
- package/lib/sdk/models/webhook/index.d.ts +21 -0
- package/lib/sdk/models/webhook/index.js +45 -0
- package/lib/utils/boolean.utils.d.ts +4 -0
- package/lib/utils/boolean.utils.js +53 -0
- package/lib/utils/case.util.d.ts +4 -0
- package/lib/utils/case.util.js +61 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +5 -0
- package/package.json +3 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Transaction = void 0;
|
|
4
|
+
var Transaction = /** @class */ (function () {
|
|
5
|
+
function Transaction(id, externalId, invoiceNumber, creationDate, metadata, state, amount, taxedAmount, tipAmount, billedAmount, law, client, instrument, currency, items, customer, paymentProcessor, paymentFacilitator, loyaltyProgramAmount, installments, expiration, batchId, purchaseInfo, cancellationInfo, refundInfo, reserveInfo, partialRefundsInfo) {
|
|
6
|
+
this.id = id;
|
|
7
|
+
this.batchId = batchId;
|
|
8
|
+
this.externalId = externalId;
|
|
9
|
+
this.invoiceNumber = invoiceNumber;
|
|
10
|
+
this.creationDate = creationDate;
|
|
11
|
+
this.expiration = expiration;
|
|
12
|
+
this.metadata = metadata;
|
|
13
|
+
this.state = state;
|
|
14
|
+
this.amount = amount;
|
|
15
|
+
this.installments = installments;
|
|
16
|
+
this.taxedAmount = taxedAmount;
|
|
17
|
+
this.tipAmount = tipAmount;
|
|
18
|
+
this.billedAmount = billedAmount;
|
|
19
|
+
this.loyaltyProgramAmount = loyaltyProgramAmount;
|
|
20
|
+
this.law = law;
|
|
21
|
+
this.client = client;
|
|
22
|
+
this.instrument = instrument;
|
|
23
|
+
this.currency = currency;
|
|
24
|
+
this.purchaseInfo = purchaseInfo;
|
|
25
|
+
this.cancellationInfo = cancellationInfo;
|
|
26
|
+
this.refundInfo = refundInfo;
|
|
27
|
+
this.reserveInfo = reserveInfo;
|
|
28
|
+
this.partialRefundsInfo = partialRefundsInfo;
|
|
29
|
+
this.items = items;
|
|
30
|
+
this.customer = customer;
|
|
31
|
+
this.paymentProcessor = paymentProcessor;
|
|
32
|
+
this.paymentFacilitator = paymentFacilitator;
|
|
33
|
+
}
|
|
34
|
+
return Transaction;
|
|
35
|
+
}());
|
|
36
|
+
exports.Transaction = Transaction;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionResult = void 0;
|
|
4
|
+
var TransactionResult = /** @class */ (function () {
|
|
5
|
+
function TransactionResult(results) {
|
|
6
|
+
this.results = results;
|
|
7
|
+
}
|
|
8
|
+
return TransactionResult;
|
|
9
|
+
}());
|
|
10
|
+
exports.TransactionResult = TransactionResult;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export { Address } from './Address';
|
|
2
|
+
export { CancellationInfo } from './CancellationInfo';
|
|
3
|
+
export { Client } from './Client';
|
|
4
|
+
export { Commerce } from './Commerce';
|
|
5
|
+
export { Currency } from './Currency';
|
|
6
|
+
export { Customer } from './Customer';
|
|
7
|
+
export { Document } from './Document';
|
|
8
|
+
export { Instrument } from './Instrument';
|
|
9
|
+
export { Issuer } from './Issuer';
|
|
10
|
+
export { IssuerData } from './IssuerData';
|
|
11
|
+
export { IssuerDto } from './IssuerDto';
|
|
12
|
+
export { Item } from './Item';
|
|
13
|
+
export { PartialRefundsInfo } from './PartialRefundsInfo';
|
|
14
|
+
export { PaymentFacilitator } from './PaymentFacilitator';
|
|
15
|
+
export { PaymentProcessor } from './PaymentProcessor';
|
|
16
|
+
export { PurchaseInfo } from './PurchaseInfo';
|
|
17
|
+
export { RefundInfo } from './RefundInfo';
|
|
18
|
+
export { ReserveInfo } from './ReserveInfo';
|
|
19
|
+
export { Shipping } from './Shipping';
|
|
20
|
+
export { Transaction } from './Transaction';
|
|
21
|
+
export { TransactionResult } from './TransactionResult';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TransactionResult = exports.Transaction = exports.Shipping = exports.ReserveInfo = exports.RefundInfo = exports.PurchaseInfo = exports.PaymentProcessor = exports.PaymentFacilitator = exports.PartialRefundsInfo = exports.Item = exports.IssuerDto = exports.IssuerData = exports.Issuer = exports.Instrument = exports.Document = exports.Customer = exports.Currency = exports.Commerce = exports.Client = exports.CancellationInfo = exports.Address = void 0;
|
|
4
|
+
var Address_1 = require("./Address");
|
|
5
|
+
Object.defineProperty(exports, "Address", { enumerable: true, get: function () { return Address_1.Address; } });
|
|
6
|
+
var CancellationInfo_1 = require("./CancellationInfo");
|
|
7
|
+
Object.defineProperty(exports, "CancellationInfo", { enumerable: true, get: function () { return CancellationInfo_1.CancellationInfo; } });
|
|
8
|
+
var Client_1 = require("./Client");
|
|
9
|
+
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return Client_1.Client; } });
|
|
10
|
+
var Commerce_1 = require("./Commerce");
|
|
11
|
+
Object.defineProperty(exports, "Commerce", { enumerable: true, get: function () { return Commerce_1.Commerce; } });
|
|
12
|
+
var Currency_1 = require("./Currency");
|
|
13
|
+
Object.defineProperty(exports, "Currency", { enumerable: true, get: function () { return Currency_1.Currency; } });
|
|
14
|
+
var Customer_1 = require("./Customer");
|
|
15
|
+
Object.defineProperty(exports, "Customer", { enumerable: true, get: function () { return Customer_1.Customer; } });
|
|
16
|
+
var Document_1 = require("./Document");
|
|
17
|
+
Object.defineProperty(exports, "Document", { enumerable: true, get: function () { return Document_1.Document; } });
|
|
18
|
+
var Instrument_1 = require("./Instrument");
|
|
19
|
+
Object.defineProperty(exports, "Instrument", { enumerable: true, get: function () { return Instrument_1.Instrument; } });
|
|
20
|
+
var Issuer_1 = require("./Issuer");
|
|
21
|
+
Object.defineProperty(exports, "Issuer", { enumerable: true, get: function () { return Issuer_1.Issuer; } });
|
|
22
|
+
var IssuerData_1 = require("./IssuerData");
|
|
23
|
+
Object.defineProperty(exports, "IssuerData", { enumerable: true, get: function () { return IssuerData_1.IssuerData; } });
|
|
24
|
+
var IssuerDto_1 = require("./IssuerDto");
|
|
25
|
+
Object.defineProperty(exports, "IssuerDto", { enumerable: true, get: function () { return IssuerDto_1.IssuerDto; } });
|
|
26
|
+
var Item_1 = require("./Item");
|
|
27
|
+
Object.defineProperty(exports, "Item", { enumerable: true, get: function () { return Item_1.Item; } });
|
|
28
|
+
var PartialRefundsInfo_1 = require("./PartialRefundsInfo");
|
|
29
|
+
Object.defineProperty(exports, "PartialRefundsInfo", { enumerable: true, get: function () { return PartialRefundsInfo_1.PartialRefundsInfo; } });
|
|
30
|
+
var PaymentFacilitator_1 = require("./PaymentFacilitator");
|
|
31
|
+
Object.defineProperty(exports, "PaymentFacilitator", { enumerable: true, get: function () { return PaymentFacilitator_1.PaymentFacilitator; } });
|
|
32
|
+
var PaymentProcessor_1 = require("./PaymentProcessor");
|
|
33
|
+
Object.defineProperty(exports, "PaymentProcessor", { enumerable: true, get: function () { return PaymentProcessor_1.PaymentProcessor; } });
|
|
34
|
+
var PurchaseInfo_1 = require("./PurchaseInfo");
|
|
35
|
+
Object.defineProperty(exports, "PurchaseInfo", { enumerable: true, get: function () { return PurchaseInfo_1.PurchaseInfo; } });
|
|
36
|
+
var RefundInfo_1 = require("./RefundInfo");
|
|
37
|
+
Object.defineProperty(exports, "RefundInfo", { enumerable: true, get: function () { return RefundInfo_1.RefundInfo; } });
|
|
38
|
+
var ReserveInfo_1 = require("./ReserveInfo");
|
|
39
|
+
Object.defineProperty(exports, "ReserveInfo", { enumerable: true, get: function () { return ReserveInfo_1.ReserveInfo; } });
|
|
40
|
+
var Shipping_1 = require("./Shipping");
|
|
41
|
+
Object.defineProperty(exports, "Shipping", { enumerable: true, get: function () { return Shipping_1.Shipping; } });
|
|
42
|
+
var Transaction_1 = require("./Transaction");
|
|
43
|
+
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return Transaction_1.Transaction; } });
|
|
44
|
+
var TransactionResult_1 = require("./TransactionResult");
|
|
45
|
+
Object.defineProperty(exports, "TransactionResult", { enumerable: true, get: function () { return TransactionResult_1.TransactionResult; } });
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.booleanUtils = void 0;
|
|
4
|
+
var signatureUtils_1 = require("../sdk/helpers/signature/signatureUtils");
|
|
5
|
+
var booleanValues = [
|
|
6
|
+
'CrossBankTransfers'
|
|
7
|
+
];
|
|
8
|
+
var stringifyBooleans = function (object) {
|
|
9
|
+
booleanValues.forEach(function (word) {
|
|
10
|
+
if (JSON.stringify(object).includes(word)) {
|
|
11
|
+
substituteValueRecursively(object, word, true);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
return object;
|
|
15
|
+
};
|
|
16
|
+
var substituteValueRecursively = function (object, specialWord, toString) {
|
|
17
|
+
if (object && typeof object === 'object') {
|
|
18
|
+
Object.keys(object).map(function (key) {
|
|
19
|
+
if (key === specialWord) {
|
|
20
|
+
if (toString)
|
|
21
|
+
if (object[key] === true) {
|
|
22
|
+
object[key] = 'True';
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
object[key] = 'False';
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
if (object[key] === 'True') {
|
|
29
|
+
object[key] = true;
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
object[key] = false;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
if (typeof object[key] === 'object') {
|
|
37
|
+
substituteValueRecursively(object[key], specialWord, toString);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var booleanizeStrings = function (object) {
|
|
43
|
+
booleanValues.forEach(function (specialWord) {
|
|
44
|
+
if (JSON.stringify(object).includes(specialWord)) {
|
|
45
|
+
substituteValueRecursively(object, specialWord, false);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
return signatureUtils_1.signatureUtils.sortObject(object);
|
|
49
|
+
};
|
|
50
|
+
exports.booleanUtils = {
|
|
51
|
+
stringifyBooleans: stringifyBooleans,
|
|
52
|
+
booleanizeStrings: booleanizeStrings,
|
|
53
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.caseUtils = void 0;
|
|
4
|
+
var js_convert_case_1 = require("js-convert-case");
|
|
5
|
+
var signatureUtils_1 = require("../sdk/helpers/signature/signatureUtils");
|
|
6
|
+
var specialWords = [
|
|
7
|
+
{ word: 'UtcUnixTimeExpiration', substitute: 'UTCUnixTimeExpiration' },
|
|
8
|
+
{ word: 'UtcunixTimeExpiration', substitute: 'UTCUnixTimeExpiration' },
|
|
9
|
+
{ word: 'VatAmount', substitute: 'VATAmount' },
|
|
10
|
+
{ word: 'InstrumentExpirationUtc', substitute: 'InstrumentExpirationUTC' },
|
|
11
|
+
{ word: 'Mcc', substitute: 'MCC' },
|
|
12
|
+
{ word: 'CommerceRut', substitute: 'CommerceRUT' },
|
|
13
|
+
{ word: 'Ui', substitute: 'UI' },
|
|
14
|
+
{ word: 'Background', substitute: 'background' },
|
|
15
|
+
{ word: 'Primary', substitute: 'primary' },
|
|
16
|
+
{ word: 'Secondary', substitute: 'secondary' },
|
|
17
|
+
];
|
|
18
|
+
var camelCaseSpecialWords = [
|
|
19
|
+
{
|
|
20
|
+
word: 'instrumentExpirationUtc',
|
|
21
|
+
substitute: 'instrumentExpirationUTC',
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
var toCamelKeys = function (object) {
|
|
25
|
+
var parsedObject = (0, js_convert_case_1.camelKeys)(object, { recursive: true, recursiveInArray: true });
|
|
26
|
+
camelCaseSpecialWords.forEach(function (specialWord) {
|
|
27
|
+
if (JSON.stringify(parsedObject).includes(specialWord.word)) {
|
|
28
|
+
substituteWordRecursively(parsedObject, specialWord.word, specialWord.substitute);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
return parsedObject;
|
|
32
|
+
};
|
|
33
|
+
var substituteWordRecursively = function (theParsedObject, word, substitute) {
|
|
34
|
+
var deleteObject = function (obj, key) {
|
|
35
|
+
delete obj[key];
|
|
36
|
+
};
|
|
37
|
+
if (theParsedObject && typeof theParsedObject === 'object') {
|
|
38
|
+
Object.keys(theParsedObject).map(function (key) {
|
|
39
|
+
if (key === word) {
|
|
40
|
+
Object.defineProperty(theParsedObject, substitute, Object.getOwnPropertyDescriptor(theParsedObject, word) || '');
|
|
41
|
+
deleteObject(theParsedObject, word);
|
|
42
|
+
}
|
|
43
|
+
if (typeof theParsedObject[key] === 'object') {
|
|
44
|
+
substituteWordRecursively(theParsedObject[key], word, substitute);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var toPascalKeys = function (object) {
|
|
50
|
+
var parsedObject = (0, js_convert_case_1.pascalKeys)(object, { recursive: true, recursiveInArray: true });
|
|
51
|
+
specialWords.forEach(function (specialWord) {
|
|
52
|
+
if (JSON.stringify(parsedObject).includes(specialWord.word)) {
|
|
53
|
+
substituteWordRecursively(parsedObject, specialWord.word, specialWord.substitute);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return signatureUtils_1.signatureUtils.sortObject(parsedObject);
|
|
57
|
+
};
|
|
58
|
+
exports.caseUtils = {
|
|
59
|
+
toCamelKeys: toCamelKeys,
|
|
60
|
+
toPascalKeys: toPascalKeys,
|
|
61
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { caseUtils } from './case.util';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.caseUtils = void 0;
|
|
4
|
+
var case_util_1 = require("./case.util");
|
|
5
|
+
Object.defineProperty(exports, "caseUtils", { enumerable: true, get: function () { return case_util_1.caseUtils; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@houlak/plexo-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7-fx",
|
|
4
4
|
"description": "Node SDK for Plexo payment services",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
46
|
"engines": {
|
|
47
|
-
"node": "
|
|
47
|
+
"node": "20"
|
|
48
48
|
},
|
|
49
49
|
"files": [
|
|
50
50
|
"lib/**/*"
|
|
51
51
|
]
|
|
52
|
-
}
|
|
52
|
+
}
|