@wix/auto_sdk_site-import_imports 1.0.6 → 1.0.8

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, 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';
2
+ import { StartImportOptions, StartImportResponse, GetImportStatusOptions, GetImportStatusResponse, GetImportDebugResponse, CancelImportResponse, SendImportMessageResponse, StartFrontendPreviewResponse, GetImportSourceOptions, GetImportSourceResponse, GetImportSourceFileOptions, GetImportSourceFileResponse, GetImportSourceForSiteOptions, GetImportSourceForSiteResponse, GetImportSourceFileForSiteOptions, GetImportSourceFileForSiteResponse, SearchImportSourceOptions, SearchImportSourceResponse, SearchImportSourceForSiteOptions, SearchImportSourceForSiteResponse, GetImportBySiteOptions, GetImportBySiteResponse, StartSkillSessionOptions } from './index.typings.js';
3
+ export { CancelImportRequest, ClaudeResultSummary, FailedTaskDetail, GetImportBySiteRequest, GetImportDebugRequest, GetImportSourceFileForSiteRequest, GetImportSourceFileRequest, GetImportSourceForSiteRequest, GetImportSourceRequest, GetImportStatusRequest, Import, ImportActivity, ImportActivityKind, ImportActivityKindWithLiterals, ImportArtifact, ImportArtifactFormat, ImportArtifactFormatWithLiterals, ImportDestination, ImportDestinationWithLiterals, ImportStatus, ImportStatusWithLiterals, ImportTodo, ImportTodoStatus, ImportTodoStatusWithLiterals, LinkSkillSessionRequest, LinkSkillSessionResponse, SearchImportSourceForSiteRequest, SearchImportSourceRequest, SearchMatch, SendImportMessageRequest, SourceChange, SourceChangeStatus, SourceChangeStatusWithLiterals, SourceConfidence, SourceConfidenceWithLiterals, SourceFile, SourceMatch, SourcePlatform, SourcePlatformWithLiterals, SourceSyncMode, SourceSyncModeWithLiterals, StartFrontendPreviewRequest, StartImportRequest, StartSkillSessionRequest, StartSkillSessionResponse, TaskDebug } from './index.typings.js';
4
4
 
5
5
  declare function startImport$1(httpClient: HttpClient): StartImportSignature;
