@fragment-dev/cli 2025.8.25 → 2025.8.26-2

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.
@@ -4614,11 +4614,38 @@ var BaseScene = z.object({
4614
4614
  name: z.string(),
4615
4615
  events: z.array(SceneEventSchema)
4616
4616
  });
4617
+ var FlowEdge = z.object({
4618
+ sourceStepId: z.string(),
4619
+ targetStepId: z.string()
4620
+ });
4621
+ var FlowEntry = z.object({
4622
+ type: z.string(),
4623
+ typeVersion: z.number().int().optional(),
4624
+ optional: z.boolean()
4625
+ });
4626
+ var FlowDuration = z.object({
4627
+ type: z.enum(["year", "month", "day", "hour", "minute", "second"]),
4628
+ value: z.number().int().positive()
4629
+ });
4630
+ var OutOfOrderEntryPolicy = z.enum(["allow", "warning", "block"]);
4631
+ var BaseSchemaLedgerFlowInput = z.object({
4632
+ id: z.string(),
4633
+ title: z.string(),
4634
+ initialStep: z.string(),
4635
+ steps: z.record(z.string(), FlowEntry),
4636
+ edges: z.array(FlowEdge),
4637
+ clearingAccountPath: z.string(),
4638
+ flowDuration: FlowDuration.optional(),
4639
+ version: z.number().int().positive(),
4640
+ archived: z.boolean(),
4641
+ OutOfOrderEntryPolicy
4642
+ });
4617
4643
  var BaseSchema = z.object({
4618
4644
  name: z.string().optional(),
4619
4645
  key: z.string(),
4620
4646
  chartOfAccounts: BaseChartOfAccounts,
4621
4647
  ledgerEntries: BaseLedgerEntries.optional(),
4648
+ flows: z.array(BaseSchemaLedgerFlowInput).optional(),
4622
4649
  scenes: z.array(BaseScene).optional(),
4623
4650
  consistencyConfig: z.optional(
4624
4651
  z.object({
@@ -4723,12 +4750,6 @@ var getEntryTypeVersion = ({
4723
4750
 
4724
4751
  // ../../libs/schema-validation/utils/transformers/account.ts
4725
4752
  init_cjs_shims();
4726
- var isLedgerAccountArchivalEnabled = () => {
4727
- if (process.env.NODE_ENV === "test") {
4728
- return process.env.LEDGER_ACCOUNT_ARCHIVAL_ENABLED === "true";
4729
- }
4730
- return true;
4731
- };
4732
4753
  var validateAccount = ({
4733
4754
  account,
4734
4755
  path,
@@ -4841,24 +4862,17 @@ var validateAccount = ({
4841
4862
  const accountConsistencyErrors = account.consistencyConfig ? validateAccountConsistencySettings(account.consistencyConfig) : { errors: [] };
4842
4863
  errors.push(...accountConsistencyErrors.errors);
4843
4864
  const status = getAccountStatus(account);
4844
- if (status !== "active" && !isLedgerAccountArchivalEnabled()) {
4845
- errors.push({
4846
- message: `Ledger Accounts cannot be ${status} (key: ${account.key}, name: ${account.name})`,
4847
- path: [...path, "status"]
4848
- });
4849
- } else {
4850
- const isArchived = status === "archived";
4851
- if (isArchived && (account.children ?? []).length) {
4852
- const areChildrenArchivedOrDisabled = account.children?.every(
4853
- (child) => ["archived", "disabled"].includes(getAccountStatus(child))
4854
- );
4855
- if (!areChildrenArchivedOrDisabled) {
4856
- errors.push({
4857
- code: `invalid_children_accounts_status`,
4858
- message: `Ledger Accounts with active children cannot be ${status} (key: ${account.key}, name: ${account.name})`,
4859
- path: [...path, `status`]
4860
- });
4861
- }
4865
+ const isArchived = status === "archived";
4866
+ if (isArchived && (account.children ?? []).length) {
4867
+ const areChildrenArchivedOrDisabled = account.children?.every(
4868
+ (child) => ["archived", "disabled"].includes(getAccountStatus(child))
4869
+ );
4870
+ if (!areChildrenArchivedOrDisabled) {
4871
+ errors.push({
4872
+ code: `invalid_children_accounts_status`,
4873
+ message: `Ledger Accounts with active children cannot be ${status} (key: ${account.key}, name: ${account.name})`,
4874
+ path: [...path, `status`]
4875
+ });
4862
4876
  }
4863
4877
  }
4864
4878
  const childrenValidationErrors = (account.children ?? []).flatMap(
@@ -5509,7 +5523,8 @@ var MAX_CONSISTENT_BALANCE_UPDATES = 30;
5509
5523
  init_cjs_shims();
5510
5524
  var MAX_ENTRY_LINES = 30;
5511
5525
 
5512
- // ../../libs/schema-validation/utils/transformers/entries.ts
5526
+ // ../../libs/schema-validation/utils/transformers/utilities.ts
5527
+ init_cjs_shims();
5513
5528
  var getStructuralPathToAccount = (validatedCoA) => {
5514
5529
  const accountPathToAccount = /* @__PURE__ */ new Map();
5515
5530
  const walk = (account, path) => {
@@ -5520,6 +5535,8 @@ var getStructuralPathToAccount = (validatedCoA) => {
5520
5535
  validatedCoA.accounts.forEach((account) => walk(account));
5521
5536
  return accountPathToAccount;
5522
5537
  };
5538
+
5539
+ // ../../libs/schema-validation/utils/transformers/entries.ts
5523
5540
  var validateNonEmptySafeString = ({
5524
5541
  value,
5525
5542
  path,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Schema,
3
3
  parseWithError
4
- } from "./chunk-SGAVAFEG.js";
4
+ } from "./chunk-DUKEJXL7.js";
5
5
  import {
6
6
  formatValidationErrors
7
7
  } from "./chunk-X7325FVE.js";
@@ -18,7 +18,7 @@ import {
18
18
  } from "./chunk-SIANE5YG.js";
19
19
  import {
20
20
  VerifySchema
21
- } from "./chunk-GXCCJRMP.js";
21
+ } from "./chunk-XQQBJ5B2.js";
22
22
  import {
23
23
  Workspace
24
24
  } from "./chunk-QBIZ7TKK.js";
@@ -66,7 +66,7 @@ import {
66
66
  } from "./chunk-EW6ZJJMC.js";
67
67
  import {
68
68
  GenGraphQL
69
- } from "./chunk-FL5TD5ZD.js";
69
+ } from "./chunk-MB6B2T3Q.js";
70
70
  import {
71
71
  init_cjs_shims
72
72
  } from "./chunk-7GH3YGSC.js";
@@ -3,11 +3,11 @@ import {
3
3
  generateQueryFiles,
4
4
  schemaToEntryDefinitions,
5
5
  validateOutputName
6
- } from "./chunk-64PMDSIU.js";
6
+ } from "./chunk-O4I4SRJH.js";
7
7
  import {
8
8
  Schema,
9
9
  parseWithError
10
- } from "./chunk-SGAVAFEG.js";
10
+ } from "./chunk-DUKEJXL7.js";
11
11
  import {
12
12
  formatValidationErrors,
13
13
  logValidationErrors
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  standardQueries
3
- } from "./chunk-JIRE2OKX.js";
3
+ } from "./chunk-ODU6I44Y.js";
4
4
  import {
5
5
  InvalidGraphQlError
6
6
  } from "./chunk-73ZTML2E.js";
@@ -963,6 +963,239 @@ query ListLedgerEntryGroupBalances(
963
963
  }
964
964
  }
965
965
 
966
+ query GetEntryDataMigrations(
967
+ $ledgerIk: SafeString!
968
+ $filter: LedgerEntryDataMigrationsFilterSet
969
+ $after: String
970
+ $before: String
971
+ $first: Int
972
+ $last: Int
973
+ ) {
974
+ ledger(ledger: { ik: $ledgerIk }) {
975
+ ledgerEntryDataMigrations(
976
+ first: $first
977
+ after: $after
978
+ before: $before
979
+ last: $last
980
+ filter: $filter
981
+ ) {
982
+ nodes {
983
+ entryType
984
+ typeVersion
985
+ status
986
+ currentMigration {
987
+ schemaVersion
988
+ status
989
+ }
990
+ ledgerEntries {
991
+ nodes {
992
+ id
993
+ type
994
+ posted
995
+ parameters
996
+ }
997
+ pageInfo {
998
+ hasNextPage
999
+ endCursor
1000
+ hasPreviousPage
1001
+ startCursor
1002
+ }
1003
+ }
1004
+ history {
1005
+ nodes {
1006
+ schemaVersion
1007
+ status
1008
+ }
1009
+ pageInfo {
1010
+ hasNextPage
1011
+ endCursor
1012
+ hasPreviousPage
1013
+ startCursor
1014
+ }
1015
+ }
1016
+ }
1017
+ pageInfo {
1018
+ hasNextPage
1019
+ endCursor
1020
+ hasPreviousPage
1021
+ startCursor
1022
+ }
1023
+ }
1024
+ }
1025
+ }
1026
+
1027
+ query GetEntriesToMigrateForLedgerEntryDataMigration(
1028
+ $ledgerIk: SafeString!
1029
+ $entryType: String!
1030
+ $typeVersion: String!
1031
+ $after: String
1032
+ $before: String
1033
+ $first: Int
1034
+ $last: Int
1035
+ ) {
1036
+ ledger(ledger: { ik: $ledgerIk }) {
1037
+ ledgerEntryDataMigrations(
1038
+ filter: {
1039
+ entryType: {
1040
+ equalTo: $entryType
1041
+ }
1042
+ typeVersion: {
1043
+ equalTo: $typeVersion
1044
+ }
1045
+ }
1046
+ ) {
1047
+ nodes {
1048
+ ledgerEntries(
1049
+ first: $first
1050
+ after: $after
1051
+ last: $last
1052
+ before: $before
1053
+ ) {
1054
+ nodes {
1055
+ id
1056
+ ik
1057
+ type
1058
+ typeVersion
1059
+ description
1060
+ posted
1061
+ created
1062
+ parameters
1063
+ lines {
1064
+ nodes {
1065
+ id
1066
+ amount
1067
+ account {
1068
+ path
1069
+ }
1070
+ }
1071
+ }
1072
+ }
1073
+ pageInfo {
1074
+ hasNextPage
1075
+ endCursor
1076
+ hasPreviousPage
1077
+ startCursor
1078
+ }
1079
+ }
1080
+ }
1081
+ }
1082
+ }
1083
+ }
1084
+
1085
+ query GetAccountDataMigrations(
1086
+ $ledgerIk: SafeString!
1087
+ $filter: LedgerAccountDataMigrationsFilterSet
1088
+ $after: String
1089
+ $before: String
1090
+ $first: Int
1091
+ $last: Int
1092
+ ) {
1093
+ ledger(ledger: { ik: $ledgerIk }) {
1094
+ ledgerAccountDataMigrations(
1095
+ first: $first
1096
+ after: $after
1097
+ before: $before
1098
+ last: $last
1099
+ filter: $filter
1100
+ ) {
1101
+ nodes {
1102
+ accountPath
1103
+ status
1104
+ currentMigration {
1105
+ schemaVersion
1106
+ status
1107
+ }
1108
+ ledgerEntries {
1109
+ nodes {
1110
+ id
1111
+ type
1112
+ posted
1113
+ parameters
1114
+ }
1115
+ pageInfo {
1116
+ hasNextPage
1117
+ endCursor
1118
+ hasPreviousPage
1119
+ startCursor
1120
+ }
1121
+ }
1122
+ history {
1123
+ nodes {
1124
+ schemaVersion
1125
+ status
1126
+ }
1127
+ pageInfo {
1128
+ hasNextPage
1129
+ endCursor
1130
+ hasPreviousPage
1131
+ startCursor
1132
+ }
1133
+ }
1134
+ }
1135
+ pageInfo {
1136
+ hasNextPage
1137
+ endCursor
1138
+ hasPreviousPage
1139
+ startCursor
1140
+ }
1141
+ }
1142
+ }
1143
+ }
1144
+
1145
+ query GetEntriesToMigrateForLedgerAccountDataMigration(
1146
+ $ledgerIk: SafeString!
1147
+ $accountPath: String!
1148
+ $after: String
1149
+ $before: String
1150
+ $first: Int
1151
+ $last: Int
1152
+ ) {
1153
+ ledger(ledger: { ik: $ledgerIk }) {
1154
+ ledgerAccountDataMigrations(
1155
+ filter: {
1156
+ accountPath: {
1157
+ equalTo: $accountPath
1158
+ }
1159
+ }
1160
+ ) {
1161
+ nodes {
1162
+ ledgerEntries(
1163
+ first: $first
1164
+ after: $after
1165
+ last: $last
1166
+ before: $before
1167
+ ) {
1168
+ nodes {
1169
+ id
1170
+ ik
1171
+ type
1172
+ typeVersion
1173
+ description
1174
+ posted
1175
+ created
1176
+ parameters
1177
+ lines {
1178
+ nodes {
1179
+ id
1180
+ amount
1181
+ account {
1182
+ path
1183
+ }
1184
+ }
1185
+ }
1186
+ }
1187
+ pageInfo {
1188
+ hasNextPage
1189
+ endCursor
1190
+ hasPreviousPage
1191
+ startCursor
1192
+ }
1193
+ }
1194
+ }
1195
+ }
1196
+ }
1197
+ }
1198
+
966
1199
  mutation CreateCustomCurrency(
967
1200
  $id: SafeString!,
968
1201
  $name: String!,
@@ -2,7 +2,7 @@ import {
2
2
  extractSchemaMetadata,
3
3
  isJsonParseError,
4
4
  validateSchemaStructure
5
- } from "./chunk-BTL5DOIZ.js";
5
+ } from "./chunk-F6WU5LCQ.js";
6
6
  import {
7
7
  DEFAULT_SCHEMA_PATH
8
8
  } from "./chunk-A4BSWX5D.js";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  GenGraphQL
3
- } from "../chunk-FL5TD5ZD.js";
4
- import "../chunk-64PMDSIU.js";
5
- import "../chunk-JIRE2OKX.js";
3
+ } from "../chunk-MB6B2T3Q.js";
4
+ import "../chunk-O4I4SRJH.js";
5
+ import "../chunk-ODU6I44Y.js";
6
6
  import "../chunk-73ZTML2E.js";
7
- import "../chunk-SGAVAFEG.js";
7
+ import "../chunk-DUKEJXL7.js";
8
8
  import "../chunk-X7325FVE.js";
9
9
  import "../chunk-IN5AT6GS.js";
10
10
  import "../chunk-UKL7LXEA.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  VerifySchema
3
- } from "../chunk-GXCCJRMP.js";
4
- import "../chunk-BTL5DOIZ.js";
3
+ } from "../chunk-XQQBJ5B2.js";
4
+ import "../chunk-F6WU5LCQ.js";
5
5
  import "../chunk-A4BSWX5D.js";
6
- import "../chunk-SGAVAFEG.js";
6
+ import "../chunk-DUKEJXL7.js";
7
7
  import "../chunk-X7325FVE.js";
8
8
  import "../chunk-IN5AT6GS.js";
9
9
  import "../chunk-UKL7LXEA.js";
package/dist/commands.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  COMMANDS
3
- } from "./chunk-L4QUOEMS.js";
3
+ } from "./chunk-JVYPMSNW.js";
4
4
  import "./chunk-S2W7I2OB.js";
5
5
  import "./chunk-CQC265GZ.js";
6
6
  import "./chunk-TRKCW3NY.js";
7
7
  import "./chunk-JVTCCEVF.js";
8
8
  import "./chunk-SXU2Z4NO.js";
9
9
  import "./chunk-SIANE5YG.js";
10
- import "./chunk-GXCCJRMP.js";
11
- import "./chunk-BTL5DOIZ.js";
10
+ import "./chunk-XQQBJ5B2.js";
11
+ import "./chunk-F6WU5LCQ.js";
12
12
  import "./chunk-A4BSWX5D.js";
13
13
  import "./chunk-QBIZ7TKK.js";
14
14
  import "./chunk-7VJJQFG3.js";
@@ -28,11 +28,11 @@ import "./chunk-GH45O4YP.js";
28
28
  import "./chunk-EW6ZJJMC.js";
29
29
  import "./chunk-PWYEYSX5.js";
30
30
  import "./chunk-UXTOXY2F.js";
31
- import "./chunk-FL5TD5ZD.js";
32
- import "./chunk-64PMDSIU.js";
33
- import "./chunk-JIRE2OKX.js";
31
+ import "./chunk-MB6B2T3Q.js";
32
+ import "./chunk-O4I4SRJH.js";
33
+ import "./chunk-ODU6I44Y.js";
34
34
  import "./chunk-73ZTML2E.js";
35
- import "./chunk-SGAVAFEG.js";
35
+ import "./chunk-DUKEJXL7.js";
36
36
  import "./chunk-X7325FVE.js";
37
37
  import "./chunk-IN5AT6GS.js";
38
38
  import "./chunk-UKL7LXEA.js";
package/dist/graphql.js CHANGED
@@ -8,8 +8,8 @@ import {
8
8
  isValidGraphQlName,
9
9
  schemaToEntryDefinitions,
10
10
  validateOutputName
11
- } from "./chunk-64PMDSIU.js";
12
- import "./chunk-JIRE2OKX.js";
11
+ } from "./chunk-O4I4SRJH.js";
12
+ import "./chunk-ODU6I44Y.js";
13
13
  import "./chunk-73ZTML2E.js";
14
14
  import "./chunk-IN5AT6GS.js";
15
15
  import "./chunk-UKL7LXEA.js";
package/dist/index.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import {
2
2
  COMMANDS
3
- } from "./chunk-L4QUOEMS.js";
3
+ } from "./chunk-JVYPMSNW.js";
4
4
  import "./chunk-S2W7I2OB.js";
5
5
  import "./chunk-CQC265GZ.js";
6
6
  import "./chunk-TRKCW3NY.js";
7
7
  import "./chunk-JVTCCEVF.js";
8
8
  import "./chunk-SXU2Z4NO.js";
9
9
  import "./chunk-SIANE5YG.js";
10
- import "./chunk-GXCCJRMP.js";
11
- import "./chunk-BTL5DOIZ.js";
10
+ import "./chunk-XQQBJ5B2.js";
11
+ import "./chunk-F6WU5LCQ.js";
12
12
  import "./chunk-A4BSWX5D.js";
13
13
  import "./chunk-QBIZ7TKK.js";
14
14
  import "./chunk-7VJJQFG3.js";
@@ -28,11 +28,11 @@ import "./chunk-GH45O4YP.js";
28
28
  import "./chunk-EW6ZJJMC.js";
29
29
  import "./chunk-PWYEYSX5.js";
30
30
  import "./chunk-UXTOXY2F.js";
31
- import "./chunk-FL5TD5ZD.js";
32
- import "./chunk-64PMDSIU.js";
33
- import "./chunk-JIRE2OKX.js";
31
+ import "./chunk-MB6B2T3Q.js";
32
+ import "./chunk-O4I4SRJH.js";
33
+ import "./chunk-ODU6I44Y.js";
34
34
  import "./chunk-73ZTML2E.js";
35
- import "./chunk-SGAVAFEG.js";
35
+ import "./chunk-DUKEJXL7.js";
36
36
  import "./chunk-X7325FVE.js";
37
37
  import "./chunk-IN5AT6GS.js";
38
38
  import "./chunk-UKL7LXEA.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  standardQueries
3
- } from "../chunk-JIRE2OKX.js";
3
+ } from "../chunk-ODU6I44Y.js";
4
4
  import "../chunk-7GH3YGSC.js";
5
5
  export {
6
6
  standardQueries
@@ -3,8 +3,8 @@ import {
3
3
  extractSchemaMetadata,
4
4
  isJsonParseError,
5
5
  validateSchemaStructure
6
- } from "../chunk-BTL5DOIZ.js";
7
- import "../chunk-SGAVAFEG.js";
6
+ } from "../chunk-F6WU5LCQ.js";
7
+ import "../chunk-DUKEJXL7.js";
8
8
  import "../chunk-X7325FVE.js";
9
9
  import "../chunk-IN5AT6GS.js";
10
10
  import "../chunk-UKL7LXEA.js";
@@ -973,5 +973,5 @@
973
973
  "help": "Generate GraphQL queries from your Schema for your SDK."
974
974
  }
975
975
  },
976
- "version": "2025.8.25"
976
+ "version": "2025.8.26-2"
977
977
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fragment-dev/cli",
3
- "version": "2025.8.25",
3
+ "version": "2025.8.26-2",
4
4
  "description": "FRAGMENT CLI",
5
5
  "author": "hello@fragment.dev",
6
6
  "bin": {