@fragment-dev/cli 2026.11.13-1 → 2026.11.13-3

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.
Files changed (87) hide show
  1. package/README.md +42 -0
  2. package/dist/{chunk-6H5VEWMH.js → chunk-2EMLJCCB.js} +1 -1
  3. package/dist/{chunk-F5CCJ6FF.js → chunk-2EZPMAOG.js} +1 -1
  4. package/dist/{chunk-V3LLFTBC.js → chunk-2YTWJRNP.js} +1 -1
  5. package/dist/{chunk-JTGVX5GX.js → chunk-3XCYMGE3.js} +48 -7
  6. package/dist/{chunk-D46OZVDM.js → chunk-4EBR67QU.js} +2 -2
  7. package/dist/{chunk-CTS34CX4.js → chunk-4GSTQ6O4.js} +2 -2
  8. package/dist/{chunk-6SLKFJ3R.js → chunk-5YXK5XSL.js} +2 -2
  9. package/dist/{chunk-6MYCJAJL.js → chunk-67N5LE4N.js} +2 -2
  10. package/dist/{chunk-3ZBETKSW.js → chunk-6T66IJCY.js} +5 -0
  11. package/dist/{chunk-ECRNMUZY.js → chunk-AEIRSM6M.js} +1 -1
  12. package/dist/{chunk-IGBICJSY.js → chunk-B7254H5E.js} +1 -1
  13. package/dist/{chunk-OFNXU6XT.js → chunk-BV3DJZN2.js} +1 -1
  14. package/dist/{chunk-CSUC4K6Z.js → chunk-CSP4CXUF.js} +3 -3
  15. package/dist/{chunk-R266LOJY.js → chunk-FI2U3AB2.js} +11 -3
  16. package/dist/{chunk-S6EUZBEH.js → chunk-FMDJEY4R.js} +1 -1
  17. package/dist/{chunk-LMAJOZGP.js → chunk-GM4XMO7R.js} +3 -3
  18. package/dist/{chunk-WABMYMTO.js → chunk-GR3GGYJY.js} +2 -2
  19. package/dist/{chunk-RJBVOPFD.js → chunk-H34FQN7O.js} +27 -27
  20. package/dist/{chunk-VETXOSAQ.js → chunk-HGJQFG33.js} +2 -2
  21. package/dist/{chunk-GJZISVDV.js → chunk-IWY22QAC.js} +2 -2
  22. package/dist/{chunk-ZYFQDN2K.js → chunk-MB3FR4WL.js} +28 -4
  23. package/dist/{chunk-PBOTSYWN.js → chunk-MHNH7UHD.js} +1 -1
  24. package/dist/chunk-NEW2NRYM.js +46 -0
  25. package/dist/{chunk-S4VUE6OA.js → chunk-NUXJ4UQR.js} +63 -5
  26. package/dist/{chunk-Q7Z3H3GL.js → chunk-P63ZOWQQ.js} +7 -4
  27. package/dist/{chunk-AY5LBONU.js → chunk-PYG6AFYU.js} +2 -2
  28. package/dist/{chunk-4LUAFIF5.js → chunk-RBNP4MID.js} +9 -5
  29. package/dist/{chunk-OPMMPSLX.js → chunk-RQFQK7WV.js} +2 -2
  30. package/dist/{chunk-5WAZAXOW.js → chunk-SACWMZFU.js} +2 -2
  31. package/dist/{chunk-TGEDLZAO.js → chunk-SBV53D6N.js} +3 -3
  32. package/dist/{chunk-HII7DWWZ.js → chunk-SL4IWVLO.js} +2 -2
  33. package/dist/{chunk-MZLYFF2A.js → chunk-TNZS3WJW.js} +2 -2
  34. package/dist/{chunk-EO6QNP4N.js → chunk-VEM4AZAI.js} +3 -3
  35. package/dist/{chunk-3UJFEFTD.js → chunk-VN2DVYGG.js} +2 -2
  36. package/dist/{chunk-H2RK3NKQ.js → chunk-VXYOFJKR.js} +2 -2
  37. package/dist/{chunk-DYLKAHKE.js → chunk-WAU6SFQ5.js} +7 -1
  38. package/dist/{chunk-35PT2VZ6.js → chunk-WQQ3DSJH.js} +2 -2
  39. package/dist/{chunk-77TG73N3.js → chunk-XJS4FFUC.js} +2 -2
  40. package/dist/{chunk-PWOJYW62.js → chunk-XTEERZ7T.js} +2 -2
  41. package/dist/{chunk-G3IDF3GN.js → chunk-YWITUQIX.js} +1 -1
  42. package/dist/{chunk-SLD5GAXB.js → chunk-Z5SFM3A5.js} +1 -1
  43. package/dist/{chunk-CI336LA7.js → chunk-ZPU5TX3B.js} +1 -1
  44. package/dist/{chunk-4FLUWOFO.js → chunk-ZQ2XTJ24.js} +2 -2
  45. package/dist/commands/add-ledger-entry.js +6 -5
  46. package/dist/commands/api-client/create.js +4 -3
  47. package/dist/commands/create-custom-link.js +6 -5
  48. package/dist/commands/create-ledger.js +6 -5
  49. package/dist/commands/delete-custom-txs.js +6 -5
  50. package/dist/commands/delete-ledger.js +6 -5
  51. package/dist/commands/delete-schema.js +6 -5
  52. package/dist/commands/gen-graphql.js +7 -6
  53. package/dist/commands/get-schema.js +7 -6
  54. package/dist/commands/init.js +4 -3
  55. package/dist/commands/login.js +5 -4
  56. package/dist/commands/migrate-ledger-entry.js +6 -5
  57. package/dist/commands/print-schema.js +8 -7
  58. package/dist/commands/query/ledgerAccounts.js +6 -5
  59. package/dist/commands/query/ledgers.js +6 -5
  60. package/dist/commands/query/schema.js +6 -5
  61. package/dist/commands/query/schemas.js +6 -5
  62. package/dist/commands/reverse-ledger-entry.js +6 -5
  63. package/dist/commands/simulate-scenario.js +8 -7
  64. package/dist/commands/start.js +4 -3
  65. package/dist/commands/store-schema.js +6 -5
  66. package/dist/commands/token.js +6 -5
  67. package/dist/commands/update-ledger-account.js +6 -5
  68. package/dist/commands/update.js +5 -4
  69. package/dist/commands/verify-schema.js +8 -7
  70. package/dist/commands/version.js +4 -3
  71. package/dist/commands/workspace.js +6 -5
  72. package/dist/commands.js +43 -42
  73. package/dist/graphql.js +2 -2
  74. package/dist/index.js +43 -42
  75. package/dist/lib/authenticatedCommand.js +5 -4
  76. package/dist/lib/baseCommand.js +3 -2
  77. package/dist/lib/curl.js +13 -0
  78. package/dist/lib/sdk.js +1 -1
  79. package/dist/lib/version.js +2 -1
  80. package/dist/utils/formatChartOfAccounts.js +3 -3
  81. package/dist/utils/formatEntries.js +3 -3
  82. package/dist/utils/formatScenarioAccountBalances.js +3 -3
  83. package/dist/utils/formatScenarioBalances.js +4 -4
  84. package/dist/utils/schemaBackCompat.js +4 -4
  85. package/dist/utils/schemaValidation.js +3 -3
  86. package/oclif.manifest.json +1 -1
  87. package/package.json +1 -1
