@fragment-dev/cli 2026.2.3 → 2026.2.5-1
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-NSFGROMG.js → chunk-23FWWC5Q.js} +1 -1
- package/dist/{chunk-A52J5Z4K.js → chunk-2DNDGK5W.js} +1 -1
- package/dist/{chunk-Q5PW5APY.js → chunk-5UOG5RJJ.js} +2 -2
- package/dist/{chunk-4D76AF6Z.js → chunk-ELZ3W64C.js} +88 -23
- package/dist/{chunk-4EXMJ3X7.js → chunk-K5YR2U62.js} +1 -1
- package/dist/commands/gen-graphql.js +2 -2
- package/dist/commands/verify-schema.js +3 -3
- package/dist/commands.js +5 -5
- package/dist/index.js +5 -5
- package/dist/utils/schemaValidation.js +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-S2H2GXXC.js";
|
|
19
19
|
import {
|
|
20
20
|
VerifySchema
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-23FWWC5Q.js";
|
|
22
22
|
import {
|
|
23
23
|
Workspace
|
|
24
24
|
} from "./chunk-KERHWPH2.js";
|
|
@@ -66,7 +66,7 @@ import {
|
|
|
66
66
|
} from "./chunk-QBK3LAGY.js";
|
|
67
67
|
import {
|
|
68
68
|
GenGraphQL
|
|
69
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-K5YR2U62.js";
|
|
70
70
|
import {
|
|
71
71
|
init_cjs_shims
|
|
72
72
|
} from "./chunk-7GH3YGSC.js";
|
|
@@ -4651,6 +4651,9 @@ init_cjs_shims();
|
|
|
4651
4651
|
|
|
4652
4652
|
// ../../libs/schema-validation/utils/consistencyValidation.ts
|
|
4653
4653
|
init_cjs_shims();
|
|
4654
|
+
var isTotalBalanceSchema = (defaultConsistencyConfig) => {
|
|
4655
|
+
return defaultConsistencyConfig?.totalBalanceUpdates !== void 0;
|
|
4656
|
+
};
|
|
4654
4657
|
var validateAccountConsistencySettings = ({
|
|
4655
4658
|
lines,
|
|
4656
4659
|
ownBalanceUpdates,
|
|
@@ -4984,16 +4987,16 @@ var fillInDefaultsAndInferMetadata = ({
|
|
|
4984
4987
|
accounts
|
|
4985
4988
|
}) => {
|
|
4986
4989
|
const defaultCurrencyMode = defaultCurrencyModeInput ?? "single";
|
|
4987
|
-
const
|
|
4990
|
+
const isTotalBalance = isTotalBalanceSchema(defaultConsistencyConfigInput);
|
|
4988
4991
|
const defaultConsistencyConfig = {
|
|
4989
4992
|
lines: defaultConsistencyConfigInput?.lines ?? "eventual",
|
|
4990
4993
|
// Only include ownBalanceUpdates if NOT a totalBalance schema
|
|
4991
|
-
...!
|
|
4994
|
+
...!isTotalBalance && {
|
|
4992
4995
|
ownBalanceUpdates: defaultConsistencyConfigInput?.ownBalanceUpdates ?? "eventual"
|
|
4993
4996
|
},
|
|
4994
4997
|
// Only include totalBalanceUpdates if it's defined
|
|
4995
|
-
...
|
|
4996
|
-
totalBalanceUpdates: defaultConsistencyConfigInput
|
|
4998
|
+
...isTotalBalance && {
|
|
4999
|
+
totalBalanceUpdates: defaultConsistencyConfigInput?.totalBalanceUpdates
|
|
4997
5000
|
}
|
|
4998
5001
|
};
|
|
4999
5002
|
const inferAccountMetadata = ({
|
|
@@ -5016,19 +5019,23 @@ var fillInDefaultsAndInferMetadata = ({
|
|
|
5016
5019
|
}
|
|
5017
5020
|
const newCurrencyMode = account.currencyMode ?? (newCurrency ? "single" : fallbackDefaultCurrencyMode);
|
|
5018
5021
|
const partialConsistencyConfig = account.consistencyConfig ?? {};
|
|
5019
|
-
const
|
|
5020
|
-
|
|
5022
|
+
const getBalanceUpdatesConfig = () => {
|
|
5023
|
+
if (isTotalBalance) {
|
|
5024
|
+
if (partialConsistencyConfig.totalBalanceUpdates !== void 0) {
|
|
5025
|
+
return {
|
|
5026
|
+
totalBalanceUpdates: partialConsistencyConfig.totalBalanceUpdates
|
|
5027
|
+
};
|
|
5028
|
+
}
|
|
5029
|
+
return {};
|
|
5030
|
+
}
|
|
5031
|
+
return {
|
|
5032
|
+
ownBalanceUpdates: partialConsistencyConfig.ownBalanceUpdates ?? fallbackDefaultConsistencyMode.ownBalanceUpdates
|
|
5033
|
+
};
|
|
5034
|
+
};
|
|
5021
5035
|
const newConsistencyConfig = {
|
|
5022
|
-
// Only include ownBalanceUpdates if it resolves to a value
|
|
5023
|
-
...resolvedOwnBalance !== void 0 && {
|
|
5024
|
-
ownBalanceUpdates: resolvedOwnBalance
|
|
5025
|
-
},
|
|
5026
|
-
// Only include totalBalanceUpdates if it resolves to a value
|
|
5027
|
-
...resolvedTotalBalance !== void 0 && {
|
|
5028
|
-
totalBalanceUpdates: resolvedTotalBalance
|
|
5029
|
-
},
|
|
5030
5036
|
lines: partialConsistencyConfig.lines ?? fallbackDefaultConsistencyMode.lines,
|
|
5031
|
-
groups: partialConsistencyConfig.groups ?? fallbackDefaultConsistencyMode.groups
|
|
5037
|
+
groups: partialConsistencyConfig.groups ?? fallbackDefaultConsistencyMode.groups,
|
|
5038
|
+
...getBalanceUpdatesConfig()
|
|
5032
5039
|
};
|
|
5033
5040
|
let newName;
|
|
5034
5041
|
if (account.name) {
|
|
@@ -5086,6 +5093,37 @@ var fillInDefaultsAndInferMetadata = ({
|
|
|
5086
5093
|
};
|
|
5087
5094
|
};
|
|
5088
5095
|
var MAX_COA_DEPTH = 10;
|
|
5096
|
+
var validateAccountConsistencyType = ({
|
|
5097
|
+
accounts,
|
|
5098
|
+
isTotalBalance
|
|
5099
|
+
}) => {
|
|
5100
|
+
const errors = [];
|
|
5101
|
+
const walkAccounts = (accountList, basePath) => {
|
|
5102
|
+
accountList.forEach((account, idx) => {
|
|
5103
|
+
const accountPath = [...basePath, idx];
|
|
5104
|
+
if (isTotalBalance && account.consistencyConfig?.ownBalanceUpdates !== void 0) {
|
|
5105
|
+
errors.push({
|
|
5106
|
+
path: [...accountPath, "consistencyConfig", "ownBalanceUpdates"],
|
|
5107
|
+
message: `Account "${account.key}" has ownBalanceUpdates set, but schema uses totalBalance. Remove ownBalanceUpdates from account-level config.`
|
|
5108
|
+
});
|
|
5109
|
+
}
|
|
5110
|
+
if (!isTotalBalance && account.consistencyConfig?.totalBalanceUpdates !== void 0) {
|
|
5111
|
+
errors.push({
|
|
5112
|
+
path: [...accountPath, "consistencyConfig", "totalBalanceUpdates"],
|
|
5113
|
+
message: `Account "${account.key}" has totalBalanceUpdates set, but schema uses ownBalance. Remove totalBalanceUpdates from account-level config.`
|
|
5114
|
+
});
|
|
5115
|
+
}
|
|
5116
|
+
if (account.children && account.children.length > 0) {
|
|
5117
|
+
walkAccounts(account.children, [
|
|
5118
|
+
...accountPath,
|
|
5119
|
+
"children"
|
|
5120
|
+
]);
|
|
5121
|
+
}
|
|
5122
|
+
});
|
|
5123
|
+
};
|
|
5124
|
+
walkAccounts(accounts, ["accounts"]);
|
|
5125
|
+
return errors;
|
|
5126
|
+
};
|
|
5089
5127
|
var transformAndValidateAccounts = ({
|
|
5090
5128
|
accounts,
|
|
5091
5129
|
defaultConsistencyConfig,
|
|
@@ -5111,6 +5149,12 @@ var transformAndValidateAccounts = ({
|
|
|
5111
5149
|
});
|
|
5112
5150
|
errors.push(...accountValidationErrors);
|
|
5113
5151
|
});
|
|
5152
|
+
const isTotalBalance = isTotalBalanceSchema(defaultConsistencyConfig);
|
|
5153
|
+
const accountConsistencyTypeErrors = validateAccountConsistencyType({
|
|
5154
|
+
accounts,
|
|
5155
|
+
isTotalBalance
|
|
5156
|
+
});
|
|
5157
|
+
errors.push(...accountConsistencyTypeErrors);
|
|
5114
5158
|
const seenAccountPaths = /* @__PURE__ */ new Map();
|
|
5115
5159
|
const walk = (account, objPath, depth, path) => {
|
|
5116
5160
|
if (depth > MAX_COA_DEPTH) {
|
|
@@ -5162,7 +5206,7 @@ var transformAndValidateCoA = ({
|
|
|
5162
5206
|
errors.push(...currencyValidation.errors);
|
|
5163
5207
|
const defaultCurrencyMode = coa.defaultCurrencyMode === "multi" || coa.defaultCurrencyMode === "single" ? coa.defaultCurrencyMode : "single";
|
|
5164
5208
|
const coaConsistencyConfig = coa.defaultConsistencyConfig ?? {};
|
|
5165
|
-
const
|
|
5209
|
+
const isTotalBalance = isTotalBalanceSchema(coaConsistencyConfig);
|
|
5166
5210
|
const rawHasOwnBalance = coaConsistencyConfig.ownBalanceUpdates !== void 0;
|
|
5167
5211
|
const rawHasTotalBalance = coaConsistencyConfig.totalBalanceUpdates !== void 0;
|
|
5168
5212
|
if (rawHasOwnBalance && rawHasTotalBalance) {
|
|
@@ -5174,11 +5218,11 @@ var transformAndValidateCoA = ({
|
|
|
5174
5218
|
const defaultConsistencyConfig = {
|
|
5175
5219
|
lines: coaConsistencyConfig.lines ?? "eventual",
|
|
5176
5220
|
// Only include ownBalanceUpdates if NOT a totalBalance schema
|
|
5177
|
-
...!
|
|
5221
|
+
...!isTotalBalance && {
|
|
5178
5222
|
ownBalanceUpdates: coaConsistencyConfig.ownBalanceUpdates ?? "eventual"
|
|
5179
5223
|
},
|
|
5180
5224
|
// Only include totalBalanceUpdates if it's defined
|
|
5181
|
-
...
|
|
5225
|
+
...isTotalBalance && {
|
|
5182
5226
|
totalBalanceUpdates: coaConsistencyConfig.totalBalanceUpdates
|
|
5183
5227
|
}
|
|
5184
5228
|
};
|
|
@@ -6088,7 +6132,7 @@ var validateBalancedLines = (entryType, entryParameters, lines, accountPathToAcc
|
|
|
6088
6132
|
}
|
|
6089
6133
|
return [];
|
|
6090
6134
|
};
|
|
6091
|
-
var validateEntryConditions = (entryConditions, staticParameters, entryType, accountPathToAccount) => {
|
|
6135
|
+
var validateEntryConditions = (entryConditions, staticParameters, entryType, accountPathToAccount, defaultConsistencyConfig) => {
|
|
6092
6136
|
const errors = [];
|
|
6093
6137
|
const conditions = entryConditions.map(
|
|
6094
6138
|
(condition) => parameterizeSchemaLedgerEntryConditionInput({
|
|
@@ -6106,7 +6150,22 @@ var validateEntryConditions = (entryConditions, staticParameters, entryType, acc
|
|
|
6106
6150
|
const isOwnBalanceCondition = (condition) => {
|
|
6107
6151
|
return Boolean(condition.precondition?.ownBalance) || Boolean(condition.postcondition?.ownBalance);
|
|
6108
6152
|
};
|
|
6153
|
+
const isTotalBalance = isTotalBalanceSchema(defaultConsistencyConfig);
|
|
6109
6154
|
conditions.forEach((condition, idx) => {
|
|
6155
|
+
const hasOwnBalanceCondition = isOwnBalanceCondition(condition);
|
|
6156
|
+
const hasTotalBalanceCondition = isTotalBalanceCondition(condition);
|
|
6157
|
+
if (isTotalBalance && hasOwnBalanceCondition) {
|
|
6158
|
+
errors.push({
|
|
6159
|
+
path: ["conditions", idx],
|
|
6160
|
+
message: `Schema uses totalBalance but entry type "${entryType}" has ownBalance conditions. Use totalBalance conditions instead.`
|
|
6161
|
+
});
|
|
6162
|
+
}
|
|
6163
|
+
if (!isTotalBalance && hasTotalBalanceCondition) {
|
|
6164
|
+
errors.push({
|
|
6165
|
+
path: ["conditions", idx],
|
|
6166
|
+
message: `Schema uses ownBalance but entry type "${entryType}" has totalBalance conditions. Use ownBalance conditions instead.`
|
|
6167
|
+
});
|
|
6168
|
+
}
|
|
6110
6169
|
const structuralPath = getStructuralPath(condition.account.path);
|
|
6111
6170
|
const fullyParameterizedMatchedAccount = accountPathToAccount.get(structuralPath);
|
|
6112
6171
|
const matchedAccount = fullyParameterizedMatchedAccount ? reparameterizeSchemaLedgerAccountInput({
|
|
@@ -6222,7 +6281,8 @@ var validateEntryConditions = (entryConditions, staticParameters, entryType, acc
|
|
|
6222
6281
|
});
|
|
6223
6282
|
}
|
|
6224
6283
|
if (condition?.[condType]?.totalBalance) {
|
|
6225
|
-
|
|
6284
|
+
const totalBalanceConsistencyMode = matchedAccount?.consistencyConfig?.totalBalanceUpdates ?? defaultConsistencyConfig?.totalBalanceUpdates;
|
|
6285
|
+
if (totalBalanceConsistencyMode !== "strong") {
|
|
6226
6286
|
errors.push({
|
|
6227
6287
|
path: ["conditions", idx, condType, "totalBalance"],
|
|
6228
6288
|
message: `You cannot supply a totalBalance condition on an account whose totalBalance consistency mode is not 'strong'.`
|
|
@@ -6503,7 +6563,7 @@ var validateEntryAndAccountStatus = ({
|
|
|
6503
6563
|
});
|
|
6504
6564
|
return errors;
|
|
6505
6565
|
};
|
|
6506
|
-
var validateEntry = (ledgerEntry, accountPathToAccount) => {
|
|
6566
|
+
var validateEntry = (ledgerEntry, accountPathToAccount, defaultConsistencyConfig) => {
|
|
6507
6567
|
const errors = validateNonEmptySafeString({
|
|
6508
6568
|
value: ledgerEntry.type,
|
|
6509
6569
|
path: ["type"],
|
|
@@ -6579,7 +6639,8 @@ var validateEntry = (ledgerEntry, accountPathToAccount) => {
|
|
|
6579
6639
|
ledgerEntry.conditions,
|
|
6580
6640
|
ledgerEntry.parameters,
|
|
6581
6641
|
ledgerEntry.type,
|
|
6582
|
-
accountPathToAccount
|
|
6642
|
+
accountPathToAccount,
|
|
6643
|
+
defaultConsistencyConfig
|
|
6583
6644
|
)
|
|
6584
6645
|
);
|
|
6585
6646
|
errors.push(
|
|
@@ -6642,7 +6703,11 @@ var transformAndValidateEntries = ({
|
|
|
6642
6703
|
const errors = [
|
|
6643
6704
|
...validationResultsForDuplicateTypes,
|
|
6644
6705
|
...filledIn.types.flatMap(
|
|
6645
|
-
(entry, idx) => validateEntry(
|
|
6706
|
+
(entry, idx) => validateEntry(
|
|
6707
|
+
entry,
|
|
6708
|
+
accountPathToAccount,
|
|
6709
|
+
validatedCoA.defaultConsistencyConfig
|
|
6710
|
+
).map(({ path, ...rest }) => ({
|
|
6646
6711
|
path: ["types", idx, ...path],
|
|
6647
6712
|
...rest
|
|
6648
6713
|
}))
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GenGraphQL
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-K5YR2U62.js";
|
|
4
4
|
import "../chunk-J5BKIOWK.js";
|
|
5
5
|
import "../chunk-ODU6I44Y.js";
|
|
6
6
|
import "../chunk-73ZTML2E.js";
|
|
7
|
-
import "../chunk-
|
|
7
|
+
import "../chunk-ELZ3W64C.js";
|
|
8
8
|
import "../chunk-KBN6UBJ5.js";
|
|
9
9
|
import "../chunk-5OE525LM.js";
|
|
10
10
|
import "../chunk-QBJBZ2W4.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VerifySchema
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-23FWWC5Q.js";
|
|
4
|
+
import "../chunk-2DNDGK5W.js";
|
|
5
5
|
import "../chunk-A4BSWX5D.js";
|
|
6
|
-
import "../chunk-
|
|
6
|
+
import "../chunk-ELZ3W64C.js";
|
|
7
7
|
import "../chunk-KBN6UBJ5.js";
|
|
8
8
|
import "../chunk-5OE525LM.js";
|
|
9
9
|
import "../chunk-QBJBZ2W4.js";
|
package/dist/commands.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMMANDS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5UOG5RJJ.js";
|
|
4
4
|
import "./chunk-WOZYXIWP.js";
|
|
5
5
|
import "./chunk-OOVV5G4Q.js";
|
|
6
6
|
import "./chunk-XUBNEHXD.js";
|
|
7
7
|
import "./chunk-QBJ5OH6K.js";
|
|
8
8
|
import "./chunk-5NLTSMZ4.js";
|
|
9
9
|
import "./chunk-S2H2GXXC.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-23FWWC5Q.js";
|
|
11
|
+
import "./chunk-2DNDGK5W.js";
|
|
12
12
|
import "./chunk-A4BSWX5D.js";
|
|
13
13
|
import "./chunk-KERHWPH2.js";
|
|
14
14
|
import "./chunk-NOGSS5QP.js";
|
|
@@ -28,11 +28,11 @@ import "./chunk-SCS6SLPR.js";
|
|
|
28
28
|
import "./chunk-QBK3LAGY.js";
|
|
29
29
|
import "./chunk-OJFPO3SF.js";
|
|
30
30
|
import "./chunk-7N2Q46HP.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-K5YR2U62.js";
|
|
32
32
|
import "./chunk-J5BKIOWK.js";
|
|
33
33
|
import "./chunk-ODU6I44Y.js";
|
|
34
34
|
import "./chunk-73ZTML2E.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-ELZ3W64C.js";
|
|
36
36
|
import "./chunk-KBN6UBJ5.js";
|
|
37
37
|
import "./chunk-5OE525LM.js";
|
|
38
38
|
import "./chunk-QBJBZ2W4.js";
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
COMMANDS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5UOG5RJJ.js";
|
|
4
4
|
import "./chunk-WOZYXIWP.js";
|
|
5
5
|
import "./chunk-OOVV5G4Q.js";
|
|
6
6
|
import "./chunk-XUBNEHXD.js";
|
|
7
7
|
import "./chunk-QBJ5OH6K.js";
|
|
8
8
|
import "./chunk-5NLTSMZ4.js";
|
|
9
9
|
import "./chunk-S2H2GXXC.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-23FWWC5Q.js";
|
|
11
|
+
import "./chunk-2DNDGK5W.js";
|
|
12
12
|
import "./chunk-A4BSWX5D.js";
|
|
13
13
|
import "./chunk-KERHWPH2.js";
|
|
14
14
|
import "./chunk-NOGSS5QP.js";
|
|
@@ -28,11 +28,11 @@ import "./chunk-SCS6SLPR.js";
|
|
|
28
28
|
import "./chunk-QBK3LAGY.js";
|
|
29
29
|
import "./chunk-OJFPO3SF.js";
|
|
30
30
|
import "./chunk-7N2Q46HP.js";
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-K5YR2U62.js";
|
|
32
32
|
import "./chunk-J5BKIOWK.js";
|
|
33
33
|
import "./chunk-ODU6I44Y.js";
|
|
34
34
|
import "./chunk-73ZTML2E.js";
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-ELZ3W64C.js";
|
|
36
36
|
import "./chunk-KBN6UBJ5.js";
|
|
37
37
|
import "./chunk-5OE525LM.js";
|
|
38
38
|
import "./chunk-QBJBZ2W4.js";
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
extractSchemaMetadata,
|
|
4
4
|
isJsonParseError,
|
|
5
5
|
validateSchemaStructure
|
|
6
|
-
} from "../chunk-
|
|
7
|
-
import "../chunk-
|
|
6
|
+
} from "../chunk-2DNDGK5W.js";
|
|
7
|
+
import "../chunk-ELZ3W64C.js";
|
|
8
8
|
import "../chunk-KBN6UBJ5.js";
|
|
9
9
|
import "../chunk-5OE525LM.js";
|
|
10
10
|
import "../chunk-QBJBZ2W4.js";
|
package/oclif.manifest.json
CHANGED