@wix/auto_sdk_site-import_imports 1.0.2 → 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 { 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
@@ -66,6 +68,10 @@ function resolveWixEcomSiteImportV1SiteImportServiceUrl(opts) {
66
68
  {
67
69
  srcPath: "/site-import",
68
70
  destPath: ""
71
+ },
72
+ {
73
+ srcPath: "/ecom/site-import",
74
+ destPath: ""
69
75
  }
70
76
  ],
71
77
  _: [
@@ -312,6 +318,48 @@ function getImportSourceFileForSite(payload) {
312
318
  }
313
319
  return __getImportSourceFileForSite;
314
320
  }
321
+ function searchImportSource(payload) {
322
+ function __searchImportSource({ host }) {
323
+ const metadata = {
324
+ entityFqdn: "wix.ecom.site_import.v1.import",
325
+ method: "GET",
326
+ methodFqn: "wix.ecom.site_import.v1.SiteImportService.SearchImportSource",
327
+ packageName: PACKAGE_NAME,
328
+ migrationOptions: {
329
+ optInTransformResponse: true
330
+ },
331
+ url: resolveWixEcomSiteImportV1SiteImportServiceUrl({
332
+ protoPath: "/v1/imports/{importId}/source/search",
333
+ data: payload,
334
+ host
335
+ }),
336
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
337
+ };
338
+ return metadata;
339
+ }
340
+ return __searchImportSource;
341
+ }
342
+ function searchImportSourceForSite(payload) {
343
+ function __searchImportSourceForSite({ host }) {
344
+ const metadata = {
345
+ entityFqdn: "wix.ecom.site_import.v1.import",
346
+ method: "GET",
347
+ methodFqn: "wix.ecom.site_import.v1.SiteImportService.SearchImportSourceForSite",
348
+ packageName: PACKAGE_NAME,
349
+ migrationOptions: {
350
+ optInTransformResponse: true
351
+ },
352
+ url: resolveWixEcomSiteImportV1SiteImportServiceUrl({
353
+ protoPath: "/v1/site-imports/source/search",
354
+ data: payload,
355
+ host
356
+ }),
357
+ params: (0, import_rest_modules.toURLSearchParams)(payload)
358
+ };
359
+ return metadata;
360
+ }
361
+ return __searchImportSourceForSite;
362
+ }
315
363
  function getImportBySite(payload) {
316
364
  function __getImportBySite({ host }) {
317
365
  const metadata = {
@@ -589,7 +637,13 @@ async function getImportSourceFile2(importId, checkpoint, options) {
589
637
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
590
638
  importId,
591
639
  checkpoint,
592
- filePath: options?.filePath
640
+ filePath: options?.filePath,
641
+ tail: options?.tail,
642
+ head: options?.head,
643
+ lines: options?.lines,
644
+ grep: options?.grep,
645
+ context: options?.context,
646
+ fixed: options?.fixed
593
647
  });
594
648
  const reqOpts = getImportSourceFile(payload);
595
649
  sideEffects?.onSiteCall?.();
@@ -605,7 +659,13 @@ async function getImportSourceFile2(importId, checkpoint, options) {
605
659
  explicitPathsToArguments: {
606
660
  importId: "$[0]",
607
661
  checkpoint: "$[1]",
608
- filePath: "$[2].filePath"
662
+ filePath: "$[2].filePath",
663
+ tail: "$[2].tail",
664
+ head: "$[2].head",
665
+ lines: "$[2].lines",
666
+ grep: "$[2].grep",
667
+ context: "$[2].context",
668
+ fixed: "$[2].fixed"
609
669
  },
610
670
  singleArgumentUnchanged: false
611
671
  },
@@ -651,7 +711,13 @@ async function getImportSourceFileForSite2(checkpoint, options) {
651
711
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
652
712
  checkpoint,
653
713
  filePath: options?.filePath,
654
- importId: options?.importId
714
+ importId: options?.importId,
715
+ tail: options?.tail,
716
+ head: options?.head,
717
+ lines: options?.lines,
718
+ grep: options?.grep,
719
+ context: options?.context,
720
+ fixed: options?.fixed
655
721
  });
656
722
  const reqOpts = getImportSourceFileForSite(payload);
657
723
  sideEffects?.onSiteCall?.();
@@ -667,7 +733,13 @@ async function getImportSourceFileForSite2(checkpoint, options) {
667
733
  explicitPathsToArguments: {
668
734
  checkpoint: "$[0]",
669
735
  filePath: "$[1].filePath",
670
- importId: "$[1].importId"
736
+ importId: "$[1].importId",
737
+ tail: "$[1].tail",
738
+ head: "$[1].head",
739
+ lines: "$[1].lines",
740
+ grep: "$[1].grep",
741
+ context: "$[1].context",
742
+ fixed: "$[1].fixed"
671
743
  },
672
744
  singleArgumentUnchanged: false
673
745
  },
@@ -677,6 +749,80 @@ async function getImportSourceFileForSite2(checkpoint, options) {
677
749
  throw transformedError;
678
750
  }
679
751
  }
752
+ async function searchImportSource2(importId, options) {
753
+ const { httpClient, sideEffects } = arguments[2];
754
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
755
+ importId,
756
+ checkpoint: options?.checkpoint,
757
+ pattern: options?.pattern,
758
+ fixed: options?.fixed,
759
+ context: options?.context,
760
+ pathPrefix: options?.pathPrefix
761
+ });
762
+ const reqOpts = searchImportSource(payload);
763
+ sideEffects?.onSiteCall?.();
764
+ try {
765
+ const result = await httpClient.request(reqOpts);
766
+ sideEffects?.onSuccess?.(result);
767
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
768
+ } catch (err) {
769
+ const transformedError = (0, import_transform_error.transformError)(
770
+ err,
771
+ {
772
+ spreadPathsToArguments: {},
773
+ explicitPathsToArguments: {
774
+ importId: "$[0]",
775
+ checkpoint: "$[1].checkpoint",
776
+ pattern: "$[1].pattern",
777
+ fixed: "$[1].fixed",
778
+ context: "$[1].context",
779
+ pathPrefix: "$[1].pathPrefix"
780
+ },
781
+ singleArgumentUnchanged: false
782
+ },
783
+ ["importId", "options"]
784
+ );
785
+ sideEffects?.onError?.(err);
786
+ throw transformedError;
787
+ }
788
+ }
789
+ async function searchImportSourceForSite2(options) {
790
+ const { httpClient, sideEffects } = arguments[1];
791
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
792
+ importId: options?.importId,
793
+ checkpoint: options?.checkpoint,
794
+ pattern: options?.pattern,
795
+ fixed: options?.fixed,
796
+ context: options?.context,
797
+ pathPrefix: options?.pathPrefix
798
+ });
799
+ const reqOpts = searchImportSourceForSite(payload);
800
+ sideEffects?.onSiteCall?.();
801
+ try {
802
+ const result = await httpClient.request(reqOpts);
803
+ sideEffects?.onSuccess?.(result);
804
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
805
+ } catch (err) {
806
+ const transformedError = (0, import_transform_error.transformError)(
807
+ err,
808
+ {
809
+ spreadPathsToArguments: {},
810
+ explicitPathsToArguments: {
811
+ importId: "$[0].importId",
812
+ checkpoint: "$[0].checkpoint",
813
+ pattern: "$[0].pattern",
814
+ fixed: "$[0].fixed",
815
+ context: "$[0].context",
816
+ pathPrefix: "$[0].pathPrefix"
817
+ },
818
+ singleArgumentUnchanged: false
819
+ },
820
+ ["options"]
821
+ );
822
+ sideEffects?.onError?.(err);
823
+ throw transformedError;
824
+ }
825
+ }
680
826
  async function getImportBySite2(options) {
681
827
  const { httpClient, sideEffects } = arguments[1];
682
828
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
@@ -785,6 +931,21 @@ function getImportSourceFileForSite3(httpClient) {
785
931
  { httpClient }
786
932
  );
787
933
  }
