@mytegroupinc/myte-core 0.0.12 → 0.0.13

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 (2) hide show
  1. package/cli.js +16 -2
  2. package/package.json +1 -1
package/cli.js CHANGED
@@ -1153,7 +1153,7 @@ async function postSuggestionsMutation({ apiBase, key, timeoutMs, endpoint, payl
1153
1153
  return body.data || {};
1154
1154
  }
1155
1155
 
1156
- async function createRunQaqcBatch({ apiBase, key, timeoutMs, payload }) {
1156
+ async function createRunQaqcBatch({ apiBase, key, timeoutMs, payload, idempotencyKey, clientSessionId }) {
1157
1157
  const fetchFn = await getFetch();
1158
1158
  const url = `${apiBase}/project-assistant/run-qaqc`;
1159
1159
  const { resp, body } = await fetchJsonWithTimeout(
@@ -1164,6 +1164,8 @@ async function createRunQaqcBatch({ apiBase, key, timeoutMs, payload }) {
1164
1164
  headers: {
1165
1165
  "Content-Type": "application/json",
1166
1166
  Authorization: `Bearer ${key}`,
1167
+ "X-Idempotency-Key": String(idempotencyKey || "").trim(),
1168
+ ...(String(clientSessionId || "").trim() ? { "X-Client-Session-Id": String(clientSessionId).trim() } : {}),
1167
1169
  },
1168
1170
  body: JSON.stringify(payload),
1169
1171
  },
@@ -1247,6 +1249,11 @@ async function runRunQaqc(args) {
1247
1249
  };
1248
1250
  const clientSessionId = firstNonEmptyString(args["client-session-id"], args.clientSessionId, args.client_session_id);
1249
1251
  if (clientSessionId) payload.client_session_id = clientSessionId;
1252
+ const idempotencyKey = resolveProjectMutationIdempotencyKey({
1253
+ args,
1254
+ operation: "run-qaqc",
1255
+ payload,
1256
+ });
1250
1257
 
1251
1258
  if (args["print-context"] || args.printContext || args["dry-run"] || args.dryRun) {
1252
1259
  console.log(JSON.stringify(payload, null, 2));
@@ -1260,7 +1267,14 @@ async function runRunQaqc(args) {
1260
1267
 
1261
1268
  let data;
1262
1269
  try {
1263
- data = await createRunQaqcBatch({ apiBase, key, timeoutMs, payload });
1270
+ data = await createRunQaqcBatch({
1271
+ apiBase,
1272
+ key,
1273
+ timeoutMs,
1274
+ payload,
1275
+ idempotencyKey,
1276
+ clientSessionId,
1277
+ });
1264
1278
  } catch (err) {
1265
1279
  if (err?.name === "AbortError") {
1266
1280
  console.error(`Request timed out after ${timeoutMs}ms`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mytegroupinc/myte-core",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "Myte CLI core implementation (Project Assistant + deterministic diffs).",
5
5
  "type": "commonjs",
6
6
  "main": "cli.js",