@accounter/shaam-uniform-format-generator 0.1.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/README.md +123 -0
- package/cjs/api/generate-report.js +53 -0
- package/cjs/api/parse-files.js +32 -0
- package/cjs/format/index.js +8 -0
- package/cjs/format/newline.js +10 -0
- package/cjs/format/padding.js +39 -0
- package/cjs/generator/format/decoder.js +17 -0
- package/cjs/generator/format/encoder.js +46 -0
- package/cjs/generator/format/index.js +8 -0
- package/cjs/generator/index.js +8 -0
- package/cjs/generator/records/a000.js +8 -0
- package/cjs/generator/records/a100.js +8 -0
- package/cjs/generator/records/b100.js +8 -0
- package/cjs/generator/records/b110.js +8 -0
- package/cjs/generator/records/c100.js +8 -0
- package/cjs/generator/records/d110.js +8 -0
- package/cjs/generator/records/d120.js +8 -0
- package/cjs/generator/records/index.js +15 -0
- package/cjs/generator/records/m100.js +8 -0
- package/cjs/generator/records/z900.js +8 -0
- package/cjs/index.js +19 -0
- package/cjs/package.json +1 -0
- package/cjs/parser/data-parser.js +16 -0
- package/cjs/parser/index.js +8 -0
- package/cjs/parser/ini-parser.js +16 -0
- package/cjs/types/index.js +74 -0
- package/cjs/validation/errors.js +30 -0
- package/cjs/validation/index.js +8 -0
- package/cjs/validation/validate-input.js +56 -0
- package/esm/api/generate-report.js +50 -0
- package/esm/api/parse-files.js +29 -0
- package/esm/format/index.js +5 -0
- package/esm/format/newline.js +7 -0
- package/esm/format/padding.js +35 -0
- package/esm/generator/format/decoder.js +14 -0
- package/esm/generator/format/encoder.js +42 -0
- package/esm/generator/format/index.js +5 -0
- package/esm/generator/index.js +5 -0
- package/esm/generator/records/a000.js +5 -0
- package/esm/generator/records/a100.js +5 -0
- package/esm/generator/records/b100.js +5 -0
- package/esm/generator/records/b110.js +5 -0
- package/esm/generator/records/c100.js +5 -0
- package/esm/generator/records/d110.js +5 -0
- package/esm/generator/records/d120.js +5 -0
- package/esm/generator/records/index.js +12 -0
- package/esm/generator/records/m100.js +5 -0
- package/esm/generator/records/z900.js +5 -0
- package/esm/index.js +13 -0
- package/esm/parser/data-parser.js +13 -0
- package/esm/parser/index.js +5 -0
- package/esm/parser/ini-parser.js +13 -0
- package/esm/types/index.js +71 -0
- package/esm/validation/errors.js +25 -0
- package/esm/validation/index.js +5 -0
- package/esm/validation/validate-input.js +53 -0
- package/package.json +54 -0
- package/typings/api/generate-report.d.cts +13 -0
- package/typings/api/generate-report.d.ts +13 -0
- package/typings/api/parse-files.d.cts +13 -0
- package/typings/api/parse-files.d.ts +13 -0
- package/typings/format/index.d.cts +5 -0
- package/typings/format/index.d.ts +5 -0
- package/typings/format/newline.d.cts +7 -0
- package/typings/format/newline.d.ts +7 -0
- package/typings/format/padding.d.cts +21 -0
- package/typings/format/padding.d.ts +21 -0
- package/typings/generator/format/decoder.d.cts +12 -0
- package/typings/generator/format/decoder.d.ts +12 -0
- package/typings/generator/format/encoder.d.cts +33 -0
- package/typings/generator/format/encoder.d.ts +33 -0
- package/typings/generator/format/index.d.cts +5 -0
- package/typings/generator/format/index.d.ts +5 -0
- package/typings/generator/index.d.cts +5 -0
- package/typings/generator/index.d.ts +5 -0
- package/typings/generator/records/a000.d.cts +4 -0
- package/typings/generator/records/a000.d.ts +4 -0
- package/typings/generator/records/a100.d.cts +4 -0
- package/typings/generator/records/a100.d.ts +4 -0
- package/typings/generator/records/b100.d.cts +4 -0
- package/typings/generator/records/b100.d.ts +4 -0
- package/typings/generator/records/b110.d.cts +4 -0
- package/typings/generator/records/b110.d.ts +4 -0
- package/typings/generator/records/c100.d.cts +4 -0
- package/typings/generator/records/c100.d.ts +4 -0
- package/typings/generator/records/d110.d.cts +4 -0
- package/typings/generator/records/d110.d.ts +4 -0
- package/typings/generator/records/d120.d.cts +4 -0
- package/typings/generator/records/d120.d.ts +4 -0
- package/typings/generator/records/index.d.cts +12 -0
- package/typings/generator/records/index.d.ts +12 -0
- package/typings/generator/records/m100.d.cts +4 -0
- package/typings/generator/records/m100.d.ts +4 -0
- package/typings/generator/records/z900.d.cts +4 -0
- package/typings/generator/records/z900.d.ts +4 -0
- package/typings/index.d.cts +12 -0
- package/typings/index.d.ts +12 -0
- package/typings/parser/data-parser.d.cts +10 -0
- package/typings/parser/data-parser.d.ts +10 -0
- package/typings/parser/index.d.cts +5 -0
- package/typings/parser/index.d.ts +5 -0
- package/typings/parser/ini-parser.d.cts +10 -0
- package/typings/parser/ini-parser.d.ts +10 -0
- package/typings/types/index.d.cts +371 -0
- package/typings/types/index.d.ts +371 -0
- package/typings/validation/errors.d.cts +15 -0
- package/typings/validation/errors.d.ts +15 -0
- package/typings/validation/index.d.cts +5 -0
- package/typings/validation/index.d.ts +5 -0
- package/typings/validation/validate-input.d.cts +12 -0
- package/typings/validation/validate-input.d.ts +12 -0
|
@@ -0,0 +1,371 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for SHAAM uniform format generator
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const BusinessMetadataSchema: z.ZodObject<{
|
|
6
|
+
businessId: z.ZodString;
|
|
7
|
+
name: z.ZodString;
|
|
8
|
+
taxId: z.ZodString;
|
|
9
|
+
reportingPeriod: z.ZodObject<{
|
|
10
|
+
startDate: z.ZodString;
|
|
11
|
+
endDate: z.ZodString;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
startDate: string;
|
|
14
|
+
endDate: string;
|
|
15
|
+
}, {
|
|
16
|
+
startDate: string;
|
|
17
|
+
endDate: string;
|
|
18
|
+
}>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
businessId: string;
|
|
21
|
+
name: string;
|
|
22
|
+
taxId: string;
|
|
23
|
+
reportingPeriod: {
|
|
24
|
+
startDate: string;
|
|
25
|
+
endDate: string;
|
|
26
|
+
};
|
|
27
|
+
}, {
|
|
28
|
+
businessId: string;
|
|
29
|
+
name: string;
|
|
30
|
+
taxId: string;
|
|
31
|
+
reportingPeriod: {
|
|
32
|
+
startDate: string;
|
|
33
|
+
endDate: string;
|
|
34
|
+
};
|
|
35
|
+
}>;
|
|
36
|
+
export declare const DocumentSchema: z.ZodObject<{
|
|
37
|
+
id: z.ZodString;
|
|
38
|
+
type: z.ZodString;
|
|
39
|
+
date: z.ZodString;
|
|
40
|
+
amount: z.ZodNumber;
|
|
41
|
+
description: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
type: string;
|
|
44
|
+
date: string;
|
|
45
|
+
id: string;
|
|
46
|
+
amount: number;
|
|
47
|
+
description?: string | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
type: string;
|
|
50
|
+
date: string;
|
|
51
|
+
id: string;
|
|
52
|
+
amount: number;
|
|
53
|
+
description?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
export declare const JournalEntrySchema: z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
date: z.ZodString;
|
|
58
|
+
amount: z.ZodNumber;
|
|
59
|
+
accountId: z.ZodString;
|
|
60
|
+
description: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
date: string;
|
|
63
|
+
id: string;
|
|
64
|
+
amount: number;
|
|
65
|
+
accountId: string;
|
|
66
|
+
description?: string | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
date: string;
|
|
69
|
+
id: string;
|
|
70
|
+
amount: number;
|
|
71
|
+
accountId: string;
|
|
72
|
+
description?: string | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
export declare const AccountSchema: z.ZodObject<{
|
|
75
|
+
id: z.ZodString;
|
|
76
|
+
name: z.ZodString;
|
|
77
|
+
type: z.ZodString;
|
|
78
|
+
balance: z.ZodNumber;
|
|
79
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
|
+
name: string;
|
|
81
|
+
type: string;
|
|
82
|
+
id: string;
|
|
83
|
+
balance: number;
|
|
84
|
+
}, {
|
|
85
|
+
name: string;
|
|
86
|
+
type: string;
|
|
87
|
+
id: string;
|
|
88
|
+
balance: number;
|
|
89
|
+
}>;
|
|
90
|
+
export declare const InventoryItemSchema: z.ZodObject<{
|
|
91
|
+
id: z.ZodString;
|
|
92
|
+
name: z.ZodString;
|
|
93
|
+
quantity: z.ZodNumber;
|
|
94
|
+
unitPrice: z.ZodNumber;
|
|
95
|
+
}, "strip", z.ZodTypeAny, {
|
|
96
|
+
name: string;
|
|
97
|
+
id: string;
|
|
98
|
+
quantity: number;
|
|
99
|
+
unitPrice: number;
|
|
100
|
+
}, {
|
|
101
|
+
name: string;
|
|
102
|
+
id: string;
|
|
103
|
+
quantity: number;
|
|
104
|
+
unitPrice: number;
|
|
105
|
+
}>;
|
|
106
|
+
export declare const ReportInputSchema: z.ZodObject<{
|
|
107
|
+
business: z.ZodObject<{
|
|
108
|
+
businessId: z.ZodString;
|
|
109
|
+
name: z.ZodString;
|
|
110
|
+
taxId: z.ZodString;
|
|
111
|
+
reportingPeriod: z.ZodObject<{
|
|
112
|
+
startDate: z.ZodString;
|
|
113
|
+
endDate: z.ZodString;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
startDate: string;
|
|
116
|
+
endDate: string;
|
|
117
|
+
}, {
|
|
118
|
+
startDate: string;
|
|
119
|
+
endDate: string;
|
|
120
|
+
}>;
|
|
121
|
+
}, "strip", z.ZodTypeAny, {
|
|
122
|
+
businessId: string;
|
|
123
|
+
name: string;
|
|
124
|
+
taxId: string;
|
|
125
|
+
reportingPeriod: {
|
|
126
|
+
startDate: string;
|
|
127
|
+
endDate: string;
|
|
128
|
+
};
|
|
129
|
+
}, {
|
|
130
|
+
businessId: string;
|
|
131
|
+
name: string;
|
|
132
|
+
taxId: string;
|
|
133
|
+
reportingPeriod: {
|
|
134
|
+
startDate: string;
|
|
135
|
+
endDate: string;
|
|
136
|
+
};
|
|
137
|
+
}>;
|
|
138
|
+
documents: z.ZodArray<z.ZodObject<{
|
|
139
|
+
id: z.ZodString;
|
|
140
|
+
type: z.ZodString;
|
|
141
|
+
date: z.ZodString;
|
|
142
|
+
amount: z.ZodNumber;
|
|
143
|
+
description: z.ZodOptional<z.ZodString>;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
type: string;
|
|
146
|
+
date: string;
|
|
147
|
+
id: string;
|
|
148
|
+
amount: number;
|
|
149
|
+
description?: string | undefined;
|
|
150
|
+
}, {
|
|
151
|
+
type: string;
|
|
152
|
+
date: string;
|
|
153
|
+
id: string;
|
|
154
|
+
amount: number;
|
|
155
|
+
description?: string | undefined;
|
|
156
|
+
}>, "many">;
|
|
157
|
+
journalEntries: z.ZodArray<z.ZodObject<{
|
|
158
|
+
id: z.ZodString;
|
|
159
|
+
date: z.ZodString;
|
|
160
|
+
amount: z.ZodNumber;
|
|
161
|
+
accountId: z.ZodString;
|
|
162
|
+
description: z.ZodOptional<z.ZodString>;
|
|
163
|
+
}, "strip", z.ZodTypeAny, {
|
|
164
|
+
date: string;
|
|
165
|
+
id: string;
|
|
166
|
+
amount: number;
|
|
167
|
+
accountId: string;
|
|
168
|
+
description?: string | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
date: string;
|
|
171
|
+
id: string;
|
|
172
|
+
amount: number;
|
|
173
|
+
accountId: string;
|
|
174
|
+
description?: string | undefined;
|
|
175
|
+
}>, "many">;
|
|
176
|
+
accounts: z.ZodArray<z.ZodObject<{
|
|
177
|
+
id: z.ZodString;
|
|
178
|
+
name: z.ZodString;
|
|
179
|
+
type: z.ZodString;
|
|
180
|
+
balance: z.ZodNumber;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
name: string;
|
|
183
|
+
type: string;
|
|
184
|
+
id: string;
|
|
185
|
+
balance: number;
|
|
186
|
+
}, {
|
|
187
|
+
name: string;
|
|
188
|
+
type: string;
|
|
189
|
+
id: string;
|
|
190
|
+
balance: number;
|
|
191
|
+
}>, "many">;
|
|
192
|
+
inventory: z.ZodArray<z.ZodObject<{
|
|
193
|
+
id: z.ZodString;
|
|
194
|
+
name: z.ZodString;
|
|
195
|
+
quantity: z.ZodNumber;
|
|
196
|
+
unitPrice: z.ZodNumber;
|
|
197
|
+
}, "strip", z.ZodTypeAny, {
|
|
198
|
+
name: string;
|
|
199
|
+
id: string;
|
|
200
|
+
quantity: number;
|
|
201
|
+
unitPrice: number;
|
|
202
|
+
}, {
|
|
203
|
+
name: string;
|
|
204
|
+
id: string;
|
|
205
|
+
quantity: number;
|
|
206
|
+
unitPrice: number;
|
|
207
|
+
}>, "many">;
|
|
208
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
|
+
business: {
|
|
210
|
+
businessId: string;
|
|
211
|
+
name: string;
|
|
212
|
+
taxId: string;
|
|
213
|
+
reportingPeriod: {
|
|
214
|
+
startDate: string;
|
|
215
|
+
endDate: string;
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
documents: {
|
|
219
|
+
type: string;
|
|
220
|
+
date: string;
|
|
221
|
+
id: string;
|
|
222
|
+
amount: number;
|
|
223
|
+
description?: string | undefined;
|
|
224
|
+
}[];
|
|
225
|
+
journalEntries: {
|
|
226
|
+
date: string;
|
|
227
|
+
id: string;
|
|
228
|
+
amount: number;
|
|
229
|
+
accountId: string;
|
|
230
|
+
description?: string | undefined;
|
|
231
|
+
}[];
|
|
232
|
+
accounts: {
|
|
233
|
+
name: string;
|
|
234
|
+
type: string;
|
|
235
|
+
id: string;
|
|
236
|
+
balance: number;
|
|
237
|
+
}[];
|
|
238
|
+
inventory: {
|
|
239
|
+
name: string;
|
|
240
|
+
id: string;
|
|
241
|
+
quantity: number;
|
|
242
|
+
unitPrice: number;
|
|
243
|
+
}[];
|
|
244
|
+
}, {
|
|
245
|
+
business: {
|
|
246
|
+
businessId: string;
|
|
247
|
+
name: string;
|
|
248
|
+
taxId: string;
|
|
249
|
+
reportingPeriod: {
|
|
250
|
+
startDate: string;
|
|
251
|
+
endDate: string;
|
|
252
|
+
};
|
|
253
|
+
};
|
|
254
|
+
documents: {
|
|
255
|
+
type: string;
|
|
256
|
+
date: string;
|
|
257
|
+
id: string;
|
|
258
|
+
amount: number;
|
|
259
|
+
description?: string | undefined;
|
|
260
|
+
}[];
|
|
261
|
+
journalEntries: {
|
|
262
|
+
date: string;
|
|
263
|
+
id: string;
|
|
264
|
+
amount: number;
|
|
265
|
+
accountId: string;
|
|
266
|
+
description?: string | undefined;
|
|
267
|
+
}[];
|
|
268
|
+
accounts: {
|
|
269
|
+
name: string;
|
|
270
|
+
type: string;
|
|
271
|
+
id: string;
|
|
272
|
+
balance: number;
|
|
273
|
+
}[];
|
|
274
|
+
inventory: {
|
|
275
|
+
name: string;
|
|
276
|
+
id: string;
|
|
277
|
+
quantity: number;
|
|
278
|
+
unitPrice: number;
|
|
279
|
+
}[];
|
|
280
|
+
}>;
|
|
281
|
+
export declare const ReportOutputSchema: z.ZodObject<{
|
|
282
|
+
iniText: z.ZodString;
|
|
283
|
+
dataText: z.ZodString;
|
|
284
|
+
iniFile: z.ZodType<File, z.ZodTypeDef, File>;
|
|
285
|
+
dataFile: z.ZodType<File, z.ZodTypeDef, File>;
|
|
286
|
+
summary: z.ZodObject<{
|
|
287
|
+
totalRecords: z.ZodNumber;
|
|
288
|
+
perType: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
289
|
+
errors: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
290
|
+
recordType: z.ZodString;
|
|
291
|
+
recordIndex: z.ZodNumber;
|
|
292
|
+
field: z.ZodString;
|
|
293
|
+
message: z.ZodString;
|
|
294
|
+
}, "strip", z.ZodTypeAny, {
|
|
295
|
+
message: string;
|
|
296
|
+
recordType: string;
|
|
297
|
+
recordIndex: number;
|
|
298
|
+
field: string;
|
|
299
|
+
}, {
|
|
300
|
+
message: string;
|
|
301
|
+
recordType: string;
|
|
302
|
+
recordIndex: number;
|
|
303
|
+
field: string;
|
|
304
|
+
}>, "many">>;
|
|
305
|
+
}, "strip", z.ZodTypeAny, {
|
|
306
|
+
totalRecords: number;
|
|
307
|
+
perType: Record<string, number>;
|
|
308
|
+
errors?: {
|
|
309
|
+
message: string;
|
|
310
|
+
recordType: string;
|
|
311
|
+
recordIndex: number;
|
|
312
|
+
field: string;
|
|
313
|
+
}[] | undefined;
|
|
314
|
+
}, {
|
|
315
|
+
totalRecords: number;
|
|
316
|
+
perType: Record<string, number>;
|
|
317
|
+
errors?: {
|
|
318
|
+
message: string;
|
|
319
|
+
recordType: string;
|
|
320
|
+
recordIndex: number;
|
|
321
|
+
field: string;
|
|
322
|
+
}[] | undefined;
|
|
323
|
+
}>;
|
|
324
|
+
}, "strip", z.ZodTypeAny, {
|
|
325
|
+
iniText: string;
|
|
326
|
+
dataText: string;
|
|
327
|
+
iniFile: File;
|
|
328
|
+
dataFile: File;
|
|
329
|
+
summary: {
|
|
330
|
+
totalRecords: number;
|
|
331
|
+
perType: Record<string, number>;
|
|
332
|
+
errors?: {
|
|
333
|
+
message: string;
|
|
334
|
+
recordType: string;
|
|
335
|
+
recordIndex: number;
|
|
336
|
+
field: string;
|
|
337
|
+
}[] | undefined;
|
|
338
|
+
};
|
|
339
|
+
}, {
|
|
340
|
+
iniText: string;
|
|
341
|
+
dataText: string;
|
|
342
|
+
iniFile: File;
|
|
343
|
+
dataFile: File;
|
|
344
|
+
summary: {
|
|
345
|
+
totalRecords: number;
|
|
346
|
+
perType: Record<string, number>;
|
|
347
|
+
errors?: {
|
|
348
|
+
message: string;
|
|
349
|
+
recordType: string;
|
|
350
|
+
recordIndex: number;
|
|
351
|
+
field: string;
|
|
352
|
+
}[] | undefined;
|
|
353
|
+
};
|
|
354
|
+
}>;
|
|
355
|
+
export type BusinessMetadata = z.infer<typeof BusinessMetadataSchema>;
|
|
356
|
+
export type Document = z.infer<typeof DocumentSchema>;
|
|
357
|
+
export type JournalEntry = z.infer<typeof JournalEntrySchema>;
|
|
358
|
+
export type Account = z.infer<typeof AccountSchema>;
|
|
359
|
+
export type InventoryItem = z.infer<typeof InventoryItemSchema>;
|
|
360
|
+
export type ReportInput = z.infer<typeof ReportInputSchema>;
|
|
361
|
+
export type ReportOutput = z.infer<typeof ReportOutputSchema>;
|
|
362
|
+
export interface ValidationError {
|
|
363
|
+
recordType: string;
|
|
364
|
+
recordIndex: number;
|
|
365
|
+
field: string;
|
|
366
|
+
message: string;
|
|
367
|
+
}
|
|
368
|
+
export interface GenerationOptions {
|
|
369
|
+
validationMode?: 'fail-fast' | 'collect-all';
|
|
370
|
+
fileNameBase?: string;
|
|
371
|
+
}
|