@wix/auto_sdk_site-import_imports 1.0.1 → 1.0.3

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 { StartImportOptions, StartImportResponse, GetImportStatusOptions, GetImportStatusResponse, GetImportDebugResponse, CancelImportResponse, SendImportMessageResponse, StartFrontendPreviewResponse, GetImportSourceOptions, GetImportSourceResponse, GetImportSourceFileOptions, GetImportSourceFileResponse, GetImportSourceForSiteOptions, GetImportSourceForSiteResponse, GetImportSourceFileForSiteOptions, GetImportSourceFileForSiteResponse, GetImportBySiteOptions, GetImportBySiteResponse } from './index.typings.js';
3
- export { CancelImportRequest, ClaudeResultSummary, FailedTaskDetail, GetImportBySiteRequest, GetImportDebugRequest, GetImportSourceFileForSiteRequest, GetImportSourceFileRequest, GetImportSourceForSiteRequest, GetImportSourceRequest, GetImportStatusRequest, Import, ImportActivity, ImportActivityKind, ImportActivityKindWithLiterals, ImportArtifact, ImportArtifactFormat, ImportArtifactFormatWithLiterals, ImportStatus, ImportStatusWithLiterals, ImportTodo, ImportTodoStatus, ImportTodoStatusWithLiterals, SendImportMessageRequest, SourceChange, SourceChangeStatus, SourceChangeStatusWithLiterals, SourceConfidence, SourceConfidenceWithLiterals, SourceFile, SourcePlatform, SourcePlatformWithLiterals, SourceSyncMode, SourceSyncModeWithLiterals, StartFrontendPreviewRequest, StartImportRequest, TaskDebug } from './index.typings.js';
2
+ import { StartImportOptions, StartImportResponse, GetImportStatusOptions, GetImportStatusResponse, GetImportDebugResponse, CancelImportResponse, SendImportMessageResponse, StartFrontendPreviewResponse, GetImportSourceOptions, GetImportSourceResponse, GetImportSourceFileOptions, GetImportSourceFileResponse, GetImportSourceForSiteOptions, GetImportSourceForSiteResponse, GetImportSourceFileForSiteOptions, GetImportSourceFileForSiteResponse, SearchImportSourceOptions, SearchImportSourceResponse, SearchImportSourceForSiteOptions, SearchImportSourceForSiteResponse, GetImportBySiteOptions, GetImportBySiteResponse } from './index.typings.js';
3
+ export { CancelImportRequest, ClaudeResultSummary, FailedTaskDetail, GetImportBySiteRequest, GetImportDebugRequest, GetImportSourceFileForSiteRequest, GetImportSourceFileRequest, GetImportSourceForSiteRequest, GetImportSourceRequest, GetImportStatusRequest, Import, ImportActivity, ImportActivityKind, ImportActivityKindWithLiterals, ImportArtifact, ImportArtifactFormat, ImportArtifactFormatWithLiterals, ImportStatus, ImportStatusWithLiterals, ImportTodo, ImportTodoStatus, ImportTodoStatusWithLiterals, SearchImportSourceForSiteRequest, SearchImportSourceRequest, SearchMatch, SendImportMessageRequest, SourceChange, SourceChangeStatus, SourceChangeStatusWithLiterals, SourceConfidence, SourceConfidenceWithLiterals, SourceFile, SourceMatch, SourcePlatform, SourcePlatformWithLiterals, SourceSyncMode, SourceSyncModeWithLiterals, StartFrontendPreviewRequest, StartImportRequest, TaskDebug } from './index.typings.js';
4
4
 
5
5
  declare function startImport$1(httpClient: HttpClient): StartImportSignature;
