@isoftdata/ebay-utility 1.2.0 → 1.2.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.
- package/package.json +1 -1
- package/lib/adapters/test-error-preservation.d.ts +0 -9
- package/lib/adapters/test-error-preservation.d.ts.map +0 -1
- package/lib/adapters/test-error-preservation.js +0 -203
- package/lib/adapters/test-error-preservation.js.map +0 -1
- package/lib/entities/itrack/FulfillmentPolicy.d.ts +0 -10
- package/lib/entities/itrack/FulfillmentPolicy.d.ts.map +0 -1
- package/lib/entities/itrack/FulfillmentPolicy.js +0 -2
- package/lib/entities/itrack/FulfillmentPolicy.js.map +0 -1
- package/lib/entities/itrack/ItrackEbayInventoryItem.js +0 -25
- package/lib/entities/itrack/ItrackEbayInventoryItem.js.map +0 -1
- package/lib/entities/itrack/ItrackEbayListing.d.ts +0 -45
- package/lib/entities/itrack/ItrackEbayListing.d.ts.map +0 -1
- package/lib/entities/itrack/ItrackEbayListing.js +0 -25
- package/lib/entities/itrack/ItrackEbayListing.js.map +0 -1
- package/lib/entities/itrack/PaymentPolicy.d.ts +0 -10
- package/lib/entities/itrack/PaymentPolicy.d.ts.map +0 -1
- package/lib/entities/itrack/PaymentPolicy.js +0 -2
- package/lib/entities/itrack/PaymentPolicy.js.map +0 -1
- package/lib/entities/itrack/ReturnPolicy.d.ts +0 -10
- package/lib/entities/itrack/ReturnPolicy.d.ts.map +0 -1
- package/lib/entities/itrack/ReturnPolicy.js +0 -2
- package/lib/entities/itrack/ReturnPolicy.js.map +0 -1
- package/lib/repositories/itrack/EbayInventoryItemRowRepo.d.ts +0 -27
- package/lib/repositories/itrack/EbayInventoryItemRowRepo.d.ts.map +0 -1
- package/lib/repositories/itrack/EbayInventoryItemRowRepo.js +0 -2
- package/lib/repositories/itrack/EbayInventoryItemRowRepo.js.map +0 -1
- package/lib/repositories/itrack/ItrackEbayFulfillmentPolicyRepo.d.ts +0 -11
- package/lib/repositories/itrack/ItrackEbayFulfillmentPolicyRepo.d.ts.map +0 -1
- package/lib/repositories/itrack/ItrackEbayFulfillmentPolicyRepo.js +0 -35
- package/lib/repositories/itrack/ItrackEbayFulfillmentPolicyRepo.js.map +0 -1
- package/lib/repositories/itrack/ItrackEbayInventoryItemRepo.js +0 -75
- package/lib/repositories/itrack/ItrackEbayInventoryItemRepo.js.map +0 -1
- package/lib/repositories/itrack/ItrackEbayListingRepo.d.ts +0 -8
- package/lib/repositories/itrack/ItrackEbayListingRepo.d.ts.map +0 -1
- package/lib/repositories/itrack/ItrackEbayListingRepo.js +0 -66
- package/lib/repositories/itrack/ItrackEbayListingRepo.js.map +0 -1
- package/lib/repositories/itrack/ItrackEbayPaymentPolicyRepo.d.ts +0 -11
- package/lib/repositories/itrack/ItrackEbayPaymentPolicyRepo.d.ts.map +0 -1
- package/lib/repositories/itrack/ItrackEbayPaymentPolicyRepo.js +0 -35
- package/lib/repositories/itrack/ItrackEbayPaymentPolicyRepo.js.map +0 -1
- package/lib/repositories/itrack/ItrackEbayReturnPolicyRepo.d.ts +0 -11
- package/lib/repositories/itrack/ItrackEbayReturnPolicyRepo.d.ts.map +0 -1
- package/lib/repositories/itrack/ItrackEbayReturnPolicyRepo.js +0 -34
- package/lib/repositories/itrack/ItrackEbayReturnPolicyRepo.js.map +0 -1
- package/lib/repositories/itrack/ItrackFulfillmentPolicyRepo.d.ts +0 -11
- package/lib/repositories/itrack/ItrackFulfillmentPolicyRepo.d.ts.map +0 -1
- package/lib/repositories/itrack/ItrackFulfillmentPolicyRepo.js +0 -35
- package/lib/repositories/itrack/ItrackFulfillmentPolicyRepo.js.map +0 -1
- package/lib/repositories/itrack/ItrackPaymentPolicyRepo.d.ts +0 -11
- package/lib/repositories/itrack/ItrackPaymentPolicyRepo.d.ts.map +0 -1
- package/lib/repositories/itrack/ItrackPaymentPolicyRepo.js +0 -35
- package/lib/repositories/itrack/ItrackPaymentPolicyRepo.js.map +0 -1
- package/lib/repositories/itrack/ItrackReturnPolicyRepo.d.ts +0 -11
- package/lib/repositories/itrack/ItrackReturnPolicyRepo.d.ts.map +0 -1
- package/lib/repositories/itrack/ItrackReturnPolicyRepo.js +0 -34
- package/lib/repositories/itrack/ItrackReturnPolicyRepo.js.map +0 -1
- package/lib/repositories/test-error-preservation.d.ts +0 -45
- package/lib/repositories/test-error-preservation.d.ts.map +0 -1
- package/lib/repositories/test-error-preservation.js +0 -125
- package/lib/repositories/test-error-preservation.js.map +0 -1
- package/lib/tests/processImageUrlTest.d.ts +0 -29
- package/lib/tests/processImageUrlTest.d.ts.map +0 -1
- package/lib/tests/processImageUrlTest.js +0 -402
- package/lib/tests/processImageUrlTest.js.map +0 -1
- package/lib/tests/test.d.ts +0 -2
- package/lib/tests/test.d.ts.map +0 -1
- package/lib/tests/test.js +0 -130
- package/lib/tests/test.js.map +0 -1
- package/lib/tests/tests.js +0 -130
- package/lib/tests/tests.js.map +0 -1
- package/lib/types/ErrorPreservation.d.ts +0 -154
- package/lib/types/ErrorPreservation.d.ts.map +0 -1
- package/lib/types/ErrorPreservation.js +0 -357
- package/lib/types/ErrorPreservation.js.map +0 -1
- package/lib/types/MysqlResponse.d.ts +0 -123
- package/lib/types/MysqlResponse.d.ts.map +0 -1
- package/lib/types/MysqlResponse.js +0 -236
- package/lib/types/MysqlResponse.js.map +0 -1
- package/lib/types/UseCaseResult.examples.d.ts +0 -42
- package/lib/types/UseCaseResult.examples.d.ts.map +0 -1
- package/lib/types/UseCaseResult.examples.js +0 -168
- package/lib/types/UseCaseResult.examples.js.map +0 -1
- package/lib/usecases/FulfillmentPolicy/AddFulfillmentPolicyToItrack.d.ts +0 -8
- package/lib/usecases/FulfillmentPolicy/AddFulfillmentPolicyToItrack.d.ts.map +0 -1
- package/lib/usecases/FulfillmentPolicy/AddFulfillmentPolicyToItrack.js +0 -5
- package/lib/usecases/FulfillmentPolicy/AddFulfillmentPolicyToItrack.js.map +0 -1
- package/lib/usecases/FulfillmentPolicy/GetFulfillmentPoliciesFromItrack.d.ts +0 -7
- package/lib/usecases/FulfillmentPolicy/GetFulfillmentPoliciesFromItrack.d.ts.map +0 -1
- package/lib/usecases/FulfillmentPolicy/GetFulfillmentPoliciesFromItrack.js +0 -5
- package/lib/usecases/FulfillmentPolicy/GetFulfillmentPoliciesFromItrack.js.map +0 -1
- package/lib/usecases/FulfillmentPolicy/RemoveFulfillmentPolicyFromItrack.d.ts +0 -8
- package/lib/usecases/FulfillmentPolicy/RemoveFulfillmentPolicyFromItrack.d.ts.map +0 -1
- package/lib/usecases/FulfillmentPolicy/RemoveFulfillmentPolicyFromItrack.js +0 -5
- package/lib/usecases/FulfillmentPolicy/RemoveFulfillmentPolicyFromItrack.js.map +0 -1
- package/lib/usecases/FulfillmentPolicy/SyncFulfillmentPolicy.d.ts +0 -11
- package/lib/usecases/FulfillmentPolicy/SyncFulfillmentPolicy.d.ts.map +0 -1
- package/lib/usecases/FulfillmentPolicy/SyncFulfillmentPolicy.js +0 -60
- package/lib/usecases/FulfillmentPolicy/SyncFulfillmentPolicy.js.map +0 -1
- package/lib/usecases/FulfillmentPolicy/UpdateFulfillmentPolicyFromItrack.d.ts +0 -8
- package/lib/usecases/FulfillmentPolicy/UpdateFulfillmentPolicyFromItrack.d.ts.map +0 -1
- package/lib/usecases/FulfillmentPolicy/UpdateFulfillmentPolicyFromItrack.js +0 -5
- package/lib/usecases/FulfillmentPolicy/UpdateFulfillmentPolicyFromItrack.js.map +0 -1
- package/lib/usecases/Inventory/ConvertInventoryItemToSku.js +0 -54
- package/lib/usecases/Inventory/ConvertInventoryItemToSku.js.map +0 -1
- package/lib/usecases/Listing/GetListingFromProduct.js +0 -15
- package/lib/usecases/Listing/GetListingFromProduct.js.map +0 -1
- package/lib/usecases/Listing/PushListingToEbay.js +0 -31
- package/lib/usecases/Listing/PushListingToEbay.js.map +0 -1
- package/lib/usecases/Listing/SyncListing.js +0 -182
- package/lib/usecases/Listing/SyncListing.js.map +0 -1
- package/lib/usecases/Listing_old/GetListingFromProduct.d.ts +0 -8
- package/lib/usecases/Listing_old/GetListingFromProduct.d.ts.map +0 -1
- package/lib/usecases/Listing_old/GetListingFromProduct.js +0 -6
- package/lib/usecases/Listing_old/GetListingFromProduct.js.map +0 -1
- package/lib/usecases/Listing_old/PushListingToEbay.d.ts +0 -16
- package/lib/usecases/Listing_old/PushListingToEbay.d.ts.map +0 -1
- package/lib/usecases/Listing_old/PushListingToEbay.js +0 -22
- package/lib/usecases/Listing_old/PushListingToEbay.js.map +0 -1
- package/lib/usecases/Listing_old/SyncListing.d.ts +0 -11
- package/lib/usecases/Listing_old/SyncListing.d.ts.map +0 -1
- package/lib/usecases/Listing_old/SyncListing.js +0 -173
- package/lib/usecases/Listing_old/SyncListing.js.map +0 -1
- package/lib/usecases/Offer/ConvertItrackInventoryListingDetailToEbayOffer.d.ts +0 -22
- package/lib/usecases/Offer/ConvertItrackInventoryListingDetailToEbayOffer.d.ts.map +0 -1
- package/lib/usecases/Offer/ConvertItrackInventoryListingDetailToEbayOffer.js +0 -67
- package/lib/usecases/Offer/ConvertItrackInventoryListingDetailToEbayOffer.js.map +0 -1
- package/lib/usecases/Offer/ConvertItrackListingToEbayOffer.d.ts +0 -17
- package/lib/usecases/Offer/ConvertItrackListingToEbayOffer.d.ts.map +0 -1
- package/lib/usecases/Offer/ConvertItrackListingToEbayOffer.js +0 -66
- package/lib/usecases/Offer/ConvertItrackListingToEbayOffer.js.map +0 -1
- package/lib/usecases/Offer/CreateEbayOffer.d.ts +0 -11
- package/lib/usecases/Offer/CreateEbayOffer.d.ts.map +0 -1
- package/lib/usecases/Offer/CreateEbayOffer.js +0 -31
- package/lib/usecases/Offer/CreateEbayOffer.js.map +0 -1
- package/lib/usecases/Offer/SyncEbayOffer.d.ts +0 -20
- package/lib/usecases/Offer/SyncEbayOffer.d.ts.map +0 -1
- package/lib/usecases/Offer/SyncEbayOffer.js +0 -49
- package/lib/usecases/Offer/SyncEbayOffer.js.map +0 -1
- package/lib/usecases/Offer/createOfferSample.d.ts +0 -1
- package/lib/usecases/Offer/createOfferSample.d.ts.map +0 -1
- package/lib/usecases/Offer/createOfferSample.js +0 -230
- package/lib/usecases/Offer/createOfferSample.js.map +0 -1
- package/lib/usecases/PaymentPolicy/AddPaymentPolicyToItrack.d.ts +0 -8
- package/lib/usecases/PaymentPolicy/AddPaymentPolicyToItrack.d.ts.map +0 -1
- package/lib/usecases/PaymentPolicy/AddPaymentPolicyToItrack.js +0 -5
- package/lib/usecases/PaymentPolicy/AddPaymentPolicyToItrack.js.map +0 -1
- package/lib/usecases/PaymentPolicy/GetPaymentPoliciesFromItrack.d.ts +0 -7
- package/lib/usecases/PaymentPolicy/GetPaymentPoliciesFromItrack.d.ts.map +0 -1
- package/lib/usecases/PaymentPolicy/GetPaymentPoliciesFromItrack.js +0 -5
- package/lib/usecases/PaymentPolicy/GetPaymentPoliciesFromItrack.js.map +0 -1
- package/lib/usecases/PaymentPolicy/RemovePaymentPolicyFromItrack.d.ts +0 -8
- package/lib/usecases/PaymentPolicy/RemovePaymentPolicyFromItrack.d.ts.map +0 -1
- package/lib/usecases/PaymentPolicy/RemovePaymentPolicyFromItrack.js +0 -5
- package/lib/usecases/PaymentPolicy/RemovePaymentPolicyFromItrack.js.map +0 -1
- package/lib/usecases/PaymentPolicy/UpdatePaymentPolicyFromItrack.d.ts +0 -8
- package/lib/usecases/PaymentPolicy/UpdatePaymentPolicyFromItrack.d.ts.map +0 -1
- package/lib/usecases/PaymentPolicy/UpdatePaymentPolicyFromItrack.js +0 -5
- package/lib/usecases/PaymentPolicy/UpdatePaymentPolicyFromItrack.js.map +0 -1
- package/lib/usecases/ReturnPolicy/AddReturnPolicyToItrack.d.ts +0 -8
- package/lib/usecases/ReturnPolicy/AddReturnPolicyToItrack.d.ts.map +0 -1
- package/lib/usecases/ReturnPolicy/AddReturnPolicyToItrack.js +0 -5
- package/lib/usecases/ReturnPolicy/AddReturnPolicyToItrack.js.map +0 -1
- package/lib/usecases/ReturnPolicy/GetReturnPoliciesFromItrack.d.ts +0 -7
- package/lib/usecases/ReturnPolicy/GetReturnPoliciesFromItrack.d.ts.map +0 -1
- package/lib/usecases/ReturnPolicy/GetReturnPoliciesFromItrack.js +0 -5
- package/lib/usecases/ReturnPolicy/GetReturnPoliciesFromItrack.js.map +0 -1
- package/lib/usecases/ReturnPolicy/RemoveReturnPolicyFromItrack.d.ts +0 -8
- package/lib/usecases/ReturnPolicy/RemoveReturnPolicyFromItrack.d.ts.map +0 -1
- package/lib/usecases/ReturnPolicy/RemoveReturnPolicyFromItrack.js +0 -5
- package/lib/usecases/ReturnPolicy/RemoveReturnPolicyFromItrack.js.map +0 -1
- package/lib/usecases/ReturnPolicy/UpdateReturnPolicyInItrack.d.ts +0 -8
- package/lib/usecases/ReturnPolicy/UpdateReturnPolicyInItrack.d.ts.map +0 -1
- package/lib/usecases/ReturnPolicy/UpdateReturnPolicyInItrack.js +0 -5
- package/lib/usecases/ReturnPolicy/UpdateReturnPolicyInItrack.js.map +0 -1
- package/lib/usecases/integration.test.d.ts +0 -33
- package/lib/usecases/integration.test.d.ts.map +0 -1
- package/lib/usecases/integration.test.js +0 -499
- package/lib/usecases/integration.test.js.map +0 -1
- /package/lib/usecases/Offer/{convertItrackListingToEbayInventoryAndOffer.d.ts → ConvertItrackListingToEbayInventoryAndOffer.d.ts} +0 -0
- /package/lib/usecases/Offer/{convertItrackListingToEbayInventoryAndOffer.d.ts.map → ConvertItrackListingToEbayInventoryAndOffer.d.ts.map} +0 -0
- /package/lib/usecases/Offer/{convertItrackListingToEbayInventoryAndOffer.js → ConvertItrackListingToEbayInventoryAndOffer.js} +0 -0
- /package/lib/usecases/Offer/{convertItrackListingToEbayInventoryAndOffer.js.map → ConvertItrackListingToEbayInventoryAndOffer.js.map} +0 -0
package/lib/tests/tests.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { test } from 'uvu';
|
|
2
|
-
import * as assert from 'uvu/assert';
|
|
3
|
-
//.import { validatePackageWeightAndSize } from '../../../entities/ebay/InventoryItem.js'
|
|
4
|
-
import { validatePackageWeightAndSize } from '../entities/ebay/InventoryItem.js';
|
|
5
|
-
import { ValidationError } from '../entities/ebay/validation.js';
|
|
6
|
-
import { EbayLengthUnitOfMeasureEnum, EbayWeightUnitOfMeasureEnum } from '../entities/ebay/PackageWeightAndSize.js';
|
|
7
|
-
const compareArrays = (firstArray, secondArray, key) => {
|
|
8
|
-
const newItems = firstArray.filter(item1 => !secondArray.some(item2 => item1[key] === item2[key]));
|
|
9
|
-
const existingItems = firstArray.filter(item1 => secondArray.some(item2 => item1[key] === item2[key]));
|
|
10
|
-
const unusedItems = secondArray.filter(item2 => !firstArray.some(item1 => item1[key] === item2[key]));
|
|
11
|
-
return {
|
|
12
|
-
newItems,
|
|
13
|
-
existingItems,
|
|
14
|
-
unusedItems,
|
|
15
|
-
};
|
|
16
|
-
};
|
|
17
|
-
const policies1 = [
|
|
18
|
-
{ id: '1', name: 'Policy 1' },
|
|
19
|
-
{ id: '2', name: 'Policy 2' },
|
|
20
|
-
{ id: '3', name: 'Policy 3' },
|
|
21
|
-
];
|
|
22
|
-
const policies2 = [
|
|
23
|
-
{ id: '2', name: 'Policy 2' },
|
|
24
|
-
{ id: '3', name: 'Policy 3' },
|
|
25
|
-
{ id: '4', name: 'Policy 4' },
|
|
26
|
-
];
|
|
27
|
-
test('compareArrays should return correct comparison results', () => {
|
|
28
|
-
const result = compareArrays(policies1, policies2, 'id');
|
|
29
|
-
assert.equal(result.newItems, [{ id: '1', name: 'Policy 1' }]);
|
|
30
|
-
assert.equal(result.existingItems, [
|
|
31
|
-
{ id: '2', name: 'Policy 2' },
|
|
32
|
-
{ id: '3', name: 'Policy 3' },
|
|
33
|
-
]);
|
|
34
|
-
assert.equal(result.unusedItems, [{ id: '4', name: 'Policy 4' }]);
|
|
35
|
-
});
|
|
36
|
-
//test.run();
|
|
37
|
-
test('validatePackageWeightAndSize should pass validation for valid input', () => {
|
|
38
|
-
const packageWeightAndSize = {
|
|
39
|
-
dimensions: {
|
|
40
|
-
height: 10,
|
|
41
|
-
length: 20,
|
|
42
|
-
width: 15,
|
|
43
|
-
unit: EbayLengthUnitOfMeasureEnum.Inch
|
|
44
|
-
},
|
|
45
|
-
weight: {
|
|
46
|
-
value: 5,
|
|
47
|
-
unit: EbayWeightUnitOfMeasureEnum.Pound
|
|
48
|
-
}
|
|
49
|
-
};
|
|
50
|
-
const result = validatePackageWeightAndSize(packageWeightAndSize);
|
|
51
|
-
assert.is(result, null);
|
|
52
|
-
});
|
|
53
|
-
test('validatePackageWeightAndSize should fail validation for height equal to 0', () => {
|
|
54
|
-
const packageWeightAndSize = {
|
|
55
|
-
dimensions: {
|
|
56
|
-
height: 0,
|
|
57
|
-
length: 20,
|
|
58
|
-
width: 15,
|
|
59
|
-
unit: EbayLengthUnitOfMeasureEnum.Inch
|
|
60
|
-
},
|
|
61
|
-
weight: {
|
|
62
|
-
value: 5,
|
|
63
|
-
unit: EbayWeightUnitOfMeasureEnum.Pound
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
const result = validatePackageWeightAndSize(packageWeightAndSize);
|
|
67
|
-
assert.instance(result, ValidationError);
|
|
68
|
-
assert.is(result === null || result === void 0 ? void 0 : result.message, 'Error validating package weight and size');
|
|
69
|
-
assert.is(result === null || result === void 0 ? void 0 : result.nestedErrors.length, 1);
|
|
70
|
-
assert.is(result === null || result === void 0 ? void 0 : result.nestedErrors[0].message, 'Value of Height must be a number that is at least 1');
|
|
71
|
-
});
|
|
72
|
-
test('validatePackageWeightAndSize should fail validation for length equal to 0', () => {
|
|
73
|
-
const packageWeightAndSize = {
|
|
74
|
-
dimensions: {
|
|
75
|
-
height: 10,
|
|
76
|
-
length: 0,
|
|
77
|
-
width: 15,
|
|
78
|
-
unit: EbayLengthUnitOfMeasureEnum.Inch
|
|
79
|
-
},
|
|
80
|
-
weight: {
|
|
81
|
-
value: 5,
|
|
82
|
-
unit: EbayWeightUnitOfMeasureEnum.Pound
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const result = validatePackageWeightAndSize(packageWeightAndSize);
|
|
86
|
-
assert.instance(result, ValidationError);
|
|
87
|
-
assert.is(result === null || result === void 0 ? void 0 : result.message, 'Error validating package weight and size');
|
|
88
|
-
assert.is(result === null || result === void 0 ? void 0 : result.nestedErrors.length, 1);
|
|
89
|
-
assert.is(result === null || result === void 0 ? void 0 : result.nestedErrors[0].message, 'Value of Length must be a number that is at least 1');
|
|
90
|
-
});
|
|
91
|
-
test('validatePackageWeightAndSize should fail validation for width equal to 0', () => {
|
|
92
|
-
const packageWeightAndSize = {
|
|
93
|
-
dimensions: {
|
|
94
|
-
height: 10,
|
|
95
|
-
length: 20,
|
|
96
|
-
width: 0,
|
|
97
|
-
unit: EbayLengthUnitOfMeasureEnum.Inch
|
|
98
|
-
},
|
|
99
|
-
weight: {
|
|
100
|
-
value: 5,
|
|
101
|
-
unit: EbayWeightUnitOfMeasureEnum.Pound
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const result = validatePackageWeightAndSize(packageWeightAndSize);
|
|
105
|
-
assert.instance(result, ValidationError);
|
|
106
|
-
assert.is(result === null || result === void 0 ? void 0 : result.message, 'Error validating package weight and size');
|
|
107
|
-
assert.is(result === null || result === void 0 ? void 0 : result.nestedErrors.length, 1);
|
|
108
|
-
assert.is(result === null || result === void 0 ? void 0 : result.nestedErrors[0].message, 'Value of Width must be a number that is at least 1');
|
|
109
|
-
});
|
|
110
|
-
test('validatePackageWeightAndSize should fail validation for weight equal to 0', () => {
|
|
111
|
-
const packageWeightAndSize = {
|
|
112
|
-
dimensions: {
|
|
113
|
-
height: 10,
|
|
114
|
-
length: 20,
|
|
115
|
-
width: 15,
|
|
116
|
-
unit: EbayLengthUnitOfMeasureEnum.Inch
|
|
117
|
-
},
|
|
118
|
-
weight: {
|
|
119
|
-
value: 0,
|
|
120
|
-
unit: EbayWeightUnitOfMeasureEnum.Pound
|
|
121
|
-
}
|
|
122
|
-
};
|
|
123
|
-
const result = validatePackageWeightAndSize(packageWeightAndSize);
|
|
124
|
-
assert.instance(result, ValidationError);
|
|
125
|
-
assert.is(result === null || result === void 0 ? void 0 : result.message, 'Error validating package weight and size');
|
|
126
|
-
assert.is(result === null || result === void 0 ? void 0 : result.nestedErrors.length, 1);
|
|
127
|
-
assert.is(result === null || result === void 0 ? void 0 : result.nestedErrors[0].message, 'Value of Weight must be a number that is at least 1');
|
|
128
|
-
});
|
|
129
|
-
test.run();
|
|
130
|
-
//# sourceMappingURL=tests.js.map
|
package/lib/tests/tests.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tests.js","sourceRoot":"","sources":["../../src/tests/tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAC3B,OAAO,KAAK,MAAM,MAAM,YAAY,CAAC;AACrC,yFAAyF;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAA;AAEhF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAC,2BAA2B,EAAC,2BAA2B,EAAE,MAAM,0CAA0C,CAAA;AAQjH,MAAM,aAAa,GAAG,CAAI,UAAe,EAAE,WAAgB,EAAE,GAAY,EAAuB,EAAE;IAC9F,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAClG,MAAM,aAAa,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IACtG,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,C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servation Utilities
|
|
3
|
-
*
|
|
4
|
-
* This module provides the foundation for preserving original errors through all layers
|
|
5
|
-
* of the application. The key principle is that each layer should add context but never
|
|
6
|
-
* transform or obscure the original error details.
|
|
7
|
-
*
|
|
8
|
-
* Error Flow: HTTP/MySQL → Repo → Adapter → Use Case
|
|
9
|
-
* Each layer preserves the complete error from the layer below while adding its own context.
|
|
10
|
-
*/
|
|
11
|
-
import { HttpRequest } from '../entities/http/HttpRequest.js';
|
|
12
|
-
/**
|
|
13
|
-
* Preserved HTTP error information from the infrastructure layer
|
|
14
|
-
* This represents the original HTTP response that failed
|
|
15
|
-
*/
|
|
16
|
-
export interface HttpErrorPreservation {
|
|
17
|
-
status: number;
|
|
18
|
-
statusText: string;
|
|
19
|
-
data: any;
|
|
20
|
-
request: HttpRequest;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Preserved MySQL error information from the infrastructure layer
|
|
24
|
-
* This represents the original MySQL error that occurred
|
|
25
|
-
*/
|
|
26
|
-
export interface MysqlErrorPreservation {
|
|
27
|
-
code?: string;
|
|
28
|
-
message: string;
|
|
29
|
-
sqlState?: string;
|
|
30
|
-
errno?: number;
|
|
31
|
-
stack?: string;
|
|
32
|
-
sql: string;
|
|
33
|
-
values: any[];
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Error chain link - represents one layer in the error propagation
|
|
37
|
-
*/
|
|
38
|
-
export interface ErrorChainLink {
|
|
39
|
-
layerContext: string;
|
|
40
|
-
timestamp: Date;
|
|
41
|
-
originalError?: HttpErrorPreservation | MysqlErrorPreservation | ErrorChainLink;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Complete error chain from root cause to current layer
|
|
45
|
-
*/
|
|
46
|
-
export interface ErrorChain {
|
|
47
|
-
rootCause: HttpErrorPreservation | MysqlErrorPreservation;
|
|
48
|
-
chain: ErrorChainLink[];
|
|
49
|
-
currentLayer: string;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Extracts the root HTTP error from any error object, regardless of how many layers deep
|
|
53
|
-
*
|
|
54
|
-
* @param error - Error object from any layer
|
|
55
|
-
* @returns The original HTTP error, or null if not found
|
|
56
|
-
*/
|
|
57
|
-
export declare function extractHttpError(error: any): HttpErrorPreservation | null;
|
|
58
|
-
/**
|
|
59
|
-
* Extracts the root MySQL error from any error object, regardless of how many layers deep
|
|
60
|
-
*
|
|
61
|
-
* @param error - Error object from any layer
|
|
62
|
-
* @returns The original MySQL error, or null if not found
|
|
63
|
-
*/
|
|
64
|
-
export declare function extractMysqlError(error: any): MysqlErrorPreservation | null;
|
|
65
|
-
/**
|
|
66
|
-
* Builds a complete error chain showing how the error propagated through layers
|
|
67
|
-
*
|
|
68
|
-
* @param error - Error object from any layer
|
|
69
|
-
* @returns Array of layer contexts in order from root to current
|
|
70
|
-
*/
|
|
71
|
-
export declare function getErrorChain(error: any): string[];
|
|
72
|
-
/**
|
|
73
|
-
* Builds a complete ErrorChain object with root cause and full trace
|
|
74
|
-
*
|
|
75
|
-
* @param error - Error object from any layer
|
|
76
|
-
* @returns Complete error chain with root cause identification
|
|
77
|
-
*/
|
|
78
|
-
export declare function buildErrorChain(error: any): ErrorChain | null;
|
|
79
|
-
/**
|
|
80
|
-
* Adds layer context to an error without losing the original error information
|
|
81
|
-
*
|
|
82
|
-
* @param originalError - The error from the layer below
|
|
83
|
-
* @param layerContext - Context string identifying the current layer
|
|
84
|
-
* @returns Error object with preserved original error and added context
|
|
85
|
-
*/
|
|
86
|
-
export declare function addLayerContext(originalError: any, layerContext: string): any;
|
|
87
|
-
/**
|
|
88
|
-
* Preserves an original error exactly while adding minimal wrapper context
|
|
89
|
-
* This is the core function for error preservation - it never transforms the original error
|
|
90
|
-
*
|
|
91
|
-
* @param originalError - The complete error object from the layer below
|
|
92
|
-
* @param layerContext - Context identifying the current layer
|
|
93
|
-
* @param additionalContext - Optional additional context (request info, etc.)
|
|
94
|
-
* @returns Wrapper that preserves original error completely
|
|
95
|
-
*/
|
|
96
|
-
export declare function preserveOriginalError(originalError: any, layerContext: string, additionalContext?: any): any;
|
|
97
|
-
/**
|
|
98
|
-
* Builds debugging context from any error object
|
|
99
|
-
* Extracts all relevant information for troubleshooting
|
|
100
|
-
*
|
|
101
|
-
* @param error - Error object from any layer
|
|
102
|
-
* @returns Comprehensive debugging information
|
|
103
|
-
*/
|
|
104
|
-
export declare function buildErrorTrace(error: any): any;
|
|
105
|
-
/**
|
|
106
|
-
* Formats an error for comprehensive logging
|
|
107
|
-
* Shows the complete error chain and root cause
|
|
108
|
-
*
|
|
109
|
-
* @param error - Error object from any layer
|
|
110
|
-
* @returns Formatted string for logging
|
|
111
|
-
*/
|
|
112
|
-
export declare function formatErrorForLogging(error: any): string;
|
|
113
|
-
/**
|
|
114
|
-
* Gets debugging context for development/troubleshooting
|
|
115
|
-
* Returns structured data that can be logged or displayed
|
|
116
|
-
*
|
|
117
|
-
* @param error - Error object from any layer
|
|
118
|
-
* @returns Structured debugging information
|
|
119
|
-
*/
|
|
120
|
-
export declare function getDebugContext(error: any): any;
|
|
121
|
-
/**
|
|
122
|
-
* Creates a simple error message for user display
|
|
123
|
-
* Extracts the most relevant error message without technical details
|
|
124
|
-
*
|
|
125
|
-
* @param error - Error object from any layer
|
|
126
|
-
* @returns User-friendly error message
|
|
127
|
-
*/
|
|
128
|
-
export declare function getSimpleErrorMessage(error: any): string;
|
|
129
|
-
/**
|
|
130
|
-
* Type guard to check if an error contains HTTP error information
|
|
131
|
-
*/
|
|
132
|
-
export declare function hasHttpError(error: any): boolean;
|
|
133
|
-
/**
|
|
134
|
-
* Type guard to check if an error contains MySQL error information
|
|
135
|
-
*/
|
|
136
|
-
export declare function hasMysqlError(error: any): boolean;
|
|
137
|
-
/**
|
|
138
|
-
* Type guard to check if an error has a complete error chain
|
|
139
|
-
*/
|
|
140
|
-
export declare function hasErrorChain(error: any): boolean;
|
|
141
|
-
/**
|
|
142
|
-
* Validates that an error object properly preserves original error information
|
|
143
|
-
* Used for testing and debugging error preservation implementation
|
|
144
|
-
*
|
|
145
|
-
* @param error - Error object to validate
|
|
146
|
-
* @returns Validation result with details
|
|
147
|
-
*/
|
|
148
|
-
export declare function validateErrorPreservation(error: any): {
|
|
149
|
-
isValid: boolean;
|
|
150
|
-
issues: string[];
|
|
151
|
-
hasRootCause: boolean;
|
|
152
|
-
chainLength: number;
|
|
153
|
-
};
|
|
154
|
-
//# sourceMappingURL=ErrorPreservation.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPreservation.d.ts","sourceRoot":"","sources":["../../src/types/ErrorPreservation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAA;AAM7D;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,GAAG,CAAA;IACT,OAAO,EAAE,WAAW,CAAA;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,OAAO,EAAE,MAAM,CAAA;IACf,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,GAAG,EAAE,CAAA;CACd;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,IAAI,CAAA;IACf,aAAa,CAAC,EAAE,qBAAqB,GAAG,sBAAsB,GAAG,cAAc,CAAA;CAChF;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,qBAAqB,GAAG,sBAAsB,CAAA;IACzD,KAAK,EAAE,cAAc,EAAE,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA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GAAG,GAAG;IACrD,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,EAAE,CAAA;IAChB,YAAY,EAAE,OAAO,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;CACpB,CAgCA"}
|
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error Preservation Utilities
|
|
3
|
-
*
|
|
4
|
-
* This module provides the foundation for preserving original errors through all layers
|
|
5
|
-
* of the application. The key principle is that each layer should add context but never
|
|
6
|
-
* transform or obscure the original error details.
|
|
7
|
-
*
|
|
8
|
-
* Error Flow: HTTP/MySQL → Repo → Adapter → Use Case
|
|
9
|
-
* Each layer preserves the complete error from the layer below while adding its own context.
|
|
10
|
-
*/
|
|
11
|
-
// ============================================================================
|
|
12
|
-
// ERROR EXTRACTION UTILITIES
|
|
13
|
-
// ============================================================================
|
|
14
|
-
/**
|
|
15
|
-
* Extracts the root HTTP error from any error object, regardless of how many layers deep
|
|
16
|
-
*
|
|
17
|
-
* @param error - Error object from any layer
|
|
18
|
-
* @returns The original HTTP error, or null if not found
|
|
19
|
-
*/
|
|
20
|
-
export function extractHttpError(error) {
|
|
21
|
-
if (!error)
|
|
22
|
-
return null;
|
|
23
|
-
// Direct HTTP error
|
|
24
|
-
if (error.status && error.statusText && error.request) {
|
|
25
|
-
return {
|
|
26
|
-
status: error.status,
|
|
27
|
-
statusText: error.statusText,
|
|
28
|
-
data: error.data,
|
|
29
|
-
request: error.request
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
// Check for preserved HTTP error in repo layer
|
|
33
|
-
if (error.originalHttpError) {
|
|
34
|
-
return extractHttpError(error.originalHttpError);
|
|
35
|
-
}
|
|
36
|
-
// Check for nested original errors (adapter/use case layers)
|
|
37
|
-
if (error.originalError) {
|
|
38
|
-
return extractHttpError(error.originalError);
|
|
39
|
-
}
|
|
40
|
-
// Check for repo error containing HTTP error
|
|
41
|
-
if (error.originalRepoError) {
|
|
42
|
-
return extractHttpError(error.originalRepoError);
|
|
43
|
-
}
|
|
44
|
-
// Check for adapter error containing repo error
|
|
45
|
-
if (error.originalAdapterError) {
|
|
46
|
-
return extractHttpError(error.originalAdapterError);
|
|
47
|
-
}
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Extracts the root MySQL error from any error object, regardless of how many layers deep
|
|
52
|
-
*
|
|
53
|
-
* @param error - Error object from any layer
|
|
54
|
-
* @returns The original MySQL error, or null if not found
|
|
55
|
-
*/
|
|
56
|
-
export function extractMysqlError(error) {
|
|
57
|
-
if (!error)
|
|
58
|
-
return null;
|
|
59
|
-
// Direct MySQL error
|
|
60
|
-
if (error.code && error.message && error.sql) {
|
|
61
|
-
return {
|
|
62
|
-
code: error.code,
|
|
63
|
-
message: error.message,
|
|
64
|
-
sqlState: error.sqlState,
|
|
65
|
-
errno: error.errno,
|
|
66
|
-
stack: error.stack,
|
|
67
|
-
sql: error.sql,
|
|
68
|
-
values: error.values || []
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
// Check for preserved MySQL error in repo layer
|
|
72
|
-
if (error.originalMysqlError) {
|
|
73
|
-
return extractMysqlError(error.originalMysqlError);
|
|
74
|
-
}
|
|
75
|
-
// Check for nested original errors (adapter/use case layers)
|
|
76
|
-
if (error.originalError) {
|
|
77
|
-
return extractMysqlError(error.originalError);
|
|
78
|
-
}
|
|
79
|
-
// Check for repo error containing MySQL error
|
|
80
|
-
if (error.originalRepoError) {
|
|
81
|
-
return extractMysqlError(error.originalRepoError);
|
|
82
|
-
}
|
|
83
|
-
// Check for adapter error containing repo error
|
|
84
|
-
if (error.originalAdapterError) {
|
|
85
|
-
return extractMysqlError(error.originalAdapterError);
|
|
86
|
-
}
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Builds a complete error chain showing how the error propagated through layers
|
|
91
|
-
*
|
|
92
|
-
* @param error - Error object from any layer
|
|
93
|
-
* @returns Array of layer contexts in order from root to current
|
|
94
|
-
*/
|
|
95
|
-
export function getErrorChain(error) {
|
|
96
|
-
const chain = [];
|
|
97
|
-
let current = error;
|
|
98
|
-
while (current) {
|
|
99
|
-
if (current.layerContext) {
|
|
100
|
-
chain.push(current.layerContext);
|
|
101
|
-
}
|
|
102
|
-
// Navigate to the next layer down
|
|
103
|
-
current = current.originalError ||
|
|
104
|
-
current.originalRepoError ||
|
|
105
|
-
current.originalAdapterError ||
|
|
106
|
-
current.originalHttpError ||
|
|
107
|
-
current.originalMysqlError;
|
|
108
|
-
}
|
|
109
|
-
return chain;
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Builds a complete ErrorChain object with root cause and full trace
|
|
113
|
-
*
|
|
114
|
-
* @param error - Error object from any layer
|
|
115
|
-
* @returns Complete error chain with root cause identification
|
|
116
|
-
*/
|
|
117
|
-
export function buildErrorChain(error) {
|
|
118
|
-
if (!error)
|
|
119
|
-
return null;
|
|
120
|
-
const httpError = extractHttpError(error);
|
|
121
|
-
const mysqlError = extractMysqlError(error);
|
|
122
|
-
const chain = getErrorChain(error);
|
|
123
|
-
if (!httpError && !mysqlError)
|
|
124
|
-
return null;
|
|
125
|
-
const rootCause = httpError || mysqlError;
|
|
126
|
-
const chainLinks = [];
|
|
127
|
-
let current = error;
|
|
128
|
-
while (current) {
|
|
129
|
-
if (current.layerContext) {
|
|
130
|
-
chainLinks.push({
|
|
131
|
-
layerContext: current.layerContext,
|
|
132
|
-
timestamp: new Date(),
|
|
133
|
-
originalError: current.originalError || current.originalRepoError || current.originalAdapterError
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
current = current.originalError ||
|
|
137
|
-
current.originalRepoError ||
|
|
138
|
-
current.originalAdapterError ||
|
|
139
|
-
current.originalHttpError ||
|
|
140
|
-
current.originalMysqlError;
|
|
141
|
-
}
|
|
142
|
-
return {
|
|
143
|
-
rootCause,
|
|
144
|
-
chain: chainLinks,
|
|
145
|
-
currentLayer: chain[0] || 'Unknown'
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
// ============================================================================
|
|
149
|
-
// ERROR CONTEXT UTILITIES
|
|
150
|
-
// ============================================================================
|
|
151
|
-
/**
|
|
152
|
-
* Adds layer context to an error without losing the original error information
|
|
153
|
-
*
|
|
154
|
-
* @param originalError - The error from the layer below
|
|
155
|
-
* @param layerContext - Context string identifying the current layer
|
|
156
|
-
* @returns Error object with preserved original error and added context
|
|
157
|
-
*/
|
|
158
|
-
export function addLayerContext(originalError, layerContext) {
|
|
159
|
-
return {
|
|
160
|
-
...originalError,
|
|
161
|
-
layerContext,
|
|
162
|
-
timestamp: new Date().toISOString()
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Preserves an original error exactly while adding minimal wrapper context
|
|
167
|
-
* This is the core function for error preservation - it never transforms the original error
|
|
168
|
-
*
|
|
169
|
-
* @param originalError - The complete error object from the layer below
|
|
170
|
-
* @param layerContext - Context identifying the current layer
|
|
171
|
-
* @param additionalContext - Optional additional context (request info, etc.)
|
|
172
|
-
* @returns Wrapper that preserves original error completely
|
|
173
|
-
*/
|
|
174
|
-
export function preserveOriginalError(originalError, layerContext, additionalContext) {
|
|
175
|
-
return {
|
|
176
|
-
success: false,
|
|
177
|
-
layerContext,
|
|
178
|
-
originalError, // EXACT preservation - no transformation
|
|
179
|
-
timestamp: new Date().toISOString(),
|
|
180
|
-
...additionalContext
|
|
181
|
-
};
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Builds debugging context from any error object
|
|
185
|
-
* Extracts all relevant information for troubleshooting
|
|
186
|
-
*
|
|
187
|
-
* @param error - Error object from any layer
|
|
188
|
-
* @returns Comprehensive debugging information
|
|
189
|
-
*/
|
|
190
|
-
export function buildErrorTrace(error) {
|
|
191
|
-
const httpError = extractHttpError(error);
|
|
192
|
-
const mysqlError = extractMysqlError(error);
|
|
193
|
-
const chain = getErrorChain(error);
|
|
194
|
-
return {
|
|
195
|
-
errorChain: chain,
|
|
196
|
-
rootCause: {
|
|
197
|
-
type: httpError ? 'HTTP' : mysqlError ? 'MySQL' : 'Unknown',
|
|
198
|
-
details: httpError || mysqlError || 'No root cause found'
|
|
199
|
-
},
|
|
200
|
-
layerCount: chain.length,
|
|
201
|
-
timestamp: new Date().toISOString(),
|
|
202
|
-
fullError: error
|
|
203
|
-
};
|
|
204
|
-
}
|
|
205
|
-
// ============================================================================
|
|
206
|
-
// LOGGING UTILITIES
|
|
207
|
-
// ============================================================================
|
|
208
|
-
/**
|
|
209
|
-
* Formats an error for comprehensive logging
|
|
210
|
-
* Shows the complete error chain and root cause
|
|
211
|
-
*
|
|
212
|
-
* @param error - Error object from any layer
|
|
213
|
-
* @returns Formatted string for logging
|
|
214
|
-
*/
|
|
215
|
-
export function formatErrorForLogging(error) {
|
|
216
|
-
const trace = buildErrorTrace(error);
|
|
217
|
-
const lines = [];
|
|
218
|
-
lines.push(`ERROR TRACE (${trace.layerCount} layers):`);
|
|
219
|
-
// Show the error chain
|
|
220
|
-
trace.errorChain.forEach((layer, index) => {
|
|
221
|
-
const indent = ' '.repeat(index);
|
|
222
|
-
lines.push(`${indent}${index + 1}. ${layer}`);
|
|
223
|
-
});
|
|
224
|
-
// Show root cause
|
|
225
|
-
lines.push(`\nROOT CAUSE (${trace.rootCause.type}):`);
|
|
226
|
-
if (trace.rootCause.type === 'HTTP') {
|
|
227
|
-
const http = trace.rootCause.details;
|
|
228
|
-
lines.push(` Status: ${http.status} ${http.statusText}`);
|
|
229
|
-
lines.push(` URL: ${http.request.method} ${http.request.url}`);
|
|
230
|
-
lines.push(` Data: ${JSON.stringify(http.data, null, 2)}`);
|
|
231
|
-
}
|
|
232
|
-
else if (trace.rootCause.type === 'MySQL') {
|
|
233
|
-
const mysql = trace.rootCause.details;
|
|
234
|
-
lines.push(` Code: ${mysql.code} (${mysql.errno})`);
|
|
235
|
-
lines.push(` Message: ${mysql.message}`);
|
|
236
|
-
lines.push(` SQL: ${mysql.sql}`);
|
|
237
|
-
lines.push(` Values: ${JSON.stringify(mysql.values)}`);
|
|
238
|
-
}
|
|
239
|
-
return lines.join('\n');
|
|
240
|
-
}
|
|
241
|
-
/**
|
|
242
|
-
* Gets debugging context for development/troubleshooting
|
|
243
|
-
* Returns structured data that can be logged or displayed
|
|
244
|
-
*
|
|
245
|
-
* @param error - Error object from any layer
|
|
246
|
-
* @returns Structured debugging information
|
|
247
|
-
*/
|
|
248
|
-
export function getDebugContext(error) {
|
|
249
|
-
const httpError = extractHttpError(error);
|
|
250
|
-
const mysqlError = extractMysqlError(error);
|
|
251
|
-
const chain = getErrorChain(error);
|
|
252
|
-
return {
|
|
253
|
-
summary: {
|
|
254
|
-
rootCauseType: httpError ? 'HTTP' : mysqlError ? 'MySQL' : 'Unknown',
|
|
255
|
-
layerCount: chain.length,
|
|
256
|
-
currentLayer: chain[0] || 'Unknown'
|
|
257
|
-
},
|
|
258
|
-
errorChain: chain,
|
|
259
|
-
rootCause: {
|
|
260
|
-
http: httpError,
|
|
261
|
-
mysql: mysqlError
|
|
262
|
-
},
|
|
263
|
-
fullTrace: buildErrorTrace(error)
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
/**
|
|
267
|
-
* Creates a simple error message for user display
|
|
268
|
-
* Extracts the most relevant error message without technical details
|
|
269
|
-
*
|
|
270
|
-
* @param error - Error object from any layer
|
|
271
|
-
* @returns User-friendly error message
|
|
272
|
-
*/
|
|
273
|
-
export function getSimpleErrorMessage(error) {
|
|
274
|
-
const httpError = extractHttpError(error);
|
|
275
|
-
const mysqlError = extractMysqlError(error);
|
|
276
|
-
if (httpError) {
|
|
277
|
-
if (httpError.status === 401)
|
|
278
|
-
return 'Authentication failed';
|
|
279
|
-
if (httpError.status === 403)
|
|
280
|
-
return 'Access denied';
|
|
281
|
-
if (httpError.status === 404)
|
|
282
|
-
return 'Resource not found';
|
|
283
|
-
if (httpError.status >= 500)
|
|
284
|
-
return 'Server error occurred';
|
|
285
|
-
return `Request failed (${httpError.status})`;
|
|
286
|
-
}
|
|
287
|
-
if (mysqlError) {
|
|
288
|
-
if (mysqlError.code === 'ER_NO_SUCH_TABLE')
|
|
289
|
-
return 'Database table not found';
|
|
290
|
-
if (mysqlError.code === 'ER_DUP_ENTRY')
|
|
291
|
-
return 'Duplicate entry';
|
|
292
|
-
if (mysqlError.code === 'ER_ACCESS_DENIED_ERROR')
|
|
293
|
-
return 'Database access denied';
|
|
294
|
-
return 'Database operation failed';
|
|
295
|
-
}
|
|
296
|
-
return 'An error occurred';
|
|
297
|
-
}
|
|
298
|
-
// ============================================================================
|
|
299
|
-
// TYPE GUARDS
|
|
300
|
-
// ============================================================================
|
|
301
|
-
/**
|
|
302
|
-
* Type guard to check if an error contains HTTP error information
|
|
303
|
-
*/
|
|
304
|
-
export function hasHttpError(error) {
|
|
305
|
-
return extractHttpError(error) !== null;
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* Type guard to check if an error contains MySQL error information
|
|
309
|
-
*/
|
|
310
|
-
export function hasMysqlError(error) {
|
|
311
|
-
return extractMysqlError(error) !== null;
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* Type guard to check if an error has a complete error chain
|
|
315
|
-
*/
|
|
316
|
-
export function hasErrorChain(error) {
|
|
317
|
-
return getErrorChain(error).length > 0;
|
|
318
|
-
}
|
|
319
|
-
// ============================================================================
|
|
320
|
-
// VALIDATION UTILITIES
|
|
321
|
-
// ============================================================================
|
|
322
|
-
/**
|
|
323
|
-
* Validates that an error object properly preserves original error information
|
|
324
|
-
* Used for testing and debugging error preservation implementation
|
|
325
|
-
*
|
|
326
|
-
* @param error - Error object to validate
|
|
327
|
-
* @returns Validation result with details
|
|
328
|
-
*/
|
|
329
|
-
export function validateErrorPreservation(error) {
|
|
330
|
-
const issues = [];
|
|
331
|
-
const httpError = extractHttpError(error);
|
|
332
|
-
const mysqlError = extractMysqlError(error);
|
|
333
|
-
const chain = getErrorChain(error);
|
|
334
|
-
// Check for root cause
|
|
335
|
-
if (!httpError && !mysqlError) {
|
|
336
|
-
issues.push('No root cause (HTTP or MySQL error) found');
|
|
337
|
-
}
|
|
338
|
-
// Check for layer context
|
|
339
|
-
if (!error.layerContext) {
|
|
340
|
-
issues.push('Missing layerContext in current layer');
|
|
341
|
-
}
|
|
342
|
-
// Check for original error preservation
|
|
343
|
-
if (!error.originalError && !error.originalHttpError && !error.originalMysqlError) {
|
|
344
|
-
issues.push('No original error preserved');
|
|
345
|
-
}
|
|
346
|
-
// Check chain integrity
|
|
347
|
-
if (chain.length === 0) {
|
|
348
|
-
issues.push('Error chain is empty');
|
|
349
|
-
}
|
|
350
|
-
return {
|
|
351
|
-
isValid: issues.length === 0,
|
|
352
|
-
issues,
|
|
353
|
-
hasRootCause: !!(httpError || mysqlError),
|
|
354
|
-
chainLength: chain.length
|
|
355
|
-
};
|
|
356
|
-
}
|
|
357
|
-
//# sourceMappingURL=ErrorPreservation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorPreservation.js","sourceRoot":"","sources":["../../src/types/ErrorPreservation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAmDH,+EAA+E;AAC/E,6BAA6B;AAC7B,+EAA+E;AAE/E;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAU;IACzC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAA;IAEvB,oBAAoB;IACpB,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,OAAO,EAAE,CAAC;QACtD,OAAO;YACL,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,UAAU,EAAE,KAAK,CAAC,UAAU;YAC5B,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,OAAO,EAAE,KAAK,CAAC,OAAO;SACvB,CAAA;IACH,CAAC;IAED,+CAA+C;IAC/C,IAAI,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC5B,OAAO,gBAAgB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