package/README.md CHANGED
@@ -2,6 +2,48 @@
2
2
 
3
3
  [Fragment](https://fragment.dev) is the Ledger API for engineers that move money. Stop wrangling payment tables, debugging balance errors and hacking together data pipelines. Start shipping the features that make a difference.
4
4
 
5
+ ## Installation
6
+
7
+ Install on macOS (Apple Silicon or Intel) or Linux x64 with glibc.
8
+ Requires [Node.js 18 or later](https://nodejs.org/en/download) on `PATH`:
9
+
10
+ ```bash
11
+ curl -fsSL https://fragment.dev/install.sh | sh
12
+ ```
13
+
14
+ The installer checks Node before downloading the JavaScript-only CLI archive.
15
+ If Node is missing or unsupported, it exits with installation guidance.
16
+ It requires no npm, Homebrew, or sudo.
17
+ The launcher uses the Node executable selected during installation.
18
+ Rerun the installer if you move or remove that Node executable.
19
+ It installs into `~/.local/share/fragment` and creates `~/.local/bin/fragment`.
20
+ Use the printed executable path immediately if that directory is absent from `PATH`.
21
+ Add the directory to your shell profile for future sessions.
22
+ Existing credentials and installations in other locations remain available.
23
+ The installer refuses to overwrite an existing executable it does not manage.
24
+
25
+ Alternatively, install with npm:
26
+
27
+ ```bash
28
+ npm install -g @fragment-dev/cli
29
+ ```
30
+
31
+ Or install with [Homebrew](https://brew.sh/):
32
+
33
+ ```bash
34
+ brew tap fragment-dev/tap
35
+ brew install fragment-dev/tap/fragment-cli
36
+ ```
37
+
38
+ Run `fragment update` to upgrade. To pin a curl installation or roll back:
39
+
40
+ ```bash
41
+ curl -fsSL https://fragment.dev/install.sh | sh -s -- --version <version>
42
+ ```
43
+
44
+ Use `--install-dir <absolute-path>` and `--bin-dir <absolute-path>` to choose installation locations.
45
+ Older releases remain in the installation directory so running commands can finish during updates.
46
+
5
47
  # Commands
6
48
 
7
49
  ## Browser login for new users
@@ -13,7 +13,7 @@ import {
13
13
  require_syntax,
14
14
  require_type,
15
15
  require_uri
16
- } from "./chunk-ZYFQDN2K.js";
16
+ } from "./chunk-MB3FR4WL.js";
17
17
  import {
18
18
  require_color_convert,
19
19
  require_source
@@ -10,7 +10,7 @@ import {
10
10
  parameterizeSchemaLedgerEntryConditionInput,
11
11
  parameterizeSchemaLedgerLineInput,
12
12
  reparameterizeSchemaLedgerAccountInput
13
- } from "./chunk-S4VUE6OA.js";
13
+ } from "./chunk-NUXJ4UQR.js";
14
14
  import {
15
15
  getStructuralPath
16
16
  } from "./chunk-2QGAXOCF.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-OPMMPSLX.js";
3
+ } from "./chunk-RQFQK7WV.js";
4
4
  import {
5
5
  require_source
6
6
  } from "./chunk-QDAKBUNO.js";
@@ -269,11 +269,31 @@ var PaymentAccountingEventKey = {
269
269
  /** A refund of the settled payment is initiated. */
270
270
  refund_initiated: "refund_initiated",
271
271
  /** An initiated refund failed, so the refunded funds return. */
272
- refund_failed: "refund_failed"
272
+ refund_failed: "refund_failed",
273
+ /** A chargeback opened, withdrawing the disputed amount and the dispute fee. */
274
+ chargeback_settled: "chargeback_settled",
275
+ /** The fee for contesting a chargeback was collected. */
276
+ chargeback_countered: "chargeback_countered",
277
+ /** Funds withdrawn for a chargeback were returned. */
278
+ chargeback_reversed: "chargeback_reversed"
273
279
  };
274
280
  var PaymentAccountingEventKeySchema = z.nativeEnum(
275
281
  PaymentAccountingEventKey
276
282
  );
283
+ var DISPUTE_PAYMENT_ACCOUNTING_EVENT_KEYS = [
284
+ PaymentAccountingEventKey.chargeback_settled,
285
+ PaymentAccountingEventKey.chargeback_countered,
286
+ PaymentAccountingEventKey.chargeback_reversed
287
+ ];
288
+ var SCENE_PAYMENT_ACCOUNTING_EVENT_KEYS = [
289
+ PaymentAccountingEventKey.initiated,
290
+ PaymentAccountingEventKey.settled,
291
+ PaymentAccountingEventKey.refund_initiated,
292
+ PaymentAccountingEventKey.refund_failed
293
+ ];
294
+ var ScenePaymentAccountingEventKeySchema = z.enum(
295
+ SCENE_PAYMENT_ACCOUNTING_EVENT_KEYS
296
+ );
277
297
  var PaymentTypeDirection = {
278
298
  payin: "payin",
279
299
  payout: "payout"
@@ -283,20 +303,36 @@ var SystemLineKind = {
283
303
  payment_settlement_line: "payment_settlement_line",
284
304
  payment_fee_line: "payment_fee_line",
285
305
  payment_refund_line: "payment_refund_line",
286
- payment_refund_reversal_line: "payment_refund_reversal_line"
306
+ payment_refund_reversal_line: "payment_refund_reversal_line",
307
+ payment_chargeback_line: "payment_chargeback_line",
308
+ /** The dispute fee charged when a chargeback opens. It is never returned. */
309
+ payment_chargeback_fee_line: "payment_chargeback_fee_line",
310
+ payment_chargeback_countered_fee_line: "payment_chargeback_countered_fee_line",
311
+ payment_chargeback_reversal_line: "payment_chargeback_reversal_line",
312
+ payment_chargeback_countered_fee_reversal_line: "payment_chargeback_countered_fee_reversal_line"
287
313
  };
288
314
  var SystemLineKindSchema = z.nativeEnum(SystemLineKind);
289
315
  var SystemLineParameterName = {
290
316
  payment_settlement_line: "settled_amount",
291
317
  payment_fee_line: "fragment_fee_amount",
292
318
  payment_refund_line: "refund_amount",
293
- payment_refund_reversal_line: "refund_amount"
319
+ payment_refund_reversal_line: "refund_amount",
320
+ payment_chargeback_line: "chargeback_amount",
321
+ payment_chargeback_fee_line: "chargeback_fee_amount",
322
+ payment_chargeback_countered_fee_line: "chargeback_countered_fee_amount",
323
+ payment_chargeback_reversal_line: "chargeback_amount",
324
+ payment_chargeback_countered_fee_reversal_line: "chargeback_countered_fee_amount"
294
325
  };
295
326
  var SYSTEM_LINE_AMOUNT = {
296
327
  [SystemLineKind.payment_settlement_line]: `{{${SystemLineParameterName.payment_settlement_line}}}`,
297
328
  [SystemLineKind.payment_fee_line]: `-{{${SystemLineParameterName.payment_fee_line}}}`,
298
329
  [SystemLineKind.payment_refund_line]: `-{{${SystemLineParameterName.payment_refund_line}}}`,
299
- [SystemLineKind.payment_refund_reversal_line]: `{{${SystemLineParameterName.payment_refund_reversal_line}}}`
330
+ [SystemLineKind.payment_refund_reversal_line]: `{{${SystemLineParameterName.payment_refund_reversal_line}}}`,
331
+ [SystemLineKind.payment_chargeback_line]: `-{{${SystemLineParameterName.payment_chargeback_line}}}`,
332
+ [SystemLineKind.payment_chargeback_fee_line]: `-{{${SystemLineParameterName.payment_chargeback_fee_line}}}`,
333
+ [SystemLineKind.payment_chargeback_countered_fee_line]: `-{{${SystemLineParameterName.payment_chargeback_countered_fee_line}}}`,
334
+ [SystemLineKind.payment_chargeback_reversal_line]: `{{${SystemLineParameterName.payment_chargeback_reversal_line}}}`,
335
+ [SystemLineKind.payment_chargeback_countered_fee_reversal_line]: `{{${SystemLineParameterName.payment_chargeback_countered_fee_reversal_line}}}`
300
336
  };
301
337
  var SYSTEM_PARAMETER_NAMES = new Set(
302
338
  Object.values(SystemLineParameterName)
@@ -328,7 +364,10 @@ var BaseSchemaPaymentTypeInput = z.object({
328
364
  initiated: BaseSchemaPaymentEntryInput.optional(),
329
365
  settled: BaseSchemaPaymentEntryInput,
330
366
  refund_initiated: BaseSchemaPaymentEntryInput.optional(),
331
- refund_failed: BaseSchemaPaymentEntryInput.optional()
367
+ refund_failed: BaseSchemaPaymentEntryInput.optional(),
368
+ chargeback_settled: BaseSchemaPaymentEntryInput.optional(),
369
+ chargeback_countered: BaseSchemaPaymentEntryInput.optional(),
370
+ chargeback_reversed: BaseSchemaPaymentEntryInput.optional()
332
371
  })
333
372
  });
334
373
  var BaseSchemaPayments = z.object({
@@ -353,7 +392,7 @@ var ScenePaymentEventSchema = z.object({
353
392
  eventType: z.literal("payment"),
354
393
  payment: z.object({
355
394
  ik: z.string(),
356
- event: PaymentAccountingEventKeySchema
395
+ event: ScenePaymentAccountingEventKeySchema
357
396
  })
358
397
  });
359
398
  var SceneEventSchema = z.discriminatedUnion("eventType", [
@@ -411,7 +450,9 @@ export {
411
450
  BaseChartOfAccounts,
412
451
  PostLinesAsSchema,
413
452
  PaymentAccountingEventKey,
414
- PaymentAccountingEventKeySchema,
453
+ DISPUTE_PAYMENT_ACCOUNTING_EVENT_KEYS,
454
+ SCENE_PAYMENT_ACCOUNTING_EVENT_KEYS,
455
+ ScenePaymentAccountingEventKeySchema,
415
456
  PaymentTypeDirection,
416
457
  PaymentTypeDirectionSchema,
417
458
  SystemLineKind,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-OPMMPSLX.js";
3
+ } from "./chunk-RQFQK7WV.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-ZYFQDN2K.js";
6
+ } from "./chunk-MB3FR4WL.js";
7
7
  import {
8
8
  require_source
9
9
  } from "./chunk-QDAKBUNO.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-OPMMPSLX.js";
3
+ } from "./chunk-RQFQK7WV.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-ZYFQDN2K.js";
6
+ } from "./chunk-MB3FR4WL.js";
7
7
  import {
8
8
  __toESM,
9
9
  init_cjs_shims
@@ -7,10 +7,10 @@ import {
7
7
  } from "./chunk-T3RKAA7V.js";
8
8
  import {
9
9
  ChartOfAccounts
10
- } from "./chunk-S4VUE6OA.js";
10
+ } from "./chunk-NUXJ4UQR.js";
11
11
  import {
12
12
  BaseSchema
13
- } from "./chunk-JTGVX5GX.js";
13
+ } from "./chunk-3XCYMGE3.js";
14
14
  import {
15
15
  init_cjs_shims
16
16
  } from "./chunk-7GH3YGSC.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-OPMMPSLX.js";
3
+ } from "./chunk-RQFQK7WV.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-ZYFQDN2K.js";
6
+ } from "./chunk-MB3FR4WL.js";
7
7
  import {
8
8
  getParsedSchema
9
9
  } from "./chunk-QZNZYG2G.js";
