@wix/ditto-codegen-public 1.0.369 → 1.0.371

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/dist/out.js +50 -6
  2. package/package.json +2 -2
package/dist/out.js CHANGED
@@ -12148,7 +12148,26 @@ var require_http_impl3 = __commonJS({
12148
12148
  };
12149
12149
  var _taskOptions = { onFailure: "_task" };
12150
12150
  function resolveComWixpressCodeProjectOrchestratorApiCodeProjectOrchestratorServiceUrl(opts) {
12151
- var domainToMappings = {};
12151
+ var domainToMappings = {
12152
+ "editor._base_domain_": [
12153
+ {
12154
+ srcPath: "/_api/code-project-orchestrator",
12155
+ destPath: ""
12156
+ }
12157
+ ],
12158
+ "blocks._base_domain_": [
12159
+ {
12160
+ srcPath: "/_api/code-project-orchestrator",
12161
+ destPath: ""
12162
+ }
12163
+ ],
12164
+ "create.editorx": [
12165
+ {
12166
+ srcPath: "/_api/code-project-orchestrator",
12167
+ destPath: ""
12168
+ }
12169
+ ]
12170
+ };
12152
12171
  return (0, metro_runtime_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
12153
12172
  }
12154
12173
  function initialize(payload) {
@@ -12516,13 +12535,37 @@ var require_checkpoint = __commonJS({
12516
12535
  return message.slice(0, MAX_COMMIT_MESSAGE_LENGTH - TRUNCATION_SUFFIX.length) + TRUNCATION_SUFFIX;
12517
12536
  };
12518
12537
  var useCodeProjectOrchestrator = () => process.env.USE_CODE_PROJECT_ORCHESTRATOR === "true";
12519
- var callCreateCheckpoint = async (client, job, commitMessage) => {
12538
+ var wasAuthorizationHeaderSent = (requestHeaders) => {
12539
+ if (typeof requestHeaders !== "object" || requestHeaders === null)
12540
+ return false;
12541
+ return Object.keys(requestHeaders).some((key) => key.toLowerCase() === "authorization");
12542
+ };
12543
+ var callCreateCheckpoint = async (client, job, commitMessage, logger) => {
12520
12544
  if (useCodeProjectOrchestrator()) {
12521
12545
  if (!job.siteBranchId) {
12522
12546
  throw new Error("[Checkpoint] SITE_BRANCH_ID is required for the code-project-orchestrator checkpoint");
12523
12547
  }
12524
- const resp2 = await client.request((0, http_2.createCheckpoint)({ siteBranchId: job.siteBranchId }));
12525
- return { checkpointId: resp2.data?.revision?.revisionId };
12548
+ try {
12549
+ const resp2 = await client.request((0, http_2.createCheckpoint)({ siteBranchId: job.siteBranchId }));
12550
+ return { checkpointId: resp2.data?.revision?.revisionId };
12551
+ } catch (error) {
12552
+ if (http_client_1.HttpClient.isHttpError(error)) {
12553
+ logger.error("[Checkpoint] code-project createCheckpoint failed", {
12554
+ siteBranchId: job.siteBranchId,
12555
+ requestId: error.requestId || void 0,
12556
+ method: error.config?.method?.toUpperCase(),
12557
+ url: error.config?.url,
12558
+ status: error.response?.status,
12559
+ statusText: error.response?.statusText,
12560
+ code: error.code,
12561
+ message: error.message,
12562
+ data: error.response?.data,
12563
+ responseHeaders: error.response?.headers ?? null,
12564
+ authorizationHeaderSent: wasAuthorizationHeaderSent(error.config?.headers)
12565
+ });
12566
+ }
12567
+ throw error;
12568
+ }
12526
12569
  }
12527
12570
  const resp = await client.request((0, http_1.createCheckpoint)({
12528
12571
  appId: job.projectId,
@@ -12547,9 +12590,10 @@ var require_checkpoint = __commonJS({
12547
12590
  };
12548
12591
  var checkpointPluginFactory = (ctx) => {
12549
12592
  const { host, job } = ctx;
12593
+ const accessToken = host.auth.getAccessToken();
12550
12594
  const orchestratorHttpClient = (0, http_client_1.createHttpClient)({
12551
12595
  baseURL: "https://editor.wix.com",
12552
- headers: { Authorization: `Bearer ${host.auth.getAccessToken() ?? ""}` }
12596
+ headers: accessToken ? { Authorization: `Bearer ${accessToken}` } : {}
12553
12597
  });
12554
12598
  let outcome;
12555
12599
  let capturedCommitMessage;
@@ -12557,7 +12601,7 @@ var require_checkpoint = __commonJS({
12557
12601
  if (!job)
12558
12602
  return;
12559
12603
  try {
12560
- const { checkpointId } = await callCreateCheckpoint(orchestratorHttpClient, job, commitMessage);
12604
+ const { checkpointId } = await callCreateCheckpoint(orchestratorHttpClient, job, commitMessage, host.logger);
12561
12605
  outcome = { status: "created", checkpointId };
12562
12606
  if (checkpointId) {
12563
12607
  await host.jobs.updatePayload({ jobId: job.jobId, taskId: job.taskId }, { checkpointId });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/ditto-codegen-public",
3
- "version": "1.0.369",
3
+ "version": "1.0.371",
4
4
  "description": "AI-powered Wix CLI app generator - standalone executable",
5
5
  "scripts": {
6
6
  "build": "node build.mjs",
@@ -29,5 +29,5 @@
29
29
  "esbuild": "^0.27.2",
30
30
  "vitest": "^4.0.16"
31
31
  },
32
- "falconPackageHash": "810043ba6ca91bc61664315a3d3610a710ec1927b24ce3853298f80c"
32
+ "falconPackageHash": "eee7d8b9eb96cc53dec76765caf89f0e3032e81427968ac5a1db6437"
33
33
  }