6
6
  interface StartImportSignature {
@@ -217,6 +217,41 @@ interface GetImportBySiteSignature {
217
217
  */
218
218
  (options?: GetImportBySiteOptions): Promise<NonNullablePaths<GetImportBySiteResponse, `importId`, 0>>;
219
219
  }
220
+ declare function startSkillSession$1(httpClient: HttpClient): StartSkillSessionSignature;
221
+ interface StartSkillSessionSignature {
222
+ /**
223
+ * Tell the service that someone started the `wix-replatform` skill, BEFORE they have logged in
224
+ * (spec 0030). The one deliberate anonymous method of this service: it reads two fields, writes
225
+ * one log line (`bix.skill-session.started`) and touches no sandbox, import, key-value store,
226
+ * Conductor or secret, which is why it may be anonymous. Not behind the import rollout: the
227
+ * point is to count people the rollout does not enable.
228
+ * `anonymous: ALLOWED` must be the ONLY audience (the guidelines forbid mixing it) and the
229
+ * method has no permission option (the permissions manager treats a permission on an anonymous
230
+ * method as a misconfiguration). A method with no account is ORGANIZATION-tenanted, overriding
231
+ * this service's ACCOUNT default for this one rpc.
232
+ * The platform enforces the GUID format and maxLength below; the version's character set and the
233
+ * all-zeros id are checked by the handler (the proto cannot express either).
234
+ * flynt: `anonymous-identity-requires-approval` is excluded in code on this method (below), which
235
+ * makes Wix Standards raise `flynt-exclusions`; that one is opted out in Standards with the reason
236
+ * and P13n reviews it (spec 0030 A.4 / A.10 step 1).
237
+ * @param - Random GUID the skill generated for this run. The all-zeros GUID is refused by the handler.
238
+ */
239
+ (skillSessionId: string, options: NonNullablePaths<StartSkillSessionOptions, `skillsVersion`, 0>): Promise<void>;
240
+ }
241
+ declare function linkSkillSession$1(httpClient: HttpClient): LinkSkillSessionSignature;
242
+ interface LinkSkillSessionSignature {
243
+ /**
244
+ * Tie a skill session to the caller's account, after `wix login` (spec 0030). The account comes
245
+ * from the gateway-signed identity (`requireIdentity(ctx).accountId`), never the request: the
246
+ * message has no account field. Writes one log line (`bix.skill-session.linked`) every call and
247
+ * keeps no state. Not behind the import rollout: it works for an owner account that
248
+ * StartImport answers with NOT_ENABLED. Its own permission, in the same scope as start_import.
249
+ * Logged-in users only: a skill session is linked by the account owner who ran `wix login`.
250
+ * @param - The id the skill sent in StartSkillSession. There is deliberately no account field: the
251
+ * account is read from the caller's login.
252
+ */
253
+ (skillSessionId: string): Promise<void>;
254
+ }
220
255
 
221
256
  declare const startImport: MaybeContext<BuildRESTFunction<typeof startImport$1> & typeof startImport$1>;
222
257
  declare const getImportStatus: MaybeContext<BuildRESTFunction<typeof getImportStatus$1> & typeof getImportStatus$1>;
@@ -231,5 +266,7 @@ declare const getImportSourceFileForSite: MaybeContext<BuildRESTFunction<typeof
231
266
  declare const searchImportSource: MaybeContext<BuildRESTFunction<typeof searchImportSource$1> & typeof searchImportSource$1>;
232
267
  declare const searchImportSourceForSite: MaybeContext<BuildRESTFunction<typeof searchImportSourceForSite$1> & typeof searchImportSourceForSite$1>;
233
268
  declare const getImportBySite: MaybeContext<BuildRESTFunction<typeof getImportBySite$1> & typeof getImportBySite$1>;
269
+ declare const startSkillSession: MaybeContext<BuildRESTFunction<typeof startSkillSession$1> & typeof startSkillSession$1>;
270
+ declare const linkSkillSession: MaybeContext<BuildRESTFunction<typeof linkSkillSession$1> & typeof linkSkillSession$1>;
234
271
 
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 };
272
+ export { CancelImportResponse, GetImportBySiteOptions, GetImportBySiteResponse, GetImportDebugResponse, GetImportSourceFileForSiteOptions, GetImportSourceFileForSiteResponse, GetImportSourceFileOptions, GetImportSourceFileResponse, GetImportSourceForSiteOptions, GetImportSourceForSiteResponse, GetImportSourceOptions, GetImportSourceResponse, GetImportStatusOptions, GetImportStatusResponse, SearchImportSourceForSiteOptions, SearchImportSourceForSiteResponse, SearchImportSourceOptions, SearchImportSourceResponse, SendImportMessageResponse, StartFrontendPreviewResponse, StartImportOptions, StartImportResponse, StartSkillSessionOptions, cancelImport, getImportBySite, getImportDebug, getImportSource, getImportSourceFile, getImportSourceFileForSite, getImportSourceForSite, getImportStatus, linkSkillSession, searchImportSource, searchImportSourceForSite, sendImportMessage, startFrontendPreview, startImport, startSkillSession };
@@ -22,6 +22,7 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  ImportActivityKind: () => ImportActivityKind,
24
24
  ImportArtifactFormat: () => ImportArtifactFormat,
25
+ ImportDestination: () => ImportDestination,
25
26
  ImportStatus: () => ImportStatus,
26
27
  ImportTodoStatus: () => ImportTodoStatus,
27
28
  SourceChangeStatus: () => SourceChangeStatus,
@@ -36,11 +37,13 @@ __export(index_exports, {
36
37
  getImportSourceFileForSite: () => getImportSourceFileForSite4,
37
38
  getImportSourceForSite: () => getImportSourceForSite4,
38
39
  getImportStatus: () => getImportStatus4,
40
+ linkSkillSession: () => linkSkillSession4,
39
41
  searchImportSource: () => searchImportSource4,
40
42
  searchImportSourceForSite: () => searchImportSourceForSite4,
41
43
  sendImportMessage: () => sendImportMessage4,
42
44
  startFrontendPreview: () => startFrontendPreview4,
43
- startImport: () => startImport4
45
+ startImport: () => startImport4,
46
+ startSkillSession: () => startSkillSession4
44
47
  });
