tally-http-json 1.6.1 → 1.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tally-http-json",
3
- "version": "1.6.1",
3
+ "version": "1.6.2",
4
4
  "description": "Tally HTTP JSON client for TallyPrime",
5
5
  "type": "module",
6
6
  "main": "./src/index.js",
package/src/index.js CHANGED
@@ -1 +1,4 @@
1
- export { default, noCompany, tdl, fromCollection, importLedger } from "./v6/index.js";
1
+ export {
2
+ default, noCompany, tdl,
3
+ fromCollection, importLedger, deleteLedger
4
+ } from "./v6/index.js";
@@ -0,0 +1,23 @@
1
+ {
2
+ "static_variables": [
3
+ {
4
+ "name": "svMstImportFormat",
5
+ "value": "JSONEx"
6
+ },
7
+ {
8
+ "name": "svCurrentCompany",
9
+ "value": "mani9"
10
+ }
11
+ ],
12
+ "tallymessage": [
13
+ {
14
+ "metadata": {
15
+ "type": "Ledger",
16
+ "action": "Delete",
17
+ "name": "aaaaa"
18
+ },
19
+ "name": "aaaaaaa",
20
+ "parent": "Sundry Debtors"
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,16 @@
1
+ import transport from "../transport.js";
2
+ import body from "./body.json" with { type: "json" };
3
+
4
+ const startFunc = async (name) => {
5
+ body.tallymessage[0].metadata.name = name;
6
+ body.tallymessage[0].name = name;
7
+
8
+ return await transport({
9
+ inHeaderId: "All Masters",
10
+ inTallyrequest: "Import",
11
+ inType: "Data",
12
+ inBodyAsJson: JSON.stringify(body)
13
+ });
14
+ };
15
+
16
+ export default startFunc;
package/src/v6/index.js CHANGED
@@ -2,6 +2,7 @@ import noCompanyFromInternal from "./noCompany/index.js";
2
2
  import tdlFromInternal from "./tdl/index.js";
3
3
  import fromCollectionInternal from "./fromCollection/index.js";
4
4
  import fromimport from "./import/index.js";
5
+ import fromDelete from "./delete/index.js";
5
6
 
6
7
  const noCompany = async (headerId = "") => {
7
8
  return await noCompanyFromInternal({ inHeaderId: headerId });
@@ -19,5 +20,9 @@ const importLedger = async (name) => {
19
20
  return await fromimport(name);
20
21
  };
21
22
 
23
+ const deleteLedger = async (name) => {
24
+ return await fromDelete(name);
25
+ };
26
+
22
27
  export default noCompany;
23
- export { noCompany, tdl, fromCollection, importLedger };
28
+ export { noCompany, tdl, fromCollection, importLedger, deleteLedger };