@wix/auto_sdk_containers_projects 1.0.3 → 1.0.5

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.
@@ -70,6 +70,16 @@ interface Project {
70
70
  * @maxLength 2000
71
71
  */
72
72
  appIconUrl?: string | null;
73
+ /**
74
+ * The Himalaya release the editor is currently on — the "head" the client previews and the next
75
+ * edit (design save or AI edit) branches from. Server-managed: set to the new draft after each
76
+ * edit, and to the chosen release by RestoreRelease. Unset means "newest release by date" (the
77
+ * pre-head default), so existing projects keep working until their first edit/restore sets it.
78
+ * Not a GUID — a Himalaya release id (e.g. `rel-<hash>` / `<sha>-<hash>`).
79
+ * @maxLength 200
80
+ * @readonly
81
+ */
82
+ headReleaseId?: string | null;
73
83
  }
74
84
  declare enum ProjectStatus {
75
85
  /** Project created; client (via containers-plans) is doing most of the work. */
@@ -527,6 +537,17 @@ interface SaveProjectDesignRequest {
527
537
  * @maxLength 200
528
538
  */
529
539
  canonicalApp?: string;
540
+ /**
541
+ * Conversation this design is saved from. When set, a CHECKPOINT message marking the saved
542
+ * version is posted into it (best-effort). Optional — an older client that omits it still saves
543
+ * the design; it just produces no checkpoint. Verified to belong to this project server-side.
544
+ *
545
+ * Deliberately NOT (.wix.api.format) = GUID: posting the checkpoint is best-effort and must never
546
+ * fail the save. A malformed/unexpected id is handled downstream (the ownership lookup rejects it
547
+ * and the checkpoint is skipped) rather than hard-failing SaveProjectDesign at the request boundary.
548
+ * @maxLength 100
549
+ */
550
+ conversationId?: string;
530
551
  }
531
552
  interface SaveProjectDesignResponse {
532
553
  /**
@@ -543,6 +564,43 @@ interface SaveProjectDesignResponse {
543
564
  /** When preview_token expires. */
544
565
  previewTokenExpiresAt?: Date | null;
545
566
  }
567
+ interface RestoreReleaseRequest {
568
+ /**
569
+ * Project whose head is being moved. The caller must own it.
570
+ * @format GUID
571
+ */
572
+ projectId: string;
573
+ /**
574
+ * The Himalaya release to make the project's editable head. Not a GUID — a Himalaya release id
575
+ * (e.g. `rel-<hash>` / `<sha>-<hash>`), taken from the project's own release ledger.
576
+ * @maxLength 200
577
+ */
578
+ releaseId: string;
579
+ /**
580
+ * Short-lived, app-scoped Himalaya control credential (the same the client obtains from Himalaya's
581
+ * owner embed-token endpoint and sends on SaveProjectDesign). When present, the server verifies
582
+ * release_id belongs to this project's Himalaya app before moving head. Optional for back-compat:
583
+ * an older client that omits it skips that check (the release still comes from the project's own
584
+ * ledger). Forwarded to Himalaya for the ledger read only — never logged, persisted, or echoed.
585
+ * @maxLength 4096
586
+ */
587
+ himalayaControlToken?: string;
588
+ /**
589
+ * Conversation this restore is made from. When set, a CHECKPOINT message marking the restored
590
+ * version is posted into it (best-effort). Optional — a client that omits it still restores; it
591
+ * just produces no checkpoint. Verified to belong to this project server-side.
592
+ *
593
+ * Deliberately NOT (.wix.api.format) = GUID: posting the checkpoint is best-effort and must never
594
+ * fail the restore. A malformed id is handled downstream (the ownership lookup rejects it and the
595
+ * checkpoint is skipped) rather than hard-failing RestoreRelease at the request boundary.
596
+ * @maxLength 100
597
+ */
598
+ conversationId?: string;
599
+ }
600
+ interface RestoreReleaseResponse {
601
+ /** The project after the restore, with head_release_id set to the restored release. */
602
+ project?: Project;
603
+ }
546
604
  interface ListProjectsRequest {
547
605
  /** Cursor paging options. */
548
606
  paging?: CursorPaging;
@@ -590,6 +648,7 @@ interface GetHimalayaAuthorizationResponse {
590
648
  * @documentationMaturity preview
591
649
  * @requiredField projectId
592
650
  * @permissionId containers:projects:v1:project:get_project
651
+ * @applicableIdentity APP
593
652
  * @returns The requested Project.
594
653
  * @fqn wix.containers.projects.v1.ContainersProjects.GetProject
595
654
  */
@@ -664,6 +723,16 @@ interface UpdateProject {
664
723
  * @maxLength 2000
665
724
  */
666
725
  appIconUrl?: string | null;
726
+ /**
727
+ * The Himalaya release the editor is currently on — the "head" the client previews and the next
728
+ * edit (design save or AI edit) branches from. Server-managed: set to the new draft after each
729
+ * edit, and to the chosen release by RestoreRelease. Unset means "newest release by date" (the
730
+ * pre-head default), so existing projects keep working until their first edit/restore sets it.
731
+ * Not a GUID — a Himalaya release id (e.g. `rel-<hash>` / `<sha>-<hash>`).
732
+ * @maxLength 200
733
+ * @readonly
734
+ */
735
+ headReleaseId?: string | null;
667
736
  }
668
737
  /**
669
738
  * Requests Project resume by starting or reusing its configured remote machine asynchronously.
@@ -672,6 +741,7 @@ interface UpdateProject {
672
741
  * @documentationMaturity preview
673
742
  * @requiredField projectId
674
743
  * @permissionId containers:projects:v1:project:resume_project
744
+ * @applicableIdentity APP
675
745
  * @fqn wix.containers.projects.v1.ContainersProjects.ResumeProject
676
746
  */
677
747
  declare function resumeProject(projectId: string): Promise<NonNullablePaths<ResumeProjectResponse, `project.name` | `project.status` | `project.sandboxStatus` | `project.metaSiteIds` | `project.platform`, 1>>;
@@ -681,8 +751,9 @@ declare function resumeProject(projectId: string): Promise<NonNullablePaths<Resu
681
751
  *
682
752
  * Synchronous: the Himalaya write completes before this call returns. Never touches the project's
683
753
  * sandbox, runs a build, or activates the app — the saved release stays a draft, so what the live
684
- * app serves is unaffected. Persists nothing on our side: this creates no entity and posts no
685
- * chat checkpoint.
754
+ * app serves is unaffected. Persists no entity of its own. When `conversation_id` is supplied it
755
+ * posts a CHECKPOINT message for the saved release into that conversation (best-effort — a chat
756
+ * failure never fails the save); omit it to skip the checkpoint.
686
757
  * @param projectId - Project whose design is being saved. The caller must own it.
687
758
  * @param baseReleaseId - The Himalaya release ID currently displayed by the client. The saved draft branches from
688
759
  * exactly this release, even when a newer release exists for the app.
@@ -693,6 +764,7 @@ declare function resumeProject(projectId: string): Promise<NonNullablePaths<Resu
693
764
  * @requiredField options.tokensJson
694
765
  * @requiredField projectId
695
766
  * @permissionId containers:projects:v1:project:save_project_design
767
+ * @applicableIdentity APP
696
768
  * @fqn wix.containers.projects.v1.ContainersProjects.SaveProjectDesign
697
769
  */
698
770
  declare function saveProjectDesign(projectId: string, baseReleaseId: string, options?: NonNullablePaths<SaveProjectDesignOptions, `himalayaControlToken` | `tokensJson`, 0>): Promise<NonNullablePaths<SaveProjectDesignResponse, `himalayaReleaseId` | `previewToken`, 0>>;
@@ -720,6 +792,61 @@ interface SaveProjectDesignOptions {
720
792
  * @maxLength 200
721
793
  */
722
794
  canonicalApp?: string;
795
+ /**
796
+ * Conversation this design is saved from. When set, a CHECKPOINT message marking the saved
797
+ * version is posted into it (best-effort). Optional — an older client that omits it still saves
798
+ * the design; it just produces no checkpoint. Verified to belong to this project server-side.
799
+ *
800
+ * Deliberately NOT (.wix.api.format) = GUID: posting the checkpoint is best-effort and must never
801
+ * fail the save. A malformed/unexpected id is handled downstream (the ownership lookup rejects it
802
+ * and the checkpoint is skipped) rather than hard-failing SaveProjectDesign at the request boundary.
803
+ * @maxLength 100
804
+ */
805
+ conversationId?: string;
806
+ }
807
+ /**
808
+ * Restores an earlier version by pointing the project's editable head at `release_id`: the client
809
+ * then previews that release and the next edit (design save or AI edit) branches from it. Pure
810
+ * project state — sets `head_release_id` and nothing in Himalaya: it does NOT activate the release,
811
+ * so the live app end-users run is untouched (a later publish/build is what carries head live).
812
+ *
813
+ * `release_id` is a Himalaya release id the caller already holds from the project's own release
814
+ * ledger, scoped to this project's app; the server stores it as head without re-reading Himalaya.
815
+ * When `conversation_id` is supplied, a CHECKPOINT message for the restored release is posted into
816
+ * it (best-effort — a chat failure never fails the restore); omit it to skip the checkpoint.
817
+ * @param projectId - Project whose head is being moved. The caller must own it.
818
+ * @param releaseId - The Himalaya release to make the project's editable head. Not a GUID — a Himalaya release id
819
+ * (e.g. `rel-<hash>` / `<sha>-<hash>`), taken from the project's own release ledger.
820
+ * @public
821
+ * @documentationMaturity preview
822
+ * @requiredField projectId
823
+ * @requiredField releaseId
824
+ * @permissionId containers:projects:v1:project:restore_release
825
+ * @applicableIdentity APP
826
+ * @fqn wix.containers.projects.v1.ContainersProjects.RestoreRelease
827
+ */
828
+ declare function restoreRelease(projectId: string, releaseId: string, options?: RestoreReleaseOptions): Promise<NonNullablePaths<RestoreReleaseResponse, `project.name` | `project.status` | `project.sandboxStatus` | `project.metaSiteIds` | `project.platform`, 1>>;
829
+ interface RestoreReleaseOptions {
830
+ /**
831
+ * Short-lived, app-scoped Himalaya control credential (the same the client obtains from Himalaya's
832
+ * owner embed-token endpoint and sends on SaveProjectDesign). When present, the server verifies
833
+ * release_id belongs to this project's Himalaya app before moving head. Optional for back-compat:
834
+ * an older client that omits it skips that check (the release still comes from the project's own
835
+ * ledger). Forwarded to Himalaya for the ledger read only — never logged, persisted, or echoed.
836
+ * @maxLength 4096
837
+ */
838
+ himalayaControlToken?: string;
839
+ /**
840
+ * Conversation this restore is made from. When set, a CHECKPOINT message marking the restored
841
+ * version is posted into it (best-effort). Optional — a client that omits it still restores; it
842
+ * just produces no checkpoint. Verified to belong to this project server-side.
843
+ *
844
+ * Deliberately NOT (.wix.api.format) = GUID: posting the checkpoint is best-effort and must never
845
+ * fail the restore. A malformed id is handled downstream (the ownership lookup rejects it and the
846
+ * checkpoint is skipped) rather than hard-failing RestoreRelease at the request boundary.
847
+ * @maxLength 100
848
+ */
849
+ conversationId?: string;
723
850
  }
724
851
  interface ListProjectsOptions {
725
852
  /** Cursor paging options. */
@@ -733,8 +860,9 @@ interface ListProjectsOptions {
733
860
  * @documentationMaturity preview
734
861
  * @requiredField projectId
735
862
  * @permissionId containers:projects:v1:project:get_himalaya_authorization
863
+ * @applicableIdentity APP
736
864
  * @fqn wix.containers.projects.v1.ContainersProjects.GetHimalayaAuthorization
737
865
  */
738
866
  declare function getHimalayaAuthorization(projectId: string): Promise<NonNullablePaths<GetHimalayaAuthorizationResponse, `authorizationVersion` | `metaSiteId` | `projectId` | `canonicalApp` | `workerLaunch` | `saveDesign`, 0>>;
739
867
 
740
- export { type AccountInfo, type ActionEvent, type CreateAgentSessionRequest, type CreateAgentSessionResponse, type CreateProjectRequest, type CreateProjectResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DeleteProjectRequest, type DeleteProjectResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetHimalayaAuthorizationRequest, type GetHimalayaAuthorizationResponse, type GetProjectRequest, type GetProjectResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListProjectsForCurrentUserRequest, type ListProjectsForCurrentUserResponse, type ListProjectsOptions, type ListProjectsRequest, type ListProjectsResponse, type MessageEnvelope, Platform, type PlatformWithLiterals, type Project, type ProjectPlanReady, type ProjectResumeRequested, type ProjectStartRequested, ProjectStatus, type ProjectStatusWithLiterals, type RefreshAgentSiteTokenRequest, type RefreshAgentSiteTokenResponse, type RegenerateProjectIconRequest, type RegenerateProjectIconResponse, type RegenerateProjectNameRequest, type RegenerateProjectNameResponse, type RestoreInfo, type ResumeProjectRequest, type ResumeProjectResponse, SandboxStatus, type SandboxStatusWithLiterals, type SaveProjectDesignOptions, type SaveProjectDesignRequest, type SaveProjectDesignResponse, type StartProjectRequest, type StartProjectResponse, type UpdateProject, type UpdateProjectRequest, type UpdateProjectResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getHimalayaAuthorization, getProject, resumeProject, saveProjectDesign };
868
+ export { type AccountInfo, type ActionEvent, type CreateAgentSessionRequest, type CreateAgentSessionResponse, type CreateProjectRequest, type CreateProjectResponse, type CursorPaging, type CursorPagingMetadata, type Cursors, type DeleteProjectRequest, type DeleteProjectResponse, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type GetHimalayaAuthorizationRequest, type GetHimalayaAuthorizationResponse, type GetProjectRequest, type GetProjectResponse, type IdentificationData, type IdentificationDataIdOneOf, type ListProjectsForCurrentUserRequest, type ListProjectsForCurrentUserResponse, type ListProjectsOptions, type ListProjectsRequest, type ListProjectsResponse, type MessageEnvelope, Platform, type PlatformWithLiterals, type Project, type ProjectPlanReady, type ProjectResumeRequested, type ProjectStartRequested, ProjectStatus, type ProjectStatusWithLiterals, type RefreshAgentSiteTokenRequest, type RefreshAgentSiteTokenResponse, type RegenerateProjectIconRequest, type RegenerateProjectIconResponse, type RegenerateProjectNameRequest, type RegenerateProjectNameResponse, type RestoreInfo, type RestoreReleaseOptions, type RestoreReleaseRequest, type RestoreReleaseResponse, type ResumeProjectRequest, type ResumeProjectResponse, SandboxStatus, type SandboxStatusWithLiterals, type SaveProjectDesignOptions, type SaveProjectDesignRequest, type SaveProjectDesignResponse, type StartProjectRequest, type StartProjectResponse, type UpdateProject, type UpdateProjectRequest, type UpdateProjectResponse, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, getHimalayaAuthorization, getProject, restoreRelease, resumeProject, saveProjectDesign };
@@ -31,6 +31,7 @@ __export(index_typings_exports, {
31
31
  listProjects: () => listProjects2,
32
32
  regenerateProjectIcon: () => regenerateProjectIcon2,
33
33
  regenerateProjectName: () => regenerateProjectName2,
34
+ restoreRelease: () => restoreRelease2,
34
35
  resumeProject: () => resumeProject2,
35
36
  saveProjectDesign: () => saveProjectDesign2,
36
37
  updateProject: () => updateProject2
@@ -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)({
@@ -631,6 +694,7 @@ async function getHimalayaAuthorization2(projectId) {
631
694
  listProjects,
632
695
  regenerateProjectIcon,
633
696
  regenerateProjectName,
697
+ restoreRelease,
634
698
  resumeProject,
635
699
  saveProjectDesign,
636
700
  updateProject