tally-xml-tdl 1.27.1 → 1.27.3
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/index.d.ts +83 -65
- package/package.json +9 -2
- package/src/index.js +1 -1
- package/src/v24/api.json +17 -17
- package/src/v24/engine/execution/buildXml.js +54 -54
- package/src/v24/engine/execution/dispatchTally.js +29 -29
- package/src/v24/engine/execution/getEndpointSpec.js +12 -12
- package/src/v24/engine/execution/index.js +27 -27
- package/src/v24/engine/execution/parseResponse.js +13 -13
- package/src/v24/engine/execution/templates.js +42 -42
- package/src/v24/engine/execution/transport.js +16 -16
- package/src/v24/engine/execution/validateInput.js +19 -19
- package/src/v24/engine/route/attachPath.js +25 -25
- package/src/v24/engine/route/createLeafHandler.js +19 -19
- package/src/v24/engine/route/index.js +24 -24
- package/src/v24/index.js +12 -12
- package/src/v24/source.json +119 -119
- package/src/v25/engine/dispatchTally/buildXml/buildXml.js +45 -45
- package/src/v25/engine/dispatchTally/buildXml/templates.js +42 -42
- package/src/v25/engine/dispatchTally/index.js +25 -25
- package/src/v25/engine/dispatchTally/parseResponse.js +13 -13
- package/src/v25/engine/dispatchTally/transport.js +16 -16
- package/src/v25/engine/getEndpointSpec/index.js +12 -12
- package/src/v25/engine/index.js +24 -24
- package/src/v25/engine/validateInput/index.js +19 -19
- package/src/v25/index.js +8 -8
- package/src/v26/engine/dispatchTally/buildXml/buildXml.js +45 -45
- package/src/v26/engine/dispatchTally/buildXml/templates.js +42 -42
- package/src/v26/engine/dispatchTally/index.js +25 -25
- package/src/v26/engine/dispatchTally/parseResponse.js +13 -13
- package/src/v26/engine/dispatchTally/transport.js +16 -16
- package/src/v26/engine/getEndpointSpec/index.js +12 -12
- package/src/v26/engine/index.js +24 -24
- package/src/v26/engine/validateInput/index.js +19 -19
- package/src/v26/index.js +10 -10
- package/src/v27/engine/dispatchTally/buildXml/buildXml.js +45 -45
- package/src/v27/engine/dispatchTally/buildXml/templates.js +42 -42
- package/src/v27/engine/dispatchTally/index.js +20 -20
- package/src/v27/engine/dispatchTally/transport.js +16 -16
- package/src/v27/engine/getEndpointSpec/index.js +12 -12
- package/src/v27/engine/index.js +24 -24
- package/src/v27/engine/validateInput/index.js +19 -19
- package/src/v27/index.js +10 -10
package/index.d.ts
CHANGED
|
@@ -1,65 +1,83 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated by create-intellisense from src/
|
|
3
|
-
* Do not edit this file directly.
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export type TallyApi = {
|
|
7
|
-
company: {
|
|
8
|
-
/** Fetches company list from Tally. */
|
|
9
|
-
fetch: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
10
|
-
};
|
|
11
|
-
vouchers: {
|
|
12
|
-
purchases: {
|
|
13
|
-
/** Fetches purchase vouchers. */
|
|
14
|
-
fetch: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
15
|
-
};
|
|
16
|
-
sales: {
|
|
17
|
-
/** Fetches sales vouchers. */
|
|
18
|
-
fetch: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
masters: {
|
|
22
|
-
unit: {
|
|
23
|
-
/** Fetches all units. */
|
|
24
|
-
all: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
/** Fetches
|
|
28
|
-
|
|
29
|
-
/** Fetches
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
/** Fetches
|
|
36
|
-
|
|
37
|
-
/** Fetches
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/** Fetches
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/** Fetches
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
/** Fetches
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Generated by create-intellisense from src/v27.
|
|
3
|
+
* Do not edit this file directly.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export type TallyApi = {
|
|
7
|
+
company: {
|
|
8
|
+
/** Fetches company list from Tally. */
|
|
9
|
+
fetch: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
10
|
+
};
|
|
11
|
+
vouchers: {
|
|
12
|
+
purchases: {
|
|
13
|
+
/** Fetches purchase vouchers. */
|
|
14
|
+
fetch: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
15
|
+
};
|
|
16
|
+
sales: {
|
|
17
|
+
/** Fetches sales vouchers. */
|
|
18
|
+
fetch: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
masters: {
|
|
22
|
+
unit: {
|
|
23
|
+
/** Fetches all units. */
|
|
24
|
+
all: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
25
|
+
};
|
|
26
|
+
units: {
|
|
27
|
+
/** Fetches units master from Tally. */
|
|
28
|
+
fetch: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
29
|
+
/** Fetches all units. */
|
|
30
|
+
all: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
31
|
+
};
|
|
32
|
+
stockItem: {
|
|
33
|
+
/** Fetches all stock items. */
|
|
34
|
+
all: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
35
|
+
/** Fetches stock items with base units. */
|
|
36
|
+
withBaseUnits: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
37
|
+
/** Fetches stock items with batches. */
|
|
38
|
+
withBatches: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
39
|
+
};
|
|
40
|
+
stockItems: {
|
|
41
|
+
/** Fetches stock items with batch allocations from Tally. */
|
|
42
|
+
withBatches: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
43
|
+
};
|
|
44
|
+
ledger: {
|
|
45
|
+
/** Fetches all ledgers. */
|
|
46
|
+
all: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
47
|
+
/** Fetches ledgers with GSTIN details. */
|
|
48
|
+
withDetails: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
49
|
+
/** Fetches ledgers with full GST registration details. */
|
|
50
|
+
withGstDetails: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
51
|
+
};
|
|
52
|
+
ledgers: {
|
|
53
|
+
/** Fetches ledgers with GST registration details from Tally. */
|
|
54
|
+
withGstDetails: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
55
|
+
};
|
|
56
|
+
stockGroup: {
|
|
57
|
+
/** Fetches all stock groups. */
|
|
58
|
+
all: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
59
|
+
/** Fetches stock groups with parent hierarchies. */
|
|
60
|
+
withParent: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
61
|
+
};
|
|
62
|
+
stockGroups: {
|
|
63
|
+
/** Fetches stock groups with parent details from Tally. */
|
|
64
|
+
withParent: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
65
|
+
};
|
|
66
|
+
godown: {
|
|
67
|
+
/** Fetches all godowns. */
|
|
68
|
+
all: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
69
|
+
/** Fetches godowns with parent hierarchies. */
|
|
70
|
+
withParent: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
reports: {
|
|
74
|
+
stockSummary: {
|
|
75
|
+
/** Fetches the Stock Summary report from Tally. */
|
|
76
|
+
fetch: (inParam: string, ...inArgs: any[]) => Promise<any>;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
declare const tally: TallyApi;
|
|
82
|
+
|
|
83
|
+
export default tally;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tally-xml-tdl",
|
|
3
|
-
"version": "1.27.
|
|
3
|
+
"version": "1.27.3",
|
|
4
4
|
"description": "Simple, clean TDL and XML extraction and manipulation tools for Tally",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -29,8 +29,15 @@
|
|
|
29
29
|
"bugs": {
|
|
30
30
|
"url": "https://github.com/keshavsoft/tally-xml-tdl/issues"
|
|
31
31
|
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"generate:dts": "create-intellisense",
|
|
34
|
+
"test": "node --test Test/v27/company.js Test/v27/index.js Test/v27/units.js"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"create-intellisense": "^1.2.1"
|
|
38
|
+
},
|
|
32
39
|
"dependencies": {
|
|
33
40
|
"@keshavsoft/api-tree": "^11.1.1",
|
|
34
|
-
"tally-spec": "^1.
|
|
41
|
+
"tally-spec": "^1.2.2"
|
|
35
42
|
}
|
|
36
43
|
}
|
package/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./v27/index.js";
|
|
1
|
+
export { default } from "./v27/index.js";
|
|
2
2
|
export * from "./v27/index.js";
|
package/src/v24/api.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
[
|
|
2
|
-
"tally.company.fetch",
|
|
3
|
-
"tally.vouchers.purchases.fetch",
|
|
4
|
-
"tally.vouchers.sales.fetch",
|
|
5
|
-
"tally.masters.unit.all",
|
|
6
|
-
"tally.masters.stockItem.all",
|
|
7
|
-
"tally.masters.stockItem.withBaseUnits",
|
|
8
|
-
"tally.masters.stockItem.withBatches",
|
|
9
|
-
"tally.masters.ledger.all",
|
|
10
|
-
"tally.masters.ledger.withDetails",
|
|
11
|
-
"tally.masters.ledger.withGstDetails",
|
|
12
|
-
"tally.masters.stockGroup.all",
|
|
13
|
-
"tally.masters.stockGroup.withParent",
|
|
14
|
-
"tally.masters.godown.all",
|
|
15
|
-
"tally.masters.godown.withParent",
|
|
16
|
-
"tally.reports.stockSummary.fetch"
|
|
17
|
-
]
|
|
1
|
+
[
|
|
2
|
+
"tally.company.fetch",
|
|
3
|
+
"tally.vouchers.purchases.fetch",
|
|
4
|
+
"tally.vouchers.sales.fetch",
|
|
5
|
+
"tally.masters.unit.all",
|
|
6
|
+
"tally.masters.stockItem.all",
|
|
7
|
+
"tally.masters.stockItem.withBaseUnits",
|
|
8
|
+
"tally.masters.stockItem.withBatches",
|
|
9
|
+
"tally.masters.ledger.all",
|
|
10
|
+
"tally.masters.ledger.withDetails",
|
|
11
|
+
"tally.masters.ledger.withGstDetails",
|
|
12
|
+
"tally.masters.stockGroup.all",
|
|
13
|
+
"tally.masters.stockGroup.withParent",
|
|
14
|
+
"tally.masters.godown.all",
|
|
15
|
+
"tally.masters.godown.withParent",
|
|
16
|
+
"tally.reports.stockSummary.fetch"
|
|
17
|
+
]
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
import { collectionTemplate, dataTemplate } from "./templates.js";
|
|
2
|
-
|
|
3
|
-
const startFunc = ({ inEndpoint, inParam, inArgs }) => {
|
|
4
|
-
const localEndpoint = inEndpoint;
|
|
5
|
-
const localParam = inParam;
|
|
6
|
-
const localArgs = inArgs || [];
|
|
7
|
-
|
|
8
|
-
if (localEndpoint?.reportId) {
|
|
9
|
-
let staticVars = "";
|
|
10
|
-
|
|
11
|
-
if (typeof localParam === "string" && localParam.length > 0) {
|
|
12
|
-
staticVars += `<SVCURRENTCOMPANY>${localParam}</SVCURRENTCOMPANY>`;
|
|
13
|
-
} else if (typeof localParam === "object" && localParam?.company) {
|
|
14
|
-
staticVars += `<SVCURRENTCOMPANY>${localParam.company}</SVCURRENTCOMPANY>`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
if (localEndpoint.staticVariables) {
|
|
18
|
-
staticVars += localEndpoint.staticVariables;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (localArgs[0] && typeof localArgs[0] === "string") {
|
|
22
|
-
staticVars += localArgs[0];
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return dataTemplate
|
|
26
|
-
.replace("{{ID}}", localEndpoint.reportId)
|
|
27
|
-
.replace("{{STATICVARIABLES}}", staticVars);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
let staticVars = "";
|
|
31
|
-
|
|
32
|
-
if (typeof localParam === "string" && localParam.length > 0) {
|
|
33
|
-
staticVars += `<SVCURRENTCOMPANY>${localParam}</SVCURRENTCOMPANY>`;
|
|
34
|
-
} else if (typeof localParam === "object" && localParam) {
|
|
35
|
-
if (localParam.company) {
|
|
36
|
-
staticVars += `<SVCURRENTCOMPANY>${localParam.company}</SVCURRENTCOMPANY>`;
|
|
37
|
-
}
|
|
38
|
-
if (localParam.fromDate && localParam.toDate) {
|
|
39
|
-
staticVars += `<SVFROMDATE TYPE="Date">${localParam.fromDate}</SVFROMDATE><SVTODATE TYPE="Date">${localParam.toDate}</SVTODATE>`;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (localArgs.length >= 2 && localArgs[0] && localArgs[1]) {
|
|
44
|
-
staticVars += `<SVFROMDATE TYPE="Date">${localArgs[0]}</SVFROMDATE><SVTODATE TYPE="Date">${localArgs[1]}</SVTODATE>`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const tdlMessage = localEndpoint?.tdl || "";
|
|
48
|
-
|
|
49
|
-
return collectionTemplate
|
|
50
|
-
.replace("{{STATICVARIABLES}}", staticVars)
|
|
51
|
-
.replace("{{TDLMESSAGE}}", tdlMessage);
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export default startFunc;
|
|
1
|
+
import { collectionTemplate, dataTemplate } from "./templates.js";
|
|
2
|
+
|
|
3
|
+
const startFunc = ({ inEndpoint, inParam, inArgs }) => {
|
|
4
|
+
const localEndpoint = inEndpoint;
|
|
5
|
+
const localParam = inParam;
|
|
6
|
+
const localArgs = inArgs || [];
|
|
7
|
+
|
|
8
|
+
if (localEndpoint?.reportId) {
|
|
9
|
+
let staticVars = "";
|
|
10
|
+
|
|
11
|
+
if (typeof localParam === "string" && localParam.length > 0) {
|
|
12
|
+
staticVars += `<SVCURRENTCOMPANY>${localParam}</SVCURRENTCOMPANY>`;
|
|
13
|
+
} else if (typeof localParam === "object" && localParam?.company) {
|
|
14
|
+
staticVars += `<SVCURRENTCOMPANY>${localParam.company}</SVCURRENTCOMPANY>`;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (localEndpoint.staticVariables) {
|
|
18
|
+
staticVars += localEndpoint.staticVariables;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (localArgs[0] && typeof localArgs[0] === "string") {
|
|
22
|
+
staticVars += localArgs[0];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return dataTemplate
|
|
26
|
+
.replace("{{ID}}", localEndpoint.reportId)
|
|
27
|
+
.replace("{{STATICVARIABLES}}", staticVars);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
let staticVars = "";
|
|
31
|
+
|
|
32
|
+
if (typeof localParam === "string" && localParam.length > 0) {
|
|
33
|
+
staticVars += `<SVCURRENTCOMPANY>${localParam}</SVCURRENTCOMPANY>`;
|
|
34
|
+
} else if (typeof localParam === "object" && localParam) {
|
|
35
|
+
if (localParam.company) {
|
|
36
|
+
staticVars += `<SVCURRENTCOMPANY>${localParam.company}</SVCURRENTCOMPANY>`;
|
|
37
|
+
}
|
|
38
|
+
if (localParam.fromDate && localParam.toDate) {
|
|
39
|
+
staticVars += `<SVFROMDATE TYPE="Date">${localParam.fromDate}</SVFROMDATE><SVTODATE TYPE="Date">${localParam.toDate}</SVTODATE>`;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (localArgs.length >= 2 && localArgs[0] && localArgs[1]) {
|
|
44
|
+
staticVars += `<SVFROMDATE TYPE="Date">${localArgs[0]}</SVFROMDATE><SVTODATE TYPE="Date">${localArgs[1]}</SVTODATE>`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const tdlMessage = localEndpoint?.tdl || "";
|
|
48
|
+
|
|
49
|
+
return collectionTemplate
|
|
50
|
+
.replace("{{STATICVARIABLES}}", staticVars)
|
|
51
|
+
.replace("{{TDLMESSAGE}}", tdlMessage);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export default startFunc;
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import buildXml from "./buildXml.js";
|
|
2
|
-
import transport from "./transport.js";
|
|
3
|
-
import parseResponse from "./parseResponse.js";
|
|
4
|
-
|
|
5
|
-
const startFunc = async ({ inEndpoint, inParam, inArgs, inUrl }) => {
|
|
6
|
-
const localEndpoint = inEndpoint;
|
|
7
|
-
const localParam = inParam;
|
|
8
|
-
const localArgs = inArgs;
|
|
9
|
-
const localUrl = inUrl;
|
|
10
|
-
|
|
11
|
-
const xml = buildXml({
|
|
12
|
-
inEndpoint: localEndpoint,
|
|
13
|
-
inParam: localParam,
|
|
14
|
-
inArgs: localArgs
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const rawResponse = await transport({
|
|
18
|
-
inXml: xml,
|
|
19
|
-
inUrl: localUrl
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const parsedJson = parseResponse({
|
|
23
|
-
inXml: rawResponse
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
return parsedJson;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default startFunc;
|
|
1
|
+
import buildXml from "./buildXml.js";
|
|
2
|
+
import transport from "./transport.js";
|
|
3
|
+
import parseResponse from "./parseResponse.js";
|
|
4
|
+
|
|
5
|
+
const startFunc = async ({ inEndpoint, inParam, inArgs, inUrl }) => {
|
|
6
|
+
const localEndpoint = inEndpoint;
|
|
7
|
+
const localParam = inParam;
|
|
8
|
+
const localArgs = inArgs;
|
|
9
|
+
const localUrl = inUrl;
|
|
10
|
+
|
|
11
|
+
const xml = buildXml({
|
|
12
|
+
inEndpoint: localEndpoint,
|
|
13
|
+
inParam: localParam,
|
|
14
|
+
inArgs: localArgs
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const rawResponse = await transport({
|
|
18
|
+
inXml: xml,
|
|
19
|
+
inUrl: localUrl
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
const parsedJson = parseResponse({
|
|
23
|
+
inXml: rawResponse
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
return parsedJson;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default startFunc;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const startFunc = ({ inSource, inRoutePath }) => {
|
|
2
|
-
const localSource = inSource;
|
|
3
|
-
const localRoutePath = inRoutePath;
|
|
4
|
-
|
|
5
|
-
const endpoint = localRoutePath
|
|
6
|
-
.split(".")
|
|
7
|
-
.reduce((current, key) => current?.[key], localSource);
|
|
8
|
-
|
|
9
|
-
return endpoint;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export default startFunc;
|
|
1
|
+
const startFunc = ({ inSource, inRoutePath }) => {
|
|
2
|
+
const localSource = inSource;
|
|
3
|
+
const localRoutePath = inRoutePath;
|
|
4
|
+
|
|
5
|
+
const endpoint = localRoutePath
|
|
6
|
+
.split(".")
|
|
7
|
+
.reduce((current, key) => current?.[key], localSource);
|
|
8
|
+
|
|
9
|
+
return endpoint;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export default startFunc;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import validateInput from "./validateInput.js";
|
|
2
|
-
import getEndpointSpec from "./getEndpointSpec.js";
|
|
3
|
-
import dispatchTally from "./dispatchTally.js";
|
|
4
|
-
|
|
5
|
-
const startFunc = async ({ inRoutePath, inParam, inArgs, inSource }) => {
|
|
6
|
-
const localRoutePath = inRoutePath;
|
|
7
|
-
const localParam = inParam;
|
|
8
|
-
const localArgs = inArgs;
|
|
9
|
-
const localSource = inSource;
|
|
10
|
-
|
|
11
|
-
const param = validateInput({
|
|
12
|
-
inParam: localParam
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const endpoint = getEndpointSpec({
|
|
16
|
-
inSource: localSource,
|
|
17
|
-
inRoutePath: localRoutePath
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
return await dispatchTally({
|
|
21
|
-
inEndpoint: endpoint,
|
|
22
|
-
inParam: param,
|
|
23
|
-
inArgs: localArgs
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
export default startFunc;
|
|
1
|
+
import validateInput from "./validateInput.js";
|
|
2
|
+
import getEndpointSpec from "./getEndpointSpec.js";
|
|
3
|
+
import dispatchTally from "./dispatchTally.js";
|
|
4
|
+
|
|
5
|
+
const startFunc = async ({ inRoutePath, inParam, inArgs, inSource }) => {
|
|
6
|
+
const localRoutePath = inRoutePath;
|
|
7
|
+
const localParam = inParam;
|
|
8
|
+
const localArgs = inArgs;
|
|
9
|
+
const localSource = inSource;
|
|
10
|
+
|
|
11
|
+
const param = validateInput({
|
|
12
|
+
inParam: localParam
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const endpoint = getEndpointSpec({
|
|
16
|
+
inSource: localSource,
|
|
17
|
+
inRoutePath: localRoutePath
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return await dispatchTally({
|
|
21
|
+
inEndpoint: endpoint,
|
|
22
|
+
inParam: param,
|
|
23
|
+
inArgs: localArgs
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default startFunc;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { XMLParser } from "fast-xml-parser";
|
|
2
|
-
|
|
3
|
-
const startFunc = ({ inXml }) => {
|
|
4
|
-
const localXml = inXml;
|
|
5
|
-
|
|
6
|
-
const parser = new XMLParser({
|
|
7
|
-
ignoreAttributes: false
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
return parser.parse(localXml);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export default startFunc;
|
|
1
|
+
import { XMLParser } from "fast-xml-parser";
|
|
2
|
+
|
|
3
|
+
const startFunc = ({ inXml }) => {
|
|
4
|
+
const localXml = inXml;
|
|
5
|
+
|
|
6
|
+
const parser = new XMLParser({
|
|
7
|
+
ignoreAttributes: false
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
return parser.parse(localXml);
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default startFunc;
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
const collectionTemplate = `<ENVELOPE>
|
|
2
|
-
<HEADER>
|
|
3
|
-
<VERSION>1</VERSION>
|
|
4
|
-
<TALLYREQUEST>Export</TALLYREQUEST>
|
|
5
|
-
<TYPE>Collection</TYPE>
|
|
6
|
-
<ID>TDLID</ID>
|
|
7
|
-
</HEADER>
|
|
8
|
-
<BODY>
|
|
9
|
-
<DESC>
|
|
10
|
-
<STATICVARIABLES>
|
|
11
|
-
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
|
|
12
|
-
{{STATICVARIABLES}}
|
|
13
|
-
</STATICVARIABLES>
|
|
14
|
-
<TDL>
|
|
15
|
-
<TDLMESSAGE>
|
|
16
|
-
<COLLECTION NAME="TDLID">
|
|
17
|
-
{{TDLMESSAGE}}
|
|
18
|
-
</COLLECTION>
|
|
19
|
-
</TDLMESSAGE>
|
|
20
|
-
</TDL>
|
|
21
|
-
</DESC>
|
|
22
|
-
</BODY>
|
|
23
|
-
</ENVELOPE>`;
|
|
24
|
-
|
|
25
|
-
const dataTemplate = `<ENVELOPE>
|
|
26
|
-
<HEADER>
|
|
27
|
-
<VERSION>1</VERSION>
|
|
28
|
-
<TALLYREQUEST>Export</TALLYREQUEST>
|
|
29
|
-
<TYPE>Data</TYPE>
|
|
30
|
-
<ID>{{ID}}</ID>
|
|
31
|
-
</HEADER>
|
|
32
|
-
<BODY>
|
|
33
|
-
<DESC>
|
|
34
|
-
<STATICVARIABLES>
|
|
35
|
-
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
|
|
36
|
-
{{STATICVARIABLES}}
|
|
37
|
-
</STATICVARIABLES>
|
|
38
|
-
</DESC>
|
|
39
|
-
</BODY>
|
|
40
|
-
</ENVELOPE>`;
|
|
41
|
-
|
|
42
|
-
export { collectionTemplate, dataTemplate };
|
|
1
|
+
const collectionTemplate = `<ENVELOPE>
|
|
2
|
+
<HEADER>
|
|
3
|
+
<VERSION>1</VERSION>
|
|
4
|
+
<TALLYREQUEST>Export</TALLYREQUEST>
|
|
5
|
+
<TYPE>Collection</TYPE>
|
|
6
|
+
<ID>TDLID</ID>
|
|
7
|
+
</HEADER>
|
|
8
|
+
<BODY>
|
|
9
|
+
<DESC>
|
|
10
|
+
<STATICVARIABLES>
|
|
11
|
+
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
|
|
12
|
+
{{STATICVARIABLES}}
|
|
13
|
+
</STATICVARIABLES>
|
|
14
|
+
<TDL>
|
|
15
|
+
<TDLMESSAGE>
|
|
16
|
+
<COLLECTION NAME="TDLID">
|
|
17
|
+
{{TDLMESSAGE}}
|
|
18
|
+
</COLLECTION>
|
|
19
|
+
</TDLMESSAGE>
|
|
20
|
+
</TDL>
|
|
21
|
+
</DESC>
|
|
22
|
+
</BODY>
|
|
23
|
+
</ENVELOPE>`;
|
|
24
|
+
|
|
25
|
+
const dataTemplate = `<ENVELOPE>
|
|
26
|
+
<HEADER>
|
|
27
|
+
<VERSION>1</VERSION>
|
|
28
|
+
<TALLYREQUEST>Export</TALLYREQUEST>
|
|
29
|
+
<TYPE>Data</TYPE>
|
|
30
|
+
<ID>{{ID}}</ID>
|
|
31
|
+
</HEADER>
|
|
32
|
+
<BODY>
|
|
33
|
+
<DESC>
|
|
34
|
+
<STATICVARIABLES>
|
|
35
|
+
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
|
|
36
|
+
{{STATICVARIABLES}}
|
|
37
|
+
</STATICVARIABLES>
|
|
38
|
+
</DESC>
|
|
39
|
+
</BODY>
|
|
40
|
+
</ENVELOPE>`;
|
|
41
|
+
|
|
42
|
+
export { collectionTemplate, dataTemplate };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
const startFunc = async ({ inXml, inUrl }) => {
|
|
2
|
-
const localXml = inXml;
|
|
3
|
-
const localUrl = inUrl || "http://localhost:9000";
|
|
4
|
-
|
|
5
|
-
const response = await fetch(localUrl, {
|
|
6
|
-
method: "POST",
|
|
7
|
-
headers: {
|
|
8
|
-
"Content-Type": "text/xml"
|
|
9
|
-
},
|
|
10
|
-
body: localXml
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
return await response.text();
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default startFunc;
|
|
1
|
+
const startFunc = async ({ inXml, inUrl }) => {
|
|
2
|
+
const localXml = inXml;
|
|
3
|
+
const localUrl = inUrl || "http://localhost:9000";
|
|
4
|
+
|
|
5
|
+
const response = await fetch(localUrl, {
|
|
6
|
+
method: "POST",
|
|
7
|
+
headers: {
|
|
8
|
+
"Content-Type": "text/xml"
|
|
9
|
+
},
|
|
10
|
+
body: localXml
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
return await response.text();
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default startFunc;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
const startFunc = ({ inParam }) => {
|
|
2
|
-
const localParam = inParam;
|
|
3
|
-
|
|
4
|
-
if (localParam === undefined || localParam === null) {
|
|
5
|
-
return "";
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
if (typeof localParam === "string") {
|
|
9
|
-
return localParam.trim();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
if (typeof localParam === "object") {
|
|
13
|
-
return localParam;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
return String(localParam);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export default startFunc;
|
|
1
|
+
const startFunc = ({ inParam }) => {
|
|
2
|
+
const localParam = inParam;
|
|
3
|
+
|
|
4
|
+
if (localParam === undefined || localParam === null) {
|
|
5
|
+
return "";
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (typeof localParam === "string") {
|
|
9
|
+
return localParam.trim();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
if (typeof localParam === "object") {
|
|
13
|
+
return localParam;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return String(localParam);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export default startFunc;
|