@mulmoclaude/accounting-plugin 1.0.3 → 1.2.0
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/accountNormalize.d.ts +11 -0
- package/dist/server/accountNormalize.d.ts.map +1 -1
- package/dist/server/bodyFields.d.ts +16 -0
- package/dist/server/bodyFields.d.ts.map +1 -0
- package/dist/server/http.d.ts +33 -1
- package/dist/server/http.d.ts.map +1 -1
- package/dist/server/journal.d.ts +36 -10
- package/dist/server/journal.d.ts.map +1 -1
- package/dist/server/openingBalances.d.ts +13 -9
- package/dist/server/openingBalances.d.ts.map +1 -1
- package/dist/server/router.d.ts.map +1 -1
- package/dist/server/service.d.ts +4 -10
- package/dist/server/service.d.ts.map +1 -1
- package/dist/server.cjs +344 -133
- package/dist/server.cjs.map +1 -1
- package/dist/server.js +344 -133
- package/dist/server.js.map +1 -1
- package/dist/{shared-CcU3_qAa.cjs → shared-C9K9ZkfK.cjs} +19 -1
- package/dist/{shared-CcU3_qAa.cjs.map → shared-C9K9ZkfK.cjs.map} +1 -1
- package/dist/{shared-MOpJ1kUa.js → shared-qp9j-GTD.js} +8 -2
- package/dist/{shared-MOpJ1kUa.js.map → shared-qp9j-GTD.js.map} +1 -1
- package/dist/shared.cjs +1 -1
- package/dist/shared.js +1 -1
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +1 -1
- package/package.json +4 -4
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import type { Account } from "../shared/types.js";
|
|
2
|
+
export type AccountParseResult = {
|
|
3
|
+
ok: true;
|
|
4
|
+
account: Account;
|
|
5
|
+
} | {
|
|
6
|
+
ok: false;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
/** Narrow a wire payload to an `Account`. `name` and `type` are as
|
|
10
|
+
* required as `code`: an account persisted without a type is invisible
|
|
11
|
+
* to every report, which groups rows by it. */
|
|
12
|
+
export declare function parseAccountInput(raw: unknown): AccountParseResult;
|
|
2
13
|
export declare function normalizeStoredAccount(input: Account, existing?: Account): Account;
|
|
3
14
|
//# sourceMappingURL=accountNormalize.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accountNormalize.d.ts","sourceRoot":"","sources":["../../src/server/accountNormalize.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"accountNormalize.d.ts","sourceRoot":"","sources":["../../src/server/accountNormalize.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,OAAO,EAAe,MAAM,oBAAoB,CAAC;AAG/D,MAAM,MAAM,kBAAkB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAMjG;;gDAEgD;AAChD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,kBAAkB,CAYlE;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,CAMlF"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReportPeriod } from "../shared/types.js";
|
|
2
|
+
export declare const optionalString: (value: unknown) => string | undefined;
|
|
3
|
+
export declare const optionalRecord: (value: unknown) => Record<string, unknown> | undefined;
|
|
4
|
+
/** Rebuilt field by field rather than narrowed with a predicate, so the
|
|
5
|
+
* returned object is one this function actually proved. A half-formed
|
|
6
|
+
* `{ kind: "month" }` reads as absent and the caller raises its own
|
|
7
|
+
* "period is required" — previously it reached the report builders and
|
|
8
|
+
* produced an `undefined-01` date. */
|
|
9
|
+
export declare const optionalReportPeriod: (value: unknown) => ReportPeriod | undefined;
|
|
10
|
+
/** The two fields the addEntries narration quotes back, read out of a
|
|
11
|
+
* service payload that is only `unknown` to the router. */
|
|
12
|
+
export declare const describeEntry: (entry: unknown) => {
|
|
13
|
+
id?: string;
|
|
14
|
+
date?: string;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=bodyFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bodyFields.d.ts","sourceRoot":"","sources":["../../src/server/bodyFields.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,MAAM,GAAG,SAA4D,CAAC;AAEtH,eAAO,MAAM,cAAc,GAAI,OAAO,OAAO,KAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAkD,CAAC;AAE7H;;;;uCAIuC;AACvC,eAAO,MAAM,oBAAoB,GAAI,OAAO,OAAO,KAAG,YAAY,GAAG,SAOpE,CAAC;AAEF;4DAC4D;AAC5D,eAAO,MAAM,aAAa,GAAI,OAAO,OAAO,KAAG;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAG1E,CAAC"}
|
package/dist/server/http.d.ts
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
1
|
import type { Request, Response, NextFunction } from "express";
|
|
2
|
-
|
|
2
|
+
/** The body the catch path sends. Declared here rather than imported from the
|
|
3
|
+
* host's `httpError.ts` for the same reason the wrapper is copied: reaching
|
|
4
|
+
* into the host would be an uphill import. */
|
|
5
|
+
export interface ErrorBody {
|
|
6
|
+
error: string;
|
|
7
|
+
}
|
|
8
|
+
/** A route response that can carry either its success body or an error — use
|
|
9
|
+
* this, not a bare `Response<T>`, for any handler wrapped by `asyncHandler`,
|
|
10
|
+
* which can always emit `ErrorBody` on the failure path. */
|
|
11
|
+
export type ApiResponse<T> = Response<T | ErrorBody>;
|
|
12
|
+
/** The bounds below name exactly what the catch path dereferences.
|
|
13
|
+
*
|
|
14
|
+
* They are NOT `extends Request` / `extends Response`: Express uses its type
|
|
15
|
+
* parameters in mixed variance positions, so a nominal bound rejects valid
|
|
16
|
+
* call sites like `Request<object, unknown, MyBody>`. Naming only the members
|
|
17
|
+
* we touch keeps every concrete `Request<…>` / `Response<…>` assignable.
|
|
18
|
+
*
|
|
19
|
+
* Structural bounds rather than unconstrained generics plus `as` casts,
|
|
20
|
+
* because the casts were load-bearing in a way that hid a real contract: this
|
|
21
|
+
* wrapper sends `{ error }` on the failure path, so a route declaring a
|
|
22
|
+
* `ResBody` that cannot carry it was lying. That is now a compile error, and
|
|
23
|
+
* the fix at such a site is `ApiResponse<T>`. */
|
|
24
|
+
interface RoutePathBearing {
|
|
25
|
+
path: string;
|
|
26
|
+
}
|
|
27
|
+
interface ErrorSendableResponse {
|
|
28
|
+
headersSent: boolean;
|
|
29
|
+
status: (code: number) => {
|
|
30
|
+
json: (body: ErrorBody) => unknown;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export declare function asyncHandler<TReq extends RoutePathBearing = Request, TRes extends ErrorSendableResponse = Response>(namespace: string, fallbackMessage: string, handler: (req: TReq, res: TRes) => Promise<void>): (req: TReq, res: TRes, next: NextFunction) => Promise<void>;
|
|
34
|
+
export {};
|
|
3
35
|
//# sourceMappingURL=http.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/server/http.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI/D,wBAAgB,YAAY,CAAC,IAAI,GAAG,OAAO,EAAE,IAAI,GAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/server/http.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAI/D;;+CAE+C;AAC/C,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;6DAE6D;AAC7D,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;AAErD;;;;;;;;;;;kDAWkD;AAClD,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,UAAU,qBAAqB;IAC7B,WAAW,EAAE,OAAO,CAAC;IACrB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK;QAAE,IAAI,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,OAAO,CAAA;KAAE,CAAC;CAClE;AAED,wBAAgB,YAAY,CAAC,IAAI,SAAS,gBAAgB,GAAG,OAAO,EAAE,IAAI,SAAS,qBAAqB,GAAG,QAAQ,EACjH,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,GAC/C,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,IAAI,CAAC,CAgB7D"}
|
package/dist/server/journal.d.ts
CHANGED
|
@@ -10,10 +10,22 @@ export interface ValidationError {
|
|
|
10
10
|
field: string;
|
|
11
11
|
message: string;
|
|
12
12
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
/** The fields `parseEntry` proves about one wire entry. `makeEntry`
|
|
14
|
+
* takes this, so an entry can only be built from input something
|
|
15
|
+
* actually checked. */
|
|
16
|
+
export interface ParsedEntry {
|
|
17
|
+
date: string;
|
|
18
|
+
lines: JournalLine[];
|
|
19
|
+
memo?: string;
|
|
20
|
+
replacesEntryId?: string;
|
|
16
21
|
}
|
|
22
|
+
export type EntryParseResult = {
|
|
23
|
+
ok: true;
|
|
24
|
+
entry: ParsedEntry;
|
|
25
|
+
} | {
|
|
26
|
+
ok: false;
|
|
27
|
+
errors: ValidationError[];
|
|
28
|
+
};
|
|
17
29
|
/** Build today's `YYYY-MM-DD` from the host's local timezone.
|
|
18
30
|
* Centralised here so server-side defaults (the void-date on
|
|
19
31
|
* `voidEntry`, the today() stamp on opening replacements, etc.)
|
|
@@ -32,13 +44,27 @@ export declare function isValidCalendarDate(date: string): boolean;
|
|
|
32
44
|
/** Returns Σ debit − Σ credit. Used by callers that need the actual
|
|
33
45
|
* imbalance value (e.g. the OpeningBalancesForm shows live diff). */
|
|
34
46
|
export declare function netBalance(lines: readonly JournalLine[]): number;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
47
|
+
/** Narrow one wire value to a `JournalLine`, pushing an issue per bad
|
|
48
|
+
* field. Shape only: account existence and the debit/credit-side rule
|
|
49
|
+
* belong to the caller, because journal entries and opening balances
|
|
50
|
+
* disagree about them. Returns null when nothing usable came out —
|
|
51
|
+
* the caller drops the line rather than reading fields off it. */
|
|
52
|
+
export declare function parseJournalLine(raw: unknown, idx: number, errors: ValidationError[]): JournalLine | null;
|
|
53
|
+
/** Report the debit = credit imbalance — but only when every line was
|
|
54
|
+
* readable. A line that failed to parse contributes nothing to the sum,
|
|
55
|
+
* so an entry that balances perfectly would otherwise be told it
|
|
56
|
+
* doesn't, sending the caller off to "fix" amounts that were never
|
|
57
|
+
* wrong. Naming the unreadable line is the actionable message; the
|
|
58
|
+
* balance is worth re-checking once it's a line. */
|
|
59
|
+
export declare function checkBalances(lines: readonly JournalLine[], expectedLineCount: number, subject: string, errors: ValidationError[]): void;
|
|
60
|
+
/** Parse one entry off the wire. Does not throw: every rejection comes
|
|
61
|
+
* back as a list of issues so the REST handler can return a structured
|
|
62
|
+
* 400 instead of an opaque 500. Parse rather than validate — the
|
|
63
|
+
* narrowed entry rides along on success, so `makeEntry` never has to
|
|
64
|
+
* take the caller's word for the shape. */
|
|
65
|
+
export declare function parseEntry(raw: unknown, accounts: readonly Account[]): EntryParseResult;
|
|
66
|
+
/** Build a JournalEntry from lines something already parsed
|
|
67
|
+
* (`parseEntry` / `parseOpening`). The id is a fresh
|
|
42
68
|
* UUID; createdAt is the wall clock at the moment of creation.
|
|
43
69
|
* Lines are normalized so optional string fields don't persist as
|
|
44
70
|
* empty strings. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../../src/server/journal.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"journal.d.ts","sourceRoot":"","sources":["../../src/server/journal.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAS7E;;;;;wDAKwD;AACxD,eAAO,MAAM,8BAA8B,KAAK,CAAC;AAEjD,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;wBAEwB;AACxB,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,WAAW,EAAE,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,gBAAgB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,WAAW,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,eAAe,EAAE,CAAA;CAAE,CAAC;AAY3G;;;;;;yDAMyD;AACzD,wBAAgB,eAAe,CAAC,GAAG,GAAE,IAAiB,GAAG,MAAM,CAK9D;AAED;;;;;yDAKyD;AACzD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAKzD;AAED;sEACsE;AACtE,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,GAAG,MAAM,CAOhE;AA4CD;;;;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
|
message: string;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
7
|
-
ok:
|
|
6
|
+
export type OpeningParseResult = {
|
|
7
|
+
ok: true;
|
|
8
|
+
lines: JournalLine[];
|
|
9
|
+
} | {
|
|
10
|
+
ok: false;
|
|
8
11
|
errors: OpeningValidationError[];
|
|
9
|
-
}
|
|
12
|
+
};
|
|
10
13
|
/** Find the existing opening entry for a book, if any. Multiple
|
|
11
14
|
* openings shouldn't coexist (the route enforces void-then-append),
|
|
12
15
|
* but if they do the most recent by `createdAt` wins so callers
|
|
13
16
|
* always see one canonical opening. */
|
|
14
17
|
export declare function findActiveOpening(entries: readonly JournalEntry[]): JournalEntry | null;
|
|
15
|
-
interface
|
|
18
|
+
interface OpeningParseInput {
|
|
16
19
|
asOfDate: string;
|
|
17
|
-
lines:
|
|
20
|
+
lines: unknown;
|
|
18
21
|
accounts: readonly Account[];
|
|
19
22
|
existingEntries: readonly JournalEntry[];
|
|
20
23
|
}
|
|
21
|
-
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
+
/** Parse the inputs for `setOpeningBalances`, returning the narrowed
|
|
25
|
+
* lines so the caller can persist what was actually checked. Caller
|
|
26
|
+
* passes the full list of journal entries in the book so we can check
|
|
27
|
+
* the "asOfDate must precede every other entry" rule. An opening with
|
|
24
28
|
* zero lines is accepted as a no-op marker — it satisfies the
|
|
25
29
|
* "book has an opening" gate the UI uses without committing the
|
|
26
30
|
* user to specific balances on day one (they can replace it
|
|
27
31
|
* later). */
|
|
28
|
-
export declare function
|
|
32
|
+
export declare function parseOpening(input: OpeningParseInput): OpeningParseResult;
|
|
29
33
|
export {};
|
|
30
34
|
//# sourceMappingURL=openingBalances.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"openingBalances.d.ts","sourceRoot":"","sources":["../../src/server/openingBalances.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"openingBalances.d.ts","sourceRoot":"","sources":["../../src/server/openingBalances.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAI7E,MAAM,WAAW,sBAAsB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,kBAAkB,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,WAAW,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,sBAAsB,EAAE,CAAA;CAAE,CAAC;AAEtH;;;wCAGwC;AACxC,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,YAAY,GAAG,IAAI,CASvF;AAED,UAAU,iBAAiB;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,SAAS,OAAO,EAAE,CAAC;IAC7B,eAAe,EAAE,SAAS,YAAY,EAAE,CAAC;CAC1C;AAqDD;;;;;;;cAOc;AACd,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB,CAczE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/server/router.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"router.d.ts","sourceRoot":"","sources":["../../src/server/router.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,MAAM,EAAqB,MAAM,SAAS,CAAC;AA2VpD;;;2BAG2B;AAC3B,wBAAgB,sBAAsB,IAAI,MAAM,CAsC/C"}
|
package/dist/server/service.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { aggregateBalances, buildBalanceSheet, buildLedger, buildProfitLoss } from "./report.js";
|
|
2
2
|
import { type TimeSeriesGranularity, type TimeSeriesMetric, type TimeSeriesPoint } from "./timeSeries.js";
|
|
3
3
|
import { balancesAtEndOf } from "./snapshotCache.js";
|
|
4
|
-
import type { Account, BookSummary, JournalEntry,
|
|
4
|
+
import type { Account, BookSummary, JournalEntry, ReportPeriod } from "../shared/types.js";
|
|
5
5
|
export declare class AccountingError extends Error {
|
|
6
6
|
status: number;
|
|
7
7
|
details?: unknown | undefined;
|
|
@@ -42,21 +42,15 @@ export declare function listAccounts(input: {
|
|
|
42
42
|
}>;
|
|
43
43
|
export declare function upsertAccount(input: {
|
|
44
44
|
bookId?: string;
|
|
45
|
-
account:
|
|
45
|
+
account: unknown;
|
|
46
46
|
}, workspaceRoot?: string): Promise<{
|
|
47
47
|
bookId: string;
|
|
48
48
|
account: Account;
|
|
49
49
|
accounts: Account[];
|
|
50
50
|
}>;
|
|
51
|
-
export interface AddEntriesItem {
|
|
52
|
-
date: string;
|
|
53
|
-
lines: JournalLine[];
|
|
54
|
-
memo?: string;
|
|
55
|
-
replacesEntryId?: string;
|
|
56
|
-
}
|
|
57
51
|
export declare function addEntries(input: {
|
|
58
52
|
bookId?: string;
|
|
59
|
-
entries:
|
|
53
|
+
entries: unknown;
|
|
60
54
|
}, workspaceRoot?: string): Promise<{
|
|
61
55
|
bookId: string;
|
|
62
56
|
entries: JournalEntry[];
|
|
@@ -91,7 +85,7 @@ export declare function getOpeningBalances(input: {
|
|
|
91
85
|
export declare function setOpeningBalances(input: {
|
|
92
86
|
bookId?: string;
|
|
93
87
|
asOfDate: string;
|
|
94
|
-
lines:
|
|
88
|
+
lines: unknown;
|
|
95
89
|
memo?: string;
|
|
96
90
|
}, workspaceRoot?: string): Promise<{
|
|
97
91
|
bookId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/server/service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/server/service.ts"],"names":[],"m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