@@ -1087,6 +1087,11 @@ var SchemaPaymentTypeStatus = /* @__PURE__ */ ((SchemaPaymentTypeStatus2) => {
1087
1087
  return SchemaPaymentTypeStatus2;
1088
1088
  })(SchemaPaymentTypeStatus || {});
1089
1089
  var SchemaSystemLineKind = /* @__PURE__ */ ((SchemaSystemLineKind2) => {
1090
+ SchemaSystemLineKind2["PaymentChargebackCounteredFeeLine"] = "payment_chargeback_countered_fee_line";
1091
+ SchemaSystemLineKind2["PaymentChargebackCounteredFeeReversalLine"] = "payment_chargeback_countered_fee_reversal_line";
1092
+ SchemaSystemLineKind2["PaymentChargebackFeeLine"] = "payment_chargeback_fee_line";
1093
+ SchemaSystemLineKind2["PaymentChargebackLine"] = "payment_chargeback_line";
1094
+ SchemaSystemLineKind2["PaymentChargebackReversalLine"] = "payment_chargeback_reversal_line";
1090
1095
  SchemaSystemLineKind2["PaymentFeeLine"] = "payment_fee_line";
1091
1096
  SchemaSystemLineKind2["PaymentRefundLine"] = "payment_refund_line";
1092
1097
  SchemaSystemLineKind2["PaymentRefundReversalLine"] = "payment_refund_reversal_line";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-OPMMPSLX.js";
3
+ } from "./chunk-RQFQK7WV.js";
4
4
  import {
5
5
  init_cjs_shims
6
6
  } from "./chunk-7GH3YGSC.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-OPMMPSLX.js";
3
+ } from "./chunk-RQFQK7WV.js";
4
4
  import {
5
5
  init_cjs_shims
6
6
  } from "./chunk-7GH3YGSC.js";
