@wix/auto_sdk_ecom_recommendations 1.0.14 → 1.0.16

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.
Files changed (130) hide show
  1. package/build/{es/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts → ecom-recommendations-v1-recommendation-recommendations.universal-CEpjDJVC.d.mts} +30 -14
  2. package/build/{internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts → ecom-recommendations-v1-recommendation-recommendations.universal-CEpjDJVC.d.ts} +30 -14
  3. package/build/{internal/es/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts → index.d.mts} +11 -8
  4. package/build/{cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts → index.d.ts} +11 -8
  5. package/build/index.js +179 -0
  6. package/build/index.js.map +1 -0
  7. package/build/index.mjs +153 -0
  8. package/build/index.mjs.map +1 -0
  9. package/build/{cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts → internal/ecom-recommendations-v1-recommendation-recommendations.universal-CEpjDJVC.d.mts} +30 -14
  10. package/build/internal/{es/src/ecom-recommendations-v1-recommendation-recommendations.types.d.ts → ecom-recommendations-v1-recommendation-recommendations.universal-CEpjDJVC.d.ts} +30 -14
  11. package/build/{es/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts → internal/index.d.mts} +11 -8
  12. package/build/internal/{cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.d.ts → index.d.ts} +11 -8
  13. package/build/internal/index.js +179 -0
  14. package/build/internal/index.js.map +1 -0
  15. package/build/internal/index.mjs +153 -0
  16. package/build/internal/index.mjs.map +1 -0
  17. package/build/internal/meta.d.mts +164 -0
  18. package/build/internal/meta.d.ts +164 -0
  19. package/build/internal/meta.js +128 -0
  20. package/build/internal/meta.js.map +1 -0
  21. package/build/internal/meta.mjs +100 -0
  22. package/build/internal/meta.mjs.map +1 -0
  23. package/build/meta.d.mts +164 -0
  24. package/build/meta.d.ts +164 -0
  25. package/build/meta.js +128 -0
  26. package/build/meta.js.map +1 -0
  27. package/build/meta.mjs +100 -0
  28. package/build/meta.mjs.map +1 -0
  29. package/package.json +12 -11
  30. package/build/cjs/index.d.ts +0 -1
  31. package/build/cjs/index.js +0 -18
  32. package/build/cjs/index.js.map +0 -1
  33. package/build/cjs/index.typings.d.ts +0 -1
  34. package/build/cjs/index.typings.js +0 -18
  35. package/build/cjs/index.typings.js.map +0 -1
  36. package/build/cjs/meta.d.ts +0 -1
  37. package/build/cjs/meta.js +0 -18
  38. package/build/cjs/meta.js.map +0 -1
  39. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +0 -6
  40. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js +0 -10
  41. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +0 -1
  42. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +0 -37
  43. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js +0 -94
  44. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +0 -1
  45. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +0 -14
  46. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +0 -66
  47. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +0 -1
  48. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js +0 -20
  49. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +0 -1
  50. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js +0 -10
  51. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +0 -1
  52. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +0 -260
  53. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +0 -158
  54. package/build/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +0 -1
  55. package/build/es/index.d.ts +0 -1
  56. package/build/es/index.js +0 -2
  57. package/build/es/index.js.map +0 -1
  58. package/build/es/index.typings.d.ts +0 -1
  59. package/build/es/index.typings.js +0 -2
  60. package/build/es/index.typings.js.map +0 -1
  61. package/build/es/meta.d.ts +0 -1
  62. package/build/es/meta.js +0 -2
  63. package/build/es/meta.js.map +0 -1
  64. package/build/es/package.json +0 -3
  65. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +0 -6
  66. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js +0 -6
  67. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +0 -1
  68. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +0 -37
  69. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js +0 -89
  70. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +0 -1
  71. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +0 -14
  72. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +0 -38
  73. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +0 -1
  74. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js +0 -14
  75. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +0 -1
  76. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js +0 -7
  77. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +0 -1
  78. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +0 -260
  79. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +0 -130
  80. package/build/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +0 -1
  81. package/build/internal/cjs/index.d.ts +0 -1
  82. package/build/internal/cjs/index.js +0 -18
  83. package/build/internal/cjs/index.js.map +0 -1
  84. package/build/internal/cjs/index.typings.d.ts +0 -1
  85. package/build/internal/cjs/index.typings.js +0 -18
  86. package/build/internal/cjs/index.typings.js.map +0 -1
  87. package/build/internal/cjs/meta.d.ts +0 -1
  88. package/build/internal/cjs/meta.js +0 -18
  89. package/build/internal/cjs/meta.js.map +0 -1
  90. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +0 -6
  91. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js +0 -10
  92. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +0 -1
  93. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +0 -37
  94. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js +0 -94
  95. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +0 -1
  96. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +0 -14
  97. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +0 -66
  98. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +0 -1
  99. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js +0 -20
  100. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +0 -1
  101. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js +0 -10
  102. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +0 -1
  103. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +0 -260
  104. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +0 -158
  105. package/build/internal/cjs/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +0 -1
  106. package/build/internal/es/index.d.ts +0 -1
  107. package/build/internal/es/index.js +0 -2
  108. package/build/internal/es/index.js.map +0 -1
  109. package/build/internal/es/index.typings.d.ts +0 -1
  110. package/build/internal/es/index.typings.js +0 -2
  111. package/build/internal/es/index.typings.js.map +0 -1
  112. package/build/internal/es/meta.d.ts +0 -1
  113. package/build/internal/es/meta.js +0 -2
  114. package/build/internal/es/meta.js.map +0 -1
  115. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.d.ts +0 -6
  116. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js +0 -6
  117. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.context.js.map +0 -1
  118. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.d.ts +0 -37
  119. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js +0 -89
  120. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.http.js.map +0 -1
  121. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.d.ts +0 -14
  122. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js +0 -38
  123. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.meta.js.map +0 -1
  124. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js +0 -14
  125. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.public.js.map +0 -1
  126. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js +0 -7
  127. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.types.js.map +0 -1
  128. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.d.ts +0 -260
  129. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js +0 -130
  130. package/build/internal/es/src/ecom-recommendations-v1-recommendation-recommendations.universal.js.map +0 -1
