@fragment-dev/cli 2026.10.22-6 → 2026.10.22-9

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 (83) hide show
  1. package/README.md +10 -14
  2. package/dist/{chunk-ND7QZR7R.js → chunk-5GP3GUTJ.js} +2 -2
  3. package/dist/{chunk-YJGBEX5B.js → chunk-5J7GO2LD.js} +2 -2
  4. package/dist/{chunk-WWLP4HPC.js → chunk-5MNVNPOL.js} +2 -2
  5. package/dist/{chunk-AO62X3BO.js → chunk-5OKT5EMG.js} +5 -3
  6. package/dist/{chunk-ZA2L64JN.js → chunk-67DUFD6P.js} +1 -1
  7. package/dist/{chunk-PIQ6WUMK.js → chunk-AGSUHPTK.js} +4 -4
  8. package/dist/{chunk-E5P6XCQL.js → chunk-B23ACFAK.js} +2 -2
  9. package/dist/{chunk-5SZAIV6H.js → chunk-DF3U6ZLT.js} +1 -1
  10. package/dist/{chunk-OXHLKGQ5.js → chunk-EA4PQ3Q6.js} +15 -17
  11. package/dist/{chunk-TXZYFCBO.js → chunk-FGNF2UZU.js} +1 -1
  12. package/dist/{chunk-3FYCTUQG.js → chunk-FJHK32F7.js} +2 -2
  13. package/dist/{chunk-CSTRC57Q.js → chunk-GMESN77F.js} +4 -4
  14. package/dist/{chunk-2ZOSYPMG.js → chunk-GP4YLGE7.js} +1 -1
  15. package/dist/{chunk-MSTL4SGM.js → chunk-GSRBM4QF.js} +2 -2
  16. package/dist/{chunk-RXZ4S2ZQ.js → chunk-H55MKRZS.js} +25 -25
  17. package/dist/{chunk-5ZNQLL3D.js → chunk-HOGDV2YN.js} +3 -3
  18. package/dist/{chunk-7UQY3FIG.js → chunk-IDAIGTVO.js} +1 -1
  19. package/dist/{chunk-KEPMDY7V.js → chunk-J5VE25EA.js} +1 -1
  20. package/dist/{chunk-JMBVKYGC.js → chunk-JKZUZUAV.js} +1 -1
  21. package/dist/{chunk-Z6NR5CSS.js → chunk-JLXUB5H5.js} +18 -19
  22. package/dist/chunk-K2C7FOE6.js +1477 -0
  23. package/dist/{chunk-I55F4IDB.js → chunk-LR3ZGFUV.js} +2 -2
  24. package/dist/{chunk-4OP66KOV.js → chunk-M2C3IDIY.js} +1 -1
  25. package/dist/{chunk-HUH6X4FR.js → chunk-MM46JBHF.js} +3 -3
  26. package/dist/{chunk-DQKSSCGB.js → chunk-MODGIOPG.js} +38 -11
  27. package/dist/{chunk-N2IUAYUD.js → chunk-MVAJNY4X.js} +2 -2
  28. package/dist/{chunk-WSCCYKTK.js → chunk-N66WU3TN.js} +2 -2
  29. package/dist/{chunk-W7NFIOVK.js → chunk-OA3SUDZN.js} +2 -2
  30. package/dist/{chunk-DRY3QBRK.js → chunk-OCY2MVO7.js} +1 -1
  31. package/dist/{chunk-JYXPC5JP.js → chunk-OKMRVQTQ.js} +5 -5
  32. package/dist/{chunk-XZ6O5DO6.js → chunk-QFH4ECMN.js} +7 -5
  33. package/dist/{chunk-AQYXSJII.js → chunk-R6VUCOQM.js} +2 -2
  34. package/dist/{chunk-XL3PNDE7.js → chunk-RGB7H5GE.js} +1 -1
  35. package/dist/{chunk-TK6OCIYG.js → chunk-RPKBDFB4.js} +2 -2
  36. package/dist/{chunk-NL2ECIET.js → chunk-RWQZFXSF.js} +2 -1470
  37. package/dist/{chunk-M3W6IZD4.js → chunk-SPIU7ZUZ.js} +2 -2
  38. package/dist/chunk-T3EXEEYL.js +104 -0
  39. package/dist/{chunk-45ANXGMD.js → chunk-VCN774BB.js} +1 -1
  40. package/dist/{chunk-ELTMQLAC.js → chunk-VPOARVKJ.js} +10 -5
  41. package/dist/{chunk-CXCEORCL.js → chunk-WDUCGD5M.js} +1 -1
  42. package/dist/{chunk-AB4ADA3B.js → chunk-WKMNNG4S.js} +2 -2
  43. package/dist/{chunk-AIYVYJL6.js → chunk-XWCVZGAX.js} +1 -1
  44. package/dist/commands/add-ledger-entry.js +6 -6
  45. package/dist/commands/api-client/create.js +8 -6
  46. package/dist/commands/create-custom-link.js +6 -6
  47. package/dist/commands/create-ledger.js +6 -6
  48. package/dist/commands/delete-custom-txs.js +6 -6
  49. package/dist/commands/delete-ledger.js +6 -6
  50. package/dist/commands/delete-schema.js +6 -6
  51. package/dist/commands/gen-graphql.js +11 -10
  52. package/dist/commands/get-schema.js +7 -7
  53. package/dist/commands/init.js +5 -5
  54. package/dist/commands/login.js +9 -7
  55. package/dist/commands/migrate-ledger-entry.js +6 -6
  56. package/dist/commands/query/ledgerAccounts.js +6 -6
  57. package/dist/commands/query/ledgers.js +6 -6
  58. package/dist/commands/query/schema.js +6 -6
  59. package/dist/commands/query/schemas.js +6 -6
  60. package/dist/commands/reverse-ledger-entry.js +6 -6
  61. package/dist/commands/start.js +5 -5
  62. package/dist/commands/store-schema.js +6 -6
  63. package/dist/commands/token.js +6 -6
  64. package/dist/commands/update-ledger-account.js +6 -6
  65. package/dist/commands/update.js +6 -6
  66. package/dist/commands/verify-schema.js +12 -11
  67. package/dist/commands/version.js +5 -5
  68. package/dist/commands/workspace.js +6 -6
  69. package/dist/commands.js +42 -40
  70. package/dist/graphql.js +4 -3
  71. package/dist/index.js +42 -40
  72. package/dist/lib/auth.js +2 -2
  73. package/dist/lib/authenticatedCommand.js +5 -5
  74. package/dist/lib/baseCommand.js +4 -4
  75. package/dist/lib/browserAuth.js +3 -1
  76. package/dist/lib/browserLogin.js +13 -0
  77. package/dist/lib/constants.js +5 -5
  78. package/dist/utils/formatValidationErrors.js +3 -2
  79. package/dist/utils/schemaBackCompat.js +7 -6
  80. package/dist/utils/schemaValidation.js +6 -5
  81. package/dist/version.js +2 -2
  82. package/oclif.manifest.json +1 -17
  83. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-KEPMDY7V.js";
