tally-xml-tdl 1.13.3 → 1.15.2
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/README.md +174 -174
- package/index.d.ts +15 -15
- package/package.json +6 -17
- package/src/index.js +2 -5
- package/src/{v13 → v15}/company.js +4 -2
- package/src/{v13 → v15}/core/changeType/v1/changeTypeString.js +111 -111
- package/src/{v13 → v15}/core/changeType/v2/changeTypeString.js +111 -111
- package/src/{v13 → v15}/core/changeType/v3/alterLeaf.js +45 -45
- package/src/{v13 → v15}/core/changeType/v3/changeTypeString.js +21 -21
- package/src/{v13 → v15}/core/changeType/v3/forArray/v1/index.js +17 -17
- package/src/{v13 → v15}/core/changeType/v3/forObject/v1/index.js +19 -19
- package/src/{v13 → v15}/core/changeType/v3/guards.js +26 -26
- package/src/{v13 → v15}/core/changeType/v3/traverse.js +47 -47
- package/src/{v13 → v15}/core/cleanTallyResponse.js +57 -57
- package/src/{v13 → v15}/index.d.ts +13 -13
- package/src/{v13 → v15}/main.d.ts +2 -2
- package/src/{v6/index.js → v15/masters.js} +5 -23
- package/src/v15/masters.json +78 -0
- package/src/v6/body.json +0 -30
- package/src/v6/body.xml +0 -25
- package/src/v6/core/buildXml.js +0 -9
- package/src/v6/core/cleanTallyResponse.js +0 -57
- package/src/v6/core/execute/executeXml.js +0 -14
- package/src/v6/core/execute/executeXmlAndClean.js +0 -15
- package/src/v6/core/execute/index.js +0 -3
- package/src/v6/core/index.js +0 -20
- package/src/v6/core/response/index.js +0 -2
- package/src/v6/core/response/xmlToJson.js +0 -18
- package/src/v6/core/transport/http.js +0 -40
- package/src/v6/core/transport/index.js +0 -1
- package/src/v6/index.d.ts +0 -8
- /package/src/{v13 → v15}/body.json +0 -0
- /package/src/{v13 → v15}/body.xml +0 -0
- /package/src/{v13 → v15}/core/buildXml.js +0 -0
- /package/src/{v13 → v15}/core/execute/executeBody.js +0 -0
- /package/src/{v13 → v15}/core/execute/executeXml.js +0 -0
- /package/src/{v13 → v15}/core/execute/executeXmlAndClean.js +0 -0
- /package/src/{v13 → v15}/core/execute/index.js +0 -0
- /package/src/{v13 → v15}/core/index.js +0 -0
- /package/src/{v13 → v15}/core/request/envelope.js +0 -0
- /package/src/{v13 → v15}/core/request/index.js +0 -0
- /package/src/{v13 → v15}/core/request/jsonToXml.js +0 -0
- /package/src/{v13 → v15}/core/response/index.js +0 -0
- /package/src/{v13 → v15}/core/response/xmlToJson.js +0 -0
- /package/src/{v13 → v15}/core/transport/http.js +0 -0
- /package/src/{v13 → v15}/core/transport/index.js +0 -0
- /package/src/{v13 → v15}/daybook/body copy.xml +0 -0
- /package/src/{v13 → v15}/daybook/body.xml +0 -0
- /package/src/{v13 → v15}/fromJson.js +0 -0
- /package/src/{v13 → v15}/fromXml.js +0 -0
- /package/src/{v13 → v15}/index.js +0 -0
- /package/src/{v13 → v15}/main.js +0 -0
- /package/src/{v13 → v15}/purc/body.json +0 -0
- /package/src/{v13 → v15}/purc/body.xml +0 -0
- /package/src/{v13 → v15}/purchases/v1.xml +0 -0
- /package/src/{v13 → v15}/purchases.js +0 -0
package/README.md
CHANGED
|
@@ -1,175 +1,175 @@
|
|
|
1
|
-
# tally-xml-tdl
|
|
2
|
-
|
|
3
|
-
> Simple, clean TDL and XML extraction and manipulation tools for Tally.
|
|
4
|
-
|
|
5
|
-
[](https://www.npmjs.com/package/tally-xml-tdl)
|
|
6
|
-
[](https://opensource.org/licenses/MIT)
|
|
7
|
-
|
|
8
|
-
Extract data directly from **Tally Prime / Tally.ERP 9** using TDL XML requests over HTTP, and get back **clean, developer-friendly JSON** ready for modern web apps, APIs, dashboards, and databases.
|
|
9
|
-
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
## 📖 The Story
|
|
13
|
-
|
|
14
|
-
Interfacing with Tally usually means dealing with complex, deeply nested XML envelopes, verbose TDL message syntax, and responses filled with XML parser artifacts (`@_RESERVEDNAME`, `#text`, `@_TYPE`, etc.):
|
|
15
|
-
|
|
16
|
-
```json
|
|
17
|
-
// Traditional Tally XML-to-JSON response (cluttered & nested):
|
|
18
|
-
{
|
|
19
|
-
"ENVELOPE": {
|
|
20
|
-
"BODY": {
|
|
21
|
-
"DATA": {
|
|
22
|
-
"COLLECTION": {
|
|
23
|
-
"UNIT": [
|
|
24
|
-
{
|
|
25
|
-
"@_NAME": "Kgs",
|
|
26
|
-
"@_RESERVEDNAME": "",
|
|
27
|
-
"NAME": { "#text": "Kgs", "@_TYPE": "String" }
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
**`tally-xml-tdl` changes that.** With version **`v6`**, it introduces a streamlined template-driven engine and two simple functions:
|
|
38
|
-
|
|
39
|
-
- **`clean()`**: Strips all XML noise, flattens text nodes, removes reserved attributes, and returns plain JavaScript objects or arrays.
|
|
40
|
-
- **`get()`**: Returns the full XML-to-JSON parsed object when you need raw envelope fidelity.
|
|
41
|
-
|
|
42
|
-
```json
|
|
43
|
-
// With tally-xml-tdl clean():
|
|
44
|
-
[
|
|
45
|
-
"Kgs"
|
|
46
|
-
]
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
## 🚀 Features
|
|
52
|
-
|
|
53
|
-
- 🧹 **Clean Data Out-of-the-Box**: Automatically strips Tally metadata attributes and flattens nested values.
|
|
54
|
-
- ⚡ **Two Extraction Modes**: Choose `clean()` for clean data arrays, or `get()` for the full parsed envelope.
|
|
55
|
-
- 📋 **Pre-configured Queries**: Built-in TDL queries for UOM, Stock Items, Stock Items with Base Units, and Ledgers.
|
|
56
|
-
- 🏎️ **Fast & Lightweight**: Built on top of `fast-xml-parser` with minimal overhead.
|
|
57
|
-
- 📦 **Zero-Config HTTP Transport**: Communicates directly with Tally's built-in HTTP server (`http://localhost:9000`).
|
|
58
|
-
- 🔷 **First-Class TypeScript Support**: Full type declarations included (`.d.ts`).
|
|
59
|
-
- 🌐 **Modern ESM**: Native ES modules with subpath exports (`tally-xml-tdl` and `tally-xml-tdl/v6`).
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## 📦 Installation
|
|
64
|
-
|
|
65
|
-
```bash
|
|
66
|
-
npm install tally-xml-tdl
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
### Prerequisites
|
|
70
|
-
Make sure Tally is running and its HTTP server is enabled:
|
|
71
|
-
- **Tally Prime / Tally.ERP 9**: Press `F12` (Configure) -> **Advanced Configuration** -> Set **Tally is acting as** to `Both` or `Server`, and note the port (default is `9000`).
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## 💡 Quick Start
|
|
76
|
-
|
|
77
|
-
```javascript
|
|
78
|
-
import { clean, get } from "tally-xml-tdl";
|
|
79
|
-
|
|
80
|
-
// 1. Fetch clean, simplified data
|
|
81
|
-
const items = await clean({
|
|
82
|
-
company: "My Company Name",
|
|
83
|
-
jsonId: "stockItemsWithBaseUnits"
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
console.log(items);
|
|
87
|
-
// Output:
|
|
88
|
-
// [
|
|
89
|
-
// { NAME: "Item A", BASEUNITS: "Nos" },
|
|
90
|
-
// { NAME: "Item B", BASEUNITS: "Kgs" }
|
|
91
|
-
// ]
|
|
92
|
-
|
|
93
|
-
// 2. Fetch raw parsed JSON (full fidelity)
|
|
94
|
-
const raw = await get({
|
|
95
|
-
company: "My Company Name",
|
|
96
|
-
jsonId: "uom"
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
console.log(raw);
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## 📚 API Reference
|
|
105
|
-
|
|
106
|
-
### `clean(options)`
|
|
107
|
-
Sends the TDL query to Tally, parses the XML response, and cleans the resulting collection data.
|
|
108
|
-
|
|
109
|
-
```typescript
|
|
110
|
-
clean<T = any>(options: V6Options): Promise<T>
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
#### Options:
|
|
114
|
-
| Option | Type | Required | Default | Description |
|
|
115
|
-
| :--- | :--- | :---: | :--- | :--- |
|
|
116
|
-
| `company` | `string` | **Yes** | — | Name of the active company in Tally. |
|
|
117
|
-
| `jsonId` | `string` | **Yes** | — | ID of the pre-configured TDL query. |
|
|
118
|
-
| `url` | `string` | No | `"http://localhost:9000"` | Tally HTTP endpoint URL. |
|
|
119
|
-
|
|
120
|
-
---
|
|
121
|
-
|
|
122
|
-
### `get(options)`
|
|
123
|
-
Sends the TDL query to Tally and returns the complete XML response converted to a JavaScript object without stripping any metadata.
|
|
124
|
-
|
|
125
|
-
```typescript
|
|
126
|
-
get<T = any>(options: V6Options): Promise<T>
|
|
127
|
-
```
|
|
128
|
-
|
|
129
|
-
---
|
|
130
|
-
|
|
131
|
-
## 🗂️ Built-in Query Catalog (`jsonId`)
|
|
132
|
-
|
|
133
|
-
| `jsonId` | Target Entity | Description | Fields Fetched |
|
|
134
|
-
| :--- | :--- | :--- | :--- |
|
|
135
|
-
| `"uom"` | Units of Measure | List of units of measurement | `$$Alias:Name` |
|
|
136
|
-
| `"stockItems"` | Stock Items | List of inventory stock items | `$$Alias:Name` |
|
|
137
|
-
| `"stockItemsWithBaseUnits"` | Stock Items | Inventory stock items with their base units | `$$Alias:Name`, `BaseUnits` |
|
|
138
|
-
| `"ledgerNames"` | Ledgers | List of accounting ledgers | `$$Alias:Name` |
|
|
139
|
-
|
|
140
|
-
---
|
|
141
|
-
|
|
142
|
-
## 🎯 Advanced Usage
|
|
143
|
-
|
|
144
|
-
### Connecting to a Remote or Custom Port
|
|
145
|
-
If Tally is hosted on another machine or running on a non-default port:
|
|
146
|
-
|
|
147
|
-
```javascript
|
|
148
|
-
import { clean } from "tally-xml-tdl";
|
|
149
|
-
|
|
150
|
-
const data = await clean({
|
|
151
|
-
company: "Acme Corp",
|
|
152
|
-
jsonId: "ledgerNames",
|
|
153
|
-
url: "http://192.168.1.100:9005"
|
|
154
|
-
});
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### Subpath Import
|
|
158
|
-
You can also explicitly import from the `v6` subpath:
|
|
159
|
-
|
|
160
|
-
```javascript
|
|
161
|
-
import { clean, get } from "tally-xml-tdl/v6";
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Using Namespaces
|
|
165
|
-
```javascript
|
|
166
|
-
import { v6 } from "tally-xml-tdl";
|
|
167
|
-
|
|
168
|
-
const data = await v6.clean({ company: "Acme Corp", jsonId: "uom" });
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
## 📄 License
|
|
174
|
-
|
|
1
|
+
# tally-xml-tdl
|
|
2
|
+
|
|
3
|
+
> Simple, clean TDL and XML extraction and manipulation tools for Tally.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/tally-xml-tdl)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
Extract data directly from **Tally Prime / Tally.ERP 9** using TDL XML requests over HTTP, and get back **clean, developer-friendly JSON** ready for modern web apps, APIs, dashboards, and databases.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## 📖 The Story
|
|
13
|
+
|
|
14
|
+
Interfacing with Tally usually means dealing with complex, deeply nested XML envelopes, verbose TDL message syntax, and responses filled with XML parser artifacts (`@_RESERVEDNAME`, `#text`, `@_TYPE`, etc.):
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
// Traditional Tally XML-to-JSON response (cluttered & nested):
|
|
18
|
+
{
|
|
19
|
+
"ENVELOPE": {
|
|
20
|
+
"BODY": {
|
|
21
|
+
"DATA": {
|
|
22
|
+
"COLLECTION": {
|
|
23
|
+
"UNIT": [
|
|
24
|
+
{
|
|
25
|
+
"@_NAME": "Kgs",
|
|
26
|
+
"@_RESERVEDNAME": "",
|
|
27
|
+
"NAME": { "#text": "Kgs", "@_TYPE": "String" }
|
|
28
|
+
}
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**`tally-xml-tdl` changes that.** With version **`v6`**, it introduces a streamlined template-driven engine and two simple functions:
|
|
38
|
+
|
|
39
|
+
- **`clean()`**: Strips all XML noise, flattens text nodes, removes reserved attributes, and returns plain JavaScript objects or arrays.
|
|
40
|
+
- **`get()`**: Returns the full XML-to-JSON parsed object when you need raw envelope fidelity.
|
|
41
|
+
|
|
42
|
+
```json
|
|
43
|
+
// With tally-xml-tdl clean():
|
|
44
|
+
[
|
|
45
|
+
"Kgs"
|
|
46
|
+
]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## 🚀 Features
|
|
52
|
+
|
|
53
|
+
- 🧹 **Clean Data Out-of-the-Box**: Automatically strips Tally metadata attributes and flattens nested values.
|
|
54
|
+
- ⚡ **Two Extraction Modes**: Choose `clean()` for clean data arrays, or `get()` for the full parsed envelope.
|
|
55
|
+
- 📋 **Pre-configured Queries**: Built-in TDL queries for UOM, Stock Items, Stock Items with Base Units, and Ledgers.
|
|
56
|
+
- 🏎️ **Fast & Lightweight**: Built on top of `fast-xml-parser` with minimal overhead.
|
|
57
|
+
- 📦 **Zero-Config HTTP Transport**: Communicates directly with Tally's built-in HTTP server (`http://localhost:9000`).
|
|
58
|
+
- 🔷 **First-Class TypeScript Support**: Full type declarations included (`.d.ts`).
|
|
59
|
+
- 🌐 **Modern ESM**: Native ES modules with subpath exports (`tally-xml-tdl` and `tally-xml-tdl/v6`).
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 📦 Installation
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npm install tally-xml-tdl
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Prerequisites
|
|
70
|
+
Make sure Tally is running and its HTTP server is enabled:
|
|
71
|
+
- **Tally Prime / Tally.ERP 9**: Press `F12` (Configure) -> **Advanced Configuration** -> Set **Tally is acting as** to `Both` or `Server`, and note the port (default is `9000`).
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 💡 Quick Start
|
|
76
|
+
|
|
77
|
+
```javascript
|
|
78
|
+
import { clean, get } from "tally-xml-tdl";
|
|
79
|
+
|
|
80
|
+
// 1. Fetch clean, simplified data
|
|
81
|
+
const items = await clean({
|
|
82
|
+
company: "My Company Name",
|
|
83
|
+
jsonId: "stockItemsWithBaseUnits"
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
console.log(items);
|
|
87
|
+
// Output:
|
|
88
|
+
// [
|
|
89
|
+
// { NAME: "Item A", BASEUNITS: "Nos" },
|
|
90
|
+
// { NAME: "Item B", BASEUNITS: "Kgs" }
|
|
91
|
+
// ]
|
|
92
|
+
|
|
93
|
+
// 2. Fetch raw parsed JSON (full fidelity)
|
|
94
|
+
const raw = await get({
|
|
95
|
+
company: "My Company Name",
|
|
96
|
+
jsonId: "uom"
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
console.log(raw);
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## 📚 API Reference
|
|
105
|
+
|
|
106
|
+
### `clean(options)`
|
|
107
|
+
Sends the TDL query to Tally, parses the XML response, and cleans the resulting collection data.
|
|
108
|
+
|
|
109
|
+
```typescript
|
|
110
|
+
clean<T = any>(options: V6Options): Promise<T>
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### Options:
|
|
114
|
+
| Option | Type | Required | Default | Description |
|
|
115
|
+
| :--- | :--- | :---: | :--- | :--- |
|
|
116
|
+
| `company` | `string` | **Yes** | — | Name of the active company in Tally. |
|
|
117
|
+
| `jsonId` | `string` | **Yes** | — | ID of the pre-configured TDL query. |
|
|
118
|
+
| `url` | `string` | No | `"http://localhost:9000"` | Tally HTTP endpoint URL. |
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
### `get(options)`
|
|
123
|
+
Sends the TDL query to Tally and returns the complete XML response converted to a JavaScript object without stripping any metadata.
|
|
124
|
+
|
|
125
|
+
```typescript
|
|
126
|
+
get<T = any>(options: V6Options): Promise<T>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 🗂️ Built-in Query Catalog (`jsonId`)
|
|
132
|
+
|
|
133
|
+
| `jsonId` | Target Entity | Description | Fields Fetched |
|
|
134
|
+
| :--- | :--- | :--- | :--- |
|
|
135
|
+
| `"uom"` | Units of Measure | List of units of measurement | `$$Alias:Name` |
|
|
136
|
+
| `"stockItems"` | Stock Items | List of inventory stock items | `$$Alias:Name` |
|
|
137
|
+
| `"stockItemsWithBaseUnits"` | Stock Items | Inventory stock items with their base units | `$$Alias:Name`, `BaseUnits` |
|
|
138
|
+
| `"ledgerNames"` | Ledgers | List of accounting ledgers | `$$Alias:Name` |
|
|
139
|
+
|
|
140
|
+
---
|
|
141
|
+
|
|
142
|
+
## 🎯 Advanced Usage
|
|
143
|
+
|
|
144
|
+
### Connecting to a Remote or Custom Port
|
|
145
|
+
If Tally is hosted on another machine or running on a non-default port:
|
|
146
|
+
|
|
147
|
+
```javascript
|
|
148
|
+
import { clean } from "tally-xml-tdl";
|
|
149
|
+
|
|
150
|
+
const data = await clean({
|
|
151
|
+
company: "Acme Corp",
|
|
152
|
+
jsonId: "ledgerNames",
|
|
153
|
+
url: "http://192.168.1.100:9005"
|
|
154
|
+
});
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
### Subpath Import
|
|
158
|
+
You can also explicitly import from the `v6` subpath:
|
|
159
|
+
|
|
160
|
+
```javascript
|
|
161
|
+
import { clean, get } from "tally-xml-tdl/v6";
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Using Namespaces
|
|
165
|
+
```javascript
|
|
166
|
+
import { v6 } from "tally-xml-tdl";
|
|
167
|
+
|
|
168
|
+
const data = await v6.clean({ company: "Acme Corp", jsonId: "uom" });
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
---
|
|
172
|
+
|
|
173
|
+
## 📄 License
|
|
174
|
+
|
|
175
175
|
[MIT](LICENSE) © [KeshavSoft](https://keshavsoft.com)
|
package/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export function company(showLog?: boolean): Promise<any>;
|
|
2
|
-
export default company;
|
|
3
|
-
|
|
4
|
-
export interface V6Options {
|
|
5
|
-
company: string;
|
|
6
|
-
jsonId: string;
|
|
7
|
-
url?: string;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export function get<T = any>(options?: V6Options): Promise<T>;
|
|
11
|
-
export function clean<T = any>(options?: V6Options): Promise<T>;
|
|
12
|
-
|
|
13
|
-
export * as v6 from "./src/v6/index.js";
|
|
14
|
-
export * as v13 from "./src/v13/main.js";
|
|
15
|
-
|
|
1
|
+
export function company(showLog?: boolean): Promise<any>;
|
|
2
|
+
export default company;
|
|
3
|
+
|
|
4
|
+
export interface V6Options {
|
|
5
|
+
company: string;
|
|
6
|
+
jsonId: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function get<T = any>(options?: V6Options): Promise<T>;
|
|
11
|
+
export function clean<T = any>(options?: V6Options): Promise<T>;
|
|
12
|
+
|
|
13
|
+
export * as v6 from "./src/v6/index.js";
|
|
14
|
+
export * as v13 from "./src/v13/main.js";
|
|
15
|
+
|
package/package.json
CHANGED
|
@@ -1,32 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tally-xml-tdl",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.2",
|
|
4
4
|
"description": "Simple, clean TDL and XML extraction and manipulation tools for Tally",
|
|
5
5
|
"type": "module",
|
|
6
|
-
"main": "src/
|
|
7
|
-
"module": "./src/
|
|
6
|
+
"main": "src/index.js",
|
|
7
|
+
"module": "./src/index.js",
|
|
8
8
|
"types": "index.d.ts",
|
|
9
9
|
"sideEffects": false,
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
12
|
"types": "./index.d.ts",
|
|
13
|
-
"import": "./src/
|
|
14
|
-
"default": "./src/
|
|
15
|
-
},
|
|
16
|
-
"./v13": {
|
|
17
|
-
"types": "./src/v13/main.d.ts",
|
|
18
|
-
"import": "./src/v13/main.js",
|
|
19
|
-
"default": "./src/v13/main.js"
|
|
20
|
-
},
|
|
21
|
-
"./v6": {
|
|
22
|
-
"types": "./src/v6/index.d.ts",
|
|
23
|
-
"import": "./src/v6/index.js",
|
|
24
|
-
"default": "./src/v6/index.js"
|
|
13
|
+
"import": "./src/index.js",
|
|
14
|
+
"default": "./src/index.js"
|
|
25
15
|
}
|
|
26
16
|
},
|
|
27
17
|
"files": [
|
|
28
|
-
"src/
|
|
29
|
-
"src/v6",
|
|
18
|
+
"src/v15",
|
|
30
19
|
"src/index.js",
|
|
31
20
|
"index.js",
|
|
32
21
|
"index.d.ts",
|
package/src/index.js
CHANGED
|
@@ -11,6 +11,7 @@ const body = fs.readFileSync(path.join(__dirname, "body.xml"), "utf8");
|
|
|
11
11
|
|
|
12
12
|
const startFunc = async (showLog = false) => {
|
|
13
13
|
const jsonId = "company";
|
|
14
|
+
// console.log("------------ : ", jsonId);
|
|
14
15
|
|
|
15
16
|
const { tdlMessage } = bodyJson[jsonId];
|
|
16
17
|
if (showLog) console.log("tdlMessage : ", tdlMessage);
|
|
@@ -18,11 +19,12 @@ const startFunc = async (showLog = false) => {
|
|
|
18
19
|
const xml = buildXml(body, {
|
|
19
20
|
tdlMessage
|
|
20
21
|
});
|
|
22
|
+
|
|
21
23
|
if (showLog) console.log("xml : ", xml);
|
|
24
|
+
|
|
22
25
|
const jsonToReturn = await executeXmlAndClean(xml);
|
|
26
|
+
|
|
23
27
|
if (showLog) console.log("jsonToReturn : ", jsonToReturn);
|
|
24
|
-
// const firstRow = jsonToReturn[0];
|
|
25
|
-
// const { "@_NAME": name, "@_RESERVEDNAME": reservedName } = firstRow;
|
|
26
28
|
|
|
27
29
|
return jsonToReturn;
|
|
28
30
|
};
|