@@ -4,7 +4,7 @@ import {
4
4
  import {
5
5
  Schema,
6
6
  parseWithError
7
- } from "./chunk-S4VUE6OA.js";
7
+ } from "./chunk-NUXJ4UQR.js";
8
8
  import {
9
9
  BadRequestError
10
10
  } from "./chunk-IJNU7K35.js";
@@ -8,18 +8,18 @@ import {
8
8
  schemaToEntryDefinitions,
9
9
  schemaToPaymentDefinitions,
10
10
  validateOutputName
11
- } from "./chunk-R266LOJY.js";
11
+ } from "./chunk-FI2U3AB2.js";
12
12
  import {
13
13
  Schema,
14
14
  parseWithError
15
- } from "./chunk-S4VUE6OA.js";
15
+ } from "./chunk-NUXJ4UQR.js";
16
16
  import {
17
17
  BadRequestError
18
18
  } from "./chunk-IJNU7K35.js";
19
19
  import {
20
20
  FragmentCommand,
21
21
  require_lib
22
- } from "./chunk-ZYFQDN2K.js";
22
+ } from "./chunk-MB3FR4WL.js";
23
23
  import {
24
24
  getParsedSchema
25
25
  } from "./chunk-QZNZYG2G.js";
@@ -5,9 +5,10 @@ import {
5
5
  InvalidGraphQlError
6
6
  } from "./chunk-UQALZFPK.js";