3
+ } from "./chunk-J5VE25EA.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-ELTMQLAC.js";
6
+ } from "./chunk-VPOARVKJ.js";
7
7
  import {
8
8
  require_source
9
9
  } from "./chunk-QDAKBUNO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-KEPMDY7V.js";
3
+ } from "./chunk-J5VE25EA.js";
4
4
  import {
5
5
  init_cjs_shims
6
6
  } from "./chunk-7GH3YGSC.js";
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  Schema,
3
3
  parseWithError
4
- } from "./chunk-XZ6O5DO6.js";
4
+ } from "./chunk-QFH4ECMN.js";
5
5
  import {
6
6
  formatValidationErrors
7
- } from "./chunk-DRY3QBRK.js";
7
+ } from "./chunk-OCY2MVO7.js";
8
8
  import {
9
9
  BadRequestError
10
- } from "./chunk-NL2ECIET.js";
10
+ } from "./chunk-K2C7FOE6.js";
11
11
  import {
12
12
  init_cjs_shims
13
13
  } from "./chunk-7GH3YGSC.js";
@@ -24,7 +24,7 @@ var jsonOk = async (response, what) => {
24
24
  return response.json();
25
25
  };
26
26
  var errorPage = (message) => `<html><body>${message} You can close this window and return to the CLI.</body></html>`;