934
+ function searchImportSource3(httpClient) {
935
+ return (importId, options) => searchImportSource2(
936
+ importId,
937
+ options,
938
+ // @ts-ignore
939
+ { httpClient }
940
+ );
941
+ }
942
+ function searchImportSourceForSite3(httpClient) {
943
+ return (options) => searchImportSourceForSite2(
944
+ options,
945
+ // @ts-ignore
946
+ { httpClient }
947
+ );
948
+ }
788
949
  function getImportBySite3(httpClient) {
789
950
  return (options) => getImportBySite2(
790
951
  options,
@@ -805,6 +966,8 @@ var getImportSource4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule
805
966
  var getImportSourceFile4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getImportSourceFile3);
806
967
  var getImportSourceForSite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getImportSourceForSite3);
807
968
  var getImportSourceFileForSite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getImportSourceFileForSite3);
969
+ var searchImportSource4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(searchImportSource3);
970
+ var searchImportSourceForSite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(searchImportSourceForSite3);
808
971
  var getImportBySite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getImportBySite3);
809
972
  // Annotate the CommonJS export names for ESM import in node:
810
973
  0 && (module.exports = {
@@ -824,6 +987,8 @@ var getImportBySite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule
824
987
  getImportSourceFileForSite,
825
988
  getImportSourceForSite,
826
989
  getImportStatus,
990
+ searchImportSource,
991
+ searchImportSourceForSite,
827
992
  sendImportMessage,
828
993
  startFrontendPreview,
829
994
  startImport