7
7
  import {
8
+ DISPUTE_PAYMENT_ACCOUNTING_EVENT_KEYS,
8
9
  SYSTEM_PARAMETER_NAMES,
9
10
  getSchemaObjectParameters
10
- } from "./chunk-JTGVX5GX.js";
11
+ } from "./chunk-3XCYMGE3.js";
11
12
  import {
12
13
  getStructuralSubpaths
13
14
  } from "./chunk-2QGAXOCF.js";
@@ -39,8 +40,15 @@ var getCallerParameters = (schemaObject) => new Set(
39
40
  );
40
41
  var getRequiredPaymentParameters = ({
41
42
  payment,
42
- accounting: { initiated, settled }
43
- }) => getCallerParameters({ payment, initiated, settled });
43
+ accounting
44
+ }) => getCallerParameters({
45
+ payment,
46
+ initiated: accounting.initiated,
47
+ settled: accounting.settled,
48
+ disputeEntries: DISPUTE_PAYMENT_ACCOUNTING_EVENT_KEYS.map(
49
+ (event) => accounting[event]
50
+ )
51
+ });
44
52
 
45
53
  // src/graphql.ts
46
54
  var getAccountParams = (accountPath, schema) => {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  FragmentCommand,
3
3
  require_lib
4
- } from "./chunk-ZYFQDN2K.js";
4
+ } from "./chunk-MB3FR4WL.js";
5
5
  import {
6
6
  require_source
7
7
  } from "./chunk-QDAKBUNO.js";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  formatChartOfAccounts