27
- var startLoopbackServer = (expectedState) => new Promise((resolveServer) => {
27
+ var startCallbackServer = (expectedState, parseResult) => new Promise((resolveServer, rejectServer) => {
28
28
  let resolveCode;
29
29
  let rejectCode;
30
30
  const codePromise = new Promise((res, rej) => {
@@ -44,29 +44,32 @@ var startLoopbackServer = (expectedState) => new Promise((resolveServer) => {
44
44
  return;
45
45
  }
46
46
  const error = url.searchParams.get("error");
47
- const code = url.searchParams.get("code");
48
47
  if (error) {
49
48
  res.writeHead(400, { "Content-Type": "text/html" }).end(errorPage("Authorization was denied."));
50
49
  rejectCode(new Error(`authorization denied: ${error}`));
51
50
  return;
52
51
  }
53
- if (!code) {
54
- res.writeHead(400, { "Content-Type": "text/html" }).end(errorPage("Authorization response was missing a code."));
55
- rejectCode(new Error("callback missing code"));
56
- return;
57
- }
58
52
  if (pendingResponse) {
59
53
  res.writeHead(409).end("Authorization already received.");
60
54
  return;
61
55
  }
62
- pendingResponse = res;
63
- resolveCode(code);
56
+ try {
57
+ const result = parseResult(url);
58
+ pendingResponse = res;
59
+ resolveCode(result);
60
+ } catch (error2) {
61
+ res.writeHead(400, { "Content-Type": "text/html" }).end(errorPage("Invalid authorization response."));
62
+ rejectCode(
63
+ error2 instanceof Error ? error2 : new Error("Invalid authorization response")
64
+ );
65
+ }
64
66
  });
67
+ server.once("error", rejectServer);
65
68
  server.listen(0, "127.0.0.1", () => {
66
69
  const { port } = server.address();
67
70
  resolveServer({
68
71
  redirectUri: `http://127.0.0.1:${port}/callback`,
69
- waitForCode: () => new Promise((resolve, reject) => {
72
+ waitForResult: () => new Promise((resolve, reject) => {
70
73
  const timer = setTimeout(() => {
71
74
  server.close();
72
75
  reject(new Error("timed out waiting for browser authorization"));
@@ -106,6 +109,20 @@ var startLoopbackServer = (expectedState) => new Promise((resolveServer) => {
106
109
  });
107
110
  });
108
111
  });
112
+ var startLoopbackServer = async (expectedState) => {
113
+ const callback = await startCallbackServer(expectedState, (url) => {
114
+ const code = url.searchParams.get("code");
115
+ if (!code)
116
+ throw new Error("callback missing code");
117
+ return code;
118
+ });
119
+ return {
120
+ redirectUri: callback.redirectUri,
121
+ waitForCode: callback.waitForResult,
122
+ complete: callback.complete,
123
+ close: callback.close
124
+ };
125
+ };
109
126
  var defaultBrowserAuthDeps = (log) => ({
110
127
  fetchFn: fetch,
111
128
  openBrowser: async (url) => {
@@ -193,7 +210,16 @@ ${authorizeUrl.toString()}`
193
210
  method: "DELETE",
194
211
  headers: authHeader
195
212
  }).catch(() => void 0);
196
- loopback.complete(token.dashboard_url);
213
+ const completionUrl = token.dashboard_url ? new URL(token.dashboard_url) : void 0;
214
+ if (completionUrl) {
215
+ completionUrl.pathname = `${completionUrl.pathname.replace(
216
+ /\/$/,
217
+ ""
218
+ )}/authorize/success`;
219
+ completionUrl.search = "";
220
+ completionUrl.hash = "";
221
+ }
222
+ loopback.complete(completionUrl?.toString());
197
223
  return credentials;
198
224
  } finally {
199
225
  loopback.close();
@@ -202,6 +228,7 @@ ${authorizeUrl.toString()}`
202
228
 
203
229
  export {
204
230
  AUTH_TIMEOUT_MS,
231
+ startCallbackServer,
205
232
  startLoopbackServer,
206
233
  defaultBrowserAuthDeps,
207
234
  provisionApiClient
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  inquirer_default
3
- } from "./chunk-2ZOSYPMG.js";
3
+ } from "./chunk-GP4YLGE7.js";
4
4
  import {
5
5
  FragmentCommand,
6
6
  require_lib
7
- } from "./chunk-ELTMQLAC.js";
7
+ } from "./chunk-VPOARVKJ.js";
8
8
  import {
9
9
  require_source
10
10
  } from "./chunk-QDAKBUNO.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-KEPMDY7V.js";
3
+ } from "./chunk-J5VE25EA.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-ELTMQLAC.js";
6
+ } from "./chunk-VPOARVKJ.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-KEPMDY7V.js";
3
+ } from "./chunk-J5VE25EA.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-ELTMQLAC.js";
6
+ } from "./chunk-VPOARVKJ.js";
7
7
  import {
8
8
  require_source
9
9
  } from "./chunk-QDAKBUNO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  BadRequestError
3
- } from "./chunk-NL2ECIET.js";
3
+ } from "./chunk-K2C7FOE6.js";
4
4
  import {
5
5
  require_source
6
6
  } from "./chunk-QDAKBUNO.js";
@@ -4,22 +4,22 @@ import {
4
4
  schemaToEntryDefinitions,
5
5
  schemaToPaymentDefinitions,
6
6
  validateOutputName
7
- } from "./chunk-TXZYFCBO.js";
7
+ } from "./chunk-FGNF2UZU.js";
8
8
  import {
9
9
  Schema,
10
10
  parseWithError
11
- } from "./chunk-XZ6O5DO6.js";
11
+ } from "./chunk-QFH4ECMN.js";
12
12
  import {
13
13
  formatValidationErrors,
14
14
  logValidationErrors
15
- } from "./chunk-DRY3QBRK.js";
15
+ } from "./chunk-OCY2MVO7.js";
16
16
  import {
17
17
  BadRequestError
18
- } from "./chunk-NL2ECIET.js";
18
+ } from "./chunk-K2C7FOE6.js";
19
19
  import {
20
20
  FragmentCommand,
21
21
  require_lib
22
- } from "./chunk-ELTMQLAC.js";
22
+ } from "./chunk-VPOARVKJ.js";
23
23
  import {
24
24
  getParsedSchema
25
25
  } from "./chunk-QZNZYG2G.js";
@@ -22,22 +22,24 @@ import {
22
22
  getStructuralPath,
23
23
  getStructuralSubpaths,
24
24
  getSubpaths
25
- } from "./chunk-AO62X3BO.js";
25
+ } from "./chunk-5OKT5EMG.js";
26
26
  import {
27
27
  BadRequestError,
28
28
  CurrencyMatchInputSchema,
29
29
  InternalError,
30
+ assertIsError,
31
+ assert_default,
32
+ currencyCodes
33
+ } from "./chunk-K2C7FOE6.js";
34
+ import {
30
35
  MAX_FREEFORM_TEXT_LENGTH,
31
36
  ParameterizedAmount,
32
37
  ParameterizedString,
33
38
  SafeStringSchema,
34
- assertIsError,
35
- assert_default,
36
- currencyCodes,
37
39
  getStringParameters,
38
40
  safe,
39
41
  z
40
- } from "./chunk-NL2ECIET.js";
42
+ } from "./chunk-RWQZFXSF.js";
41
43
  import {
42
44
  __commonJS,
43
45
  __toESM,
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-KEPMDY7V.js";
3
+ } from "./chunk-J5VE25EA.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-ELTMQLAC.js";
6
+ } from "./chunk-VPOARVKJ.js";
7
7
  import {
8
8
  require_source
9
9
  } from "./chunk-QDAKBUNO.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-KEPMDY7V.js";
3
+ } from "./chunk-J5VE25EA.js";
4
4
  import {
5
5
  init_cjs_shims
6
6
  } from "./chunk-7GH3YGSC.js";
@@ -1,9 +1,9 @@
1
1
  import {
2
2
  AuthenticatedCommand
3
- } from "./chunk-KEPMDY7V.js";
3
+ } from "./chunk-J5VE25EA.js";
4
4
  import {
5
5
  require_lib
6
- } from "./chunk-ELTMQLAC.js";
6
+ } from "./chunk-VPOARVKJ.js";
7
7
  import {
8
8
  __toESM,
9
9
  init_cjs_shims