@fragment-dev/cli 2025.9.16 → 2025.9.18
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/{chunk-TQRNHCRL.js → chunk-2L2ZCHD7.js} +315 -7
- package/dist/{chunk-5NNGFUR2.js → chunk-2YDYMQEU.js} +5 -5
- package/dist/{chunk-TRKCW3NY.js → chunk-3BFX3ZQM.js} +2 -2
- package/dist/{chunk-QBIZ7TKK.js → chunk-3LSL4JNW.js} +1 -1
- package/dist/{chunk-SHWFFRUQ.js → chunk-5YFHCTKF.js} +3 -3
- package/dist/{chunk-WIRNGK2K.js → chunk-65EPGXM5.js} +2 -2
- package/dist/{chunk-VSZ6RUPS.js → chunk-6Z6OR4JK.js} +2 -2
- package/dist/{chunk-2HFDOCFT.js → chunk-BQJEXZ3Z.js} +2 -2
- package/dist/{chunk-MZOZSRIG.js → chunk-C3HNQQDL.js} +1 -1
- package/dist/{chunk-AB5MEBC5.js → chunk-DPINR45T.js} +23 -23
- package/dist/{chunk-GX2Y7J77.js → chunk-EUDPQTGG.js} +1 -1
- package/dist/{chunk-2FO2MNL3.js → chunk-GGCDYQIW.js} +1 -1
- package/dist/{chunk-SXU2Z4NO.js → chunk-GRMPAF2X.js} +2 -2
- package/dist/{chunk-5MGMIUUK.js → chunk-H3DG2EYM.js} +2 -2
- package/dist/{chunk-SIANE5YG.js → chunk-HDSQSGJZ.js} +2 -2
- package/dist/{chunk-YYLQONCA.js → chunk-HLAM7IYL.js} +2 -2
- package/dist/{chunk-EBRMLGNI.js → chunk-IH6BCA6S.js} +1407 -277
- package/dist/{chunk-PWYEYSX5.js → chunk-IVDQ4PQW.js} +1 -1
- package/dist/{chunk-J64IPF3G.js → chunk-IWMNMIA6.js} +1 -1
- package/dist/{chunk-7D2QXYKM.js → chunk-JEFROCJ4.js} +14 -208
- package/dist/{chunk-JVTCCEVF.js → chunk-LCVLN3SZ.js} +1 -1
- package/dist/{chunk-YCYDA7QC.js → chunk-LWYIMR7B.js} +1 -1
- package/dist/{chunk-J43COUXZ.js → chunk-O5U5EZDT.js} +2 -2
- package/dist/{chunk-CQC265GZ.js → chunk-T3TNAOFS.js} +1 -1
- package/dist/{chunk-7VJJQFG3.js → chunk-UOIGY3UB.js} +3 -3
- package/dist/{chunk-5LMN5BVB.js → chunk-V25PI4BY.js} +2 -2
- package/dist/{chunk-EW6ZJJMC.js → chunk-VRHCYGEJ.js} +2 -2
- package/dist/{chunk-3UMWAIEH.js → chunk-WVPWSZFV.js} +1 -1
- package/dist/{chunk-GH45O4YP.js → chunk-YGEYBIHA.js} +2 -2
- package/dist/{chunk-SVOY3WJA.js → chunk-YWVJMLFY.js} +2 -1
- package/dist/{chunk-VDFDR5ZV.js → chunk-Z3BY6FHK.js} +3 -3
- package/dist/{chunk-S2W7I2OB.js → chunk-ZDE3DZ3I.js} +2 -2
- package/dist/{chunk-TGCLIO5Q.js → chunk-ZQHWOO25.js} +2 -2
- package/dist/commands/add-ledger-entry.js +3 -3
- package/dist/commands/create-custom-link.js +3 -3
- package/dist/commands/create-ledger.js +3 -3
- package/dist/commands/delete-custom-txs.js +3 -3
- package/dist/commands/delete-ledger.js +3 -3
- package/dist/commands/delete-schema.js +3 -3
- package/dist/commands/gen-graphql.js +7 -7
- package/dist/commands/get-schema.js +4 -4
- package/dist/commands/init.js +2 -2
- package/dist/commands/login.js +3 -3
- package/dist/commands/migrate-ledger-entry.js +3 -3
- package/dist/commands/query/ledgerAccounts.js +3 -3
- package/dist/commands/query/ledgers.js +3 -3
- package/dist/commands/query/schema.js +3 -3
- package/dist/commands/query/schemas.js +3 -3
- package/dist/commands/reverse-ledger-entry.js +3 -3
- package/dist/commands/start.js +2 -2
- package/dist/commands/store-schema.js +3 -3
- package/dist/commands/token.js +3 -3
- package/dist/commands/update-ledger-account.js +3 -3
- package/dist/commands/update.js +3 -3
- package/dist/commands/verify-schema.js +7 -7
- package/dist/commands/workspace.js +3 -3
- package/dist/commands.js +33 -33
- package/dist/graphql.js +3 -3
- package/dist/index.js +33 -33
- package/dist/lib/authenticatedCommand.js +2 -2
- package/dist/lib/baseCommand.js +1 -1
- package/dist/utils/formatValidationErrors.js +2 -2
- package/dist/utils/schemaValidation.js +5 -5
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
getInstanceValueByAccountPath,
|
|
4
4
|
getSchemaObjectParameters,
|
|
5
5
|
getStructuralPath
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-C3HNQQDL.js";
|
|
7
7
|
import {
|
|
8
8
|
BadRequestError,
|
|
9
9
|
CurrencyMatchInputSchema,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
assert_default,
|
|
19
19
|
currencyCodes,
|
|
20
20
|
safe
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-YWVJMLFY.js";
|
|
22
22
|
import {
|
|
23
23
|
z
|
|
24
24
|
} from "./chunk-5TQBOAE7.js";
|
|
@@ -4621,9 +4621,9 @@ var FlowKey = z.object({
|
|
|
4621
4621
|
var SchemaLedgerFlowInput = z.object({
|
|
4622
4622
|
type: SafeStringSchema,
|
|
4623
4623
|
typeVersion: z.number().int().positive(),
|
|
4624
|
-
description:
|
|
4624
|
+
description: ParameterizedString.optional(),
|
|
4625
4625
|
clearingAccountPath: ParameterizedString,
|
|
4626
|
-
initializingEntry:
|
|
4626
|
+
initializingEntry: FlowKey,
|
|
4627
4627
|
entries: z.array(FlowKey),
|
|
4628
4628
|
flows: z.array(FlowKey)
|
|
4629
4629
|
});
|
|
@@ -5522,6 +5522,93 @@ var getStructuralPathToAccount = (validatedCoA) => {
|
|
|
5522
5522
|
validatedCoA.accounts.forEach((account) => walk(account));
|
|
5523
5523
|
return accountPathToAccount;
|
|
5524
5524
|
};
|
|
5525
|
+
var validateAccountPathExists = (accountPath, accountPathToAccount, context, path) => {
|
|
5526
|
+
const structuralPath = getStructuralPath(accountPath);
|
|
5527
|
+
const account = accountPathToAccount.get(structuralPath);
|
|
5528
|
+
if (!account) {
|
|
5529
|
+
return [
|
|
5530
|
+
{
|
|
5531
|
+
message: `${context} refers to a non-existent account path: ${accountPath}`,
|
|
5532
|
+
path
|
|
5533
|
+
}
|
|
5534
|
+
];
|
|
5535
|
+
}
|
|
5536
|
+
return [];
|
|
5537
|
+
};
|
|
5538
|
+
var validateAccountPathFormat = (accountPath, context, path) => {
|
|
5539
|
+
if (accountPath.includes("#")) {
|
|
5540
|
+
return [
|
|
5541
|
+
{
|
|
5542
|
+
message: `${context} account path '${accountPath}' cannot contain '#'`,
|
|
5543
|
+
path
|
|
5544
|
+
}
|
|
5545
|
+
];
|
|
5546
|
+
}
|
|
5547
|
+
return [];
|
|
5548
|
+
};
|
|
5549
|
+
var validateAccountPathNotEmpty = (accountPath, context, path) => {
|
|
5550
|
+
if (!accountPath || accountPath.trim() === "") {
|
|
5551
|
+
return [
|
|
5552
|
+
{
|
|
5553
|
+
message: `${context} must specify an account path`,
|
|
5554
|
+
path
|
|
5555
|
+
}
|
|
5556
|
+
];
|
|
5557
|
+
}
|
|
5558
|
+
return [];
|
|
5559
|
+
};
|
|
5560
|
+
var validateAccountPath = (accountPath, accountPathToAccount, context, path) => {
|
|
5561
|
+
const errors = [];
|
|
5562
|
+
errors.push(...validateAccountPathNotEmpty(accountPath, context, path));
|
|
5563
|
+
if (errors.length > 0) {
|
|
5564
|
+
return errors;
|
|
5565
|
+
}
|
|
5566
|
+
errors.push(...validateAccountPathFormat(accountPath, context, path));
|
|
5567
|
+
errors.push(
|
|
5568
|
+
...validateAccountPathExists(
|
|
5569
|
+
accountPath,
|
|
5570
|
+
accountPathToAccount,
|
|
5571
|
+
context,
|
|
5572
|
+
path
|
|
5573
|
+
)
|
|
5574
|
+
);
|
|
5575
|
+
return errors;
|
|
5576
|
+
};
|
|
5577
|
+
var validateAccountIsActive = (accountPath, accountPathToAccount, context, path) => {
|
|
5578
|
+
const structuralPath = getStructuralPath(accountPath);
|
|
5579
|
+
const account = accountPathToAccount.get(structuralPath);
|
|
5580
|
+
if (!account) {
|
|
5581
|
+
return [];
|
|
5582
|
+
}
|
|
5583
|
+
const accountStatus = getAccountStatus(account);
|
|
5584
|
+
if (accountStatus !== "active") {
|
|
5585
|
+
return [
|
|
5586
|
+
{
|
|
5587
|
+
message: `${context} refers to an account with status '${account.status}'. Only active accounts can be used.`,
|
|
5588
|
+
path
|
|
5589
|
+
}
|
|
5590
|
+
];
|
|
5591
|
+
}
|
|
5592
|
+
return [];
|
|
5593
|
+
};
|
|
5594
|
+
var validateTemplateAccountParameters = (accountPath, accountPathToAccount, context, path) => {
|
|
5595
|
+
const instanceValueMap = getInstanceValueByAccountPath(accountPath);
|
|
5596
|
+
const errors = [];
|
|
5597
|
+
Array.from(instanceValueMap.keys()).forEach((ancestorPath) => {
|
|
5598
|
+
const structuralAncestorPath = getStructuralPath(ancestorPath);
|
|
5599
|
+
const ancestor = accountPathToAccount.get(structuralAncestorPath);
|
|
5600
|
+
if (!ancestor) {
|
|
5601
|
+
return;
|
|
5602
|
+
}
|
|
5603
|
+
if (ancestor.template && !instanceValueMap.get(ancestorPath)) {
|
|
5604
|
+
errors.push({
|
|
5605
|
+
message: `Invalid account path for ${context.toLowerCase()}. This ${context.toLowerCase()} refers to a Template Account, but is missing a variable that identifies the instance of the Template Account. For example: ${ancestorPath}:{{var}}`,
|
|
5606
|
+
path
|
|
5607
|
+
});
|
|
5608
|
+
}
|
|
5609
|
+
});
|
|
5610
|
+
return errors;
|
|
5611
|
+
};
|
|
5525
5612
|
|
|
5526
5613
|
// ../../libs/schema-validation/utils/transformers/entries.ts
|
|
5527
5614
|
var validateNonEmptySafeString = ({
|
|
@@ -6231,6 +6318,209 @@ var transformAndValidateEntries = ({
|
|
|
6231
6318
|
};
|
|
6232
6319
|
};
|
|
6233
6320
|
|
|
6321
|
+
// ../../libs/schema-validation/utils/transformers/flows.ts
|
|
6322
|
+
init_cjs_shims();
|
|
6323
|
+
var isAccountPathEquivalent = (path1, path2) => {
|
|
6324
|
+
return getStructuralPath(path1) === getStructuralPath(path2);
|
|
6325
|
+
};
|
|
6326
|
+
var validateMinimumSteps = (flow) => {
|
|
6327
|
+
const stepCount = flow.entries.length + (flow.flows?.length ?? 0);
|
|
6328
|
+
if (stepCount < 2) {
|
|
6329
|
+
return [
|
|
6330
|
+
{
|
|
6331
|
+
message: "Flow must have at least 2 elements (entries or flows)",
|
|
6332
|
+
path: []
|
|
6333
|
+
}
|
|
6334
|
+
];
|
|
6335
|
+
}
|
|
6336
|
+
return [];
|
|
6337
|
+
};
|
|
6338
|
+
var validateInitializingEntryExists = (flow, validatedEntries) => {
|
|
6339
|
+
const initializingEntry = validatedEntries.types.find(
|
|
6340
|
+
(e) => e.type === flow.initializingEntry.type && (e.typeVersion ?? 1) === flow.initializingEntry.typeVersion
|
|
6341
|
+
);
|
|
6342
|
+
if (!initializingEntry) {
|
|
6343
|
+
return [
|
|
6344
|
+
{
|
|
6345
|
+
message: "Flow must have an initializing entry",
|
|
6346
|
+
path: ["initializingEntry"]
|
|
6347
|
+
}
|
|
6348
|
+
];
|
|
6349
|
+
}
|
|
6350
|
+
return [];
|
|
6351
|
+
};
|
|
6352
|
+
var validateUniqueEntries = (flow) => {
|
|
6353
|
+
const entrySet = new Set(
|
|
6354
|
+
flow.entries.map((entry) => `${entry.type}:${entry.typeVersion}`)
|
|
6355
|
+
);
|
|
6356
|
+
if (entrySet.size !== flow.entries.length) {
|
|
6357
|
+
return [
|
|
6358
|
+
{
|
|
6359
|
+
message: "Cannot have duplicate entries in the flow",
|
|
6360
|
+
path: ["entries"]
|
|
6361
|
+
}
|
|
6362
|
+
];
|
|
6363
|
+
}
|
|
6364
|
+
return [];
|
|
6365
|
+
};
|
|
6366
|
+
var validateUniqueFlows = (flow) => {
|
|
6367
|
+
const flowSet = new Set(flow.flows.map((f) => `${f.type}:${f.typeVersion}`));
|
|
6368
|
+
if (flowSet.size !== flow.flows.length) {
|
|
6369
|
+
return [
|
|
6370
|
+
{ message: "Cannot have duplicate flows in the flow", path: ["flows"] }
|
|
6371
|
+
];
|
|
6372
|
+
}
|
|
6373
|
+
return [];
|
|
6374
|
+
};
|
|
6375
|
+
var validateEntriesModifyClearingAccount = (flow, validatedEntries) => {
|
|
6376
|
+
const clearingAccount = flow.clearingAccountPath;
|
|
6377
|
+
const fullEntries = flow.entries.map((entry) => {
|
|
6378
|
+
const fullEntry = validatedEntries.types.find(
|
|
6379
|
+
(e) => e.type === entry.type && (e.typeVersion ?? 1) === entry.typeVersion
|
|
6380
|
+
);
|
|
6381
|
+
return fullEntry;
|
|
6382
|
+
});
|
|
6383
|
+
if (fullEntries.length !== flow.entries.length) {
|
|
6384
|
+
return [
|
|
6385
|
+
{
|
|
6386
|
+
message: "All entries in the flow must be present in the validated entries",
|
|
6387
|
+
path: ["entries"]
|
|
6388
|
+
}
|
|
6389
|
+
];
|
|
6390
|
+
}
|
|
6391
|
+
const entriesMissingClearingAccount = fullEntries.filter(
|
|
6392
|
+
(e) => !e?.lines?.some(
|
|
6393
|
+
(l) => isAccountPathEquivalent(l.account.path, clearingAccount)
|
|
6394
|
+
)
|
|
6395
|
+
);
|
|
6396
|
+
if (entriesMissingClearingAccount.length > 0) {
|
|
6397
|
+
return entriesMissingClearingAccount.map((e) => ({
|
|
6398
|
+
message: `All entries in the flow must modify the clearing account, not present in the entries ${e?.type} v${e?.typeVersion}`,
|
|
6399
|
+
path: ["entries"]
|
|
6400
|
+
}));
|
|
6401
|
+
}
|
|
6402
|
+
return [];
|
|
6403
|
+
};
|
|
6404
|
+
var validateFlowsDepthAndCircularity = (flow, flows) => {
|
|
6405
|
+
if (!flows || !flow.flows || flow.flows.length === 0) {
|
|
6406
|
+
return [];
|
|
6407
|
+
}
|
|
6408
|
+
const errors = [];
|
|
6409
|
+
const visited = /* @__PURE__ */ new Set();
|
|
6410
|
+
const currentPath = [];
|
|
6411
|
+
const validateFlowRecursively = (currentFlow, depth, path) => {
|
|
6412
|
+
const flowId = `${currentFlow.type}:${currentFlow.typeVersion}`;
|
|
6413
|
+
if (visited.has(flowId)) {
|
|
6414
|
+
if (currentPath.includes(flowId)) {
|
|
6415
|
+
errors.push({
|
|
6416
|
+
message: `Circular reference detected in flow: ${flowId}`,
|
|
6417
|
+
path: ["flows", ...path]
|
|
6418
|
+
});
|
|
6419
|
+
return;
|
|
6420
|
+
}
|
|
6421
|
+
return;
|
|
6422
|
+
}
|
|
6423
|
+
if (depth > 5) {
|
|
6424
|
+
errors.push({
|
|
6425
|
+
message: `Flow depth exceeds maximum of 5 levels: ${flowId}`,
|
|
6426
|
+
path: ["flows", ...path]
|
|
6427
|
+
});
|
|
6428
|
+
return;
|
|
6429
|
+
}
|
|
6430
|
+
visited.add(flowId);
|
|
6431
|
+
currentPath.push(flowId);
|
|
6432
|
+
if (currentFlow.flows && currentFlow.flows.length > 0) {
|
|
6433
|
+
currentFlow.flows.forEach((flowKey, index) => {
|
|
6434
|
+
const childFlowId = `${flowKey.type}:${flowKey.typeVersion}`;
|
|
6435
|
+
const childFlow = flows.find(
|
|
6436
|
+
(f) => f.type === flowKey.type && f.typeVersion === flowKey.typeVersion
|
|
6437
|
+
);
|
|
6438
|
+
if (childFlow) {
|
|
6439
|
+
validateFlowRecursively(childFlow, depth + 1, [
|
|
6440
|
+
...path,
|
|
6441
|
+
index.toString()
|
|
6442
|
+
]);
|
|
6443
|
+
} else {
|
|
6444
|
+
errors.push({
|
|
6445
|
+
message: `Referenced flow not found: ${childFlowId}`,
|
|
6446
|
+
path: ["flows", ...path, index.toString()]
|
|
6447
|
+
});
|
|
6448
|
+
}
|
|
6449
|
+
});
|
|
6450
|
+
}
|
|
6451
|
+
currentPath.pop();
|
|
6452
|
+
};
|
|
6453
|
+
validateFlowRecursively(flow, 0, []);
|
|
6454
|
+
return errors;
|
|
6455
|
+
};
|
|
6456
|
+
var validateFlowEntryReferences = (flow, validatedEntries) => {
|
|
6457
|
+
const errors = [];
|
|
6458
|
+
flow.entries.forEach((entryRef, index) => {
|
|
6459
|
+
const matchingEntry = validatedEntries?.types?.find(
|
|
6460
|
+
(entry) => entry.type === entryRef.type && (entry.typeVersion ?? 1) === entryRef.typeVersion
|
|
6461
|
+
);
|
|
6462
|
+
if (!matchingEntry) {
|
|
6463
|
+
errors.push({
|
|
6464
|
+
message: `Flow entry not found in validated entries: ${entryRef.type}:${entryRef.typeVersion}`,
|
|
6465
|
+
path: ["entries", index]
|
|
6466
|
+
});
|
|
6467
|
+
} else {
|
|
6468
|
+
}
|
|
6469
|
+
});
|
|
6470
|
+
return errors;
|
|
6471
|
+
};
|
|
6472
|
+
var validateClearingAccount = (flow, validatedCoA) => {
|
|
6473
|
+
const clearingAccount = flow.clearingAccountPath;
|
|
6474
|
+
const accountPathToAccount = getStructuralPathToAccount(validatedCoA);
|
|
6475
|
+
const errors = [];
|
|
6476
|
+
errors.push(
|
|
6477
|
+
...validateAccountPath(
|
|
6478
|
+
clearingAccount,
|
|
6479
|
+
accountPathToAccount,
|
|
6480
|
+
"Flow clearing account",
|
|
6481
|
+
["clearingAccountPath"]
|
|
6482
|
+
)
|
|
6483
|
+
);
|
|
6484
|
+
errors.push(
|
|
6485
|
+
...validateAccountIsActive(
|
|
6486
|
+
clearingAccount,
|
|
6487
|
+
accountPathToAccount,
|
|
6488
|
+
"Flow clearing account",
|
|
6489
|
+
["clearingAccountPath"]
|
|
6490
|
+
)
|
|
6491
|
+
);
|
|
6492
|
+
errors.push(
|
|
6493
|
+
...validateTemplateAccountParameters(
|
|
6494
|
+
clearingAccount,
|
|
6495
|
+
accountPathToAccount,
|
|
6496
|
+
"Flow clearing account",
|
|
6497
|
+
["clearingAccountPath"]
|
|
6498
|
+
)
|
|
6499
|
+
);
|
|
6500
|
+
return errors;
|
|
6501
|
+
};
|
|
6502
|
+
var validateFlow = (flow, validatedCoA, validatedEntries, flows) => {
|
|
6503
|
+
const errors = [];
|
|
6504
|
+
const zodErrors = safeGetZodErrors(SchemaLedgerFlowInput, flow, []);
|
|
6505
|
+
errors.push(...zodErrors);
|
|
6506
|
+
if (errors.length > 0) {
|
|
6507
|
+
return errors;
|
|
6508
|
+
}
|
|
6509
|
+
errors.push(...validateMinimumSteps(flow));
|
|
6510
|
+
errors.push(...validateInitializingEntryExists(flow, validatedEntries));
|
|
6511
|
+
errors.push(...validateUniqueEntries(flow));
|
|
6512
|
+
errors.push(...validateUniqueFlows(flow));
|
|
6513
|
+
if (errors.length === 0) {
|
|
6514
|
+
errors.push(...validateFlowEntryReferences(flow, validatedEntries));
|
|
6515
|
+
errors.push(...validateFlowsDepthAndCircularity(flow, flows));
|
|
6516
|
+
errors.push(...validateClearingAccount(flow, validatedCoA));
|
|
6517
|
+
errors.push(
|
|
6518
|
+
...validateEntriesModifyClearingAccount(flow, validatedEntries)
|
|
6519
|
+
);
|
|
6520
|
+
}
|
|
6521
|
+
return errors;
|
|
6522
|
+
};
|
|
6523
|
+
|
|
6234
6524
|
// ../../libs/schema-validation/types.ts
|
|
6235
6525
|
var SchemaCurrencyMatchInput2 = z.object({
|
|
6236
6526
|
customCurrencyId: ParameterizedString.optional(),
|
|
@@ -6464,10 +6754,11 @@ var Schema = z.object({
|
|
|
6464
6754
|
chartOfAccounts: ChartOfAccounts,
|
|
6465
6755
|
ledgerEntries: SchemaLedgerEntriesInput.optional(),
|
|
6466
6756
|
consistencyConfig: z.optional(LedgerConsistencyConfigSchema),
|
|
6467
|
-
scenes: z.array(Scene).optional()
|
|
6757
|
+
scenes: z.array(Scene).optional(),
|
|
6758
|
+
flows: z.array(SchemaLedgerFlowInput).optional()
|
|
6468
6759
|
}).transform((schema, ctx) => {
|
|
6469
|
-
const { chartOfAccounts, ledgerEntries, consistencyConfig } = schema;
|
|
6470
|
-
const { errors } = transformAndValidateEntries({
|
|
6760
|
+
const { chartOfAccounts, ledgerEntries, consistencyConfig, flows } = schema;
|
|
6761
|
+
const { errors, filledIn: validatedLedgerEntries } = transformAndValidateEntries({
|
|
6471
6762
|
ledgerEntries: ledgerEntries ?? { types: [] },
|
|
6472
6763
|
validatedCoA: chartOfAccounts
|
|
6473
6764
|
});
|
|
@@ -6478,6 +6769,23 @@ var Schema = z.object({
|
|
|
6478
6769
|
path
|
|
6479
6770
|
})
|
|
6480
6771
|
);
|
|
6772
|
+
if (flows && flows.length > 0) {
|
|
6773
|
+
flows.forEach((flow, index) => {
|
|
6774
|
+
const flowErrors = validateFlow(
|
|
6775
|
+
flow,
|
|
6776
|
+
chartOfAccounts,
|
|
6777
|
+
validatedLedgerEntries,
|
|
6778
|
+
flows
|
|
6779
|
+
);
|
|
6780
|
+
flowErrors.forEach(
|
|
6781
|
+
({ message, path }) => ctx.addIssue({
|
|
6782
|
+
code: z.ZodIssueCode.custom,
|
|
6783
|
+
message,
|
|
6784
|
+
path: ["flows", index, ...path]
|
|
6785
|
+
})
|
|
6786
|
+
);
|
|
6787
|
+
});
|
|
6788
|
+
}
|
|
6481
6789
|
return {
|
|
6482
6790
|
...schema,
|
|
6483
6791
|
ledgerEntries: {
|
|
@@ -3,22 +3,22 @@ import {
|
|
|
3
3
|
generateQueryFiles,
|
|
4
4
|
schemaToEntryDefinitions,
|
|
5
5
|
validateOutputName
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WVPWSZFV.js";
|
|
7
7
|
import {
|
|
8
8
|
Schema,
|
|
9
9
|
parseWithError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2L2ZCHD7.js";
|
|
11
11
|
import {
|
|
12
12
|
formatValidationErrors,
|
|
13
13
|
logValidationErrors
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-EUDPQTGG.js";
|
|
15
15
|
import {
|
|
16
16
|
BadRequestError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YWVJMLFY.js";
|
|
18
18
|
import {
|
|
19
19
|
FragmentCommand,
|
|
20
20
|
require_lib
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-IH6BCA6S.js";
|
|
22
22
|
import {
|
|
23
23
|
getParsedSchema
|
|
24
24
|
} from "./chunk-UDU5PBTV.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Schema,
|
|
3
3
|
parseWithError
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-2L2ZCHD7.js";
|
|
5
5
|
import {
|
|
6
6
|
formatValidationErrors
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-EUDPQTGG.js";
|
|
8
8
|
import {
|
|
9
9
|
BadRequestError
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YWVJMLFY.js";
|
|
11
11
|
import {
|
|
12
12
|
init_cjs_shims
|
|
13
13
|
} from "./chunk-7GH3YGSC.js";
|
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ReverseLedgerEntry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-ZDE3DZ3I.js";
|
|
4
4
|
import {
|
|
5
5
|
Start
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-T3TNAOFS.js";
|
|
7
7
|
import {
|
|
8
8
|
StoreSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-3BFX3ZQM.js";
|
|
10
10
|
import {
|
|
11
11
|
Token
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-LCVLN3SZ.js";
|
|
13
13
|
import {
|
|
14
14
|
UpdateLedgerAccount
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-GRMPAF2X.js";
|
|
16
16
|
import {
|
|
17
17
|
Update
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-HDSQSGJZ.js";
|
|
19
19
|
import {
|
|
20
20
|
VerifySchema
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-Z3BY6FHK.js";
|
|
22
22
|
import {
|
|
23
23
|
Workspace
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-3LSL4JNW.js";
|
|
25
25
|
import {
|
|
26
26
|
GetSchema
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-UOIGY3UB.js";
|
|
28
28
|
import {
|
|
29
29
|
Init
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-GGCDYQIW.js";
|
|
31
31
|
import {
|
|
32
32
|
Login
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-V25PI4BY.js";
|
|
34
34
|
import {
|
|
35
35
|
MigrateLedgerEntry
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-6Z6OR4JK.js";
|
|
37
37
|
import {
|
|
38
38
|
QueryLedgerAccounts
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-HLAM7IYL.js";
|
|
40
40
|
import {
|
|
41
41
|
QueryLedgers
|
|
42
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-IWMNMIA6.js";
|
|
43
43
|
import {
|
|
44
44
|
GetSchema as GetSchema2
|
|
45
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-O5U5EZDT.js";
|
|
46
46
|
import {
|
|
47
47
|
QuerySchemas
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-LWYIMR7B.js";
|
|
49
49
|
import {
|
|
50
50
|
AddLedgerEntry
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-BQJEXZ3Z.js";
|
|
52
52
|
import {
|
|
53
53
|
CreateCustomLink
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-H3DG2EYM.js";
|
|
55
55
|
import {
|
|
56
56
|
CreateLedger
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-65EPGXM5.js";
|
|
58
58
|
import {
|
|
59
59
|
DeleteCustomTxs
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-ZQHWOO25.js";
|
|
61
61
|
import {
|
|
62
62
|
DeleteLedger
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-YGEYBIHA.js";
|
|
64
64
|
import {
|
|
65
65
|
DeleteSchema
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-VRHCYGEJ.js";
|
|
67
67
|
import {
|
|
68
68
|
GenGraphQL
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-2YDYMQEU.js";
|
|
70
70
|
import {
|
|
71
71
|
init_cjs_shims
|
|
72
72
|
} from "./chunk-7GH3YGSC.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
inquirer_default
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-JEFROCJ4.js";
|
|
4
4
|
import {
|
|
5
5
|
FragmentCommand,
|
|
6
6
|
require_lib
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-IH6BCA6S.js";
|
|
8
8
|
import {
|
|
9
9
|
require_source
|
|
10
10
|
} from "./chunk-M5OAS5QZ.js";
|