@mulmoclaude/accounting-plugin 0.3.1 → 0.3.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/dist/server.js CHANGED
@@ -1914,7 +1914,7 @@ async function handleOpenBook(rest) {
1914
1914
  };
1915
1915
  }
1916
1916
  async function handleGetReport(rest) {
1917
- const kind = String(rest.kind ?? "");
1917
+ const kind = typeof rest.kind === "string" ? rest.kind : "";
1918
1918
  const periodInput = rest.period;
1919
1919
  const bookId = rest.bookId;
1920
1920
  if (kind === "balance") {
@@ -1946,7 +1946,7 @@ var ACTION_HANDLERS = {
1946
1946
  [ACCOUNTING_ACTIONS.getBooks]: () => listBooks(),
1947
1947
  [ACCOUNTING_ACTIONS.createBook]: async (rest) => {
1948
1948
  const result = await createBook({
1949
- name: String(rest.name ?? ""),
1949
+ name: typeof rest.name === "string" ? rest.name : "",
1950
1950
  currency: typeof rest.currency === "string" ? rest.currency : void 0,
1951
1951
  country: typeof rest.country === "string" ? rest.country : void 0,
1952
1952
  fiscalYearEnd: rest.fiscalYearEnd
@@ -1958,7 +1958,7 @@ var ACTION_HANDLERS = {
1958
1958
  },
1959
1959
  [ACCOUNTING_ACTIONS.updateBook]: async (rest) => {
1960
1960
  const result = await updateBook({
1961
- bookId: String(rest.bookId ?? ""),
1961
+ bookId: typeof rest.bookId === "string" ? rest.bookId : "",
1962
1962
  name: typeof rest.name === "string" ? rest.name : void 0,
1963
1963
  country: typeof rest.country === "string" ? rest.country : void 0,
1964
1964
  fiscalYearEnd: rest.fiscalYearEnd
@@ -1969,7 +1969,7 @@ var ACTION_HANDLERS = {
1969
1969
  };
1970
1970
  },
1971
1971
  [ACCOUNTING_ACTIONS.deleteBook]: (rest) => deleteBook({
1972
- bookId: String(rest.bookId ?? ""),
1972
+ bookId: typeof rest.bookId === "string" ? rest.bookId : "",
1973
1973
  confirm: rest.confirm === true
1974
1974
  }),
1975
1975
  [ACCOUNTING_ACTIONS.getAccounts]: (rest) => listAccounts({ bookId: rest.bookId }),
@@ -1983,7 +1983,7 @@ var ACTION_HANDLERS = {
1983
1983
  }),
1984
1984
  [ACCOUNTING_ACTIONS.voidEntry]: (rest) => voidEntry({
1985
1985
  bookId: rest.bookId,
1986
- entryId: String(rest.entryId ?? ""),
1986
+ entryId: typeof rest.entryId === "string" ? rest.entryId : "",
1987
1987
  reason: rest.reason,
1988
1988
  voidDate: rest.voidDate
1989
1989
  }),
@@ -1996,7 +1996,7 @@ var ACTION_HANDLERS = {
1996
1996
  [ACCOUNTING_ACTIONS.getOpeningBalances]: (rest) => getOpeningBalances({ bookId: rest.bookId }),
1997
1997
  [ACCOUNTING_ACTIONS.setOpeningBalances]: (rest) => setOpeningBalances({
1998
1998
  bookId: rest.bookId,
1999
- asOfDate: String(rest.asOfDate ?? ""),
1999
+ asOfDate: typeof rest.asOfDate === "string" ? rest.asOfDate : "",
2000
2000
  lines: rest.lines ?? [],
2001
2001
  memo: rest.memo
2002
2002
  }),
@@ -2127,6 +2127,6 @@ function createAccountingRouter() {
2127
2127
  return router;
2128
2128
  }
2129
2129
  //#endregion
2130
- export { configureAccountingServer, createAccountingRouter, initAccountingEventPublisher, isValidCalendarDate };
2130
+ export { configureAccountingServer, createAccountingRouter, initAccountingEventPublisher, isValidCalendarDate, listBooks };
2131
2131
 
2132
2132
  //# sourceMappingURL=server.js.map