6
6
  interface StartImportSignature {
@@ -124,7 +124,7 @@ interface GetImportSourceFileSignature {
124
124
  * GetImportSource response's `checkpoint`, so a selected file's content
125
125
  * matches what that manifest/delta said was there.
126
126
  */
127
- (importId: string, checkpoint: string, options: NonNullablePaths<GetImportSourceFileOptions, `filePath`, 0>): Promise<NonNullablePaths<GetImportSourceFileResponse, `importId` | `checkpoint` | `path` | `content` | `truncated`, 0>>;
127
+ (importId: string, checkpoint: string, options?: NonNullablePaths<GetImportSourceFileOptions, `filePath`, 0>): Promise<NonNullablePaths<GetImportSourceFileResponse, `importId` | `checkpoint` | `path` | `content` | `truncated` | `firstLine` | `matches` | `matches.${number}.line` | `matches.${number}.text` | `matches.${number}.contextLine` | `truncatedReason`, 2>>;
128
128
  }
129
129
  declare function getImportSourceForSite$1(httpClient: HttpClient): GetImportSourceForSiteSignature;
130
130
  interface GetImportSourceForSiteSignature {
@@ -168,7 +168,31 @@ interface GetImportSourceFileForSiteSignature {
168
168
  * because flynt's request-response naming rule ties one response message to
169
169
  * one rpc name.
170
170
  */
171
- (checkpoint: string, options: NonNullablePaths<GetImportSourceFileForSiteOptions, `filePath` | `importId`, 0>): Promise<NonNullablePaths<GetImportSourceFileForSiteResponse, `importId` | `checkpoint` | `path` | `content` | `truncated`, 0>>;
171
+ (checkpoint: string, options?: NonNullablePaths<GetImportSourceFileForSiteOptions, `filePath` | `importId`, 0>): Promise<NonNullablePaths<GetImportSourceFileForSiteResponse, `importId` | `checkpoint` | `path` | `content` | `truncated` | `firstLine` | `matches` | `matches.${number}.line` | `matches.${number}.text` | `matches.${number}.contextLine` | `truncatedReason`, 2>>;
172
+ }
173
+ declare function searchImportSource$1(httpClient: HttpClient): SearchImportSourceSignature;
174
+ interface SearchImportSourceSignature {
175
+ /**
176
+ * Search the migration's source for a pattern WITHOUT downloading it (spec
177
+ * 0027): the service streams each file from S3, matches, and returns only
178
+ * the matching lines (with optional context). Works only on checkpoints
179
+ * that have a snapshot and only for accounts the snapshot-read rollout
180
+ * covers; otherwise FAILED_PRECONDITION / UNIMPLEMENTED. Bounded — a
181
+ * `truncated_reason` says which cap (files, bytes, time, matches, response
182
+ * size) ended the scan and `last_path_scanned` lets the caller continue with
183
+ * a narrower `path_prefix`.
184
+ * @param - Id of the import whose source to search.
185
+ */
186
+ (importId: string, options?: NonNullablePaths<SearchImportSourceOptions, `pattern`, 0>): Promise<NonNullablePaths<SearchImportSourceResponse, `importId` | `checkpoint` | `matches` | `matches.${number}.path` | `matches.${number}.line` | `matches.${number}.text` | `matches.${number}.contextLine` | `truncated` | `truncatedReason` | `lastPathScanned`, 2>>;
187
+ }
188
+ declare function searchImportSourceForSite$1(httpClient: HttpClient): SearchImportSourceForSiteSignature;
189
+ interface SearchImportSourceForSiteSignature {
190
+ /**
191
+ * SITE-tenancy counterpart to SearchImportSource: the import is resolved
192
+ * from the caller's destination site (optionally pinned with `import_id`),
193
+ * exactly like GetImportSourceForSite.
194
+ */
195
+ (options?: NonNullablePaths<SearchImportSourceForSiteOptions, `pattern`, 0>): Promise<NonNullablePaths<SearchImportSourceForSiteResponse, `importId` | `checkpoint` | `matches` | `matches.${number}.path` | `matches.${number}.line` | `matches.${number}.text` | `matches.${number}.contextLine` | `truncated` | `truncatedReason` | `lastPathScanned`, 2>>;
172
196
  }
173
197
  declare function getImportBySite$1(httpClient: HttpClient): GetImportBySiteSignature;
174
198
  interface GetImportBySiteSignature {
@@ -204,6 +228,8 @@ declare const getImportSource: MaybeContext<BuildRESTFunction<typeof getImportSo
204
228
  declare const getImportSourceFile: MaybeContext<BuildRESTFunction<typeof getImportSourceFile$1> & typeof getImportSourceFile$1>;
205
229
  declare const getImportSourceForSite: MaybeContext<BuildRESTFunction<typeof getImportSourceForSite$1> & typeof getImportSourceForSite$1>;
206
230
  declare const getImportSourceFileForSite: MaybeContext<BuildRESTFunction<typeof getImportSourceFileForSite$1> & typeof getImportSourceFileForSite$1>;
231
+ declare const searchImportSource: MaybeContext<BuildRESTFunction<typeof searchImportSource$1> & typeof searchImportSource$1>;
232
+ declare const searchImportSourceForSite: MaybeContext<BuildRESTFunction<typeof searchImportSourceForSite$1> & typeof searchImportSourceForSite$1>;
207
233
  declare const getImportBySite: MaybeContext<BuildRESTFunction<typeof getImportBySite$1> & typeof getImportBySite$1>;
208
234
 
209
- export { CancelImportResponse, GetImportBySiteOptions, GetImportBySiteResponse, GetImportDebugResponse, GetImportSourceFileForSiteOptions, GetImportSourceFileForSiteResponse, GetImportSourceFileOptions, GetImportSourceFileResponse, GetImportSourceForSiteOptions, GetImportSourceForSiteResponse, GetImportSourceOptions, GetImportSourceResponse, GetImportStatusOptions, GetImportStatusResponse, SendImportMessageResponse, StartFrontendPreviewResponse, StartImportOptions, StartImportResponse, cancelImport, getImportBySite, getImportDebug, getImportSource, getImportSourceFile, getImportSourceFileForSite, getImportSourceForSite, getImportStatus, sendImportMessage, startFrontendPreview, startImport };
235
+ export { CancelImportResponse, GetImportBySiteOptions, GetImportBySiteResponse, GetImportDebugResponse, GetImportSourceFileForSiteOptions, GetImportSourceFileForSiteResponse, GetImportSourceFileOptions, GetImportSourceFileResponse, GetImportSourceForSiteOptions, GetImportSourceForSiteResponse, GetImportSourceOptions, GetImportSourceResponse, GetImportStatusOptions, GetImportStatusResponse, SearchImportSourceForSiteOptions, SearchImportSourceForSiteResponse, SearchImportSourceOptions, SearchImportSourceResponse, SendImportMessageResponse, StartFrontendPreviewResponse, StartImportOptions, StartImportResponse, cancelImport, getImportBySite, getImportDebug, getImportSource, getImportSourceFile, getImportSourceFileForSite, getImportSourceForSite, getImportStatus, searchImportSource, searchImportSourceForSite, sendImportMessage, startFrontendPreview, startImport };
@@ -36,6 +36,8 @@ __export(index_exports, {
36
36
  getImportSourceFileForSite: () => getImportSourceFileForSite4,
37
37
  getImportSourceForSite: () => getImportSourceForSite4,
38
38
  getImportStatus: () => getImportStatus4,
39
+ searchImportSource: () => searchImportSource4,
40
+ searchImportSourceForSite: () => searchImportSourceForSite4,
39
41
  sendImportMessage: () => sendImportMessage4,
40
42
  startFrontendPreview: () => startFrontendPreview4,
41
43
  startImport: () => startImport4
@@ -73,6 +75,12 @@ function resolveWixEcomSiteImportV1SiteImportServiceUrl(opts) {
73
75
  srcPath: "/site-import",
74
76
  destPath: ""
75
77
  }
78
+ ],
79
+ "*.dev.wix-code.com": [
80
+ {
81
+ srcPath: "/_api/bix-site-import",
82
+ destPath: ""
83
+ }
76
84
  ]
77
85
  };
78
86
  return (0, import_rest_modules2.resolveUrl)(Object.assign(opts, { domainToMappings }));
@@ -306,6 +314,48 @@ function getImportSourceFileForSite(payload) {
306
314
  }
307
315
  return __getImportSourceFileForSite;
308
316
  }
317
+ function searchImportSource(payload) {
318
+ function __searchImportSource({ host }) {
319
+ const metadata = {
320
+ entityFqdn: "wix.ecom.site_import.v1.import",
321
+ method: "GET",
322
+ methodFqn: "wix.ecom.site_import.v1.SiteImportService.SearchImportSource",
323
+ packageName: PACKAGE_NAME,
324
+ migrationOptions: {
325
+ optInTransformResponse: true
326
+ },
327
+ url: resolveWixEcomSiteImportV1SiteImportServiceUrl({
328
+ protoPath: "/v1/imports/{importId}/source/search",
329
+ data: payload,
330
+ host
331
+ }),
332
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
333
+ };
334
+ return metadata;
335
+ }
336
+ return __searchImportSource;
337
+ }
338
+ function searchImportSourceForSite(payload) {
339
+ function __searchImportSourceForSite({ host }) {
340
+ const metadata = {
341
+ entityFqdn: "wix.ecom.site_import.v1.import",
342
+ method: "GET",
343
+ methodFqn: "wix.ecom.site_import.v1.SiteImportService.SearchImportSourceForSite",
344
+ packageName: PACKAGE_NAME,
345
+ migrationOptions: {
346
+ optInTransformResponse: true
347
+ },
348
+ url: resolveWixEcomSiteImportV1SiteImportServiceUrl({
349
+ protoPath: "/v1/site-imports/source/search",
350
+ data: payload,
351
+ host
352
+ }),
353
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
354
+ };
355
+ return metadata;
356
+ }
357
+ return __searchImportSourceForSite;
358
+ }
309
359
  function getImportBySite(payload) {
310
360
  function __getImportBySite({ host }) {
311
361
  const metadata = {
@@ -583,7 +633,13 @@ async function getImportSourceFile2(importId, checkpoint, options) {
583
633
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
584
634
  importId,
585
635
  checkpoint,
586
- filePath: options?.filePath
636
+ filePath: options?.filePath,
637
+ tail: options?.tail,
638
+ head: options?.head,
639
+ lines: options?.lines,
640
+ grep: options?.grep,
641
+ context: options?.context,
642
+ fixed: options?.fixed
587
643
  });
588
644
  const reqOpts = getImportSourceFile(payload);
589
645
  sideEffects?.onSiteCall?.();
@@ -599,7 +655,13 @@ async function getImportSourceFile2(importId, checkpoint, options) {
599
655
  explicitPathsToArguments: {
600
656
  importId: "$[0]",
601
657
  checkpoint: "$[1]",
602
- filePath: "$[2].filePath"
658
+ filePath: "$[2].filePath",
659
+ tail: "$[2].tail",
660
+ head: "$[2].head",
661
+ lines: "$[2].lines",
662
+ grep: "$[2].grep",
663
+ context: "$[2].context",
664
+ fixed: "$[2].fixed"
603
665
  },
604
666
  singleArgumentUnchanged: false
605
667
  },
@@ -645,7 +707,13 @@ async function getImportSourceFileForSite2(checkpoint, options) {
645
707
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
646
708
  checkpoint,
647
709
  filePath: options?.filePath,
648
- importId: options?.importId
710
+ importId: options?.importId,
711
+ tail: options?.tail,
712
+ head: options?.head,
713
+ lines: options?.lines,
714
+ grep: options?.grep,
715
+ context: options?.context,
716
+ fixed: options?.fixed
649
717
  });
650
718
  const reqOpts = getImportSourceFileForSite(payload);
651
719
  sideEffects?.onSiteCall?.();
@@ -661,7 +729,13 @@ async function getImportSourceFileForSite2(checkpoint, options) {
661
729
  explicitPathsToArguments: {
662
730
  checkpoint: "$[0]",
663
731
  filePath: "$[1].filePath",
664
- importId: "$[1].importId"
732
+ importId: "$[1].importId",
733
+ tail: "$[1].tail",
734
+ head: "$[1].head",
735
+ lines: "$[1].lines",
736
+ grep: "$[1].grep",
737
+ context: "$[1].context",
738
+ fixed: "$[1].fixed"
665
739
  },
666
740
  singleArgumentUnchanged: false
667
741
  },
@@ -671,6 +745,80 @@ async function getImportSourceFileForSite2(checkpoint, options) {
671
745
  throw transformedError;
672
746
  }
673
747
  }
748
+ async function searchImportSource2(importId, options) {
749
+ const { httpClient, sideEffects } = arguments[2];
750
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
751
+ importId,
752
+ checkpoint: options?.checkpoint,
753
+ pattern: options?.pattern,
754
+ fixed: options?.fixed,
755
+ context: options?.context,
756
+ pathPrefix: options?.pathPrefix
757
+ });
758
+ const reqOpts = searchImportSource(payload);
759
+ sideEffects?.onSiteCall?.();
760
+ try {
761
+ const result = await httpClient.request(reqOpts);
762
+ sideEffects?.onSuccess?.(result);
763
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
764
+ } catch (err) {
765
+ const transformedError = (0, import_transform_error.transformError)(
766
+ err,
767
+ {
768
+ spreadPathsToArguments: {},
769
+ explicitPathsToArguments: {
770
+ importId: "$[0]",
771
+ checkpoint: "$[1].checkpoint",
772
+ pattern: "$[1].pattern",
773
+ fixed: "$[1].fixed",
774
+ context: "$[1].context",
775
+ pathPrefix: "$[1].pathPrefix"
776
+ },
777
+ singleArgumentUnchanged: false
778
+ },
779
+ ["importId", "options"]
780
+ );
781
+ sideEffects?.onError?.(err);
782
+ throw transformedError;
783
+ }
784
+ }
785
+ async function searchImportSourceForSite2(options) {
786
+ const { httpClient, sideEffects } = arguments[1];
787
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
788
+ importId: options?.importId,
789
+ checkpoint: options?.checkpoint,
790
+ pattern: options?.pattern,
791
+ fixed: options?.fixed,
792
+ context: options?.context,
793
+ pathPrefix: options?.pathPrefix
794
+ });
795
+ const reqOpts = searchImportSourceForSite(payload);
796
+ sideEffects?.onSiteCall?.();
797
+ try {
798
+ const result = await httpClient.request(reqOpts);
799
+ sideEffects?.onSuccess?.(result);
800
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
801
+ } catch (err) {
802
+ const transformedError = (0, import_transform_error.transformError)(
803
+ err,
804
+ {
805
+ spreadPathsToArguments: {},
806
+ explicitPathsToArguments: {
807
+ importId: "$[0].importId",
808
+ checkpoint: "$[0].checkpoint",
809
+ pattern: "$[0].pattern",
810
+ fixed: "$[0].fixed",
811
+ context: "$[0].context",
812
+ pathPrefix: "$[0].pathPrefix"
813
+ },
814
+ singleArgumentUnchanged: false
815
+ },
816
+ ["options"]
817
+ );
818
+ sideEffects?.onError?.(err);
819
+ throw transformedError;
820
+ }
821
+ }
674
822
  async function getImportBySite2(options) {
675
823
  const { httpClient, sideEffects } = arguments[1];
676
824
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -779,6 +927,21 @@ function getImportSourceFileForSite3(httpClient) {
779
927
  { httpClient }
780
928
  );
781
929
  }
