@muhammedaksam/ayyildiz-node 1.0.0 → 1.0.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/LICENSE.md +1 -1
- package/dist/VersionInfo.js +1 -1
- package/package.json +4 -1
- package/dist/__tests__/AccountService.test.d.ts +0 -2
- package/dist/__tests__/AccountService.test.d.ts.map +0 -1
- package/dist/__tests__/AccountService.test.js +0 -83
- package/dist/__tests__/AccountService.test.js.map +0 -1
- package/dist/__tests__/AxiosHttpClient.test.d.ts +0 -2
- package/dist/__tests__/AxiosHttpClient.test.d.ts.map +0 -1
- package/dist/__tests__/AxiosHttpClient.test.js +0 -182
- package/dist/__tests__/AxiosHttpClient.test.js.map +0 -1
- package/dist/__tests__/AyyildizClient.test.d.ts +0 -2
- package/dist/__tests__/AyyildizClient.test.d.ts.map +0 -1
- package/dist/__tests__/AyyildizClient.test.js +0 -137
- package/dist/__tests__/AyyildizClient.test.js.map +0 -1
- package/dist/__tests__/ReportService.test.d.ts +0 -2
- package/dist/__tests__/ReportService.test.d.ts.map +0 -1
- package/dist/__tests__/ReportService.test.js +0 -147
- package/dist/__tests__/ReportService.test.js.map +0 -1
- package/dist/__tests__/Response.test.d.ts +0 -2
- package/dist/__tests__/Response.test.d.ts.map +0 -1
- package/dist/__tests__/Response.test.js +0 -507
- package/dist/__tests__/Response.test.js.map +0 -1
- package/dist/__tests__/SenderService.test.d.ts +0 -2
- package/dist/__tests__/SenderService.test.d.ts.map +0 -1
- package/dist/__tests__/SenderService.test.js +0 -85
- package/dist/__tests__/SenderService.test.js.map +0 -1
- package/dist/__tests__/SmsService.test.d.ts +0 -2
- package/dist/__tests__/SmsService.test.d.ts.map +0 -1
- package/dist/__tests__/SmsService.test.js +0 -176
- package/dist/__tests__/SmsService.test.js.map +0 -1
- package/dist/__tests__/VersionInfo.test.d.ts +0 -2
- package/dist/__tests__/VersionInfo.test.d.ts.map +0 -1
- package/dist/__tests__/VersionInfo.test.js +0 -56
- package/dist/__tests__/VersionInfo.test.js.map +0 -1
- package/dist/__tests__/index.test.d.ts +0 -2
- package/dist/__tests__/index.test.d.ts.map +0 -1
- package/dist/__tests__/index.test.js +0 -76
- package/dist/__tests__/index.test.js.map +0 -1
|
@@ -1,507 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const BaseResponse_1 = require("../responses/BaseResponse");
|
|
4
|
-
const SmsResponse_1 = require("../responses/SmsResponse");
|
|
5
|
-
const AccountResponse_1 = require("../responses/AccountResponse");
|
|
6
|
-
const ReportResponse_1 = require("../responses/ReportResponse");
|
|
7
|
-
const SenderResponse_1 = require("../responses/SenderResponse");
|
|
8
|
-
describe('BaseResponse', () => {
|
|
9
|
-
describe('constructor and basic functionality', () => {
|
|
10
|
-
it('should initialize with string data', () => {
|
|
11
|
-
const response = new BaseResponse_1.BaseResponse('ID:123456', 200);
|
|
12
|
-
expect(response.ok()).toBe(true);
|
|
13
|
-
expect(response.getStatusCode()).toBe(200);
|
|
14
|
-
});
|
|
15
|
-
it('should initialize with object data', () => {
|
|
16
|
-
const data = { message: 'test' };
|
|
17
|
-
const response = new BaseResponse_1.BaseResponse(data, 200);
|
|
18
|
-
expect(response.getStatusCode()).toBe(200);
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
describe('success determination', () => {
|
|
22
|
-
it('should return true for status 200 without error', () => {
|
|
23
|
-
const response = new BaseResponse_1.BaseResponse('test message', 200);
|
|
24
|
-
expect(response.ok()).toBe(true);
|
|
25
|
-
});
|
|
26
|
-
it('should return false for status 400', () => {
|
|
27
|
-
const response = new BaseResponse_1.BaseResponse('test', 400);
|
|
28
|
-
expect(response.ok()).toBe(false);
|
|
29
|
-
});
|
|
30
|
-
it('should return false for status 500', () => {
|
|
31
|
-
const response = new BaseResponse_1.BaseResponse('test', 500);
|
|
32
|
-
expect(response.ok()).toBe(false);
|
|
33
|
-
});
|
|
34
|
-
it('should return false for status 200 with error code', () => {
|
|
35
|
-
const response = new BaseResponse_1.BaseResponse('20', 200);
|
|
36
|
-
expect(response.ok()).toBe(false);
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
describe('error handling', () => {
|
|
40
|
-
it('should detect error codes', () => {
|
|
41
|
-
const response = new BaseResponse_1.BaseResponse('20', 200);
|
|
42
|
-
expect(response.hasError()).toBe(true);
|
|
43
|
-
expect(response.getErrorCode()).toBe('20');
|
|
44
|
-
});
|
|
45
|
-
it('should return error code from data object when available', () => {
|
|
46
|
-
const response = new BaseResponse_1.BaseResponse('test', 200);
|
|
47
|
-
response.data = { errorCode: 'DATA_ERROR' };
|
|
48
|
-
expect(response.getErrorCode()).toBe('DATA_ERROR');
|
|
49
|
-
});
|
|
50
|
-
it('should not detect error for success messages', () => {
|
|
51
|
-
const response = new BaseResponse_1.BaseResponse('Success message', 200);
|
|
52
|
-
expect(response.hasError()).toBe(false);
|
|
53
|
-
});
|
|
54
|
-
it('should handle two-digit error codes', () => {
|
|
55
|
-
const response = new BaseResponse_1.BaseResponse('01', 400);
|
|
56
|
-
expect(response.hasError()).toBe(true);
|
|
57
|
-
expect(response.getErrorCode()).toBe('01');
|
|
58
|
-
});
|
|
59
|
-
it('should handle three-digit error codes', () => {
|
|
60
|
-
const response = new BaseResponse_1.BaseResponse('404', 400);
|
|
61
|
-
expect(response.hasError()).toBe(true);
|
|
62
|
-
expect(response.getErrorCode()).toBe('404');
|
|
63
|
-
});
|
|
64
|
-
it('should handle trimmed error codes (tests line 90)', () => {
|
|
65
|
-
const response = new BaseResponse_1.BaseResponse(' 99 ', 400);
|
|
66
|
-
expect(response.hasError()).toBe(true);
|
|
67
|
-
expect(response.getErrorCode()).toBe('99');
|
|
68
|
-
});
|
|
69
|
-
// Additional test to cover BaseResponse line 90 - error code regex
|
|
70
|
-
it('should detect numeric error code from raw response (tests line 90)', () => {
|
|
71
|
-
// Test without data.errorCode to force the rawResponse path
|
|
72
|
-
const response = new BaseResponse_1.BaseResponse('404', 404); // Just the error code, no extra spaces initially
|
|
73
|
-
response.data = null; // Ensure data.errorCode is not available
|
|
74
|
-
expect(response.getErrorCode()).toBe('404'); // Should detect and return the error code
|
|
75
|
-
});
|
|
76
|
-
// Test to cover unknown error code fallback in getErrorMessage()
|
|
77
|
-
it('should return unknown error message for unrecognized error codes', () => {
|
|
78
|
-
const response = new BaseResponse_1.BaseResponse('999', 400); // Use an error code not in the errorMessages map
|
|
79
|
-
expect(response.getErrorMessage()).toBe('Bilinmeyen hata kodu: 999');
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
describe('message handling', () => {
|
|
83
|
-
it('should return message for successful responses', () => {
|
|
84
|
-
const response = new BaseResponse_1.BaseResponse('Success message', 200);
|
|
85
|
-
expect(response.getMessage()).toBe('Success message');
|
|
86
|
-
});
|
|
87
|
-
it('should return error message for error responses', () => {
|
|
88
|
-
const response = new BaseResponse_1.BaseResponse('01', 400);
|
|
89
|
-
expect(response.getMessage()).toContain('Kullanıcı Bilgileri Hatalı');
|
|
90
|
-
});
|
|
91
|
-
// Test to cover the fallback to empty string in getMessage() when data.message and rawResponse are both falsy
|
|
92
|
-
it('should return empty string when both data.message and rawResponse are falsy', () => {
|
|
93
|
-
const response = new BaseResponse_1.BaseResponse(null, 200);
|
|
94
|
-
response.data = {}; // No message property
|
|
95
|
-
response.rawResponse = ''; // Empty raw response
|
|
96
|
-
expect(response.getMessage()).toBe(''); // Should fallback to empty string
|
|
97
|
-
});
|
|
98
|
-
});
|
|
99
|
-
describe('getters', () => {
|
|
100
|
-
it('should return correct status code', () => {
|
|
101
|
-
const response = new BaseResponse_1.BaseResponse('test', 201);
|
|
102
|
-
expect(response.getStatusCode()).toBe(201);
|
|
103
|
-
});
|
|
104
|
-
it('should return empty error code for success', () => {
|
|
105
|
-
const response = new BaseResponse_1.BaseResponse('success', 200);
|
|
106
|
-
expect(response.getErrorCode()).toBe('');
|
|
107
|
-
});
|
|
108
|
-
it('should return empty error code for non-numeric non-error responses', () => {
|
|
109
|
-
const response = new BaseResponse_1.BaseResponse('Some random text message', 200);
|
|
110
|
-
expect(response.getErrorCode()).toBe('');
|
|
111
|
-
});
|
|
112
|
-
});
|
|
113
|
-
describe('JSON serialization', () => {
|
|
114
|
-
it('should serialize to JSON correctly', () => {
|
|
115
|
-
const response = new BaseResponse_1.BaseResponse('ID:123456', 200);
|
|
116
|
-
const json = response.toJSON();
|
|
117
|
-
expect(json).toHaveProperty('success');
|
|
118
|
-
expect(json).toHaveProperty('statusCode');
|
|
119
|
-
expect(json).toHaveProperty('message');
|
|
120
|
-
expect(json).toHaveProperty('errorCode');
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
describe('SmsResponse', () => {
|
|
125
|
-
describe('successful SMS responses', () => {
|
|
126
|
-
it('should parse successful SMS ID response', () => {
|
|
127
|
-
const response = new SmsResponse_1.SmsResponse('ID:123456', 200);
|
|
128
|
-
expect(response.ok()).toBe(true);
|
|
129
|
-
expect(response.getMessageId()).toBe('123456');
|
|
130
|
-
});
|
|
131
|
-
it('should handle multiple SMS IDs', () => {
|
|
132
|
-
const response = new SmsResponse_1.SmsResponse('ID:123456,789012', 200);
|
|
133
|
-
expect(response.ok()).toBe(true);
|
|
134
|
-
expect(response.getMessageId()).toBe('123456,789012');
|
|
135
|
-
});
|
|
136
|
-
});
|
|
137
|
-
describe('error responses', () => {
|
|
138
|
-
it('should handle error code responses', () => {
|
|
139
|
-
const response = new SmsResponse_1.SmsResponse('404', 400);
|
|
140
|
-
expect(response.ok()).toBe(false);
|
|
141
|
-
expect(response.getMessageId()).toBeNull();
|
|
142
|
-
});
|
|
143
|
-
it('should handle error message responses', () => {
|
|
144
|
-
const response = new SmsResponse_1.SmsResponse('Invalid credentials', 401);
|
|
145
|
-
expect(response.ok()).toBe(false);
|
|
146
|
-
expect(response.getMessageId()).toBeNull();
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
describe('getMessageId method', () => {
|
|
150
|
-
it('should return SMS ID for successful responses', () => {
|
|
151
|
-
const response = new SmsResponse_1.SmsResponse('ID:987654', 200);
|
|
152
|
-
expect(response.getMessageId()).toBe('987654');
|
|
153
|
-
});
|
|
154
|
-
it('should return ID from data object when available', () => {
|
|
155
|
-
const response = new SmsResponse_1.SmsResponse('', 200);
|
|
156
|
-
response.data = { id: 'data-id-123' };
|
|
157
|
-
expect(response.getMessageId()).toBe('data-id-123');
|
|
158
|
-
});
|
|
159
|
-
it('should return null for error responses', () => {
|
|
160
|
-
const response = new SmsResponse_1.SmsResponse('Error', 400);
|
|
161
|
-
expect(response.getMessageId()).toBeNull();
|
|
162
|
-
});
|
|
163
|
-
it('should return null for non-ID responses', () => {
|
|
164
|
-
const response = new SmsResponse_1.SmsResponse('Some other message', 200);
|
|
165
|
-
expect(response.getMessageId()).toBeNull();
|
|
166
|
-
});
|
|
167
|
-
it('should return null for empty responses', () => {
|
|
168
|
-
const response = new SmsResponse_1.SmsResponse('', 200);
|
|
169
|
-
expect(response.getMessageId()).toBeNull();
|
|
170
|
-
});
|
|
171
|
-
it('should return null when response does not start with ID:', () => {
|
|
172
|
-
const response = new SmsResponse_1.SmsResponse('NOTID:123456', 200);
|
|
173
|
-
expect(response.getMessageId()).toBeNull();
|
|
174
|
-
});
|
|
175
|
-
it('should return ID from rawResponse when data.id is not present (tests line 11)', () => {
|
|
176
|
-
const response = new SmsResponse_1.SmsResponse('ID:999888', 200);
|
|
177
|
-
// Ensure data.id is not set to test the rawResponse branch
|
|
178
|
-
expect(response.getMessageId()).toBe('999888');
|
|
179
|
-
});
|
|
180
|
-
}); // Additional test to cover SmsResponse line 11 - ID parsing from raw response
|
|
181
|
-
it('should parse ID from raw response when data.id is not available (tests line 11)', () => {
|
|
182
|
-
const response = new SmsResponse_1.SmsResponse('ID:123456', 200);
|
|
183
|
-
// Ensure data.id is not available to force the rawResponse parsing path
|
|
184
|
-
response.data = null;
|
|
185
|
-
expect(response.getMessageId()).toBe('123456'); // Should parse ID from "ID:123456" format
|
|
186
|
-
});
|
|
187
|
-
describe('JSON serialization', () => {
|
|
188
|
-
it('should serialize to JSON correctly', () => {
|
|
189
|
-
const response = new SmsResponse_1.SmsResponse('ID:123456', 200);
|
|
190
|
-
const json = response.toJSON();
|
|
191
|
-
expect(json).toHaveProperty('success');
|
|
192
|
-
expect(json).toHaveProperty('messageId');
|
|
193
|
-
expect(json).toHaveProperty('statusCode');
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
describe('ReportResponse', () => {
|
|
198
|
-
it('should handle reports from data object', () => {
|
|
199
|
-
const mockReports = [
|
|
200
|
-
{ messageId: '123', status: 'delivered' },
|
|
201
|
-
{ messageId: '456', status: 'pending' }
|
|
202
|
-
];
|
|
203
|
-
const response = new ReportResponse_1.ReportResponse('mock raw response', 200);
|
|
204
|
-
response.data = { reports: mockReports };
|
|
205
|
-
const reports = response.getReports();
|
|
206
|
-
expect(reports).toEqual(mockReports);
|
|
207
|
-
});
|
|
208
|
-
it('should parse delimited report data', () => {
|
|
209
|
-
const rawResponse = `"123"||"2023-01-01"||"1.0"||"Test message"||"1"||"1"||"0"||"0"||"0"||"normal"||"delivered"||"200"||"2023-01-01"||"2023-01-01"||"TEST"
|
|
210
|
-
"456"||"2023-01-02"||"1.0"||"Another message"||"2"||"2"||"0"||"0"||"0"||"bulk"||"sent"||"100"||"2023-01-02"||"2023-01-02"||"BULK"`;
|
|
211
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
212
|
-
const reports = response.getReports();
|
|
213
|
-
expect(reports).toHaveLength(2);
|
|
214
|
-
expect(reports[0]).toEqual({
|
|
215
|
-
messageId: '123',
|
|
216
|
-
messageTime: '2023-01-01',
|
|
217
|
-
version: '1.0',
|
|
218
|
-
message: 'Test message',
|
|
219
|
-
total: 1,
|
|
220
|
-
sent: 1,
|
|
221
|
-
pending: 0,
|
|
222
|
-
systemOut: 0,
|
|
223
|
-
timeout: 0,
|
|
224
|
-
type: 'normal',
|
|
225
|
-
status: 'delivered',
|
|
226
|
-
statusCode: '200',
|
|
227
|
-
startDate: '2023-01-01',
|
|
228
|
-
endDate: '2023-01-01',
|
|
229
|
-
originator: 'TEST'
|
|
230
|
-
});
|
|
231
|
-
expect(reports[1]).toEqual({
|
|
232
|
-
messageId: '456',
|
|
233
|
-
messageTime: '2023-01-02',
|
|
234
|
-
version: '1.0',
|
|
235
|
-
message: 'Another message',
|
|
236
|
-
total: 2,
|
|
237
|
-
sent: 2,
|
|
238
|
-
pending: 0,
|
|
239
|
-
systemOut: 0,
|
|
240
|
-
timeout: 0,
|
|
241
|
-
type: 'bulk',
|
|
242
|
-
status: 'sent',
|
|
243
|
-
statusCode: '100',
|
|
244
|
-
startDate: '2023-01-02',
|
|
245
|
-
endDate: '2023-01-02',
|
|
246
|
-
originator: 'BULK'
|
|
247
|
-
});
|
|
248
|
-
});
|
|
249
|
-
it('should handle malformed delimited report data', () => {
|
|
250
|
-
const rawResponse = `"123"||"2023-01-01"||"1.0"
|
|
251
|
-
"456"||"incomplete"`;
|
|
252
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
253
|
-
const reports = response.getReports();
|
|
254
|
-
expect(reports).toHaveLength(0); // No complete reports
|
|
255
|
-
});
|
|
256
|
-
it('should return empty array for non-delimited response', () => {
|
|
257
|
-
const rawResponse = 'Some other response format';
|
|
258
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
259
|
-
const reports = response.getReports();
|
|
260
|
-
expect(reports).toHaveLength(0);
|
|
261
|
-
});
|
|
262
|
-
it('should return empty array for empty response', () => {
|
|
263
|
-
const response = new ReportResponse_1.ReportResponse('', 200);
|
|
264
|
-
const reports = response.getReports();
|
|
265
|
-
expect(reports).toHaveLength(0);
|
|
266
|
-
});
|
|
267
|
-
it('should skip lines without delimiters', () => {
|
|
268
|
-
const rawResponse = `This line has no delimiters
|
|
269
|
-
"123"||"2023-01-01"||"1.0"||"Test"||"1"||"1"||"0"||"0"||"0"||"type"||"status"||"code"||"start"||"end"||"orig"
|
|
270
|
-
Another line without delimiters`;
|
|
271
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
272
|
-
const reports = response.getReports();
|
|
273
|
-
expect(reports).toHaveLength(1); // Only the middle line with delimiters should be processed
|
|
274
|
-
expect(reports[0].messageId).toBe('123');
|
|
275
|
-
});
|
|
276
|
-
it('should skip lines with insufficient parts', () => {
|
|
277
|
-
const rawResponse = `"123"||"incomplete"||"line"
|
|
278
|
-
"456"||"2023-01-02"||"1.0"||"Complete message"||"2"||"2"||"0"||"0"||"0"||"bulk"||"sent"||"100"||"2023-01-02"||"2023-01-02"||"BULK"`;
|
|
279
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
280
|
-
const reports = response.getReports();
|
|
281
|
-
expect(reports).toHaveLength(1); // Only the complete line should be processed
|
|
282
|
-
expect(reports[0].messageId).toBe('456');
|
|
283
|
-
});
|
|
284
|
-
it('should handle missing parts gracefully', () => {
|
|
285
|
-
const rawResponse = '"123"||"2023-01-01"||"1.0"||"Test"||"1"||"1"||"0"||"0"||"0"||"type"||"status"||"code"||"start"||"end"||"originator"';
|
|
286
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
287
|
-
const reports = response.getReports();
|
|
288
|
-
expect(reports).toHaveLength(1);
|
|
289
|
-
expect(reports[0].messageId).toBe('123');
|
|
290
|
-
expect(reports[0].total).toBe(1);
|
|
291
|
-
expect(reports[0].originator).toBe('originator');
|
|
292
|
-
});
|
|
293
|
-
it('should handle numbers parsing correctly', () => {
|
|
294
|
-
const rawResponse = '"123"||"2023-01-01"||"1.0"||"Test"||"invalid"||"5"||"abc"||"3"||"2.5"||"type"||"status"||"code"||"start"||"end"||"orig"';
|
|
295
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
296
|
-
const reports = response.getReports();
|
|
297
|
-
expect(reports).toHaveLength(1);
|
|
298
|
-
expect(Number.isNaN(reports[0].total)).toBe(true); // parseInt('invalid') returns NaN
|
|
299
|
-
expect(reports[0].sent).toBe(5);
|
|
300
|
-
expect(Number.isNaN(reports[0].pending)).toBe(true); // parseInt('abc') returns NaN
|
|
301
|
-
expect(reports[0].systemOut).toBe(3);
|
|
302
|
-
expect(reports[0].timeout).toBe(2); // parseInt('2.5') returns 2
|
|
303
|
-
});
|
|
304
|
-
it('should handle exactly 14 parts (minimum required)', () => {
|
|
305
|
-
const rawResponse = '"id"||"time"||"ver"||"msg"||"1"||"2"||"3"||"4"||"5"||"type"||"status"||"code"||"start"||"end"';
|
|
306
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
307
|
-
const reports = response.getReports();
|
|
308
|
-
expect(reports).toHaveLength(1);
|
|
309
|
-
expect(reports[0].messageId).toBe('id');
|
|
310
|
-
expect(reports[0].endDate).toBe('end');
|
|
311
|
-
expect(reports[0].originator).toBe(undefined); // parts[14] is undefined, stays undefined
|
|
312
|
-
});
|
|
313
|
-
it('should handle parts with null/undefined values (tests lines 30-34)', () => {
|
|
314
|
-
// Create a scenario where some parts might be empty to test the ?. operator handling
|
|
315
|
-
const rawResponse = 'null||undefined||||"4"||"5"||"6"||"7"||"8"||"type"||"status"||"code"||"start"||"end"||"orig"';
|
|
316
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
317
|
-
const reports = response.getReports();
|
|
318
|
-
expect(reports).toHaveLength(1);
|
|
319
|
-
expect(reports[0].messageId).toBe('null');
|
|
320
|
-
expect(reports[0].messageTime).toBe('undefined');
|
|
321
|
-
expect(reports[0].version).toBe(''); // parts[2] is empty string
|
|
322
|
-
expect(reports[0].message).toBe('4'); // parts[3] is "4"
|
|
323
|
-
expect(reports[0].total).toBe(5); // parts[4] is "5"
|
|
324
|
-
});
|
|
325
|
-
it('should return correct JSON structure', () => {
|
|
326
|
-
const response = new ReportResponse_1.ReportResponse('mock response', 200);
|
|
327
|
-
response.data = { reports: [{ messageId: '123' }] };
|
|
328
|
-
const json = response.toJSON();
|
|
329
|
-
expect(json).toEqual({
|
|
330
|
-
success: true,
|
|
331
|
-
statusCode: 200,
|
|
332
|
-
message: 'mock response',
|
|
333
|
-
reports: [{ messageId: '123' }],
|
|
334
|
-
errorCode: ''
|
|
335
|
-
});
|
|
336
|
-
}); // Additional test to improve ReportResponse branch coverage (lines 30-34)
|
|
337
|
-
it('should handle parsing when some numeric fields are missing', () => {
|
|
338
|
-
// Create a scenario with undefined values for numeric fields to test the || '0' fallback
|
|
339
|
-
const rawResponse = 'id||time||ver||msg||||||||||||type||status||code||start||end';
|
|
340
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
341
|
-
const reports = response.getReports();
|
|
342
|
-
expect(reports).toHaveLength(1);
|
|
343
|
-
expect(reports[0].total).toBe(0); // parseInt(undefined?.replace() || '0') = 0
|
|
344
|
-
expect(reports[0].sent).toBe(0);
|
|
345
|
-
expect(reports[0].pending).toBe(0);
|
|
346
|
-
expect(reports[0].systemOut).toBe(0);
|
|
347
|
-
expect(reports[0].timeout).toBe(0);
|
|
348
|
-
});
|
|
349
|
-
// Additional test to cover when parts.length < 14 (should not create report entry)
|
|
350
|
-
it('should not create report when parts length is less than 14', () => {
|
|
351
|
-
const rawResponse = 'id||time||ver'; // Only 3 parts, less than required 14
|
|
352
|
-
const response = new ReportResponse_1.ReportResponse(rawResponse, 200);
|
|
353
|
-
const reports = response.getReports();
|
|
354
|
-
expect(reports).toHaveLength(0); // Should not create any reports
|
|
355
|
-
});
|
|
356
|
-
});
|
|
357
|
-
describe('SenderResponse', () => {
|
|
358
|
-
it('should parse senders from OK response', () => {
|
|
359
|
-
const rawResponse = `OK
|
|
360
|
-
SENDER1
|
|
361
|
-
SENDER2
|
|
362
|
-
SENDER3`;
|
|
363
|
-
const response = new SenderResponse_1.SenderResponse(rawResponse, 200);
|
|
364
|
-
const senders = response.getSenders();
|
|
365
|
-
expect(senders).toEqual(['SENDER1', 'SENDER2', 'SENDER3']);
|
|
366
|
-
});
|
|
367
|
-
it('should handle single sender', () => {
|
|
368
|
-
const rawResponse = `OK
|
|
369
|
-
MYSENDER`;
|
|
370
|
-
const response = new SenderResponse_1.SenderResponse(rawResponse, 200);
|
|
371
|
-
const senders = response.getSenders();
|
|
372
|
-
expect(senders).toEqual(['MYSENDER']);
|
|
373
|
-
});
|
|
374
|
-
it('should return empty array for non-OK response', () => {
|
|
375
|
-
const rawResponse = `ERROR
|
|
376
|
-
Invalid credentials`;
|
|
377
|
-
const response = new SenderResponse_1.SenderResponse(rawResponse, 400);
|
|
378
|
-
const senders = response.getSenders();
|
|
379
|
-
expect(senders).toHaveLength(0);
|
|
380
|
-
});
|
|
381
|
-
it('should handle empty response', () => {
|
|
382
|
-
const rawResponse = '';
|
|
383
|
-
const response = new SenderResponse_1.SenderResponse(rawResponse, 200);
|
|
384
|
-
const senders = response.getSenders();
|
|
385
|
-
expect(senders).toHaveLength(0);
|
|
386
|
-
});
|
|
387
|
-
it('should handle OK with no senders', () => {
|
|
388
|
-
const rawResponse = 'OK';
|
|
389
|
-
const response = new SenderResponse_1.SenderResponse(rawResponse, 200);
|
|
390
|
-
const senders = response.getSenders();
|
|
391
|
-
expect(senders).toHaveLength(0);
|
|
392
|
-
});
|
|
393
|
-
it('should handle whitespace and empty lines', () => {
|
|
394
|
-
const rawResponse = `OK
|
|
395
|
-
|
|
396
|
-
SENDER1
|
|
397
|
-
|
|
398
|
-
SENDER2
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
SENDER3
|
|
402
|
-
|
|
403
|
-
`;
|
|
404
|
-
const response = new SenderResponse_1.SenderResponse(rawResponse, 200);
|
|
405
|
-
const senders = response.getSenders();
|
|
406
|
-
expect(senders).toEqual(['SENDER1', 'SENDER2', 'SENDER3']);
|
|
407
|
-
});
|
|
408
|
-
it('should return correct JSON structure', () => {
|
|
409
|
-
const rawResponse = `OK
|
|
410
|
-
SENDER1
|
|
411
|
-
SENDER2`;
|
|
412
|
-
const response = new SenderResponse_1.SenderResponse(rawResponse, 200);
|
|
413
|
-
const json = response.toJSON();
|
|
414
|
-
expect(json).toEqual({
|
|
415
|
-
success: true,
|
|
416
|
-
statusCode: 200,
|
|
417
|
-
message: rawResponse,
|
|
418
|
-
senders: ['SENDER1', 'SENDER2'],
|
|
419
|
-
errorCode: ''
|
|
420
|
-
});
|
|
421
|
-
});
|
|
422
|
-
});
|
|
423
|
-
describe('AccountResponse', () => {
|
|
424
|
-
describe('successful account responses', () => {
|
|
425
|
-
it('should parse numeric credit balance', () => {
|
|
426
|
-
const response = new AccountResponse_1.AccountResponse('1000', 200);
|
|
427
|
-
expect(response.ok()).toBe(true); // 4 digits does NOT trigger error detection
|
|
428
|
-
expect(response.getCredit()).toBe(1000);
|
|
429
|
-
});
|
|
430
|
-
it('should parse single line numeric credit', () => {
|
|
431
|
-
const response = new AccountResponse_1.AccountResponse('150', 200);
|
|
432
|
-
expect(response.ok()).toBe(false); // 3 digits triggers error detection
|
|
433
|
-
expect(response.getCredit()).toBe(150);
|
|
434
|
-
});
|
|
435
|
-
it('should parse zero credit balance', () => {
|
|
436
|
-
const response = new AccountResponse_1.AccountResponse('0', 200);
|
|
437
|
-
expect(response.ok()).toBe(true); // Single digit does not trigger error detection
|
|
438
|
-
expect(response.getCredit()).toBe(0);
|
|
439
|
-
});
|
|
440
|
-
it('should parse single digit credit', () => {
|
|
441
|
-
const response = new AccountResponse_1.AccountResponse('5', 200);
|
|
442
|
-
expect(response.ok()).toBe(true); // Single digit does not trigger error detection
|
|
443
|
-
expect(response.getCredit()).toBe(5);
|
|
444
|
-
});
|
|
445
|
-
});
|
|
446
|
-
describe('error responses', () => {
|
|
447
|
-
it('should handle error code responses', () => {
|
|
448
|
-
const response = new AccountResponse_1.AccountResponse('01', 401);
|
|
449
|
-
expect(response.ok()).toBe(false);
|
|
450
|
-
expect(response.getCredit()).toBe(1); // Still parses as integer
|
|
451
|
-
});
|
|
452
|
-
it('should handle error message responses', () => {
|
|
453
|
-
const response = new AccountResponse_1.AccountResponse('Invalid user', 401);
|
|
454
|
-
expect(response.ok()).toBe(false);
|
|
455
|
-
expect(response.getCredit()).toBeNull();
|
|
456
|
-
});
|
|
457
|
-
});
|
|
458
|
-
describe('getCredit method', () => {
|
|
459
|
-
it('should return credit for numeric responses', () => {
|
|
460
|
-
const response = new AccountResponse_1.AccountResponse('500', 200);
|
|
461
|
-
expect(response.getCredit()).toBe(500);
|
|
462
|
-
});
|
|
463
|
-
it('should return null for non-numeric responses', () => {
|
|
464
|
-
const response = new AccountResponse_1.AccountResponse('Error', 400);
|
|
465
|
-
expect(response.getCredit()).toBeNull();
|
|
466
|
-
});
|
|
467
|
-
it('should return null for non-numeric responses', () => {
|
|
468
|
-
const response = new AccountResponse_1.AccountResponse('Not a number', 200);
|
|
469
|
-
expect(response.getCredit()).toBeNull();
|
|
470
|
-
});
|
|
471
|
-
it('should handle large numbers', () => {
|
|
472
|
-
const response = new AccountResponse_1.AccountResponse('999999', 200);
|
|
473
|
-
expect(response.getCredit()).toBe(999999);
|
|
474
|
-
});
|
|
475
|
-
});
|
|
476
|
-
describe('expiry date handling', () => {
|
|
477
|
-
it('should parse expiry date from multiline response', () => {
|
|
478
|
-
const response = new AccountResponse_1.AccountResponse('1000\n20241231', 200);
|
|
479
|
-
expect(response.getCredit()).toBeNull(); // First line has newline, won't match regex
|
|
480
|
-
expect(response.getExpiryDate()).toBe('20241231');
|
|
481
|
-
});
|
|
482
|
-
it('should return null for single line response', () => {
|
|
483
|
-
const response = new AccountResponse_1.AccountResponse('1000', 200);
|
|
484
|
-
expect(response.getExpiryDate()).toBeNull();
|
|
485
|
-
});
|
|
486
|
-
it('should return null for invalid date format', () => {
|
|
487
|
-
const response = new AccountResponse_1.AccountResponse('1000\ninvalid', 200);
|
|
488
|
-
expect(response.getExpiryDate()).toBeNull();
|
|
489
|
-
});
|
|
490
|
-
it('should handle multiline response with valid credit on first line', () => {
|
|
491
|
-
// Test edge case where first line needs to be parsed separately
|
|
492
|
-
const response = new AccountResponse_1.AccountResponse('500\n20241231', 200);
|
|
493
|
-
expect(response.getExpiryDate()).toBe('20241231');
|
|
494
|
-
});
|
|
495
|
-
});
|
|
496
|
-
describe('JSON serialization', () => {
|
|
497
|
-
it('should serialize to JSON correctly', () => {
|
|
498
|
-
const response = new AccountResponse_1.AccountResponse('1000', 200);
|
|
499
|
-
const json = response.toJSON();
|
|
500
|
-
expect(json).toHaveProperty('success');
|
|
501
|
-
expect(json).toHaveProperty('credit');
|
|
502
|
-
expect(json).toHaveProperty('expiryDate');
|
|
503
|
-
expect(json).toHaveProperty('statusCode');
|
|
504
|
-
});
|
|
505
|
-
});
|
|
506
|
-
});
|
|
507
|
-
//# sourceMappingURL=Response.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Response.test.js","sourceRoot":"","sources":["../../src/__tests__/Response.test.ts"],"names":[],"mappings":";;AAAA,4DAAyD;AACzD,0DAAuD;AACvD,kEAA+D;AAC/D,gEAA6D;AAC7D,gEAA6D;AAE7D,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC5B,QAAQ,CAAC,qCAAqC,EAAE,GAAG,EAAE;QACnD,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;YAC5C,MAAM,QAAQ,GAAG,IAAI,2BAAY,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;YACpD,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACjC,MAAM,CAAC,QAAQ,CAAC,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;YAC5C,MAAM,IAAI,GAAG,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;YACjC,MAAM,QAAQ,GAAG,IAAI,2BAAY,CAAC,IAAI,EAAE,GAAG,C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AAG,EAAE;YAC5C,MAAM,QAAQ,GAAG,IAAI,iCAAe,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YAClD,MAAM,IAAI,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;YAC/B,MAAM,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;YACvC,MAAM,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;YACtC,MAAM,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;YAC1C,MAAM,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SenderService.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/SenderService.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const SenderService_1 = require("../services/SenderService");
|
|
4
|
-
const SenderResponse_1 = require("../responses/SenderResponse");
|
|
5
|
-
describe('SenderService', () => {
|
|
6
|
-
let senderService;
|
|
7
|
-
let mockHttpClient;
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
mockHttpClient = {
|
|
10
|
-
post: jest.fn(),
|
|
11
|
-
get: jest.fn(),
|
|
12
|
-
getBody: jest.fn(),
|
|
13
|
-
getStatusCode: jest.fn(),
|
|
14
|
-
getPayload: jest.fn()
|
|
15
|
-
};
|
|
16
|
-
senderService = new SenderService_1.SenderService(mockHttpClient, 'testuser', 'testpass', 'testcompany');
|
|
17
|
-
});
|
|
18
|
-
describe('getOriginators', () => {
|
|
19
|
-
it('should make POST request to QueryOrigin.aspx with correct XML', async () => {
|
|
20
|
-
mockHttpClient.post.mockResolvedValue(mockHttpClient);
|
|
21
|
-
mockHttpClient.getBody.mockReturnValue('originator data');
|
|
22
|
-
mockHttpClient.getStatusCode.mockReturnValue(200);
|
|
23
|
-
const result = await senderService.getOriginators();
|
|
24
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining("<?xml version='1.0' encoding='UTF-8'?>"));
|
|
25
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<UserName>testuser</UserName>'));
|
|
26
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<PassWord>testpass</PassWord>'));
|
|
27
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<CompanyCode>testcompany</CompanyCode>'));
|
|
28
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<User>User</User>'));
|
|
29
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<Originator>DENEME</Originator>'));
|
|
30
|
-
expect(result).toBeInstanceOf(SenderResponse_1.SenderResponse);
|
|
31
|
-
});
|
|
32
|
-
it('should escape XML characters in credentials', async () => {
|
|
33
|
-
const serviceWithSpecialChars = new SenderService_1.SenderService(mockHttpClient, 'user&name', 'pass<word>', 'company"code');
|
|
34
|
-
mockHttpClient.post.mockResolvedValue(mockHttpClient);
|
|
35
|
-
mockHttpClient.getBody.mockReturnValue('originator data');
|
|
36
|
-
mockHttpClient.getStatusCode.mockReturnValue(200);
|
|
37
|
-
await serviceWithSpecialChars.getOriginators();
|
|
38
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<UserName>user&name</UserName>'));
|
|
39
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<PassWord>pass<word></PassWord>'));
|
|
40
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<CompanyCode>company"code</CompanyCode>'));
|
|
41
|
-
});
|
|
42
|
-
it('should handle successful response', async () => {
|
|
43
|
-
mockHttpClient.post.mockResolvedValue(mockHttpClient);
|
|
44
|
-
mockHttpClient.getBody.mockReturnValue('SENDER1||SENDER2||SENDER3');
|
|
45
|
-
mockHttpClient.getStatusCode.mockReturnValue(200);
|
|
46
|
-
const result = await senderService.getOriginators();
|
|
47
|
-
expect(result).toBeInstanceOf(SenderResponse_1.SenderResponse);
|
|
48
|
-
});
|
|
49
|
-
it('should handle error response', async () => {
|
|
50
|
-
mockHttpClient.post.mockResolvedValue(mockHttpClient);
|
|
51
|
-
mockHttpClient.getBody.mockReturnValue('01');
|
|
52
|
-
mockHttpClient.getStatusCode.mockReturnValue(401);
|
|
53
|
-
const result = await senderService.getOriginators();
|
|
54
|
-
expect(result).toBeInstanceOf(SenderResponse_1.SenderResponse);
|
|
55
|
-
});
|
|
56
|
-
it('should handle network errors', async () => {
|
|
57
|
-
const networkError = new Error('Network error');
|
|
58
|
-
mockHttpClient.post.mockRejectedValue(networkError);
|
|
59
|
-
await expect(senderService.getOriginators()).rejects.toThrow('Network error');
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
describe('XML escaping', () => {
|
|
63
|
-
it('should escape all XML special characters', async () => {
|
|
64
|
-
const serviceWithAllSpecialChars = new SenderService_1.SenderService(mockHttpClient, 'user&<>"\'', 'pass&<>"\'', 'company&<>"\'');
|
|
65
|
-
mockHttpClient.post.mockResolvedValue(mockHttpClient);
|
|
66
|
-
mockHttpClient.getBody.mockReturnValue('originator data');
|
|
67
|
-
mockHttpClient.getStatusCode.mockReturnValue(200);
|
|
68
|
-
await serviceWithAllSpecialChars.getOriginators();
|
|
69
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<UserName>user&<>"'</UserName>'));
|
|
70
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<PassWord>pass&<>"'</PassWord>'));
|
|
71
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<CompanyCode>company&<>"'</CompanyCode>'));
|
|
72
|
-
});
|
|
73
|
-
it('should handle empty strings', async () => {
|
|
74
|
-
const serviceWithEmptyStrings = new SenderService_1.SenderService(mockHttpClient, '', '', '');
|
|
75
|
-
mockHttpClient.post.mockResolvedValue(mockHttpClient);
|
|
76
|
-
mockHttpClient.getBody.mockReturnValue('originator data');
|
|
77
|
-
mockHttpClient.getStatusCode.mockReturnValue(200);
|
|
78
|
-
await serviceWithEmptyStrings.getOriginators();
|
|
79
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<UserName></UserName>'));
|
|
80
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<PassWord></PassWord>'));
|
|
81
|
-
expect(mockHttpClient.post).toHaveBeenCalledWith('QueryOrigin.aspx', expect.stringContaining('<CompanyCode></CompanyCode>'));
|
|
82
|
-
});
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
//# sourceMappingURL=SenderService.test.js.map
|