@wix/auto_sdk_suppliers-hub_marketplace-provider 1.0.0
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.
- package/build/cjs/index.d.ts +7 -0
- package/build/cjs/index.js +145 -0
- package/build/cjs/index.js.map +1 -0
- package/build/cjs/index.typings.d.ts +32 -0
- package/build/cjs/index.typings.js +87 -0
- package/build/cjs/index.typings.js.map +1 -0
- package/build/cjs/service-plugins-error-classes-Bb7usATN.d.ts +463 -0
- package/build/es/index.d.mts +7 -0
- package/build/es/index.mjs +116 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/index.typings.d.mts +32 -0
- package/build/es/index.typings.mjs +57 -0
- package/build/es/index.typings.mjs.map +1 -0
- package/build/es/service-plugins-error-classes-Bb7usATN.d.mts +463 -0
- package/build/internal/cjs/index.d.ts +7 -0
- package/build/internal/cjs/index.js +145 -0
- package/build/internal/cjs/index.js.map +1 -0
- package/build/internal/cjs/index.typings.d.ts +32 -0
- package/build/internal/cjs/index.typings.js +87 -0
- package/build/internal/cjs/index.typings.js.map +1 -0
- package/build/internal/cjs/service-plugins-error-classes-Bb7usATN.d.ts +463 -0
- package/build/internal/es/index.d.mts +7 -0
- package/build/internal/es/index.mjs +116 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/index.typings.d.mts +32 -0
- package/build/internal/es/index.typings.mjs +57 -0
- package/build/internal/es/index.typings.mjs.map +1 -0
- package/build/internal/es/service-plugins-error-classes-Bb7usATN.d.mts +463 -0
- package/package.json +55 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { p as provideHandlers$1 } from './service-plugins-error-classes-Bb7usATN.js';
|
|
2
|
+
export { t as AlternativeUri, A as ApplicationError, c as BulkActionMetadata, b as BulkAddProductToStoreResult, B as BulkAddProductsToStoreRequest, a as BulkAddProductsToStoreResponse, h as BulkGenerateMockupResult, d as BulkGenerateMockupsRequest, g as BulkGenerateMockupsResponse, C as Choice, i as ChoiceValue, j as ChoiceValueValueOneOf, k as Color, u as Context, G as GetInventoryRequest, l as GetInventoryResponse, n as GetPricingBreakdownRequest, o as GetPricingBreakdownResponse, w as IdentificationData, x as IdentificationDataIdOneOf, v as IdentityType, e as Image, z as ImageNotSupportedWixError, f as ImageType, m as InventoryVariant, I as ItemMetadata, s as MarketplaceProviderConfig, M as Mockup, y as MockupGenerationNotSupportedWixError, r as PriceRange, q as PricingBreakdown, P as ProductReference, S as SpiBaseUri } from './service-plugins-error-classes-Bb7usATN.js';
|
|
3
|
+
import { BuildServicePluginDefinition } from '@wix/sdk-types';
|
|
4
|
+
|
|
5
|
+
declare const provideHandlers: BuildServicePluginDefinition<typeof provideHandlers$1> & typeof provideHandlers$1;
|
|
6
|
+
|
|
7
|
+
export { provideHandlers, provideHandlers$1 as publicProvideHandlers };
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.ts
|
|
21
|
+
var index_exports = {};
|
|
22
|
+
__export(index_exports, {
|
|
23
|
+
IdentityType: () => IdentityType,
|
|
24
|
+
ImageNotSupportedWixError: () => ImageNotSupportedWixError,
|
|
25
|
+
ImageType: () => ImageType,
|
|
26
|
+
MockupGenerationNotSupportedWixError: () => MockupGenerationNotSupportedWixError,
|
|
27
|
+
provideHandlers: () => provideHandlers2,
|
|
28
|
+
publicProvideHandlers: () => provideHandlers
|
|
29
|
+
});
|
|
30
|
+
module.exports = __toCommonJS(index_exports);
|
|
31
|
+
|
|
32
|
+
// src/service-plugins-types.ts
|
|
33
|
+
var ImageType = /* @__PURE__ */ ((ImageType2) => {
|
|
34
|
+
ImageType2["UNKNOWN_IMAGE_TYPE"] = "UNKNOWN_IMAGE_TYPE";
|
|
35
|
+
ImageType2["SITE_LOGO"] = "SITE_LOGO";
|
|
36
|
+
ImageType2["CUSTOM"] = "CUSTOM";
|
|
37
|
+
ImageType2["FALLBACK"] = "FALLBACK";
|
|
38
|
+
return ImageType2;
|
|
39
|
+
})(ImageType || {});
|
|
40
|
+
var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
|
|
41
|
+
IdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
42
|
+
IdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
43
|
+
IdentityType2["MEMBER"] = "MEMBER";
|
|
44
|
+
IdentityType2["WIX_USER"] = "WIX_USER";
|
|
45
|
+
IdentityType2["APP"] = "APP";
|
|
46
|
+
return IdentityType2;
|
|
47
|
+
})(IdentityType || {});
|
|
48
|
+
|
|
49
|
+
// src/interfaces-suppliershub-v2-marketplace-provider.public.ts
|
|
50
|
+
var import_sdk_types = require("@wix/sdk-types");
|
|
51
|
+
var import_rename_all_nested_keys = require("@wix/sdk-runtime/rename-all-nested-keys");
|
|
52
|
+
var provideHandlers = (0, import_sdk_types.ServicePluginDefinition)("SHUB_MARKETPLACE_PROVIDER", [
|
|
53
|
+
{
|
|
54
|
+
name: "bulkAddProductsToStore",
|
|
55
|
+
primaryHttpMappingPath: "/v2/bulk/add-products-to-store",
|
|
56
|
+
transformations: {
|
|
57
|
+
toREST: (payload) => {
|
|
58
|
+
const toRestResponse = payload;
|
|
59
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
60
|
+
},
|
|
61
|
+
fromREST: (payload) => {
|
|
62
|
+
const fromRestRequest = payload;
|
|
63
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
name: "bulkGenerateMockups",
|
|
69
|
+
primaryHttpMappingPath: "/v2/bulk/mockups/generate",
|
|
70
|
+
transformations: {
|
|
71
|
+
toREST: (payload) => {
|
|
72
|
+
const toRestResponse = payload;
|
|
73
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
74
|
+
},
|
|
75
|
+
fromREST: (payload) => {
|
|
76
|
+
const fromRestRequest = payload;
|
|
77
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
name: "getInventory",
|
|
83
|
+
primaryHttpMappingPath: "/v2/get-inventory",
|
|
84
|
+
transformations: {
|
|
85
|
+
toREST: (payload) => {
|
|
86
|
+
const toRestResponse = payload;
|
|
87
|
+
return (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)(toRestResponse);
|
|
88
|
+
},
|
|
89
|
+
fromREST: (payload) => {
|
|
90
|
+
const fromRestRequest = payload;
|
|
91
|
+
return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(fromRestRequest);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
]);
|
|
96
|
+
|
|
97
|
+
// src/interfaces-suppliershub-v2-marketplace-provider.context.ts
|
|
98
|
+
var import_service_plugin_modules = require("@wix/sdk-runtime/service-plugin-modules");
|
|
99
|
+
var provideHandlers2 = (0, import_service_plugin_modules.createServicePluginModule)(
|
|
100
|
+
provideHandlers
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// src/service-plugins-error-classes.ts
|
|
104
|
+
var MockupGenerationNotSupportedWixError = class extends Error {
|
|
105
|
+
constructor() {
|
|
106
|
+
super("MockupGenerationNotSupported");
|
|
107
|
+
this.httpCode = 428;
|
|
108
|
+
this.statusCode = "FAILED_PRECONDITION";
|
|
109
|
+
this.applicationCode = "MOCKUP_GENERATION_NOT_SUPPORTED";
|
|
110
|
+
this.name = "MockupGenerationNotSupported";
|
|
111
|
+
this.errorType = "SPI";
|
|
112
|
+
this.spiErrorData = {
|
|
113
|
+
name: "MockupGenerationNotSupported",
|
|
114
|
+
applicationCode: "MOCKUP_GENERATION_NOT_SUPPORTED"
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
/** @hidden */
|
|
119
|
+
MockupGenerationNotSupportedWixError.__type = "wix_spi_error";
|
|
120
|
+
var ImageNotSupportedWixError = class extends Error {
|
|
121
|
+
constructor() {
|
|
122
|
+
super("ImageNotSupported");
|
|
123
|
+
this.httpCode = 428;
|
|
124
|
+
this.statusCode = "FAILED_PRECONDITION";
|
|
125
|
+
this.applicationCode = "IMAGE_NOT_SUPPORTED";
|
|
126
|
+
this.name = "ImageNotSupported";
|
|
127
|
+
this.errorType = "SPI";
|
|
128
|
+
this.spiErrorData = {
|
|
129
|
+
name: "ImageNotSupported",
|
|
130
|
+
applicationCode: "IMAGE_NOT_SUPPORTED"
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
/** @hidden */
|
|
135
|
+
ImageNotSupportedWixError.__type = "wix_spi_error";
|
|
136
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
137
|
+
0 && (module.exports = {
|
|
138
|
+
IdentityType,
|
|
139
|
+
ImageNotSupportedWixError,
|
|
140
|
+
ImageType,
|
|
141
|
+
MockupGenerationNotSupportedWixError,
|
|
142
|
+
provideHandlers,
|
|
143
|
+
publicProvideHandlers
|
|
144
|
+
});
|
|
145
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../index.ts","../../src/service-plugins-types.ts","../../src/interfaces-suppliershub-v2-marketplace-provider.public.ts","../../src/interfaces-suppliershub-v2-marketplace-provider.context.ts","../../src/service-plugins-error-classes.ts"],"sourcesContent":["export * from './src/service-plugins-types.js';\nexport * from './src/interfaces-suppliershub-v2-marketplace-provider.context.js';\nexport * from './src/service-plugins-error-classes.js';\n","export interface BulkAddProductsToStoreRequest {\n /**\n * Product references to add to the site owner's store.\n * @minSize 1\n * @maxSize 100\n */\n productReferences?: ProductReference[];\n}\n\n/** Reference to a product on a marketplace provider's platform. */\nexport interface ProductReference {\n /**\n * Unique product identifier on the provider's platform.\n * @minLength 1\n * @maxLength 36\n */\n providerProductId?: string;\n /** Additional provider-specific data for this product. For example, other internal identifiers of the product on the provider's side. */\n options?: Record<string, any> | null;\n /**\n * Whether the product is visible in the site's store.\n *\n * Default: `false`\n */\n visibleInStore?: boolean;\n}\n\nexport interface BulkAddProductsToStoreResponse {\n /**\n * Results of adding each product to the store.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkAddProductToStoreResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ItemMetadata {\n /**\n * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).\n * @minLength 1\n * @maxLength 36\n */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkAddProductToStoreResult {\n /** Item metadata. */\n itemMetadata?: ItemMetadata;\n /** Added product reference. */\n item?: ProductReference;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface BulkGenerateMockupsRequest {\n /**\n * Mockups to generate.\n * @minSize 1\n * @maxSize 100\n */\n mockups?: Mockup[];\n}\n\nexport interface Mockup {\n /**\n * Unique product identifier on the provider's platform.\n * @minLength 1\n * @maxLength 36\n */\n providerProductId?: string;\n /** Image to overlay on the product mockup. */\n image?: Image;\n}\n\nexport interface Image {\n /**\n * Image URL.\n * @format WEB_URL\n */\n url?: string;\n /** Type of image used for mockup generation. */\n imageType?: ImageType;\n}\n\nexport enum ImageType {\n /** Unknown image type. */\n UNKNOWN_IMAGE_TYPE = 'UNKNOWN_IMAGE_TYPE',\n /** The site's logo. */\n SITE_LOGO = 'SITE_LOGO',\n /** A custom image provided by the site owner. */\n CUSTOM = 'CUSTOM',\n /** Default product mockup image used when a site logo or custom image mockup is not available. */\n FALLBACK = 'FALLBACK',\n}\n\nexport interface BulkGenerateMockupsResponse {\n /**\n * Results of the mockup generation for each product.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkGenerateMockupResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkGenerateMockupResult {\n /** Item metadata. */\n itemMetadata?: ItemMetadata;\n}\n\nexport interface GetInventoryRequest {\n /**\n * Unique product identifier on the provider's platform.\n * @minLength 1\n * @maxLength 36\n */\n providerProductId?: string;\n /**\n * Choices to filter by. For example, only return inventory for variants matching \"Size: M\" and \"Color: Black\".\n *\n * If empty, inventory for all available variants is returned.\n * @maxSize 10\n */\n choices?: Choice[];\n}\n\n/** Product variant choice such as size, color, or material. */\nexport interface Choice {\n /**\n * Choice name. For example, \"Size\", \"Color\", or \"Material\".\n * @maxLength 50\n */\n name?: string;\n /** Choice value. */\n value?: ChoiceValue;\n}\n\n/** Value of a product variant choice. */\nexport interface ChoiceValue extends ChoiceValueValueOneOf {\n /**\n * Simple text value. For example, \"M\" for size, or \"Cotton\" for material.\n * @minLength 1\n * @maxLength 50\n */\n simpleValue?: string;\n /** Color value with name and hex code. */\n color?: Color;\n}\n\n/** @oneof */\nexport interface ChoiceValueValueOneOf {\n /**\n * Simple text value. For example, \"M\" for size, or \"Cotton\" for material.\n * @minLength 1\n * @maxLength 50\n */\n simpleValue?: string;\n /** Color value with name and hex code. */\n color?: Color;\n}\n\n/** Color with name and hex code. */\nexport interface Color {\n /**\n * Color name. For example, \"Black\" or \"Red\".\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * Hex color code. For example, `#000000`.\n * @format COLOR_HEX\n */\n hex?: string;\n}\n\nexport interface GetInventoryResponse {\n /**\n * Unique product identifier on the provider's platform.\n * @minLength 1\n * @maxLength 36\n */\n providerProductId?: string;\n /**\n * Inventory data for each variant matching the requested choices.\n * @maxSize 100\n */\n inventoryVariants?: InventoryVariant[];\n}\n\nexport interface InventoryVariant {\n /**\n * Choices that define this variant. For example, \"Size: M\" and \"Color: Black\".\n * @maxSize 10\n */\n choices?: Choice[];\n /** Available inventory quantity for this variant. `null` indicates the quantity is unknown or not tracked by the provider. */\n quantity?: number | null;\n}\n\nexport interface GetPricingBreakdownRequest {\n /**\n * Product ID on the provider's platform.\n * @minLength 1\n * @maxLength 36\n */\n providerProductId?: string;\n /**\n * Currency for the pricing breakdown.\n * @format CURRENCY\n */\n currency?: string;\n}\n\nexport interface GetPricingBreakdownResponse {\n /** Pricing breakdown for the product. */\n pricingBreakdown?: PricingBreakdown;\n}\n\n/** Pricing breakdown for a marketplace product. */\nexport interface PricingBreakdown {\n /** Range of the base cost across all variants. This is the base cost charged by the provider. */\n baseCostRange?: PriceRange;\n /** Range of the suggested retail price across all variants. Calculated as cost multiplied by the markup rate. */\n suggestedRetailPriceRange?: PriceRange;\n /** Range of the potential profit across all variants. Calculated as the suggested retail price minus the base cost. */\n potentialProfitRange?: PriceRange;\n /**\n * Markup rate applied to the base cost to calculate the suggested retail price. For example, `0.60` for a 60% markup, or `2.5` for a 250% markup.\n * @decimalValue options { gte:0, lte:10, maxScale:3 }\n */\n markupRate?: string | null;\n /**\n * Currency of the monetary values.\n * @format CURRENCY\n */\n currency?: string;\n}\n\n/** Price range with a lower bound and optional upper bound. Used to represent the range of prices across all product variants. */\nexport interface PriceRange {\n /**\n * Lower bound of the price range.\n * @decimalValue options { gte:0, lte:999999999, maxScale:3 }\n */\n from?: string;\n /**\n * Upper bound of the price range. Absent when all variants have the same price.\n * @decimalValue options { gte:0, lte:999999999, maxScale:3 }\n */\n to?: string | null;\n}\n\nexport interface MarketplaceProviderConfig {\n /** URI where the service plugin implementer is deployed. */\n deploymentUri?: SpiBaseUri;\n /**\n * Whether your implementation supports the Get Pricing Breakdown method. When `false`, Wix doesn't call your implementation for pricing breakdowns and the Suppliers Hub UI omits that section.\n *\n * Default: `false`\n */\n toggleGetPricingBreakdownEnabled?: boolean;\n}\n\n/** Base URI configuration for a service plugin. Wix uses these URIs to call your service plugin methods. */\nexport interface SpiBaseUri {\n /**\n * Base URI for your service plugin. Wix appends each method's path to this URI.\n *\n * For example, to receive requests at `https://my-app.com/v1/my-method`, set this field to `https://my-app.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternative URIs for specific methods. Use these to override the default URI for individual methods. */\n alternativeUris?: AlternativeUri[];\n}\n\n/** Custom URI for the specified service plugin method. */\nexport interface AlternativeUri {\n /**\n * Name of the method to call at the absolute URI, in PascalCase. For example, to call [Get Shipping Rates](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/shipping-rates/shipping-rates-integration-service-plugin/get-shipping-rates) on an alternative URI, specify `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Absolute URI that Wix calls for this method. Wix doesn't append any path to this URI.\n *\n * The URI must begin with `https://`, such as `https://my-app.com/v1/my-custom-method`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n","import { ServicePluginDefinition } from '@wix/sdk-types';\nimport {\n Context,\n BulkAddProductsToStoreRequest,\n BulkAddProductsToStoreResponse,\n BulkGenerateMockupsRequest,\n BulkGenerateMockupsResponse,\n GetInventoryRequest,\n GetInventoryResponse,\n} from './service-plugins-types.js';\nimport {\n renameKeysFromSDKRequestToRESTRequest,\n renameKeysFromRESTResponseToSDKResponse,\n} from '@wix/sdk-runtime/rename-all-nested-keys';\n\nexport interface BulkAddProductsToStoreEnvelope {\n request: BulkAddProductsToStoreRequest;\n metadata: Context;\n}\n\nexport interface BulkGenerateMockupsEnvelope {\n request: BulkGenerateMockupsRequest;\n metadata: Context;\n}\n\nexport interface GetInventoryEnvelope {\n request: GetInventoryRequest;\n metadata: Context;\n}\n\nexport const provideHandlers = ServicePluginDefinition<{\n /**\n *\n * Retrieves full product details from the marketplace provider and adds them to the site owner's Wix Stores catalog.\n *\n * Wix calls this method when a site owner selects products to import from the marketplace provider.\n *\n * Wix calls this method to create products in the site's Wix Stores catalog, linked to the provider's product IDs. */\n bulkAddProductsToStore(\n payload: BulkAddProductsToStoreEnvelope\n ): BulkAddProductsToStoreResponse | Promise<BulkAddProductsToStoreResponse>;\n\n /**\n *\n * Generates product mockup images showing the site owner's logo or custom image on the provider's products.\n *\n * Wix calls this method when a site owner requests mockup previews for products from the marketplace provider.\n *\n * The generated mockup images are delivered asynchronously. Once generation is complete, the provider notifies Wix by calling [Submit Generated Mockups](https://dev.wix.com/docs/api-reference/business-solutions/suppliers-hub/marketplace-provider-submissions/submit-generated-mockups). */\n bulkGenerateMockups(\n payload: BulkGenerateMockupsEnvelope\n ): BulkGenerateMockupsResponse | Promise<BulkGenerateMockupsResponse>;\n\n /**\n *\n * Retrieves current inventory levels for a product's variants.\n *\n * Wix calls this method when a site owner opens a product details page and wants to see current stock levels.\n *\n * Wix uses the response to display available inventory for each product variant. */\n getInventory(\n payload: GetInventoryEnvelope\n ): GetInventoryResponse | Promise<GetInventoryResponse>;\n}>('SHUB_MARKETPLACE_PROVIDER', [\n {\n name: 'bulkAddProductsToStore',\n primaryHttpMappingPath: '/v2/bulk/add-products-to-store',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'bulkGenerateMockups',\n primaryHttpMappingPath: '/v2/bulk/mockups/generate',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n\n {\n name: 'getInventory',\n primaryHttpMappingPath: '/v2/get-inventory',\n transformations: {\n toREST: (payload: any) => {\n const toRestResponse = payload;\n\n return renameKeysFromSDKRequestToRESTRequest(toRestResponse);\n },\n fromREST: (payload: any) => {\n const fromRestRequest = payload;\n\n return renameKeysFromRESTResponseToSDKResponse(fromRestRequest);\n },\n },\n },\n]);\n","import './interfaces-suppliershub-v2-marketplace-provider.public.js';\nimport { createServicePluginModule } from '@wix/sdk-runtime/service-plugin-modules';\nimport { BuildServicePluginDefinition } from '@wix/sdk-types';\nimport { provideHandlers as publicProvideHandlers } from './interfaces-suppliershub-v2-marketplace-provider.public.js';\n\nexport { publicProvideHandlers };\n\nexport const provideHandlers: BuildServicePluginDefinition<\n typeof publicProvideHandlers\n> &\n typeof publicProvideHandlers = createServicePluginModule(\n publicProvideHandlers\n);\n","/**\n * Product doesn't support mockup generation.\n */\nexport class MockupGenerationNotSupportedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('MockupGenerationNotSupported');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'MOCKUP_GENERATION_NOT_SUPPORTED';\n this.name = 'MockupGenerationNotSupported';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MockupGenerationNotSupported',\n applicationCode: 'MOCKUP_GENERATION_NOT_SUPPORTED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Provided image format or type isn't supported for mockup generation.\n */\nexport class ImageNotSupportedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('ImageNotSupported');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'IMAGE_NOT_SUPPORTED';\n this.name = 'ImageNotSupported';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'ImageNotSupported',\n applicationCode: 'IMAGE_NOT_SUPPORTED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAAA;AAAA,EAAA;AAAA;AAAA;;;AC4GO,IAAK,YAAL,kBAAKC,eAAL;AAEL,EAAAA,WAAA,wBAAqB;AAErB,EAAAA,WAAA,eAAY;AAEZ,EAAAA,WAAA,YAAS;AAET,EAAAA,WAAA,cAAW;AARD,SAAAA;AAAA,GAAA;AAqPL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;;;ACjWZ,uBAAwC;AAUxC,oCAGO;AAiBA,IAAM,sBAAkB,0CAiC5B,6BAA6B;AAAA,EAC9B;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AAAA,EAEA;AAAA,IACE,MAAM;AAAA,IACN,wBAAwB;AAAA,IACxB,iBAAiB;AAAA,MACf,QAAQ,CAAC,YAAiB;AACxB,cAAM,iBAAiB;AAEvB,mBAAO,qEAAsC,cAAc;AAAA,MAC7D;AAAA,MACA,UAAU,CAAC,YAAiB;AAC1B,cAAM,kBAAkB;AAExB,mBAAO,uEAAwC,eAAe;AAAA,MAChE;AAAA,IACF;AAAA,EACF;AACF,CAAC;;;ACjHD,oCAA0C;AAMnC,IAAMC,uBAGoB;AAAA,EAC/B;AACF;;;ACTO,IAAM,uCAAN,cAAmD,MAAM;AAAA,EAc9D,cAAc;AACZ,UAAM,8BAA8B;AAEpC,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,qCA6BK,SAAS;AAMpB,IAAM,4BAAN,cAAwC,MAAM;AAAA,EAcnD,cAAc;AACZ,UAAM,mBAAmB;AAEzB,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,0BA6BK,SAAS;","names":["provideHandlers","ImageType","IdentityType","provideHandlers"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { D as BulkAddProductsToStoreEnvelope, a as BulkAddProductsToStoreResponse, E as BulkGenerateMockupsEnvelope, g as BulkGenerateMockupsResponse, F as GetInventoryEnvelope, l as GetInventoryResponse } from './service-plugins-error-classes-Bb7usATN.js';
|
|
2
|
+
export { t as AlternativeUri, A as ApplicationError, c as BulkActionMetadata, b as BulkAddProductToStoreResult, B as BulkAddProductsToStoreRequest, h as BulkGenerateMockupResult, d as BulkGenerateMockupsRequest, C as Choice, i as ChoiceValue, j as ChoiceValueValueOneOf, k as Color, u as Context, G as GetInventoryRequest, n as GetPricingBreakdownRequest, o as GetPricingBreakdownResponse, w as IdentificationData, x as IdentificationDataIdOneOf, v as IdentityType, e as Image, z as ImageNotSupportedWixError, f as ImageType, m as InventoryVariant, I as ItemMetadata, s as MarketplaceProviderConfig, M as Mockup, y as MockupGenerationNotSupportedWixError, r as PriceRange, q as PricingBreakdown, P as ProductReference, S as SpiBaseUri } from './service-plugins-error-classes-Bb7usATN.js';
|
|
3
|
+
import '@wix/sdk-types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Retrieves full product details from the marketplace provider and adds them to the site owner's Wix Stores catalog.
|
|
7
|
+
*
|
|
8
|
+
* Wix calls this method when a site owner selects products to import from the marketplace provider.
|
|
9
|
+
*
|
|
10
|
+
* Wix calls this method to create products in the site's Wix Stores catalog, linked to the provider's product IDs.
|
|
11
|
+
*/
|
|
12
|
+
declare function bulkAddProductsToStore(payload: BulkAddProductsToStoreEnvelope): BulkAddProductsToStoreResponse | Promise<BulkAddProductsToStoreResponse>;
|
|
13
|
+
/**
|
|
14
|
+
* Generates product mockup images showing the site owner's logo or custom image on the provider's products.
|
|
15
|
+
*
|
|
16
|
+
* Wix calls this method when a site owner requests mockup previews for products from the marketplace provider.
|
|
17
|
+
*
|
|
18
|
+
* The generated mockup images are delivered asynchronously. Once generation is complete, the provider notifies Wix by calling [Submit Generated Mockups](https://dev.wix.com/docs/api-reference/business-solutions/suppliers-hub/marketplace-provider-submissions/submit-generated-mockups).
|
|
19
|
+
* @throws MockupGenerationNotSupportedWixError
|
|
20
|
+
* @throws ImageNotSupportedWixError
|
|
21
|
+
*/
|
|
22
|
+
declare function bulkGenerateMockups(payload: BulkGenerateMockupsEnvelope): BulkGenerateMockupsResponse | Promise<BulkGenerateMockupsResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves current inventory levels for a product's variants.
|
|
25
|
+
*
|
|
26
|
+
* Wix calls this method when a site owner opens a product details page and wants to see current stock levels.
|
|
27
|
+
*
|
|
28
|
+
* Wix uses the response to display available inventory for each product variant.
|
|
29
|
+
*/
|
|
30
|
+
declare function getInventory(payload: GetInventoryEnvelope): GetInventoryResponse | Promise<GetInventoryResponse>;
|
|
31
|
+
|
|
32
|
+
export { BulkAddProductsToStoreEnvelope, BulkAddProductsToStoreResponse, BulkGenerateMockupsEnvelope, BulkGenerateMockupsResponse, GetInventoryEnvelope, GetInventoryResponse, bulkAddProductsToStore, bulkGenerateMockups, getInventory };
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// index.typings.ts
|
|
21
|
+
var index_typings_exports = {};
|
|
22
|
+
__export(index_typings_exports, {
|
|
23
|
+
IdentityType: () => IdentityType,
|
|
24
|
+
ImageNotSupportedWixError: () => ImageNotSupportedWixError,
|
|
25
|
+
ImageType: () => ImageType,
|
|
26
|
+
MockupGenerationNotSupportedWixError: () => MockupGenerationNotSupportedWixError
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(index_typings_exports);
|
|
29
|
+
|
|
30
|
+
// src/service-plugins-error-classes.ts
|
|
31
|
+
var MockupGenerationNotSupportedWixError = class extends Error {
|
|
32
|
+
constructor() {
|
|
33
|
+
super("MockupGenerationNotSupported");
|
|
34
|
+
this.httpCode = 428;
|
|
35
|
+
this.statusCode = "FAILED_PRECONDITION";
|
|
36
|
+
this.applicationCode = "MOCKUP_GENERATION_NOT_SUPPORTED";
|
|
37
|
+
this.name = "MockupGenerationNotSupported";
|
|
38
|
+
this.errorType = "SPI";
|
|
39
|
+
this.spiErrorData = {
|
|
40
|
+
name: "MockupGenerationNotSupported",
|
|
41
|
+
applicationCode: "MOCKUP_GENERATION_NOT_SUPPORTED"
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
/** @hidden */
|
|
46
|
+
MockupGenerationNotSupportedWixError.__type = "wix_spi_error";
|
|
47
|
+
var ImageNotSupportedWixError = class extends Error {
|
|
48
|
+
constructor() {
|
|
49
|
+
super("ImageNotSupported");
|
|
50
|
+
this.httpCode = 428;
|
|
51
|
+
this.statusCode = "FAILED_PRECONDITION";
|
|
52
|
+
this.applicationCode = "IMAGE_NOT_SUPPORTED";
|
|
53
|
+
this.name = "ImageNotSupported";
|
|
54
|
+
this.errorType = "SPI";
|
|
55
|
+
this.spiErrorData = {
|
|
56
|
+
name: "ImageNotSupported",
|
|
57
|
+
applicationCode: "IMAGE_NOT_SUPPORTED"
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
/** @hidden */
|
|
62
|
+
ImageNotSupportedWixError.__type = "wix_spi_error";
|
|
63
|
+
|
|
64
|
+
// src/service-plugins-types.ts
|
|
65
|
+
var ImageType = /* @__PURE__ */ ((ImageType2) => {
|
|
66
|
+
ImageType2["UNKNOWN_IMAGE_TYPE"] = "UNKNOWN_IMAGE_TYPE";
|
|
67
|
+
ImageType2["SITE_LOGO"] = "SITE_LOGO";
|
|
68
|
+
ImageType2["CUSTOM"] = "CUSTOM";
|
|
69
|
+
ImageType2["FALLBACK"] = "FALLBACK";
|
|
70
|
+
return ImageType2;
|
|
71
|
+
})(ImageType || {});
|
|
72
|
+
var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
|
|
73
|
+
IdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
74
|
+
IdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
75
|
+
IdentityType2["MEMBER"] = "MEMBER";
|
|
76
|
+
IdentityType2["WIX_USER"] = "WIX_USER";
|
|
77
|
+
IdentityType2["APP"] = "APP";
|
|
78
|
+
return IdentityType2;
|
|
79
|
+
})(IdentityType || {});
|
|
80
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
81
|
+
0 && (module.exports = {
|
|
82
|
+
IdentityType,
|
|
83
|
+
ImageNotSupportedWixError,
|
|
84
|
+
ImageType,
|
|
85
|
+
MockupGenerationNotSupportedWixError
|
|
86
|
+
});
|
|
87
|
+
//# sourceMappingURL=index.typings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../index.typings.ts","../../src/service-plugins-error-classes.ts","../../src/service-plugins-types.ts"],"sourcesContent":["import {\n BulkAddProductsToStoreResponse,\n BulkGenerateMockupsResponse,\n GetInventoryResponse,\n} from './src/service-plugins-types.js';\nimport {\n BulkAddProductsToStoreEnvelope,\n BulkGenerateMockupsEnvelope,\n GetInventoryEnvelope,\n} from './src/interfaces-suppliershub-v2-marketplace-provider.public.js';\n\nexport * from './src/service-plugins-error-classes';\nexport * from './src/service-plugins-types';\nexport {\n BulkAddProductsToStoreEnvelope,\n BulkGenerateMockupsEnvelope,\n GetInventoryEnvelope,\n};\n\n/**\n * Retrieves full product details from the marketplace provider and adds them to the site owner's Wix Stores catalog.\n *\n * Wix calls this method when a site owner selects products to import from the marketplace provider.\n *\n * Wix calls this method to create products in the site's Wix Stores catalog, linked to the provider's product IDs.\n */\nexport declare function bulkAddProductsToStore(\n payload: BulkAddProductsToStoreEnvelope\n): BulkAddProductsToStoreResponse | Promise<BulkAddProductsToStoreResponse>;\n/**\n * Generates product mockup images showing the site owner's logo or custom image on the provider's products.\n *\n * Wix calls this method when a site owner requests mockup previews for products from the marketplace provider.\n *\n * The generated mockup images are delivered asynchronously. Once generation is complete, the provider notifies Wix by calling [Submit Generated Mockups](https://dev.wix.com/docs/api-reference/business-solutions/suppliers-hub/marketplace-provider-submissions/submit-generated-mockups).\n * @throws MockupGenerationNotSupportedWixError\n * @throws ImageNotSupportedWixError\n */\nexport declare function bulkGenerateMockups(\n payload: BulkGenerateMockupsEnvelope\n): BulkGenerateMockupsResponse | Promise<BulkGenerateMockupsResponse>;\n/**\n * Retrieves current inventory levels for a product's variants.\n *\n * Wix calls this method when a site owner opens a product details page and wants to see current stock levels.\n *\n * Wix uses the response to display available inventory for each product variant.\n */\nexport declare function getInventory(\n payload: GetInventoryEnvelope\n): GetInventoryResponse | Promise<GetInventoryResponse>;\n","/**\n * Product doesn't support mockup generation.\n */\nexport class MockupGenerationNotSupportedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('MockupGenerationNotSupported');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'MOCKUP_GENERATION_NOT_SUPPORTED';\n this.name = 'MockupGenerationNotSupported';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'MockupGenerationNotSupported',\n applicationCode: 'MOCKUP_GENERATION_NOT_SUPPORTED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n\n/**\n * Provided image format or type isn't supported for mockup generation.\n */\nexport class ImageNotSupportedWixError extends Error {\n /** @hidden */\n httpCode: number;\n /** @hidden */\n statusCode: string;\n /** @hidden */\n applicationCode: string;\n /** @hidden */\n name: string;\n /** @hidden */\n errorType: string;\n /** @hidden */\n spiErrorData: object;\n\n constructor() {\n super('ImageNotSupported');\n\n this.httpCode = 428;\n this.statusCode = 'FAILED_PRECONDITION';\n this.applicationCode = 'IMAGE_NOT_SUPPORTED';\n this.name = 'ImageNotSupported';\n this.errorType = 'SPI';\n this.spiErrorData = {\n name: 'ImageNotSupported',\n applicationCode: 'IMAGE_NOT_SUPPORTED',\n };\n }\n\n /** @hidden */\n static readonly __type = 'wix_spi_error';\n}\n","export interface BulkAddProductsToStoreRequest {\n /**\n * Product references to add to the site owner's store.\n * @minSize 1\n * @maxSize 100\n */\n productReferences?: ProductReference[];\n}\n\n/** Reference to a product on a marketplace provider's platform. */\nexport interface ProductReference {\n /**\n * Unique product identifier on the provider's platform.\n * @minLength 1\n * @maxLength 36\n */\n providerProductId?: string;\n /** Additional provider-specific data for this product. For example, other internal identifiers of the product on the provider's side. */\n options?: Record<string, any> | null;\n /**\n * Whether the product is visible in the site's store.\n *\n * Default: `false`\n */\n visibleInStore?: boolean;\n}\n\nexport interface BulkAddProductsToStoreResponse {\n /**\n * Results of adding each product to the store.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkAddProductToStoreResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface ItemMetadata {\n /**\n * Item ID. Should always be available, unless it's impossible (for example, when failing to create an item).\n * @minLength 1\n * @maxLength 36\n */\n _id?: string | null;\n /** Index of the item within the request array. Allows for correlation between request and response items. */\n originalIndex?: number;\n /** Whether the requested action was successful for this item. When `false`, the `error` field is populated. */\n success?: boolean;\n /** Details about the error in case of failure. */\n error?: ApplicationError;\n}\n\nexport interface ApplicationError {\n /** Error code. */\n code?: string;\n /** Description of the error. */\n description?: string;\n /** Data related to the error. */\n data?: Record<string, any> | null;\n}\n\nexport interface BulkAddProductToStoreResult {\n /** Item metadata. */\n itemMetadata?: ItemMetadata;\n /** Added product reference. */\n item?: ProductReference;\n}\n\nexport interface BulkActionMetadata {\n /** Number of items that were successfully processed. */\n totalSuccesses?: number;\n /** Number of items that couldn't be processed. */\n totalFailures?: number;\n /** Number of failures without details because detailed failure threshold was exceeded. */\n undetailedFailures?: number;\n}\n\nexport interface BulkGenerateMockupsRequest {\n /**\n * Mockups to generate.\n * @minSize 1\n * @maxSize 100\n */\n mockups?: Mockup[];\n}\n\nexport interface Mockup {\n /**\n * Unique product identifier on the provider's platform.\n * @minLength 1\n * @maxLength 36\n */\n providerProductId?: string;\n /** Image to overlay on the product mockup. */\n image?: Image;\n}\n\nexport interface Image {\n /**\n * Image URL.\n * @format WEB_URL\n */\n url?: string;\n /** Type of image used for mockup generation. */\n imageType?: ImageType;\n}\n\nexport enum ImageType {\n /** Unknown image type. */\n UNKNOWN_IMAGE_TYPE = 'UNKNOWN_IMAGE_TYPE',\n /** The site's logo. */\n SITE_LOGO = 'SITE_LOGO',\n /** A custom image provided by the site owner. */\n CUSTOM = 'CUSTOM',\n /** Default product mockup image used when a site logo or custom image mockup is not available. */\n FALLBACK = 'FALLBACK',\n}\n\nexport interface BulkGenerateMockupsResponse {\n /**\n * Results of the mockup generation for each product.\n * @minSize 1\n * @maxSize 100\n */\n results?: BulkGenerateMockupResult[];\n /** Bulk action metadata. */\n bulkActionMetadata?: BulkActionMetadata;\n}\n\nexport interface BulkGenerateMockupResult {\n /** Item metadata. */\n itemMetadata?: ItemMetadata;\n}\n\nexport interface GetInventoryRequest {\n /**\n * Unique product identifier on the provider's platform.\n * @minLength 1\n * @maxLength 36\n */\n providerProductId?: string;\n /**\n * Choices to filter by. For example, only return inventory for variants matching \"Size: M\" and \"Color: Black\".\n *\n * If empty, inventory for all available variants is returned.\n * @maxSize 10\n */\n choices?: Choice[];\n}\n\n/** Product variant choice such as size, color, or material. */\nexport interface Choice {\n /**\n * Choice name. For example, \"Size\", \"Color\", or \"Material\".\n * @maxLength 50\n */\n name?: string;\n /** Choice value. */\n value?: ChoiceValue;\n}\n\n/** Value of a product variant choice. */\nexport interface ChoiceValue extends ChoiceValueValueOneOf {\n /**\n * Simple text value. For example, \"M\" for size, or \"Cotton\" for material.\n * @minLength 1\n * @maxLength 50\n */\n simpleValue?: string;\n /** Color value with name and hex code. */\n color?: Color;\n}\n\n/** @oneof */\nexport interface ChoiceValueValueOneOf {\n /**\n * Simple text value. For example, \"M\" for size, or \"Cotton\" for material.\n * @minLength 1\n * @maxLength 50\n */\n simpleValue?: string;\n /** Color value with name and hex code. */\n color?: Color;\n}\n\n/** Color with name and hex code. */\nexport interface Color {\n /**\n * Color name. For example, \"Black\" or \"Red\".\n * @minLength 1\n * @maxLength 50\n */\n name?: string;\n /**\n * Hex color code. For example, `#000000`.\n * @format COLOR_HEX\n */\n hex?: string;\n}\n\nexport interface GetInventoryResponse {\n /**\n * Unique product identifier on the provider's platform.\n * @minLength 1\n * @maxLength 36\n */\n providerProductId?: string;\n /**\n * Inventory data for each variant matching the requested choices.\n * @maxSize 100\n */\n inventoryVariants?: InventoryVariant[];\n}\n\nexport interface InventoryVariant {\n /**\n * Choices that define this variant. For example, \"Size: M\" and \"Color: Black\".\n * @maxSize 10\n */\n choices?: Choice[];\n /** Available inventory quantity for this variant. `null` indicates the quantity is unknown or not tracked by the provider. */\n quantity?: number | null;\n}\n\nexport interface GetPricingBreakdownRequest {\n /**\n * Product ID on the provider's platform.\n * @minLength 1\n * @maxLength 36\n */\n providerProductId?: string;\n /**\n * Currency for the pricing breakdown.\n * @format CURRENCY\n */\n currency?: string;\n}\n\nexport interface GetPricingBreakdownResponse {\n /** Pricing breakdown for the product. */\n pricingBreakdown?: PricingBreakdown;\n}\n\n/** Pricing breakdown for a marketplace product. */\nexport interface PricingBreakdown {\n /** Range of the base cost across all variants. This is the base cost charged by the provider. */\n baseCostRange?: PriceRange;\n /** Range of the suggested retail price across all variants. Calculated as cost multiplied by the markup rate. */\n suggestedRetailPriceRange?: PriceRange;\n /** Range of the potential profit across all variants. Calculated as the suggested retail price minus the base cost. */\n potentialProfitRange?: PriceRange;\n /**\n * Markup rate applied to the base cost to calculate the suggested retail price. For example, `0.60` for a 60% markup, or `2.5` for a 250% markup.\n * @decimalValue options { gte:0, lte:10, maxScale:3 }\n */\n markupRate?: string | null;\n /**\n * Currency of the monetary values.\n * @format CURRENCY\n */\n currency?: string;\n}\n\n/** Price range with a lower bound and optional upper bound. Used to represent the range of prices across all product variants. */\nexport interface PriceRange {\n /**\n * Lower bound of the price range.\n * @decimalValue options { gte:0, lte:999999999, maxScale:3 }\n */\n from?: string;\n /**\n * Upper bound of the price range. Absent when all variants have the same price.\n * @decimalValue options { gte:0, lte:999999999, maxScale:3 }\n */\n to?: string | null;\n}\n\nexport interface MarketplaceProviderConfig {\n /** URI where the service plugin implementer is deployed. */\n deploymentUri?: SpiBaseUri;\n /**\n * Whether your implementation supports the Get Pricing Breakdown method. When `false`, Wix doesn't call your implementation for pricing breakdowns and the Suppliers Hub UI omits that section.\n *\n * Default: `false`\n */\n toggleGetPricingBreakdownEnabled?: boolean;\n}\n\n/** Base URI configuration for a service plugin. Wix uses these URIs to call your service plugin methods. */\nexport interface SpiBaseUri {\n /**\n * Base URI for your service plugin. Wix appends each method's path to this URI.\n *\n * For example, to receive requests at `https://my-app.com/v1/my-method`, set this field to `https://my-app.com/`.\n * @minLength 6\n * @maxLength 2048\n */\n baseUri?: string;\n /** Alternative URIs for specific methods. Use these to override the default URI for individual methods. */\n alternativeUris?: AlternativeUri[];\n}\n\n/** Custom URI for the specified service plugin method. */\nexport interface AlternativeUri {\n /**\n * Name of the method to call at the absolute URI, in PascalCase. For example, to call [Get Shipping Rates](https://dev.wix.com/docs/api-reference/business-solutions/e-commerce/extensions/shipping-rates/shipping-rates-integration-service-plugin/get-shipping-rates) on an alternative URI, specify `GetShippingRates`.\n * @minLength 3\n * @maxLength 128\n */\n methodName?: string;\n /**\n * Absolute URI that Wix calls for this method. Wix doesn't append any path to this URI.\n *\n * The URI must begin with `https://`, such as `https://my-app.com/v1/my-custom-method`.\n * @minLength 6\n * @maxLength 2048\n */\n absoluteUri?: string;\n}\n\n/**\n * this message is not directly used by any service,\n * it exists to describe the expected parameters that SHOULD be provided to invoked Velo methods as part of open-platform.\n * e.g. SPIs, event-handlers, etc..\n * NOTE: this context object MUST be provided as the last argument in each Velo method signature.\n *\n * Example:\n * ```typescript\n * export function wixStores_onOrderCanceled({ event, metadata }: OrderCanceledEvent) {\n * ...\n * }\n * ```\n */\nexport interface Context {\n /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */\n requestId?: string | null;\n /**\n * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.\n * @format CURRENCY\n */\n currency?: string | null;\n /** An object that describes the identity that triggered this request. */\n identity?: IdentificationData;\n /** A string representing a language and region in the format of `\"xx-XX\"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash \"-\", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `\"en-US\"`. */\n languages?: string[];\n /**\n * The service provider app's instance ID.\n * @format GUID\n */\n instanceId?: string | null;\n}\n\nexport enum IdentityType {\n UNKNOWN = 'UNKNOWN',\n ANONYMOUS_VISITOR = 'ANONYMOUS_VISITOR',\n MEMBER = 'MEMBER',\n WIX_USER = 'WIX_USER',\n APP = 'APP',\n}\n\nexport interface IdentificationData extends IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n /** @readonly */\n identityType?: IdentityType;\n}\n\n/** @oneof */\nexport interface IdentificationDataIdOneOf {\n /**\n * ID of a site visitor that has not logged in to the site.\n * @format GUID\n */\n anonymousVisitorId?: string;\n /**\n * ID of a site visitor that has logged in to the site.\n * @format GUID\n */\n memberId?: string;\n /**\n * ID of a Wix user (site owner, contributor, etc.).\n * @format GUID\n */\n wixUserId?: string;\n /**\n * ID of an app.\n * @format GUID\n */\n appId?: string;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGO,IAAM,uCAAN,cAAmD,MAAM;AAAA,EAc9D,cAAc;AACZ,UAAM,8BAA8B;AAEpC,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,qCA6BK,SAAS;AAMpB,IAAM,4BAAN,cAAwC,MAAM;AAAA,EAcnD,cAAc;AACZ,UAAM,mBAAmB;AAEzB,SAAK,WAAW;AAChB,SAAK,aAAa;AAClB,SAAK,kBAAkB;AACvB,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,eAAe;AAAA,MAClB,MAAM;AAAA,MACN,iBAAiB;AAAA,IACnB;AAAA,EACF;AAIF;AAAA;AA9Ba,0BA6BK,SAAS;;;ACyCpB,IAAK,YAAL,kBAAKA,eAAL;AAEL,EAAAA,WAAA,wBAAqB;AAErB,EAAAA,WAAA,eAAY;AAEZ,EAAAA,WAAA,YAAS;AAET,EAAAA,WAAA,cAAW;AARD,SAAAA;AAAA,GAAA;AAqPL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,uBAAoB;AACpB,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,SAAM;AALI,SAAAA;AAAA,GAAA;","names":["ImageType","IdentityType"]}
|