tally-simple 1.3.1 → 1.8.4
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 +132 -83
- package/bin/tally-simple.js +2 -7
- package/docs/.nojekyll +1 -0
- package/docs/architecture.html +67 -68
- package/docs/architecture.md +74 -57
- package/docs/execution-pipeline.html +71 -0
- package/docs/execution-pipeline.md +158 -0
- package/docs/index.html +288 -26
- package/docs/queries.html +107 -0
- package/docs/queries.md +122 -0
- package/docs/route-engine.html +57 -0
- package/docs/route-engine.md +141 -0
- package/docs/style.css +137 -0
- package/docs/usage.html +82 -0
- package/docs/usage.md +117 -0
- package/package.json +14 -8
- package/src/index.js +2 -8
- package/src/v5/external-api/api.js +21 -0
- package/src/{v3 → v5}/external-api/api.json +1 -1
- package/src/v5/index.js +1 -0
- package/src/v5/internal-working/execution/buildXmlBody.js +41 -0
- package/src/v5/internal-working/execution/getTdl.js +12 -0
- package/src/v5/internal-working/execution/index.js +30 -0
- package/src/v5/internal-working/execution/postHttp.js +26 -0
- package/src/v5/internal-working/execution/validateCompany.js +11 -0
- package/src/v5/internal-working/route/attachPath.js +25 -0
- package/src/v5/internal-working/route/createLeafHandler.js +17 -0
- package/src/v5/internal-working/route/index.js +24 -0
- package/src/{v3 → v5}/source.json +1 -11
- package/src/v6/external-api/api.js +21 -0
- package/src/v6/external-api/api.json +6 -0
- package/src/v6/index.js +1 -0
- package/src/v6/internal-working/execution/buildXmlBody.js +41 -0
- package/src/v6/internal-working/execution/getTdl.js +12 -0
- package/src/v6/internal-working/execution/index.js +30 -0
- package/src/v6/internal-working/execution/postHttp.js +26 -0
- package/src/v6/internal-working/execution/validateCompany.js +11 -0
- package/src/v6/internal-working/route/attachPath.js +25 -0
- package/src/v6/internal-working/route/createLeafHandler.js +17 -0
- package/src/v6/internal-working/route/index.js +24 -0
- package/src/{v2 → v6}/source.json +8 -10
- package/src/v7/api.json +6 -0
- package/src/v7/index.js +14 -0
- package/src/v7/internal-working/execution/buildXmlBody.js +41 -0
- package/src/v7/internal-working/execution/getTdl.js +12 -0
- package/src/v7/internal-working/execution/index.js +30 -0
- package/src/v7/internal-working/execution/postHttp.js +26 -0
- package/src/v7/internal-working/execution/validateCompany.js +11 -0
- package/src/v7/internal-working/route/attachPath.js +25 -0
- package/src/v7/internal-working/route/createLeafHandler.js +17 -0
- package/src/v7/internal-working/route/index.js +24 -0
- package/src/{v1 → v7}/source.json +8 -10
- package/src/v8/engine/index.js +19 -0
- package/src/v8/engine/parseXml.js +11 -0
- package/src/v8/index.js +21 -0
- package/docs/api.html +0 -41
- package/docs/api.md +0 -20
- package/docs/developer.html +0 -57
- package/docs/developer.md +0 -41
- package/docs/end-user.html +0 -49
- package/docs/end-user.md +0 -34
- package/docs/repo-developer.html +0 -91
- package/docs/repo-developer.md +0 -107
- package/src/index.d.ts +0 -54
- package/src/v1/external-api/api.js +0 -67
- package/src/v1/external-api/api.json +0 -5
- package/src/v1/external-api/index.js +0 -1
- package/src/v1/index.js +0 -1
- package/src/v1/traverse.js +0 -103
- package/src/v1/traverseObject/index.js +0 -39
- package/src/v2/external-api/api.js +0 -67
- package/src/v2/external-api/api.json +0 -5
- package/src/v2/external-api/index.js +0 -1
- package/src/v2/index.js +0 -1
- package/src/v2/traverse.js +0 -103
- package/src/v2/traverseObject/index.js +0 -39
- package/src/v3/external-api/api.js +0 -67
- package/src/v3/external-api/index.js +0 -1
- package/src/v3/index.js +0 -1
- package/src/v3/traverse.js +0 -103
- package/src/v3/traverseObject/index.js +0 -39
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# Execution Pipeline
|
|
2
|
+
|
|
3
|
+
[**View this document as HTML**](./execution-pipeline.html) · [**Documentation Hub**](./index.html)
|
|
4
|
+
|
|
5
|
+
When a consumer invokes an endpoint like `tally.masters.units.fetch("Mani9")`, the execution engine handles the request through a clean, 4-step pipeline.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## The Pipeline Flow
|
|
10
|
+
|
|
11
|
+
```text
|
|
12
|
+
Invocation: tally.masters.units.fetch("Mani9")
|
|
13
|
+
│
|
|
14
|
+
▼
|
|
15
|
+
Step 1: validateCompany({ inCompany })
|
|
16
|
+
│ Ensures company is a non-empty string; returns trimmed name
|
|
17
|
+
▼
|
|
18
|
+
Step 2: getTdl({ inSource, inRoutePath })
|
|
19
|
+
│ Direct O(1) path lookup of TDL collection query from source.json
|
|
20
|
+
▼
|
|
21
|
+
Step 3: buildXmlBody({ inCompany, inTdl })
|
|
22
|
+
│ XML-escapes company name and injects into XML envelope template
|
|
23
|
+
▼
|
|
24
|
+
Step 4: postHttp({ inXmlBody })
|
|
25
|
+
│ Sends HTTP POST to Tally (http://localhost:9000) and returns XML text
|
|
26
|
+
▼
|
|
27
|
+
Caller receives raw XML string
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## The Four Narrative Steps
|
|
33
|
+
|
|
34
|
+
Each step is encapsulated in its own focused module under `internal-working/execution/`:
|
|
35
|
+
|
|
36
|
+
### Step 1: Validate Company Name (`validateCompany.js`)
|
|
37
|
+
|
|
38
|
+
Verifies that the supplied company name is a non-empty string. Throws early if invalid:
|
|
39
|
+
|
|
40
|
+
```javascript
|
|
41
|
+
const startFunc = ({ inCompany }) => {
|
|
42
|
+
const localCompany = inCompany;
|
|
43
|
+
|
|
44
|
+
if (typeof localCompany !== "string" || !localCompany.trim()) {
|
|
45
|
+
throw new TypeError("Company name is required.");
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return localCompany.trim();
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export default startFunc;
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
### Step 2: Direct TDL Lookup (`getTdl.js`)
|
|
57
|
+
|
|
58
|
+
Instead of crawling or traversing the JSON structure, the endpoint is retrieved in a single line using path reduction:
|
|
59
|
+
|
|
60
|
+
```javascript
|
|
61
|
+
const startFunc = ({ inSource, inRoutePath }) => {
|
|
62
|
+
const localSource = inSource;
|
|
63
|
+
const localRoutePath = inRoutePath;
|
|
64
|
+
|
|
65
|
+
const endpoint = localRoutePath
|
|
66
|
+
.split(".")
|
|
67
|
+
.reduce((current, key) => current?.[key], localSource);
|
|
68
|
+
|
|
69
|
+
return endpoint?.tdl;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
export default startFunc;
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
### Step 3: XML Body Construction (`buildXmlBody.js`)
|
|
78
|
+
|
|
79
|
+
Safely escapes XML special characters (`&`, `<`, `>`, `"`, `'`) in the company name and substitutes `{company}` and `{collectionBody}` into the envelope template:
|
|
80
|
+
|
|
81
|
+
```javascript
|
|
82
|
+
const startFunc = ({ inCompany, inTdl }) => {
|
|
83
|
+
const localCompany = inCompany;
|
|
84
|
+
const localTdl = inTdl;
|
|
85
|
+
|
|
86
|
+
return xmlEnvelopeTemplate
|
|
87
|
+
.replace("{company}", escapeXml(localCompany))
|
|
88
|
+
.replace("{collectionBody}", localTdl?.collection ?? "");
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export default startFunc;
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
---
|
|
95
|
+
|
|
96
|
+
### Step 4: HTTP Transport (`postHttp.js`)
|
|
97
|
+
|
|
98
|
+
Performs a standard `POST` request to `http://localhost:9000` with `Content-Type: text/xml`:
|
|
99
|
+
|
|
100
|
+
```javascript
|
|
101
|
+
const url = "http://localhost:9000";
|
|
102
|
+
const headers = { "Content-Type": "text/xml" };
|
|
103
|
+
|
|
104
|
+
const startFunc = async ({ inXmlBody }) => {
|
|
105
|
+
const localXmlBody = inXmlBody;
|
|
106
|
+
|
|
107
|
+
const response = await fetch(url, {
|
|
108
|
+
method: "POST",
|
|
109
|
+
headers: headers,
|
|
110
|
+
body: localXmlBody
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
const responseText = await response.text();
|
|
114
|
+
|
|
115
|
+
if (!response.ok) {
|
|
116
|
+
throw new Error(`Tally request failed with HTTP ${response.status}: ${responseText}`);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
return responseText;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
export default startFunc;
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
### The Coordinator (`index.js`)
|
|
128
|
+
|
|
129
|
+
The main entry point reads like a 4-line story:
|
|
130
|
+
|
|
131
|
+
```javascript
|
|
132
|
+
import validateCompany from "./validateCompany.js";
|
|
133
|
+
import getTdl from "./getTdl.js";
|
|
134
|
+
import buildXmlBody from "./buildXmlBody.js";
|
|
135
|
+
import postHttp from "./postHttp.js";
|
|
136
|
+
|
|
137
|
+
const startFunc = async ({ inRoutePath, inCompany, inSource }) => {
|
|
138
|
+
const localRoutePath = inRoutePath;
|
|
139
|
+
const localCompany = inCompany;
|
|
140
|
+
const localSource = inSource;
|
|
141
|
+
|
|
142
|
+
const companyName = validateCompany({ inCompany: localCompany });
|
|
143
|
+
const tdl = getTdl({ inSource: localSource, inRoutePath: localRoutePath });
|
|
144
|
+
const xmlBody = buildXmlBody({ inCompany: companyName, inTdl: tdl });
|
|
145
|
+
|
|
146
|
+
return await postHttp({ inXmlBody: xmlBody });
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export default startFunc;
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
---
|
|
153
|
+
|
|
154
|
+
## Architectural Highlights
|
|
155
|
+
|
|
156
|
+
- **Direct Resolution:** No recursion, no skipping keys, no runtime guessing.
|
|
157
|
+
- **Single Responsibility:** Each file does exactly one job.
|
|
158
|
+
- **Strict Single Export:** Every file exports `export default startFunc;`.
|
package/docs/index.html
CHANGED
|
@@ -1,32 +1,294 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta charset="
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
-
<title>Tally
|
|
7
|
-
<style>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Tally Simple — Documentation Hub</title>
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--bg: #0f172a;
|
|
10
|
+
--card-bg: #1e293b;
|
|
11
|
+
--card-border: #334155;
|
|
12
|
+
--text-main: #f8fafc;
|
|
13
|
+
--text-muted: #94a3b8;
|
|
14
|
+
--accent: #38bdf8;
|
|
15
|
+
--accent-hover: #7dd3fc;
|
|
16
|
+
--success: #34d399;
|
|
17
|
+
}
|
|
18
|
+
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
19
|
+
body {
|
|
20
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
|
|
21
|
+
background-color: var(--bg);
|
|
22
|
+
color: var(--text-main);
|
|
23
|
+
line-height: 1.6;
|
|
24
|
+
padding: 2.5rem 1.5rem;
|
|
25
|
+
}
|
|
26
|
+
.container {
|
|
27
|
+
max-width: 920px;
|
|
28
|
+
margin: 0 auto;
|
|
29
|
+
}
|
|
30
|
+
header {
|
|
31
|
+
margin-bottom: 2.5rem;
|
|
32
|
+
border-bottom: 1px solid var(--card-border);
|
|
33
|
+
padding-bottom: 1.5rem;
|
|
34
|
+
}
|
|
35
|
+
.badge-row {
|
|
36
|
+
display: flex;
|
|
37
|
+
gap: 0.5rem;
|
|
38
|
+
margin-bottom: 0.75rem;
|
|
39
|
+
flex-wrap: wrap;
|
|
40
|
+
}
|
|
41
|
+
.badge {
|
|
42
|
+
font-size: 0.75rem;
|
|
43
|
+
font-weight: 600;
|
|
44
|
+
padding: 0.2rem 0.55rem;
|
|
45
|
+
border-radius: 9999px;
|
|
46
|
+
background: rgba(56, 189, 248, 0.12);
|
|
47
|
+
color: var(--accent);
|
|
48
|
+
border: 1px solid rgba(56, 189, 248, 0.25);
|
|
49
|
+
text-transform: uppercase;
|
|
50
|
+
letter-spacing: 0.05em;
|
|
51
|
+
}
|
|
52
|
+
.badge-green {
|
|
53
|
+
background: rgba(52, 211, 153, 0.12);
|
|
54
|
+
color: var(--success);
|
|
55
|
+
border-color: rgba(52, 211, 153, 0.25);
|
|
56
|
+
}
|
|
57
|
+
h1 {
|
|
58
|
+
font-size: 2.3rem;
|
|
59
|
+
font-weight: 800;
|
|
60
|
+
color: var(--text-main);
|
|
61
|
+
margin-bottom: 0.5rem;
|
|
62
|
+
letter-spacing: -0.02em;
|
|
63
|
+
}
|
|
64
|
+
.subtitle {
|
|
65
|
+
font-size: 1.15rem;
|
|
66
|
+
color: var(--text-muted);
|
|
67
|
+
}
|
|
68
|
+
.story-hero {
|
|
69
|
+
background: var(--card-bg);
|
|
70
|
+
border: 1px solid var(--card-border);
|
|
71
|
+
border-radius: 10px;
|
|
72
|
+
padding: 1.75rem;
|
|
73
|
+
margin-bottom: 2.5rem;
|
|
74
|
+
position: relative;
|
|
75
|
+
overflow: hidden;
|
|
76
|
+
}
|
|
77
|
+
.story-hero::before {
|
|
78
|
+
content: "";
|
|
79
|
+
position: absolute;
|
|
80
|
+
top: 0;
|
|
81
|
+
left: 0;
|
|
82
|
+
width: 4px;
|
|
83
|
+
height: 100%;
|
|
84
|
+
background: var(--accent);
|
|
85
|
+
}
|
|
86
|
+
.story-hero h2 {
|
|
87
|
+
font-size: 1.35rem;
|
|
88
|
+
color: var(--accent);
|
|
89
|
+
margin-bottom: 0.5rem;
|
|
90
|
+
}
|
|
91
|
+
.story-hero p {
|
|
92
|
+
color: var(--text-muted);
|
|
93
|
+
font-size: 1rem;
|
|
94
|
+
margin-bottom: 1rem;
|
|
95
|
+
}
|
|
96
|
+
.story-flow {
|
|
97
|
+
background: rgba(15, 23, 42, 0.7);
|
|
98
|
+
border: 1px solid var(--card-border);
|
|
99
|
+
border-radius: 6px;
|
|
100
|
+
padding: 1rem;
|
|
101
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
102
|
+
font-size: 0.88rem;
|
|
103
|
+
color: #38bdf8;
|
|
104
|
+
margin: 1rem 0;
|
|
105
|
+
overflow-x: auto;
|
|
106
|
+
}
|
|
107
|
+
.pipeline-diagram {
|
|
108
|
+
display: grid;
|
|
109
|
+
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
|
110
|
+
gap: 1rem;
|
|
111
|
+
margin-top: 1.25rem;
|
|
112
|
+
}
|
|
113
|
+
.pipeline-step {
|
|
114
|
+
background: rgba(15, 23, 42, 0.5);
|
|
115
|
+
border: 1px solid var(--card-border);
|
|
116
|
+
border-radius: 6px;
|
|
117
|
+
padding: 0.85rem;
|
|
118
|
+
}
|
|
119
|
+
.pipeline-step .step-num {
|
|
120
|
+
font-size: 0.75rem;
|
|
121
|
+
font-weight: 700;
|
|
122
|
+
color: var(--accent);
|
|
123
|
+
margin-bottom: 0.2rem;
|
|
124
|
+
}
|
|
125
|
+
.pipeline-step h3 {
|
|
126
|
+
font-size: 0.95rem;
|
|
127
|
+
margin-bottom: 0.35rem;
|
|
128
|
+
color: var(--text-main);
|
|
129
|
+
}
|
|
130
|
+
.pipeline-step p {
|
|
131
|
+
font-size: 0.82rem;
|
|
132
|
+
color: var(--text-muted);
|
|
133
|
+
margin-bottom: 0;
|
|
134
|
+
}
|
|
135
|
+
.grid {
|
|
136
|
+
display: grid;
|
|
137
|
+
grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
|
|
138
|
+
gap: 1.5rem;
|
|
139
|
+
}
|
|
140
|
+
.card {
|
|
141
|
+
background-color: var(--card-bg);
|
|
142
|
+
border: 1px solid var(--card-border);
|
|
143
|
+
border-radius: 8px;
|
|
144
|
+
padding: 1.5rem;
|
|
145
|
+
display: flex;
|
|
146
|
+
flex-direction: column;
|
|
147
|
+
justify-content: space-between;
|
|
148
|
+
transition: border-color 0.2s, transform 0.2s;
|
|
149
|
+
text-decoration: none;
|
|
150
|
+
color: inherit;
|
|
151
|
+
}
|
|
152
|
+
.card:hover {
|
|
153
|
+
border-color: var(--accent);
|
|
154
|
+
transform: translateY(-2px);
|
|
155
|
+
}
|
|
156
|
+
.card h2 {
|
|
157
|
+
font-size: 1.25rem;
|
|
158
|
+
color: var(--accent);
|
|
159
|
+
margin-bottom: 0.5rem;
|
|
160
|
+
}
|
|
161
|
+
.card p {
|
|
162
|
+
color: var(--text-muted);
|
|
163
|
+
font-size: 0.93rem;
|
|
164
|
+
margin-bottom: 1rem;
|
|
165
|
+
}
|
|
166
|
+
.formats {
|
|
167
|
+
display: flex;
|
|
168
|
+
gap: 0.75rem;
|
|
169
|
+
font-size: 0.85rem;
|
|
170
|
+
}
|
|
171
|
+
.format-badge {
|
|
172
|
+
background: rgba(56, 189, 248, 0.1);
|
|
173
|
+
color: var(--accent);
|
|
174
|
+
padding: 0.2rem 0.5rem;
|
|
175
|
+
border-radius: 4px;
|
|
176
|
+
font-weight: 600;
|
|
177
|
+
}
|
|
178
|
+
footer {
|
|
179
|
+
margin-top: 3.5rem;
|
|
180
|
+
text-align: center;
|
|
181
|
+
color: var(--text-muted);
|
|
182
|
+
font-size: 0.9rem;
|
|
183
|
+
border-top: 1px solid var(--card-border);
|
|
184
|
+
padding-top: 1.5rem;
|
|
185
|
+
}
|
|
186
|
+
</style>
|
|
17
187
|
</head>
|
|
18
188
|
<body>
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
<
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
189
|
+
<div class="container">
|
|
190
|
+
<header>
|
|
191
|
+
<div class="badge-row">
|
|
192
|
+
<span class="badge">v1.7.2</span>
|
|
193
|
+
<span class="badge badge-green">Zero Dependencies</span>
|
|
194
|
+
<span class="badge">Node.js >= 20.10</span>
|
|
195
|
+
<span class="badge">Raw XML Transport</span>
|
|
196
|
+
</div>
|
|
197
|
+
<h1>Tally Simple Documentation Hub</h1>
|
|
198
|
+
<p class="subtitle">A small, typed JavaScript client and CLI for querying Tally via TDL definitions.</p>
|
|
199
|
+
</header>
|
|
200
|
+
|
|
201
|
+
<section class="story-hero">
|
|
202
|
+
<h2>The Story of Tally Simple</h2>
|
|
203
|
+
<p>Querying Tally ERP / Prime directly over HTTP (port 9000) requires complex XML request wrappers and obscure TDL syntax. <code>tally-simple</code> acts as the pure transport engine: choose an endpoint, supply a company name, and receive Tally's exact, raw XML response.</p>
|
|
204
|
+
<p>Following the UNIX philosophy, responses are kept as raw XML text—making them 100% loss-free, directly pipeable into shell files (<code>> units.xml</code>), and ideal for downstream transformation layers like <code>tally-simple-json</code>.</p>
|
|
205
|
+
|
|
206
|
+
<div class="story-flow">Your App / Shell ───► tally-simple ───► Tally (:9000) ───► Raw XML Response String</div>
|
|
207
|
+
|
|
208
|
+
<div class="pipeline-diagram">
|
|
209
|
+
<div class="pipeline-step">
|
|
210
|
+
<div class="step-num">STEP 1</div>
|
|
211
|
+
<h3>Validate Company</h3>
|
|
212
|
+
<p>Ensures company name is a non-empty string and trims whitespace.</p>
|
|
213
|
+
</div>
|
|
214
|
+
<div class="pipeline-step">
|
|
215
|
+
<div class="step-num">STEP 2</div>
|
|
216
|
+
<h3>Get TDL Query</h3>
|
|
217
|
+
<p>O(1) path reduction lookup into <code>source.json</code> to retrieve TDL.</p>
|
|
218
|
+
</div>
|
|
219
|
+
<div class="pipeline-step">
|
|
220
|
+
<div class="step-num">STEP 3</div>
|
|
221
|
+
<h3>Build XML Body</h3>
|
|
222
|
+
<p>Escapes XML entities and injects into Tally request envelope.</p>
|
|
223
|
+
</div>
|
|
224
|
+
<div class="pipeline-step">
|
|
225
|
+
<div class="step-num">STEP 4</div>
|
|
226
|
+
<h3>Post HTTP</h3>
|
|
227
|
+
<p>POST to <code>localhost:9000</code> and returns raw response body.</p>
|
|
228
|
+
</div>
|
|
229
|
+
</div>
|
|
230
|
+
</section>
|
|
231
|
+
|
|
232
|
+
<div class="grid">
|
|
233
|
+
<a class="card" href="usage.html">
|
|
234
|
+
<div>
|
|
235
|
+
<h2>1. Usage Guide</h2>
|
|
236
|
+
<p>How to consume Tally Simple via ESM JavaScript, TypeScript typings, and the command line interface.</p>
|
|
237
|
+
</div>
|
|
238
|
+
<div class="formats">
|
|
239
|
+
<span class="format-badge">HTML</span>
|
|
240
|
+
<span class="format-badge" onclick="event.preventDefault(); window.location.href='usage.md';">Markdown</span>
|
|
241
|
+
</div>
|
|
242
|
+
</a>
|
|
243
|
+
|
|
244
|
+
<a class="card" href="queries.html">
|
|
245
|
+
<div>
|
|
246
|
+
<h2>2. Available Queries</h2>
|
|
247
|
+
<p>Complete directory of supported master endpoints, requested TDL collections, and raw XML returns.</p>
|
|
248
|
+
</div>
|
|
249
|
+
<div class="formats">
|
|
250
|
+
<span class="format-badge">HTML</span>
|
|
251
|
+
<span class="format-badge" onclick="event.preventDefault(); window.location.href='queries.md';">Markdown</span>
|
|
252
|
+
</div>
|
|
253
|
+
</a>
|
|
254
|
+
|
|
255
|
+
<a class="card" href="architecture.html">
|
|
256
|
+
<div>
|
|
257
|
+
<h2>3. System Architecture</h2>
|
|
258
|
+
<p>Clean boundaries between public allowlists, domain-only specifications, and the internal engines.</p>
|
|
259
|
+
</div>
|
|
260
|
+
<div class="formats">
|
|
261
|
+
<span class="format-badge">HTML</span>
|
|
262
|
+
<span class="format-badge" onclick="event.preventDefault(); window.location.href='architecture.md';">Markdown</span>
|
|
263
|
+
</div>
|
|
264
|
+
</a>
|
|
265
|
+
|
|
266
|
+
<a class="card" href="route-engine.html">
|
|
267
|
+
<div>
|
|
268
|
+
<h2>4. Route Engine</h2>
|
|
269
|
+
<p>How the nested, callable object tree is assembled from allowlisted dot-paths without hardcoding.</p>
|
|
270
|
+
</div>
|
|
271
|
+
<div class="formats">
|
|
272
|
+
<span class="format-badge">HTML</span>
|
|
273
|
+
<span class="format-badge" onclick="event.preventDefault(); window.location.href='route-engine.md';">Markdown</span>
|
|
274
|
+
</div>
|
|
275
|
+
</a>
|
|
276
|
+
|
|
277
|
+
<a class="card" href="execution-pipeline.html">
|
|
278
|
+
<div>
|
|
279
|
+
<h2>5. Execution Pipeline</h2>
|
|
280
|
+
<p>The 4-step story: company validation, O(1) TDL lookup, XML body building, and HTTP dispatch.</p>
|
|
281
|
+
</div>
|
|
282
|
+
<div class="formats">
|
|
283
|
+
<span class="format-badge">HTML</span>
|
|
284
|
+
<span class="format-badge" onclick="event.preventDefault(); window.location.href='execution-pipeline.md';">Markdown</span>
|
|
285
|
+
</div>
|
|
286
|
+
</a>
|
|
287
|
+
</div>
|
|
288
|
+
|
|
289
|
+
<footer>
|
|
290
|
+
<p>© KeshavSoft. Distributed under the MIT License.</p>
|
|
291
|
+
</footer>
|
|
292
|
+
</div>
|
|
31
293
|
</body>
|
|
32
294
|
</html>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Available Queries — Tally Simple</title>
|
|
7
|
+
<link rel="stylesheet" href="style.css">
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div class="container">
|
|
11
|
+
<nav class="doc-nav">
|
|
12
|
+
<a href="index.html">← Documentation Hub</a>
|
|
13
|
+
<a href="queries.md">View Markdown</a>
|
|
14
|
+
</nav>
|
|
15
|
+
|
|
16
|
+
<h1>Available Queries Reference</h1>
|
|
17
|
+
<p>This document details the queries available in Tally Simple, the underlying TDL requests generated, and the XML data returned.</p>
|
|
18
|
+
|
|
19
|
+
<h2>Master Endpoints Overview</h2>
|
|
20
|
+
<table>
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th>Query Path</th>
|
|
24
|
+
<th>Domain Object</th>
|
|
25
|
+
<th>TDL Action</th>
|
|
26
|
+
</tr>
|
|
27
|
+
</thead>
|
|
28
|
+
<tbody>
|
|
29
|
+
<tr>
|
|
30
|
+
<td><code>tally.masters.units.fetch</code></td>
|
|
31
|
+
<td>Unit of Measurement</td>
|
|
32
|
+
<td><code>fetch</code></td>
|
|
33
|
+
</tr>
|
|
34
|
+
<tr>
|
|
35
|
+
<td><code>tally.masters.stockItems.withBatches</code></td>
|
|
36
|
+
<td>Inventory Stock Item</td>
|
|
37
|
+
<td><code>fetch</code></td>
|
|
38
|
+
</tr>
|
|
39
|
+
<tr>
|
|
40
|
+
<td><code>tally.masters.ledgers.withGstDetails</code></td>
|
|
41
|
+
<td>Accounting Ledger</td>
|
|
42
|
+
<td><code>fetch</code></td>
|
|
43
|
+
</tr>
|
|
44
|
+
<tr>
|
|
45
|
+
<td><code>tally.masters.stockGroup.withParent</code></td>
|
|
46
|
+
<td>Stock Classification</td>
|
|
47
|
+
<td><code>fetch</code></td>
|
|
48
|
+
</tr>
|
|
49
|
+
</tbody>
|
|
50
|
+
</table>
|
|
51
|
+
|
|
52
|
+
<h2>1. Units (<code>masters.units.fetch</code>)</h2>
|
|
53
|
+
<p>Fetches all defined units of measurement in the specified company along with their aliases and names.</p>
|
|
54
|
+
<pre><code><TYPE>Unit</TYPE>
|
|
55
|
+
<FETCH>$$Alias:Name</FETCH></code></pre>
|
|
56
|
+
|
|
57
|
+
<h2>2. Stock Items with Batches (<code>masters.stockItems.withBatches</code>)</h2>
|
|
58
|
+
<p>Fetches stock items including their base unit of measure and batch allocation details.</p>
|
|
59
|
+
<pre><code><TYPE>StockItem</TYPE>
|
|
60
|
+
<FETCH>$$Alias:Name</FETCH>
|
|
61
|
+
<FETCH>BaseUnits</FETCH>
|
|
62
|
+
<FETCH>BatchAllocations.*</FETCH></code></pre>
|
|
63
|
+
|
|
64
|
+
<h2>3. Ledgers with GST Details (<code>masters.ledgers.withGstDetails</code>)</h2>
|
|
65
|
+
<p>Fetches accounting ledgers including their GST registration details list.</p>
|
|
66
|
+
<pre><code><TYPE>Ledger</TYPE>
|
|
67
|
+
<FETCH>$$Alias:Name</FETCH>
|
|
68
|
+
<FETCH>LEDGSTREGDETAILS.LIST</FETCH></code></pre>
|
|
69
|
+
|
|
70
|
+
<h2>4. Stock Groups with Parent (<code>masters.stockGroup.withParent</code>)</h2>
|
|
71
|
+
<p>Fetches stock groups and their parent group hierarchy.</p>
|
|
72
|
+
<pre><code><TYPE>StockGroup</TYPE>
|
|
73
|
+
<FETCH>$$Alias:Name</FETCH>
|
|
74
|
+
<FETCH>Parent</FETCH></code></pre>
|
|
75
|
+
|
|
76
|
+
<h2>The Request Envelope</h2>
|
|
77
|
+
<p>Tally Simple dynamically injects the company name and TDL collection into Tally's standard Export Collection envelope:</p>
|
|
78
|
+
<pre><code><ENVELOPE>
|
|
79
|
+
<HEADER>
|
|
80
|
+
<VERSION>1</VERSION>
|
|
81
|
+
<TALLYREQUEST>Export</TALLYREQUEST>
|
|
82
|
+
<TYPE>Collection</TYPE>
|
|
83
|
+
<ID>TDLID</ID>
|
|
84
|
+
</HEADER>
|
|
85
|
+
<BODY>
|
|
86
|
+
<DESC>
|
|
87
|
+
<STATICVARIABLES>
|
|
88
|
+
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
|
|
89
|
+
<SVCURRENTCOMPANY>{company}</SVCURRENTCOMPANY>
|
|
90
|
+
</STATICVARIABLES>
|
|
91
|
+
<TDL>
|
|
92
|
+
<TDLMESSAGE>
|
|
93
|
+
<COLLECTION NAME="TDLID">
|
|
94
|
+
{collectionBody}
|
|
95
|
+
</COLLECTION>
|
|
96
|
+
</TDLMESSAGE>
|
|
97
|
+
</TDL>
|
|
98
|
+
</DESC>
|
|
99
|
+
</BODY>
|
|
100
|
+
</ENVELOPE></code></pre>
|
|
101
|
+
|
|
102
|
+
<footer>
|
|
103
|
+
<p>© KeshavSoft. Distributed under the MIT License.</p>
|
|
104
|
+
</footer>
|
|
105
|
+
</div>
|
|
106
|
+
</body>
|
|
107
|
+
</html>
|