930
+ function searchImportSource3(httpClient) {
931
+ return (importId, options) => searchImportSource2(
932
+ importId,
933
+ options,
934
+ // @ts-ignore
935
+ { httpClient }
936
+ );
937
+ }
938
+ function searchImportSourceForSite3(httpClient) {
939
+ return (options) => searchImportSourceForSite2(
940
+ options,
941
+ // @ts-ignore
942
+ { httpClient }
943
+ );
944
+ }
782
945
  function getImportBySite3(httpClient) {
783
946
  return (options) => getImportBySite2(
784
947
  options,
@@ -799,6 +962,8 @@ var getImportSource4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule
799
962
  var getImportSourceFile4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getImportSourceFile3);
800
963
  var getImportSourceForSite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getImportSourceForSite3);
801
964
  var getImportSourceFileForSite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getImportSourceFileForSite3);
965
+ var searchImportSource4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(searchImportSource3);
966
+ var searchImportSourceForSite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(searchImportSourceForSite3);
802
967
  var getImportBySite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getImportBySite3);
803
968
  // Annotate the CommonJS export names for ESM import in node:
804
969
  0 && (module.exports = {
@@ -818,6 +983,8 @@ var getImportBySite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule
818
983
  getImportSourceFileForSite,
819
984
  getImportSourceForSite,
820
985
  getImportStatus,
986
+ searchImportSource,
987
+ searchImportSourceForSite,
821
988
  sendImportMessage,
822
989
  startFrontendPreview,
823
990
  startImport