3
- } from "./chunk-MZLYFF2A.js";
3
+ } from "./chunk-TNZS3WJW.js";
4
4
  import {
5
5
  formatEntries
6
- } from "./chunk-6SLKFJ3R.js";
6
+ } from "./chunk-5YXK5XSL.js";
7
7
  import {
8
8
  DEFAULT_SCHEMA_PATH
9
9
  } from "./chunk-A4BSWX5D.js";
10
10
  import {
11
11
  FragmentCommand,
12
12
  require_lib
13
- } from "./chunk-ZYFQDN2K.js";
13
+ } from "./chunk-MB3FR4WL.js";
14
14
  import {
15
15
  getParsedSchemaString,
16
16
  parseJSON
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  inquirer_default
3
- } from "./chunk-6H5VEWMH.js";
3
+ } from "./chunk-2EMLJCCB.js";
4
4
  import {
5
5
  FragmentCommand,
6
6
  require_lib
7
- } from "./chunk-ZYFQDN2K.js";
7
+ } from "./chunk-MB3FR4WL.js";
8
8
  import {
9
9
  require_source
10
10
  } from "./chunk-QDAKBUNO.js";
@@ -1,84 +1,84 @@
1
1
  import {
2
2
  Update
3
- } from "./chunk-WABMYMTO.js";
3
+ } from "./chunk-GR3GGYJY.js";
4
4
  import {
5
5
  VerifySchema
6
- } from "./chunk-TGEDLZAO.js";
6
+ } from "./chunk-SBV53D6N.js";
7
7
  import {
8
8
  Version
9
- } from "./chunk-CI336LA7.js";
9
+ } from "./chunk-ZPU5TX3B.js";
10
10
  import {
11
11
  Workspace
12
- } from "./chunk-IGBICJSY.js";
12
+ } from "./chunk-B7254H5E.js";
13
13
  import {
14
14
  GetSchema as GetSchema2
15
- } from "./chunk-77TG73N3.js";
15
+ } from "./chunk-XJS4FFUC.js";
16
16
  import {
17
17
  QuerySchemas
18
- } from "./chunk-PBOTSYWN.js";
18
+ } from "./chunk-MHNH7UHD.js";
19
19
  import {
20
20
  ReverseLedgerEntry
21
- } from "./chunk-VETXOSAQ.js";
21
+ } from "./chunk-HGJQFG33.js";
22
22
  import {
23
23
  SimulateScenario
24
- } from "./chunk-4FLUWOFO.js";
24
+ } from "./chunk-ZQ2XTJ24.js";
25
25
  import {
26
26
  Start
27
- } from "./chunk-S6EUZBEH.js";
27
+ } from "./chunk-FMDJEY4R.js";
28
28
  import {
29
29
  StoreSchema
30
- } from "./chunk-6MYCJAJL.js";
30
+ } from "./chunk-67N5LE4N.js";
31
31
  import {
32
32
  Token
33
- } from "./chunk-V3LLFTBC.js";
33
+ } from "./chunk-2YTWJRNP.js";
34
34
  import {
35
35
  UpdateLedgerAccount
36
- } from "./chunk-35PT2VZ6.js";
36
+ } from "./chunk-WQQ3DSJH.js";
37
37
  import {
38
38
  GenGraphQL
39
- } from "./chunk-CSUC4K6Z.js";
39
+ } from "./chunk-CSP4CXUF.js";
40
40
  import {
41
41
  GetSchema
42
- } from "./chunk-EO6QNP4N.js";
42
+ } from "./chunk-VEM4AZAI.js";
43
43
  import {
44
44
  Init
45
- } from "./chunk-SLD5GAXB.js";
45
+ } from "./chunk-Z5SFM3A5.js";
46
46
  import {
47
47
  Login
48
- } from "./chunk-H2RK3NKQ.js";
48
+ } from "./chunk-VXYOFJKR.js";
49
49
  import {
50
50
  MigrateLedgerEntry
51
- } from "./chunk-D46OZVDM.js";
51
+ } from "./chunk-4EBR67QU.js";
52
52
  import {
53
53
  PrintSchema
54
- } from "./chunk-LMAJOZGP.js";
54
+ } from "./chunk-GM4XMO7R.js";
55
55
  import {
56
56
  QueryLedgerAccounts
57
- } from "./chunk-CTS34CX4.js";
57
+ } from "./chunk-4GSTQ6O4.js";
58
58
  import {
59
59
  QueryLedgers
60
- } from "./chunk-ECRNMUZY.js";
60
+ } from "./chunk-AEIRSM6M.js";
61
61
  import {
62
62
  AddLedgerEntry
63
- } from "./chunk-5WAZAXOW.js";
63
+ } from "./chunk-SACWMZFU.js";
64
64
  import {
65
65
  ApiClientCreate
66
- } from "./chunk-G3IDF3GN.js";
66
+ } from "./chunk-YWITUQIX.js";
67
67
  import {
68
68
  CreateCustomLink
69
- } from "./chunk-3UJFEFTD.js";
69
+ } from "./chunk-VN2DVYGG.js";
70
70
  import {
71
71
  CreateLedger
72
- } from "./chunk-PWOJYW62.js";
72
+ } from "./chunk-XTEERZ7T.js";
73
73
  import {
74
74
  DeleteCustomTxs
75
- } from "./chunk-AY5LBONU.js";
75
+ } from "./chunk-PYG6AFYU.js";
76
76
  import {
77
77
  DeleteLedger
78
- } from "./chunk-HII7DWWZ.js";
78
+ } from "./chunk-SL4IWVLO.js";
79
79
  import {
80
80
  DeleteSchema
81
- } from "./chunk-GJZISVDV.js";
81
+ } from "./chunk-IWY22QAC.js";
82
82
  import {
83
83
  init_cjs_shims
84
84
  } from "./chunk-7GH3YGSC.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-OPMMPSLX.js";
