-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-quick.js
More file actions
105 lines (97 loc) · 2.54 KB
/
test-quick.js
File metadata and controls
105 lines (97 loc) · 2.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/usr/bin/env node
/**
* Quick Validation Test for Logo Objects REST API Client
*
* This script performs a fast smoke test to verify:
* - All modules can be imported correctly
* - Client instances can be created
* - All entity clients are accessible
*
* Usage: node test-quick.js
*/
console.log('🧪 Logo Objects REST API Client - Quick Validation Test');
try {
// Test importing the main client
const { LogoApiClient } = require('./dist/index.js');
console.log('✅ Main import successful');
// Test creating a client instance
const client = new LogoApiClient({
baseURL: 'http://localhost:32001/api/v1',
apiKey: 'test-key',
});
console.log('✅ Client instantiation successful');
// Test accessing all entity clients
const clients = [
'additionalTaxes',
'arpGroupAssignments',
'arpMLDescriptions',
'arps',
'arpShipmentLocations',
'arpSlips',
'authorizationCodes',
'bankAccounts',
'bankCredits',
'bankMLDescriptions',
'bankSlips',
'bomStandardCosts',
'boms',
'banks',
'capi',
'characteristics',
'characteristicSets',
'chequeAndPnoteRolls',
'chequeAndPnotes',
'cities',
'collateralRolls',
'contacts',
'costDistributionSlips',
'countries',
'customerMLDescriptions',
'customers',
'customersOfSalesmen',
'customsOffices',
'dbinfo',
'definitions',
'deliveryCodes',
'demandPeggings',
'demandSlips',
'distributionOrders',
'distributionRoutes',
'distributionTemplates',
'districts',
'employeeCosts',
'employeeGroups',
'employeeStandardCosts',
'employees',
'engineeringChanges',
'exportCreditLetters',
'exportCredits',
'exportMovementSlips',
'GLAccounts',
'items',
'opportunities',
'projects',
'purchaseInvoices',
'purchaseOrders',
'salesInvoices',
'salesOrders',
'specialCodes',
'unitSets',
'workstationStandardCosts',
];
clients.forEach(clientName => {
if (client[clientName]) {
console.log(`✅ ${clientName} client available`);
} else {
console.log(`❌ ${clientName} client missing`);
}
});
// Test getAvailableClients method
const availableClients = client.getAvailableClients();
console.log(`✅ Available clients: ${availableClients.length} total`);
console.log(` Clients: ${availableClients.join(', ')}`);
console.log('\n🎉 Migration test PASSED! All clients are working correctly.');
} catch (error) {
console.error('❌ Migration test FAILED:', error.message);
process.exit(1);
}