@wix/auto_sdk_containers_projects 1.0.3 → 1.0.4

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.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, MaybeContext, BuildRESTFunction } from '@wix/sdk-types';
2
- import { Project, ResumeProjectResponse, SaveProjectDesignOptions, SaveProjectDesignResponse, GetHimalayaAuthorizationResponse } from './index.typings.js';
3
- export { AccountInfo, ActionEvent, CreateAgentSessionRequest, CreateAgentSessionResponse, CreateProjectRequest, CreateProjectResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteProjectRequest, DeleteProjectResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetHimalayaAuthorizationRequest, GetProjectRequest, GetProjectResponse, IdentificationData, IdentificationDataIdOneOf, ListProjectsForCurrentUserRequest, ListProjectsForCurrentUserResponse, ListProjectsOptions, ListProjectsRequest, ListProjectsResponse, MessageEnvelope, Platform, PlatformWithLiterals, ProjectPlanReady, ProjectResumeRequested, ProjectStartRequested, ProjectStatus, ProjectStatusWithLiterals, RefreshAgentSiteTokenRequest, RefreshAgentSiteTokenResponse, RegenerateProjectIconRequest, RegenerateProjectIconResponse, RegenerateProjectNameRequest, RegenerateProjectNameResponse, RestoreInfo, ResumeProjectRequest, SandboxStatus, SandboxStatusWithLiterals, SaveProjectDesignRequest, StartProjectRequest, StartProjectResponse, UpdateProject, UpdateProjectRequest, UpdateProjectResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
2
+ import { Project, ResumeProjectResponse, SaveProjectDesignOptions, SaveProjectDesignResponse, RestoreReleaseOptions, RestoreReleaseResponse, GetHimalayaAuthorizationResponse } from './index.typings.js';
3
+ export { AccountInfo, ActionEvent, CreateAgentSessionRequest, CreateAgentSessionResponse, CreateProjectRequest, CreateProjectResponse, CursorPaging, CursorPagingMetadata, Cursors, DeleteProjectRequest, DeleteProjectResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, GetHimalayaAuthorizationRequest, GetProjectRequest, GetProjectResponse, IdentificationData, IdentificationDataIdOneOf, ListProjectsForCurrentUserRequest, ListProjectsForCurrentUserResponse, ListProjectsOptions, ListProjectsRequest, ListProjectsResponse, MessageEnvelope, Platform, PlatformWithLiterals, ProjectPlanReady, ProjectResumeRequested, ProjectStartRequested, ProjectStatus, ProjectStatusWithLiterals, RefreshAgentSiteTokenRequest, RefreshAgentSiteTokenResponse, RegenerateProjectIconRequest, RegenerateProjectIconResponse, RegenerateProjectNameRequest, RegenerateProjectNameResponse, RestoreInfo, RestoreReleaseRequest, ResumeProjectRequest, SandboxStatus, SandboxStatusWithLiterals, SaveProjectDesignRequest, StartProjectRequest, StartProjectResponse, UpdateProject, UpdateProjectRequest, UpdateProjectResponse, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.js';
4
4
 
5
5
  declare function getProject$1(httpClient: HttpClient): GetProjectSignature;
6
6
  interface GetProjectSignature {
@@ -27,14 +27,33 @@ interface SaveProjectDesignSignature {
27
27
  *
28
28
  * Synchronous: the Himalaya write completes before this call returns. Never touches the project's
29
29
  * sandbox, runs a build, or activates the app — the saved release stays a draft, so what the live
30
- * app serves is unaffected. Persists nothing on our side: this creates no entity and posts no
31
- * chat checkpoint.
30
+ * app serves is unaffected. Persists no entity of its own. When `conversation_id` is supplied it
31
+ * posts a CHECKPOINT message for the saved release into that conversation (best-effort — a chat
32
+ * failure never fails the save); omit it to skip the checkpoint.
32
33
  * @param - Project whose design is being saved. The caller must own it.
33
34
  * @param - The Himalaya release ID currently displayed by the client. The saved draft branches from
34
35
  * exactly this release, even when a newer release exists for the app.
35
36
  */
36
37
  (projectId: string, baseReleaseId: string, options?: NonNullablePaths<SaveProjectDesignOptions, `himalayaControlToken` | `tokensJson`, 0>): Promise<NonNullablePaths<SaveProjectDesignResponse, `himalayaReleaseId` | `previewToken`, 0>>;
37
38
  }
39
+ declare function restoreRelease$1(httpClient: HttpClient): RestoreReleaseSignature;
40
+ interface RestoreReleaseSignature {
41
+ /**
42
+ * Restores an earlier version by pointing the project's editable head at `release_id`: the client
43
+ * then previews that release and the next edit (design save or AI edit) branches from it. Pure
44
+ * project state — sets `head_release_id` and nothing in Himalaya: it does NOT activate the release,
45
+ * so the live app end-users run is untouched (a later publish/build is what carries head live).
46
+ *
47
+ * `release_id` is a Himalaya release id the caller already holds from the project's own release
48
+ * ledger, scoped to this project's app; the server stores it as head without re-reading Himalaya.
49
+ * When `conversation_id` is supplied, a CHECKPOINT message for the restored release is posted into
50
+ * it (best-effort — a chat failure never fails the restore); omit it to skip the checkpoint.
51
+ * @param - Project whose head is being moved. The caller must own it.
52
+ * @param - The Himalaya release to make the project's editable head. Not a GUID — a Himalaya release id
53
+ * (e.g. `rel-<hash>` / `<sha>-<hash>`), taken from the project's own release ledger.
54
+ */
55
+ (projectId: string, releaseId: string, options?: RestoreReleaseOptions): Promise<NonNullablePaths<RestoreReleaseResponse, `project.name` | `project.status` | `project.sandboxStatus` | `project.metaSiteIds` | `project.platform`, 1>>;
56
+ }
38
57
  declare function getHimalayaAuthorization$1(httpClient: HttpClient): GetHimalayaAuthorizationSignature;
39
58
  interface GetHimalayaAuthorizationSignature {
40
59
  /**
@@ -48,6 +67,7 @@ interface GetHimalayaAuthorizationSignature {
48
67
  declare const getProject: MaybeContext<BuildRESTFunction<typeof getProject$1> & typeof getProject$1>;
49
68
  declare const resumeProject: MaybeContext<BuildRESTFunction<typeof resumeProject$1> & typeof resumeProject$1>;
50
69
  declare const saveProjectDesign: MaybeContext<BuildRESTFunction<typeof saveProjectDesign$1> & typeof saveProjectDesign$1>;
70
+ declare const restoreRelease: MaybeContext<BuildRESTFunction<typeof restoreRelease$1> & typeof restoreRelease$1>;
51
71
  declare const getHimalayaAuthorization: MaybeContext<BuildRESTFunction<typeof getHimalayaAuthorization$1> & typeof getHimalayaAuthorization$1>;
52
72
 
53
- export { GetHimalayaAuthorizationResponse, Project, ResumeProjectResponse, SaveProjectDesignOptions, SaveProjectDesignResponse, getHimalayaAuthorization, getProject, resumeProject, saveProjectDesign };
73
+ export { GetHimalayaAuthorizationResponse, Project, RestoreReleaseOptions, RestoreReleaseResponse, ResumeProjectResponse, SaveProjectDesignOptions, SaveProjectDesignResponse, getHimalayaAuthorization, getProject, restoreRelease, resumeProject, saveProjectDesign };
@@ -31,6 +31,7 @@ __export(index_exports, {
31
31
  listProjects: () => listProjects4,
32
32
  regenerateProjectIcon: () => regenerateProjectIcon4,
33
33
  regenerateProjectName: () => regenerateProjectName4,
34
+ restoreRelease: () => restoreRelease4,
34
35
  resumeProject: () => resumeProject4,
35
36
  saveProjectDesign: () => saveProjectDesign4,
36
37
  updateProject: () => updateProject4
@@ -284,6 +285,33 @@ function saveProjectDesign(payload) {
284
285
  }
285
286
  return __saveProjectDesign;
286
287
  }
288
+ function restoreRelease(payload) {
289
+ function __restoreRelease({ host }) {
290
+ const metadata = {
291
+ entityFqdn: "wix.containers.projects.v1.project",
292
+ method: "POST",
293
+ methodFqn: "wix.containers.projects.v1.ContainersProjects.RestoreRelease",
294
+ packageName: PACKAGE_NAME,
295
+ migrationOptions: {
296
+ optInTransformResponse: true
297
+ },
298
+ url: resolveWixContainersProjectsV1ContainersProjectsUrl({
299
+ protoPath: "/v1/projects/{projectId}/restore-release",
300
+ data: payload,
301
+ host
302
+ }),
303
+ data: payload,
304
+ transformResponse: (payload2) => (0, import_transform_paths.transformPaths)(payload2, [
305
+ {
306
+ transformFn: import_timestamp2.transformRESTTimestampToSDKTimestamp,
307
+ paths: TRANSFORM_PATHS_0
308
+ }
309
+ ])
310
+ };
311
+ return metadata;
312
+ }
313
+ return __restoreRelease;
314
+ }
287
315
  function listProjects(payload) {
288
316
  function __listProjects({ host }) {
289
317
  const metadata = {
@@ -540,7 +568,8 @@ async function saveProjectDesign2(projectId, baseReleaseId, options) {
540
568
  baseReleaseId,
541
569
  tokensJson: options?.tokensJson,
542
570
  himalayaControlToken: options?.himalayaControlToken,
543
- canonicalApp: options?.canonicalApp
571
+ canonicalApp: options?.canonicalApp,
572
+ conversationId: options?.conversationId
544
573
  });
545
574
  const reqOpts = saveProjectDesign(payload);
546
575
  sideEffects?.onSiteCall?.();
@@ -558,7 +587,8 @@ async function saveProjectDesign2(projectId, baseReleaseId, options) {
558
587
  baseReleaseId: "$[1]",
559
588
  tokensJson: "$[2].tokensJson",
560
589
  himalayaControlToken: "$[2].himalayaControlToken",
561
- canonicalApp: "$[2].canonicalApp"
590
+ canonicalApp: "$[2].canonicalApp",
591
+ conversationId: "$[2].conversationId"
562
592
  },
563
593
  singleArgumentUnchanged: false
564
594
  },
@@ -568,6 +598,39 @@ async function saveProjectDesign2(projectId, baseReleaseId, options) {
568
598
  throw transformedError;
569
599
  }
570
600
  }
601
+ async function restoreRelease2(projectId, releaseId, options) {
602
+ const { httpClient, sideEffects } = arguments[3];
603
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
604
+ projectId,
605
+ releaseId,
606
+ himalayaControlToken: options?.himalayaControlToken,
607
+ conversationId: options?.conversationId
608
+ });
609
+ const reqOpts = restoreRelease(payload);
610
+ sideEffects?.onSiteCall?.();
611
+ try {
612
+ const result = await httpClient.request(reqOpts);
613
+ sideEffects?.onSuccess?.(result);
614
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
615
+ } catch (err) {
616
+ const transformedError = (0, import_transform_error.transformError)(
617
+ err,
618
+ {
619
+ spreadPathsToArguments: {},
620
+ explicitPathsToArguments: {
621
+ projectId: "$[0]",
622
+ releaseId: "$[1]",
623
+ himalayaControlToken: "$[2].himalayaControlToken",
624
+ conversationId: "$[2].conversationId"
625
+ },
626
+ singleArgumentUnchanged: false
627
+ },
628
+ ["projectId", "releaseId", "options"]
629
+ );
630
+ sideEffects?.onError?.(err);
631
+ throw transformedError;
632
+ }
633
+ }
571
634
  async function listProjects2(options) {
572
635
  const { httpClient, sideEffects } = arguments[1];
573
636
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -681,6 +744,15 @@ function saveProjectDesign3(httpClient) {
681
744
  { httpClient }
682
745
  );
683
746
  }
747
+ function restoreRelease3(httpClient) {
748
+ return (projectId, releaseId, options) => restoreRelease2(
749
+ projectId,
750
+ releaseId,
751
+ options,
752
+ // @ts-ignore
753
+ { httpClient }
754
+ );
755
+ }
684
756
  function listProjects3(httpClient) {
685
757
  return (options) => listProjects2(
686
758
  options,
@@ -706,6 +778,7 @@ var resumeProject4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(
706
778
  var regenerateProjectName4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(regenerateProjectName3);
707
779
  var regenerateProjectIcon4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(regenerateProjectIcon3);
708
780
  var saveProjectDesign4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(saveProjectDesign3);
781
+ var restoreRelease4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(restoreRelease3);
709
782
  var listProjects4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(listProjects3);
710
783
  var getHimalayaAuthorization4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getHimalayaAuthorization3);
711
784
  // Annotate the CommonJS export names for ESM import in node:
@@ -721,6 +794,7 @@ var getHimalayaAuthorization4 = /* @__PURE__ */ (0, import_rest_modules3.createR
721
794
  listProjects,
722
795
  regenerateProjectIcon,
723
796
  regenerateProjectName,
797
+ restoreRelease,
724
798
  resumeProject,
725
799
  saveProjectDesign,
726
800
  updateProject