3
+ } from "./chunk-RQFQK7WV.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-ZYFQDN2K.js";
6
+ } from "./chunk-MB3FR4WL.js";
7
7
  import {
8
8
  require_source
9
9
  } from "./chunk-QDAKBUNO.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-OPMMPSLX.js";
3
+ } from "./chunk-RQFQK7WV.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-ZYFQDN2K.js";
6
+ } from "./chunk-MB3FR4WL.js";
7
7
  import {
8
8
  require_source
9
9
  } from "./chunk-QDAKBUNO.js";
@@ -5,13 +5,17 @@ import {
5
5
  import {
6
6
  parseJSON
7
7
  } from "./chunk-QZNZYG2G.js";
8
- import {
9
- require_graphql
10
- } from "./chunk-QF5EN33L.js";
11
8
  import {
12
9
  detectInstallationMethodFromPath,
13
10
  getFragmentCliVersion
14
- } from "./chunk-DYLKAHKE.js";
11
+ } from "./chunk-WAU6SFQ5.js";
12
+ import {
13
+ getCurlUpdateArgs,
14
+ hasCurlInstallation
15
+ } from "./chunk-NEW2NRYM.js";
16
+ import {
17
+ require_graphql
18
+ } from "./chunk-QF5EN33L.js";
15
19
  import {
16
20
  require_color_convert,
17
21
  require_has_flag,
@@ -50033,6 +50037,8 @@ var FragmentCommand = class extends import_core.Command {
50033
50037
  }
50034
50038
  }