45
48
  module.exports = __toCommonJS(index_exports);
46
49
 
@@ -381,8 +384,56 @@ function getImportBySite(payload) {
381
384
  }
382
385
  return __getImportBySite;
383
386
  }
387
+ function startSkillSession(payload) {
388
+ function __startSkillSession({ host }) {
389
+ const metadata = {
390
+ entityFqdn: "wix.ecom.site_import.v1.import",
391
+ method: "POST",
392
+ methodFqn: "wix.ecom.site_import.v1.SiteImportService.StartSkillSession",
393
+ packageName: PACKAGE_NAME,
394
+ migrationOptions: {
395
+ optInTransformResponse: true
396
+ },
397
+ url: resolveWixEcomSiteImportV1SiteImportServiceUrl({
398
+ protoPath: "/v1/skill-sessions",
399
+ data: payload,
400
+ host
401
+ }),
402
+ data: payload
403
+ };
404
+ return metadata;
405
+ }
406
+ return __startSkillSession;
407
+ }
408
+ function linkSkillSession(payload) {
409
+ function __linkSkillSession({ host }) {
410
+ const metadata = {
411
+ entityFqdn: "wix.ecom.site_import.v1.import",
412
+ method: "POST",
413
+ methodFqn: "wix.ecom.site_import.v1.SiteImportService.LinkSkillSession",
414
+ packageName: PACKAGE_NAME,
415
+ migrationOptions: {
416
+ optInTransformResponse: true
417
+ },
418
+ url: resolveWixEcomSiteImportV1SiteImportServiceUrl({
419
+ protoPath: "/v1/skill-sessions/link",
420
+ data: payload,
421
+ host
422
+ }),
423
+ data: payload
424
+ };
425
+ return metadata;
426
+ }
427
+ return __linkSkillSession;
428
+ }
384
429
 
385
430
  // src/ecom-site-import-v1-import-imports.universal.ts
431
+ var ImportDestination = /* @__PURE__ */ ((ImportDestination2) => {
432
+ ImportDestination2["UNKNOWN_IMPORT_DESTINATION"] = "UNKNOWN_IMPORT_DESTINATION";
433
+ ImportDestination2["NEW_SITE"] = "NEW_SITE";
434
+ ImportDestination2["CONTEXT_SITE"] = "CONTEXT_SITE";
435
+ return ImportDestination2;
436
+ })(ImportDestination || {});
386
437
  var SourcePlatform = /* @__PURE__ */ ((SourcePlatform2) => {
387
438
  SourcePlatform2["UNKNOWN_SOURCE_PLATFORM"] = "UNKNOWN_SOURCE_PLATFORM";
388
439
  SourcePlatform2["SHOPIFY"] = "SHOPIFY";
@@ -449,7 +500,8 @@ async function startImport2(request, options) {
449
500
  request,
450
501
  sourceUrl: options?.sourceUrl,
451
502
  fileUrls: options?.fileUrls,
452
- forceNew: options?.forceNew
503
+ forceNew: options?.forceNew,
504
+ destination: options?.destination
453
505
  });
454
506
  const reqOpts = startImport(payload);
455
507
  sideEffects?.onSiteCall?.();
@@ -466,7 +518,8 @@ async function startImport2(request, options) {
466
518
  request: "$[0]",
467
519
  sourceUrl: "$[1].sourceUrl",
468
520
  fileUrls: "$[1].fileUrls",
469
- forceNew: "$[1].forceNew"
521
+ forceNew: "$[1].forceNew",
522
+ destination: "$[1].destination"
470
523
  },
471
524
  singleArgumentUnchanged: false
472
525
  },
@@ -853,6 +906,58 @@ async function getImportBySite2(options) {
853
906
  throw transformedError;
854
907
  }
855
908
  }