@@ -1,94 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getRecommendation = exports.listAvailableAlgorithms = void 0;
4
- const rest_modules_1 = require("@wix/sdk-runtime/rest-modules");
5
- const rest_modules_2 = require("@wix/sdk-runtime/rest-modules");
6
- function resolveComWixEcomRecommendationsV1RecommendationsServiceUrl(opts) {
7
- const domainToMappings = {
8
- 'www.wixapis.com': [
9
- {
10
- srcPath: '/v1/recommendations',
11
- destPath: '/v1/recommendations',
12
- },
13
- {
14
- srcPath: '/ecom/v1/recommendations',
15
- destPath: '/v1/recommendations',
16
- },
17
- ],
18
- };
19
- return (0, rest_modules_2.resolveUrl)(Object.assign(opts, { domainToMappings }));
20
- }
21
- const PACKAGE_NAME = '@wix/auto_sdk_ecom_recommendations';
22
- /**
23
- * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.
24
- *
25
- * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.
26
- *
27
- * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.
28
- *
29
- *
30
- * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:
31
- * 1. The algorithm’s `appId` must match the ID of an installed Wix app.
32
- * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.
33
- *
34
- * Wix app IDs are [listed here](https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions).
35
- */
36
- function listAvailableAlgorithms(payload) {
37
- function __listAvailableAlgorithms({ host }) {
38
- const metadata = {
39
- entityFqdn: 'wix.ecom.recommendations.v1.recommendation',
40
- method: 'GET',
41
- methodFqn: 'com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms',
42
- packageName: PACKAGE_NAME,
43
- url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({
44
- protoPath: '/v1/recommendations/algorithms',
45
- data: payload,
46
- host,
47
- }),
48
- params: (0, rest_modules_1.toURLSearchParams)(payload),
49
- };
50
- return metadata;
51
- }
52
- return __listAvailableAlgorithms;
53
- }
54
- exports.listAvailableAlgorithms = listAvailableAlgorithms;
55
- /**
56
- * Returns a recommendation object containing a list of items to recommend to the customer.
57
- *
58
- * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.
59
- *
60
- * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.
61
- *
62
- * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.
63
- * For example, Wix Stores provides algorithms that can only be used on its own catalogs.
64
- * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.
65
- * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).
66
- *
67
- * `getRecommendation()` operates as follows:
68
- * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.
69
- * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.
70
- * 3. The app runs the algorithms.
71
- * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.
72
- * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.
73
- * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.
74
- */
75
- function getRecommendation(payload) {
76
- function __getRecommendation({ host }) {
77
- const metadata = {
78
- entityFqdn: 'wix.ecom.recommendations.v1.recommendation',
79
- method: 'POST',
80
- methodFqn: 'com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation',
81
- packageName: PACKAGE_NAME,
82
- url: resolveComWixEcomRecommendationsV1RecommendationsServiceUrl({
83
- protoPath: '/v1/recommendations/get',
84
- data: payload,
85
- host,
86
- }),
87
- data: payload,
88
- };
89
- return metadata;
90
- }
91
- return __getRecommendation;
92
- }
93
- exports.getRecommendation = getRecommendation;
94
- //# sourceMappingURL=ecom-recommendations-v1-recommendation-recommendations.http.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ecom-recommendations-v1-recommendation-recommendations.http.js","sourceRoot":"","sources":["../../../src/ecom-recommendations-v1-recommendation-recommendations.http.ts"],"names":[],"mappings":";;;AAAA,gEAAkE;AAClE,gEAA2D;AAI3D,SAAS,2DAA2D,CAClE,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,qBAAqB;aAChC;YACD;gBACE,OAAO,EAAE,0BAA0B;gBACnC,QAAQ,EAAE,qBAAqB;aAChC;SACF;KACF,CAAC;IAEF,OAAO,IAAA,yBAAU,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED,MAAM,YAAY,GAAG,oCAAoC,CAAC;AAE1D;;;;;;;;;;;;;GAaG;AACH,SAAgB,uBAAuB,CACrC,OAAe;IAEf,SAAS,yBAAyB,CAAC,EAAE,IAAI,EAAO;QAC9C,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,4CAA4C;YACxD,MAAM,EAAE,KAAY;YACpB,SAAS,EACP,gFAAgF;YAClF,WAAW,EAAE,YAAY;YACzB,GAAG,EAAE,2DAA2D,CAAC;gBAC/D,SAAS,EAAE,gCAAgC;gBAC3C,IAAI,EAAE,OAAO;gBACb,IAAI;aACL,CAAC;YACF,MAAM,EAAE,IAAA,gCAAiB,EAAC,OAAO,CAAC;SACnC,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,yBAAyB,CAAC;AACnC,CAAC;AAtBD,0DAsBC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,SAAS,mBAAmB,CAAC,EAAE,IAAI,EAAO;QACxC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,4CAA4C;YACxD,MAAM,EAAE,MAAa;YACrB,SAAS,EACP,0EAA0E;YAC5E,WAAW,EAAE,YAAY;YACzB,GAAG,EAAE,2DAA2D,CAAC;gBAC/D,SAAS,EAAE,yBAAyB;gBACpC,IAAI,EAAE,OAAO;gBACb,IAAI;aACL,CAAC;YACF,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,mBAAmB,CAAC;AAC7B,CAAC;AApBD,8CAoBC"}
@@ -1,14 +0,0 @@
1
- import * as ambassadorWixEcomRecommendationsV1RecommendationTypes from './ecom-recommendations-v1-recommendation-recommendations.types.js';
2
- import * as ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes from './ecom-recommendations-v1-recommendation-recommendations.universal.js';
3
- export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
- getUrl: (context: any) => string;
5
- httpMethod: K;
6
- path: string;
7
- pathParams: M;
8
- __requestType: T;
9
- __originalRequestType: S;
10
- __responseType: Q;
11
- __originalResponseType: R;
12
- };
13
- export declare function listAvailableAlgorithms(): __PublicMethodMetaInfo<'GET', {}, ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.ListAvailableAlgorithmsRequest, ambassadorWixEcomRecommendationsV1RecommendationTypes.ListAvailableAlgorithmsRequest, ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.ListAvailableAlgorithmsResponse, ambassadorWixEcomRecommendationsV1RecommendationTypes.ListAvailableAlgorithmsResponse>;
14
- export declare function getRecommendation(): __PublicMethodMetaInfo<'POST', {}, ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationRequest, ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationRequest, ambassadorWixEcomRecommendationsV1RecommendationUniversalTypes.GetRecommendationResponse, ambassadorWixEcomRecommendationsV1RecommendationTypes.GetRecommendationResponse>;
@@ -1,66 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getRecommendation = exports.listAvailableAlgorithms = void 0;
27
- const ambassadorWixEcomRecommendationsV1Recommendation = __importStar(require("./ecom-recommendations-v1-recommendation-recommendations.http.js"));
28
- function listAvailableAlgorithms() {
29
- const payload = {};
30
- const getRequestOptions = ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(payload);
31
- const getUrl = (context) => {
32
- const { url } = getRequestOptions(context);
33
- return url;
34
- };
35
- return {
36
- getUrl,
37
- httpMethod: 'GET',
38
- path: '/v1/recommendations/algorithms',
39
- pathParams: {},
40
- __requestType: null,
41
- __originalRequestType: null,
42
- __responseType: null,
43
- __originalResponseType: null,
44
- };
45
- }
46
- exports.listAvailableAlgorithms = listAvailableAlgorithms;
47
- function getRecommendation() {
48
- const payload = {};
49
- const getRequestOptions = ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);
50
- const getUrl = (context) => {
51
- const { url } = getRequestOptions(context);
52
- return url;
53
- };
54
- return {
55
- getUrl,
56
- httpMethod: 'POST',
57
- path: '/v1/recommendations/get',
58
- pathParams: {},
59
- __requestType: null,
60
- __originalRequestType: null,
61
- __responseType: null,
62
- __originalResponseType: null,
63
- };
64
- }
65
- exports.getRecommendation = getRecommendation;
66
- //# sourceMappingURL=ecom-recommendations-v1-recommendation-recommendations.meta.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ecom-recommendations-v1-recommendation-recommendations.meta.js","sourceRoot":"","sources":["../../../src/ecom-recommendations-v1-recommendation-recommendations.meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mJAAqI;AAsBrI,SAAgB,uBAAuB;IAQrC,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,gDAAgD,CAAC,uBAAuB,CACtE,OAAO,CACR,CAAC;IAEJ,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,KAAK;QACjB,IAAI,EAAE,gCAAgC;QACtC,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA9BD,0DA8BC;AAED,SAAgB,iBAAiB;IAQ/B,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,gDAAgD,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE9E,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,yBAAyB;QAC/B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA5BD,8CA4BC"}
@@ -1,20 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlgorithmType = exports.getRecommendation = exports.listAvailableAlgorithms = exports.__metadata = void 0;
4
- const ecom_recommendations_v1_recommendation_recommendations_universal_js_1 = require("./ecom-recommendations-v1-recommendation-recommendations.universal.js");
5
- exports.__metadata = { PACKAGE_NAME: '@wix/ecom' };
6
- function listAvailableAlgorithms(httpClient) {
7
- return () => (0, ecom_recommendations_v1_recommendation_recommendations_universal_js_1.listAvailableAlgorithms)(
8
- // @ts-ignore
9
- { httpClient });
10
- }
11
- exports.listAvailableAlgorithms = listAvailableAlgorithms;
12
- function getRecommendation(httpClient) {
13
- return (algorithms, options) => (0, ecom_recommendations_v1_recommendation_recommendations_universal_js_1.getRecommendation)(algorithms, options,
14
- // @ts-ignore
15
- { httpClient });
16
- }
17
- exports.getRecommendation = getRecommendation;
18
- var ecom_recommendations_v1_recommendation_recommendations_universal_js_2 = require("./ecom-recommendations-v1-recommendation-recommendations.universal.js");
19
- Object.defineProperty(exports, "AlgorithmType", { enumerable: true, get: function () { return ecom_recommendations_v1_recommendation_recommendations_universal_js_2.AlgorithmType; } });
20
- //# sourceMappingURL=ecom-recommendations-v1-recommendation-recommendations.public.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ecom-recommendations-v1-recommendation-recommendations.public.js","sourceRoot":"","sources":["../../../src/ecom-recommendations-v1-recommendation-recommendations.public.ts"],"names":[],"mappings":";;;AACA,+JAO+E;AAElE,QAAA,UAAU,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC;AAExD,SAAgB,uBAAuB,CACrC,UAAsB;IAEtB,OAAO,GAAG,EAAE,CACV,IAAA,6FAAgC;IAC9B,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AARD,0DAQC;AAoBD,SAAgB,iBAAiB,CAC/B,UAAsB;IAEtB,OAAO,CACL,UAA0D,EAC1D,OAGC,EACD,EAAE,CACF,IAAA,uFAA0B,EACxB,UAAU,EACV,OAAO;IACP,aAAa;IACb,EAAE,UAAU,EAAE,CACf,CAAC;AACN,CAAC;AAhBD,8CAgBC;AAkCD,6JAc+E;AAV7E,oKAAA,aAAa,OAAA"}
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AlgorithmType = void 0;
4
- var AlgorithmType;
5
- (function (AlgorithmType) {
6
- AlgorithmType["UNSPECIFIED"] = "UNSPECIFIED";
7
- AlgorithmType["RELATED_ITEMS"] = "RELATED_ITEMS";
8
- AlgorithmType["GLOBAL"] = "GLOBAL";
9
- })(AlgorithmType || (exports.AlgorithmType = AlgorithmType = {}));
10
- //# sourceMappingURL=ecom-recommendations-v1-recommendation-recommendations.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ecom-recommendations-v1-recommendation-recommendations.types.js","sourceRoot":"","sources":["../../../src/ecom-recommendations-v1-recommendation-recommendations.types.ts"],"names":[],"mappings":";;;AAuHA,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,gDAA+B,CAAA;IAC/B,kCAAiB,CAAA;AACnB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB"}
@@ -1,260 +0,0 @@
1
- import { NonNullablePaths } from '@wix/sdk-types';
2
- export interface Recommendation {
3
- /**
4
- * Recommended items.
5
- * @maxSize 100
6
- */
7
- items?: CatalogReference[];
8
- /** The algorithm used to provide the recommendation. */
9
- algorithm?: Algorithm;
10
- }
11
- /** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */
12
- export interface CatalogReference {
13
- /**
14
- * ID of the item within the catalog it belongs to.
15
- * @minLength 1
16
- * @maxLength 36
17
- */
18
- catalogItemId?: string;
19
- /**
20
- * ID of the app providing the catalog.
21
- *
22
- * You can get your app's ID from its page in the [app dashboard](https://dev.wix.com/dc3/my-apps/).
23
- *
24
- * For items from Wix catalogs, the following values always apply:
25
- * + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
26
- * + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
27
- * + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
28
- * @minLength 1
29
- */
30
- appId?: string;
31
- /**
32
- * Additional item details in key:value pairs. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.
33
- *
34
- * For products and variants from a Wix Stores catalog, learn more about eCommerce integration ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)).
35
- */
36
- options?: Record<string, any> | null;
37
- }
38
- export interface Algorithm {
39
- /**
40
- * Algorithm ID defined by the app providing the algorithm.
41
- * @format GUID
42
- */
43
- _id?: string;
44
- /**
45
- * App ID of the Wix or 3rd-party app providing the algorithm.
46
- *
47
- * Wix app IDs are <a href="https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions" target="_blank">listed here</a>.
48
- * @minLength 1
49
- * @maxLength 36
50
- */
51
- appId?: string;
52
- }
53
- export interface ListAvailableAlgorithmsRequest {
54
- }
55
- export interface ListAvailableAlgorithmsResponse {
56
- /**
57
- * Algorithms available for use on your Wix site or project. See the method description for more information.
58
- * @maxSize 500
59
- */
60
- availableAlgorithms?: AlgorithmInfo[];
61
- }
62
- export interface AlgorithmInfo {
63
- /** How the algorithm is configured. */
64
- config?: AlgorithmConfig;
65
- /**
66
- * The app ID of the application providing the algorithm.
67
- *
68
- * Wix app IDs are <a href="https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions" target="_blank">listed here</a>.
69
- * @minLength 1
70
- * @maxLength 36
71
- */
72
- appId?: string;
73
- /**
74
- * App IDs of catalogs to which the algorithm can be applied.
75
- *
76
- * Wix app IDs are <a href="https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions" target="_blank">listed here</a>.
77
- * @minSize 1
78
- * @maxSize 100
79
- * @minLength 1
80
- * @maxLength 36
81
- */
82
- catalogAppIds?: string[];
83
- }
84
- export interface AlgorithmConfig {
85
- /**
86
- * Algorithm name. This value is not translatable.
87
- * @minLength 1
88
- * @maxLength 50
89
- */
90
- name?: string;
91
- /**
92
- * Algorithm description. This describes how the algorithm works and if it has any limitations regarding site content, number of items in the catalog, site traffic, and so on. This value is not translatable.
93
- * @minLength 1
94
- * @maxLength 500
95
- */
96
- description?: string;
97
- /**
98
- * A supplemental `description`. It can be used to help break up and organize information. You can, for example, display this information as a tooltip or as an additional section that is collapsed by default.
99
- * @minLength 1
100
- * @maxLength 300
101
- */
102
- additionalInfo?: string | null;
103
- /**
104
- * Algorithms may have the following types:
105
- * * `RELATED_ITEMS` - This type of algorithm provides recommendations based on 1 or more other provided items. For example, when an item is added to a cart, the algorithm can suggest other items frequently bought together with that item.
106
- * * `GLOBAL` - This type of algorithm provides general recommendations based on site or project statistics. For example, bestsellers or new arrivals.
107
- */
108
- algorithmType?: AlgorithmTypeWithLiterals;
109
- /**
110
- * Algorithm ID. This must be unique for a specific app but does not have to be unique across all apps on the site or in the project.
111
- * @format GUID
112
- */
113
- algorithmId?: string;
114
- }
115
- export declare enum AlgorithmType {
116
- UNSPECIFIED = "UNSPECIFIED",
117
- RELATED_ITEMS = "RELATED_ITEMS",
118
- GLOBAL = "GLOBAL"
119
- }
120
- /** @enumType */
121
- export type AlgorithmTypeWithLiterals = AlgorithmType | 'UNSPECIFIED' | 'RELATED_ITEMS' | 'GLOBAL';
122
- export interface GetRecommendationRequest {
123
- /**
124
- * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.
125
- * @maxSize 300
126
- */
127
- items?: CatalogReference[];
128
- /**
129
- * A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.
130
- * See the method description for more information.
131
- *
132
- * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.
133
- * @minSize 1
134
- * @maxSize 10
135
- */
136
- algorithms: Algorithm[];
137
- /**
138
- * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.
139
- *
140
- * Max: `100`
141
- * @max 100
142
- */
143
- minimumRecommendedItems?: number;
144
- }
145
- export interface GetRecommendationResponse {
146
- /** An object containing a list of items recommended by 1 of the specified algorithms. The recommendation is empty if none of the specified algorithms recommended enough items. */
147
- recommendation?: Recommendation;
148
- }
149
- export interface ItemAppIdNotSupportedByProvider {
150
- /**
151
- * Items with an App ID not supported by the provider. Supported App IDs can be found in the provider config in the Dev Center.
152
- * @minSize 1
153
- * @maxSize 300
154
- */
155
- items?: CatalogReference[];
156
- /**
157
- * Algorithms that don't support the requested items.
158
- * @minSize 1
159
- * @maxSize 10
160
- */
161
- algorithms?: Algorithm[];
162
- }
163
- export interface RecommendationAlgorithmNotSupported {
164
- /**
165
- * Algorithms not supported by the provider.
166
- * @minSize 1
167
- * @maxSize 10
168
- */
169
- unsupportedAlgorithms?: Algorithm[];
170
- }
171
- type RecommendationNonNullablePaths = `items` | `items.${number}.catalogItemId` | `items.${number}.appId` | `algorithm._id` | `algorithm.appId`;
172
- /**
173
- * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.
174
- *
175
- * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.
176
- *
177
- * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.
178
- *
179
- *
180
- * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:
181
- * 1. The algorithm’s `appId` must match the ID of an installed Wix app.
182
- * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.
183
- *
184
- * Wix app IDs are [listed here](https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions).
185
- * @public
186
- * @permissionId RECOMMENDATIONS.READ
187
- * @permissionScope Manage Stores - all permissions
188
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
189
- * @permissionScope Manage Stores
190
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
191
- * @permissionScope Read eCommerce - all read permissions
192
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
193
- * @permissionScope Manage eCommerce - all permissions
194
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
195
- * @applicableIdentity APP
196
- * @applicableIdentity VISITOR
197
- * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms
198
- */
199
- export declare function listAvailableAlgorithms(): Promise<NonNullablePaths<ListAvailableAlgorithmsResponse, `availableAlgorithms` | `availableAlgorithms.${number}.config.name` | `availableAlgorithms.${number}.config.description` | `availableAlgorithms.${number}.config.algorithmType` | `availableAlgorithms.${number}.config.algorithmId` | `availableAlgorithms.${number}.appId`>>;
200
- /**
201
- * Returns a recommendation object containing a list of items to recommend to the customer.
202
- *
203
- * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.
204
- *
205
- * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.
206
- *
207
- * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.
208
- * For example, Wix Stores provides algorithms that can only be used on its own catalogs.
209
- * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.
210
- * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).
211
- *
212
- * `getRecommendation()` operates as follows:
213
- * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.
214
- * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.
215
- * 3. The app runs the algorithms.
216
- * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.
217
- * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.
218
- * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.
219
- * @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.
220
- * See the method description for more information.
221
- *
222
- * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.
223
- * @public
224
- * @requiredField algorithms
225
- * @requiredField algorithms._id
226
- * @requiredField algorithms.appId
227
- * @requiredField options.items.appId
228
- * @requiredField options.items.catalogItemId
229
- * @param options - Get recommendation options.
230
- * @permissionId RECOMMENDATIONS.READ
231
- * @permissionScope Manage Stores - all permissions
232
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
233
- * @permissionScope Manage Stores
234
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
235
- * @permissionScope Read eCommerce - all read permissions
236
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
237
- * @permissionScope Manage eCommerce - all permissions
238
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
239
- * @applicableIdentity APP
240
- * @applicableIdentity VISITOR
241
- * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation
242
- */
243
- export declare function getRecommendation(algorithms: NonNullablePaths<Algorithm, `_id` | `appId`>[], options?: NonNullablePaths<GetRecommendationOptions, `items.${number}.appId` | `items.${number}.catalogItemId`>): Promise<NonNullablePaths<GetRecommendationResponse, {
244
- [P in RecommendationNonNullablePaths]: `recommendation.${P}`;
245
- }[RecommendationNonNullablePaths]>>;
246
- export interface GetRecommendationOptions {
247
- /**
248
- * The set of items for which to get recommendations. Required if the `algorithmType` is `RELATED_ITEMS`.
249
- * @maxSize 300
250
- */
251
- items?: CatalogReference[];
252
- /**
253
- * The minimum number of items that must be recommended by the algorithm for those items to be returned in the response.
254
- *
255
- * Max: `100`
256
- * @max 100
257
- */
258
- minimumRecommendedItems?: number;
259
- }
260
- export {};
@@ -1,158 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.getRecommendation = exports.listAvailableAlgorithms = exports.AlgorithmType = void 0;
27
- const transform_error_1 = require("@wix/sdk-runtime/transform-error");
28
- const rename_all_nested_keys_1 = require("@wix/sdk-runtime/rename-all-nested-keys");
29
- const ambassadorWixEcomRecommendationsV1Recommendation = __importStar(require("./ecom-recommendations-v1-recommendation-recommendations.http.js"));
30
- var AlgorithmType;
31
- (function (AlgorithmType) {
32
- AlgorithmType["UNSPECIFIED"] = "UNSPECIFIED";
33
- AlgorithmType["RELATED_ITEMS"] = "RELATED_ITEMS";
34
- AlgorithmType["GLOBAL"] = "GLOBAL";
35
- })(AlgorithmType || (exports.AlgorithmType = AlgorithmType = {}));
36
- /**
37
- * Returns a list of recommendation algorithms that can be used on your Wix site or project. These algorithms can be used with [`getRecommendation()`](#getRecommendation) to provide item recommendations to the customer.
38
- *
39
- * Algorithms are run by the apps that provide them, and can only be used on catalogs they support. Apps may provide algorithms for use with their own catalogs and/or catalogs from other apps.
40
- *
41
- * The app which provides an algorithm is referenced by that algorithm’s `appId`. The apps whose catalogs are supported by an algorithm are referenced by the IDs in that algorithm’s `catalogAppIds` array.
42
- *
43
- *
44
- * For an algorithm to be considered “Available” and returned in this method’s response, the algorithm must meet the following conditions:
45
- * 1. The algorithm’s `appId` must match the ID of an installed Wix app.
46
- * 2. At least 1 of the IDs in `catalogAppIds` must match the ID of an installed Wix app.
47
- *
48
- * Wix app IDs are [listed here](https://dev.wix.com/api/rest/getting-started/wix-business-solutions#getting-started_wix-business-solutions_about-wix-business-solutions).
49
- * @public
50
- * @permissionId RECOMMENDATIONS.READ
51
- * @permissionScope Manage Stores - all permissions
52
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
53
- * @permissionScope Manage Stores
54
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
55
- * @permissionScope Read eCommerce - all read permissions
56
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
57
- * @permissionScope Manage eCommerce - all permissions
58
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
59
- * @applicableIdentity APP
60
- * @applicableIdentity VISITOR
61
- * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.ListAvailableAlgorithms
62
- */
63
- async function listAvailableAlgorithms() {
64
- // @ts-ignore
65
- const { httpClient, sideEffects } = arguments[0];
66
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({});
67
- const reqOpts = ambassadorWixEcomRecommendationsV1Recommendation.listAvailableAlgorithms(payload);
68
- sideEffects?.onSiteCall?.();
69
- try {
70
- const result = await httpClient.request(reqOpts);
71
- sideEffects?.onSuccess?.(result);
72
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
73
- }
74
- catch (err) {
75
- const transformedError = (0, transform_error_1.transformError)(err, {
76
- spreadPathsToArguments: {},
77
- explicitPathsToArguments: {},
78
- singleArgumentUnchanged: false,
79
- }, []);
80
- sideEffects?.onError?.(err);
81
- throw transformedError;
82
- }
83
- }
84
- exports.listAvailableAlgorithms = listAvailableAlgorithms;
85
- /**
86
- * Returns a recommendation object containing a list of items to recommend to the customer.
87
- *
88
- * `getRecommendation()` determines which items to recommend based on the given recommendation algorithms.
89
- *
90
- * `getRecommendation()` doesn’t run the algorithms. It calls the installed apps that provide them.
91
- *
92
- * Apps may provide algorithms for use with their own catalogs, or for use with catalogs from other apps.
93
- * For example, Wix Stores provides algorithms that can only be used on its own catalogs.
94
- * To run an algorithm, the app providing it must be installed, and an app providing a supported catalog must be installed.
95
- * For more information and to see which algorithms are available on your site or project, call [`listAvailableAlgorithms()`](#listavailablealgorithms).
96
- *
97
- * `getRecommendation()` operates as follows:
98
- * 1. `getRecommendation()` receives as input a list of algorithms as an array. These algorithms can be provided by different apps and can apply to different catalogs.
99
- * 2. `getRecommendation()` calls the app that corresponds to the `appId` of the first algorithm in the list of algorithms. It passes that algorithm’s ID and the IDs of any subsequent algorithms in the array for the same app.
100
- * 3. The app runs the algorithms.
101
- * 4. `getRecommendation()` returns items recommendations from the first algorithm (according to its position in the `algorithms` array) that meets the minimum number of recommendations. At that point `getRecommendation()` stops calling other apps.
102
- * 5. If none of the algorithms run by the first app meet the minimum recommended items, `getRecommendation()` finds the next algorithm in the array with a new `appId` (an ID of an app that has not yet been called), and repeats the process.
103
- * 6. If no algorithms in the `algorithms` array recommend at least the minimum recommended items, `getRecommendation()` returns an empty array.
104
- * @param algorithms - A list of algorithms checked in a specific order determined by their `appID` and their position in the `algorithms` array.
105
- * See the method description for more information.
106
- *
107
- * If no algorithm is able to return at least `minimumRecommendedItems` items, an empty array is returned.
108
- * @public
109
- * @requiredField algorithms
110
- * @requiredField algorithms._id
111
- * @requiredField algorithms.appId
112
- * @requiredField options.items.appId
113
- * @requiredField options.items.catalogItemId
114
- * @param options - Get recommendation options.
115
- * @permissionId RECOMMENDATIONS.READ
116
- * @permissionScope Manage Stores - all permissions
117
- * @permissionScopeId SCOPE.DC-STORES-MEGA.MANAGE-STORES
118
- * @permissionScope Manage Stores
119
- * @permissionScopeId SCOPE.STORES.MANAGE-STORES
120
- * @permissionScope Read eCommerce - all read permissions
121
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.READ-ECOM
122
- * @permissionScope Manage eCommerce - all permissions
123
- * @permissionScopeId SCOPE.DC-ECOM-MEGA.MANAGE-ECOM
124
- * @applicableIdentity APP
125
- * @applicableIdentity VISITOR
126
- * @fqn com.wix.ecom.recommendations.v1.RecommendationsService.GetRecommendation
127
- */
128
- async function getRecommendation(algorithms, options) {
129
- // @ts-ignore
130
- const { httpClient, sideEffects } = arguments[2];
131
- const payload = (0, rename_all_nested_keys_1.renameKeysFromSDKRequestToRESTRequest)({
132
- algorithms: algorithms,
133
- items: options?.items,
134
- minimumRecommendedItems: options?.minimumRecommendedItems,
135
- });
136
- const reqOpts = ambassadorWixEcomRecommendationsV1Recommendation.getRecommendation(payload);
137
- sideEffects?.onSiteCall?.();
138
- try {
139
- const result = await httpClient.request(reqOpts);
140
- sideEffects?.onSuccess?.(result);
141
- return (0, rename_all_nested_keys_1.renameKeysFromRESTResponseToSDKResponse)(result.data);
142
- }
143
- catch (err) {
144
- const transformedError = (0, transform_error_1.transformError)(err, {
145
- spreadPathsToArguments: {},
146
- explicitPathsToArguments: {
147
- algorithms: '$[0]',
148
- items: '$[1].items',
149
- minimumRecommendedItems: '$[1].minimumRecommendedItems',
150
- },
151
- singleArgumentUnchanged: false,
152
- }, ['algorithms', 'options']);
153
- sideEffects?.onError?.(err);
154
- throw transformedError;
155
- }
156
- }
157
- exports.getRecommendation = getRecommendation;
158
- //# sourceMappingURL=ecom-recommendations-v1-recommendation-recommendations.universal.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ecom-recommendations-v1-recommendation-recommendations.universal.js","sourceRoot":"","sources":["../../../src/ecom-recommendations-v1-recommendation-recommendations.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAuF;AACvF,oFAGiD;AAEjD,mJAAqI;AAyHrI,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,4CAA2B,CAAA;IAC3B,gDAA+B,CAAA;IAC/B,kCAAiB,CAAA;AACnB,CAAC,EAJW,aAAa,6BAAb,aAAa,QAIxB;AAqED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACI,KAAK,UAAU,uBAAuB;IAW3C,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,8DAAqC,EAAC,EAAE,CAAC,CAAC;IAE1D,MAAM,OAAO,GACX,gDAAgD,CAAC,uBAAuB,CACtE,OAAO,CACR,CAAC;IAEJ,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,IAAA,gEAAuC,EAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE,EAAE;YAC5B,uBAAuB,EAAE,KAAK;SAC/B,EACD,EAAE,CACH,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC;AA5CD,0DA4CC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACI,KAAK,UAAU,iBAAiB,CACrC,UAA0D,EAC1D,OAGC;IASD,aAAa;IACb,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAG9C,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,8DAAqC,EAAC;QACpD,UAAU,EAAE,UAAU;QACtB,KAAK,EAAE,OAAO,EAAE,KAAK;QACrB,uBAAuB,EAAE,OAAO,EAAE,uBAAuB;KAC1D,CAAC,CAAC;IAEH,MAAM,OAAO,GACX,gDAAgD,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAE9E,WAAW,EAAE,UAAU,EAAE,EAAE,CAAC;IAC5B,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACjD,WAAW,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,CAAC;QAEjC,OAAO,IAAA,gEAAuC,EAAC,MAAM,CAAC,IAAI,CAAE,CAAC;IAC/D,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,GAAG,EACH;YACE,sBAAsB,EAAE,EAAE;YAC1B,wBAAwB,EAAE;gBACxB,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,YAAY;gBACnB,uBAAuB,EAAE,8BAA8B;aACxD;YACD,uBAAuB,EAAE,KAAK;SAC/B,EACD,CAAC,YAAY,EAAE,SAAS,CAAC,CAC1B,CAAC;QACF,WAAW,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAC;QAE5B,MAAM,gBAAgB,CAAC;IACzB,CAAC;AACH,CAAC;AArDD,8CAqDC"}
@@ -1 +0,0 @@
1
- export * from './src/ecom-recommendations-v1-recommendation-recommendations.context.js';