50035
50039
  detectInstallationMethod() {
50040
+ if (hasCurlInstallation(this.config.root))
50041
+ return "curl";
50036
50042
  if (process.env.FRAGMENT_CLI_TEST_ENV === "true") {
50037
50043
  return "npm";
50038
50044
  }
@@ -50143,6 +50149,24 @@ var FragmentCommand = class extends import_core.Command {
50143
50149
  }) {
50144
50150
  const method = installationMethod ?? this.detectInstallationMethod();
50145
50151
  switch (method) {
50152
+ case "curl": {
50153
+ const version2 = await getFragmentCliVersion(this.isBeta, method);
50154
+ const args = getCurlUpdateArgs({
50155
+ root: this.config.root,
50156
+ version: version2,
50157
+ isBeta: this.isBeta
50158
+ });
50159
+ this.log(`Updating Fragment installed with curl to ${version2}...`);
50160
+ if (!dryRun) {
50161
+ const result = (0, import_cross_spawn.sync)("sh", args, {
50162
+ stdio: "inherit",
50163
+ env: { ...process.env, FRAGMENT_NODE_EXECUTABLE: process.execPath }
50164
+ });
50165
+ if (result.status !== 0)
50166
+ this.exit(1);
50167
+ }
50168
+ break;
50169
+ }
50146
50170
  case "npm":
50147
50171
  this.log("Detected npm installation. Updating via npm...");
50148
50172
  await this.updateViaNpm({ dryRun });
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-OPMMPSLX.js";
3
+ } from "./chunk-RQFQK7WV.js";
4
4
  import {
5
5
  init_cjs_shims
6
6
  } from "./chunk-7GH3YGSC.js";
@@ -0,0 +1,46 @@
1
+ import {
2
+ init_cjs_shims
3
+ } from "./chunk-7GH3YGSC.js";
4
+
5
+ // src/lib/curl.ts
6
+ init_cjs_shims();
7
+ import assert from "node:assert";
8
+ import { existsSync, readFileSync } from "node:fs";
9
+ import { isAbsolute, join } from "node:path";
10
+ var getCurlReleaseUrl = (isBeta) => `https://${isBeta ? "dev" : "prod"}-fragment-cli-bucket.s3.amazonaws.com/curl`;
11
+ var hasCurlInstallation = (root) => existsSync(join(root, ".fragment-curl"));
12
+ var getCurlUpdateArgs = (args) => {
13
+ const [installDirectory, binDirectory] = readFileSync(
14
+ join(args.root, ".fragment-curl"),
15
+ "utf8"
16
+ ).split("\n");
17
+ assert(
18
+ installDirectory && binDirectory && isAbsolute(installDirectory) && isAbsolute(binDirectory),
19
+ "Invalid curl installation marker; reinstall using https://fragment.dev/install.sh"
20
+ );
21
+ return [
22
+ join(args.root, "install.sh"),
23
+ "--version",
24
+ args.version,
25
+ "--install-dir",
26
+ installDirectory,
27
+ "--bin-dir",
28
+ binDirectory,
29
+ "--base-url",
30
+ getCurlReleaseUrl(args.isBeta)
31
+ ];
32
+ };
33
+ var getCurlCliVersion = async (isBeta) => {
34
+ const response = await fetch(`${getCurlReleaseUrl(isBeta)}/latest`);
35
+ assert(response.ok, `Curl release check failed: HTTP ${response.status}`);
36
+ const version = (await response.text()).trim();
37
+ assert(/^\d[\da-zA-Z.+-]*$/.test(version), "Invalid curl release version");
38
+ return version;
39
+ };
40
+
41
+ export {
42
+ getCurlReleaseUrl,
43
+ hasCurlInstallation,
44
+ getCurlUpdateArgs,
45
+ getCurlCliVersion
46
+ };