909
+ async function startSkillSession2(skillSessionId, options) {
910
+ const { httpClient, sideEffects } = arguments[2];
911
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
912
+ skillSessionId,
913
+ skillsVersion: options?.skillsVersion
914
+ });
915
+ const reqOpts = startSkillSession(payload);
916
+ sideEffects?.onSiteCall?.();
917
+ try {
918
+ const result = await httpClient.request(reqOpts);
919
+ sideEffects?.onSuccess?.(result);
920
+ } catch (err) {
921
+ const transformedError = (0, import_transform_error.transformError)(
922
+ err,
923
+ {
924
+ spreadPathsToArguments: {},
925
+ explicitPathsToArguments: {
926
+ skillSessionId: "$[0]",
927
+ skillsVersion: "$[1].skillsVersion"
928
+ },
929
+ singleArgumentUnchanged: false
930
+ },
931
+ ["skillSessionId", "options"]
932
+ );
933
+ sideEffects?.onError?.(err);
934
+ throw transformedError;
935
+ }
936
+ }
937
+ async function linkSkillSession2(skillSessionId) {
938
+ const { httpClient, sideEffects } = arguments[1];
939
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
940
+ skillSessionId
941
+ });
942
+ const reqOpts = linkSkillSession(payload);
943
+ sideEffects?.onSiteCall?.();
944
+ try {
945
+ const result = await httpClient.request(reqOpts);
946
+ sideEffects?.onSuccess?.(result);
947
+ } catch (err) {
948
+ const transformedError = (0, import_transform_error.transformError)(
949
+ err,
950
+ {
951
+ spreadPathsToArguments: {},
952
+ explicitPathsToArguments: { skillSessionId: "$[0]" },
953
+ singleArgumentUnchanged: false
954
+ },
955
+ ["skillSessionId"]
956
+ );
957
+ sideEffects?.onError?.(err);
958
+ throw transformedError;
959
+ }
960
+ }
856
961
 
857
962
  // src/ecom-site-import-v1-import-imports.public.ts
858
963
  function startImport3(httpClient) {
@@ -954,6 +1059,21 @@ function getImportBySite3(httpClient) {
954
1059
  { httpClient }
955
1060
  );
956
1061
  }
1062
+ function startSkillSession3(httpClient) {
1063
+ return (skillSessionId, options) => startSkillSession2(
1064
+ skillSessionId,
1065
+ options,
1066
+ // @ts-ignore
1067
+ { httpClient }
1068
+ );
1069
+ }
1070
+ function linkSkillSession3(httpClient) {
1071
+ return (skillSessionId) => linkSkillSession2(
1072
+ skillSessionId,
1073
+ // @ts-ignore
1074
+ { httpClient }
1075
+ );
1076
+ }
957
1077
 
958
1078
  // src/ecom-site-import-v1-import-imports.context.ts
959
1079
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
@@ -970,10 +1090,13 @@ var getImportSourceFileForSite4 = /* @__PURE__ */ (0, import_rest_modules3.creat
970
1090
  var searchImportSource4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(searchImportSource3);
971
1091
  var searchImportSourceForSite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(searchImportSourceForSite3);
972
1092
  var getImportBySite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getImportBySite3);
1093
+ var startSkillSession4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(startSkillSession3);
1094
+ var linkSkillSession4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(linkSkillSession3);
973
1095
  // Annotate the CommonJS export names for ESM import in node:
974
1096
  0 && (module.exports = {
975
1097
  ImportActivityKind,
976
1098
  ImportArtifactFormat,
1099
+ ImportDestination,
977
1100
  ImportStatus,
978
1101
  ImportTodoStatus,
979
1102
  SourceChangeStatus,
@@ -988,10 +1111,12 @@ var getImportBySite4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule
988
1111
  getImportSourceFileForSite,
989
1112
  getImportSourceForSite,
990
1113
  getImportStatus,
1114
+ linkSkillSession,
991
1115
  searchImportSource,
992
1116
  searchImportSourceForSite,
993
1117
  sendImportMessage,
994
1118
  startFrontendPreview,
995
- startImport
1119
+ startImport,
1120
+ startSkillSession
996
1121
  });
997
1122
  //# sourceMappingURL=index.js.map