@wix/auto_sdk_stores_subscription-options 1.0.10 → 1.0.11
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/index.d.mts +144 -0
- package/build/index.d.ts +144 -0
- package/build/index.js +873 -0
- package/build/index.js.map +1 -0
- package/build/index.mjs +836 -0
- package/build/index.mjs.map +1 -0
- package/build/internal/index.d.mts +144 -0
- package/build/internal/index.d.ts +144 -0
- package/build/internal/index.js +873 -0
- package/build/internal/index.js.map +1 -0
- package/build/internal/index.mjs +836 -0
- package/build/internal/index.mjs.map +1 -0
- package/build/internal/meta.d.mts +290 -0
- package/build/internal/meta.d.ts +290 -0
- package/build/internal/meta.js +658 -0
- package/build/internal/meta.js.map +1 -0
- package/build/internal/meta.mjs +620 -0
- package/build/internal/meta.mjs.map +1 -0
- package/build/{es/src/stores-v1-subscription-option-subscription-options.types.d.ts → internal/stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.mts} +98 -54
- package/build/internal/{cjs/src/stores-v1-subscription-option-subscription-options.types.d.ts → stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.ts} +98 -54
- package/build/meta.d.mts +290 -0
- package/build/meta.d.ts +290 -0
- package/build/meta.js +658 -0
- package/build/meta.js.map +1 -0
- package/build/meta.mjs +620 -0
- package/build/meta.mjs.map +1 -0
- package/build/{internal/es/src/stores-v1-subscription-option-subscription-options.types.d.ts → stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.mts} +98 -54
- package/build/{cjs/src/stores-v1-subscription-option-subscription-options.types.d.ts → stores-v1-subscription-option-subscription-options.universal-CvhCuWKj.d.ts} +98 -54
- package/package.json +12 -11
- package/build/cjs/index.d.ts +0 -1
- package/build/cjs/index.js +0 -18
- package/build/cjs/index.js.map +0 -1
- package/build/cjs/index.typings.d.ts +0 -1
- package/build/cjs/index.typings.js +0 -18
- package/build/cjs/index.typings.js.map +0 -1
- package/build/cjs/meta.d.ts +0 -1
- package/build/cjs/meta.js +0 -18
- package/build/cjs/meta.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.context.d.ts +0 -16
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.context.js +0 -21
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.context.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.http.d.ts +0 -70
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.http.js +0 -421
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.http.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.meta.d.ts +0 -40
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.meta.js +0 -258
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.meta.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.public.d.ts +0 -131
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.public.js +0 -81
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.public.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.types.js +0 -20
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.types.js.map +0 -1
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.universal.d.ts +0 -663
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.universal.js +0 -586
- package/build/cjs/src/stores-v1-subscription-option-subscription-options.universal.js.map +0 -1
- package/build/es/index.d.ts +0 -1
- package/build/es/index.js +0 -2
- package/build/es/index.js.map +0 -1
- package/build/es/index.typings.d.ts +0 -1
- package/build/es/index.typings.js +0 -2
- package/build/es/index.typings.js.map +0 -1
- package/build/es/meta.d.ts +0 -1
- package/build/es/meta.js +0 -2
- package/build/es/meta.js.map +0 -1
- package/build/es/package.json +0 -3
- package/build/es/src/stores-v1-subscription-option-subscription-options.context.d.ts +0 -16
- package/build/es/src/stores-v1-subscription-option-subscription-options.context.js +0 -16
- package/build/es/src/stores-v1-subscription-option-subscription-options.context.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option-subscription-options.http.d.ts +0 -70
- package/build/es/src/stores-v1-subscription-option-subscription-options.http.js +0 -406
- package/build/es/src/stores-v1-subscription-option-subscription-options.http.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option-subscription-options.meta.d.ts +0 -40
- package/build/es/src/stores-v1-subscription-option-subscription-options.meta.js +0 -220
- package/build/es/src/stores-v1-subscription-option-subscription-options.meta.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option-subscription-options.public.d.ts +0 -131
- package/build/es/src/stores-v1-subscription-option-subscription-options.public.js +0 -64
- package/build/es/src/stores-v1-subscription-option-subscription-options.public.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option-subscription-options.types.js +0 -17
- package/build/es/src/stores-v1-subscription-option-subscription-options.types.js.map +0 -1
- package/build/es/src/stores-v1-subscription-option-subscription-options.universal.d.ts +0 -663
- package/build/es/src/stores-v1-subscription-option-subscription-options.universal.js +0 -548
- package/build/es/src/stores-v1-subscription-option-subscription-options.universal.js.map +0 -1
- package/build/internal/cjs/index.d.ts +0 -1
- package/build/internal/cjs/index.js +0 -18
- package/build/internal/cjs/index.js.map +0 -1
- package/build/internal/cjs/index.typings.d.ts +0 -1
- package/build/internal/cjs/index.typings.js +0 -18
- package/build/internal/cjs/index.typings.js.map +0 -1
- package/build/internal/cjs/meta.d.ts +0 -1
- package/build/internal/cjs/meta.js +0 -18
- package/build/internal/cjs/meta.js.map +0 -1
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.context.d.ts +0 -16
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.context.js +0 -21
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.context.js.map +0 -1
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.http.d.ts +0 -70
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.http.js +0 -421
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.http.js.map +0 -1
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.meta.d.ts +0 -40
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.meta.js +0 -258
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.meta.js.map +0 -1
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.public.d.ts +0 -131
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.public.js +0 -81
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.public.js.map +0 -1
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.types.js +0 -20
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.types.js.map +0 -1
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.universal.d.ts +0 -663
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.universal.js +0 -586
- package/build/internal/cjs/src/stores-v1-subscription-option-subscription-options.universal.js.map +0 -1
- package/build/internal/es/index.d.ts +0 -1
- package/build/internal/es/index.js +0 -2
- package/build/internal/es/index.js.map +0 -1
- package/build/internal/es/index.typings.d.ts +0 -1
- package/build/internal/es/index.typings.js +0 -2
- package/build/internal/es/index.typings.js.map +0 -1
- package/build/internal/es/meta.d.ts +0 -1
- package/build/internal/es/meta.js +0 -2
- package/build/internal/es/meta.js.map +0 -1
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.context.d.ts +0 -16
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.context.js +0 -16
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.context.js.map +0 -1
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.http.d.ts +0 -70
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.http.js +0 -406
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.http.js.map +0 -1
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.meta.d.ts +0 -40
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.meta.js +0 -220
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.meta.js.map +0 -1
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.public.d.ts +0 -131
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.public.js +0 -64
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.public.js.map +0 -1
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.types.js +0 -17
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.types.js.map +0 -1
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.universal.d.ts +0 -663
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.universal.js +0 -548
- package/build/internal/es/src/stores-v1-subscription-option-subscription-options.universal.js.map +0 -1
|
@@ -0,0 +1,836 @@
|
|
|
1
|
+
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import {
|
|
4
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
5
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
6
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
7
|
+
|
|
8
|
+
// src/stores-v1-subscription-option-subscription-options.http.ts
|
|
9
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
10
|
+
import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
|
|
11
|
+
import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
|
|
12
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
13
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
14
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(opts) {
|
|
15
|
+
const domainToMappings = {
|
|
16
|
+
"api._api_base_domain_": [
|
|
17
|
+
{
|
|
18
|
+
srcPath: "/wix-ecommerce-plans",
|
|
19
|
+
destPath: ""
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"www.wixapis.com": [
|
|
23
|
+
{
|
|
24
|
+
srcPath: "/stores/v1/subscription-options",
|
|
25
|
+
destPath: "/v1/subscription-options"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"www._base_domain_": [
|
|
29
|
+
{
|
|
30
|
+
srcPath: "/_api/subscription-options-server",
|
|
31
|
+
destPath: ""
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"editor._base_domain_": [
|
|
35
|
+
{
|
|
36
|
+
srcPath: "/_api/subscription-options-server",
|
|
37
|
+
destPath: ""
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"blocks._base_domain_": [
|
|
41
|
+
{
|
|
42
|
+
srcPath: "/_api/subscription-options-server",
|
|
43
|
+
destPath: ""
|
|
44
|
+
}
|
|
45
|
+
],
|
|
46
|
+
"create.editorx": [
|
|
47
|
+
{
|
|
48
|
+
srcPath: "/_api/subscription-options-server",
|
|
49
|
+
destPath: ""
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"manage._base_domain_": [
|
|
53
|
+
{
|
|
54
|
+
srcPath: "/_api/subscription-options-server",
|
|
55
|
+
destPath: ""
|
|
56
|
+
}
|
|
57
|
+
]
|
|
58
|
+
};
|
|
59
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
60
|
+
}
|
|
61
|
+
function resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(opts) {
|
|
62
|
+
const domainToMappings = {
|
|
63
|
+
"api._api_base_domain_": [
|
|
64
|
+
{
|
|
65
|
+
srcPath: "/wix-ecommerce-plans-reader",
|
|
66
|
+
destPath: ""
|
|
67
|
+
}
|
|
68
|
+
],
|
|
69
|
+
"www._base_domain_": [
|
|
70
|
+
{
|
|
71
|
+
srcPath: "/_api/wix-ecommerce-plans-reader",
|
|
72
|
+
destPath: ""
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
_: [
|
|
76
|
+
{
|
|
77
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
78
|
+
destPath: ""
|
|
79
|
+
}
|
|
80
|
+
],
|
|
81
|
+
"manage._base_domain_": [
|
|
82
|
+
{
|
|
83
|
+
srcPath: "/_api/subscription-options-reader-server",
|
|
84
|
+
destPath: ""
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
};
|
|
88
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
89
|
+
}
|
|
90
|
+
var PACKAGE_NAME = "@wix/auto_sdk_stores_subscription-options";
|
|
91
|
+
function getSubscriptionOption(payload) {
|
|
92
|
+
function __getSubscriptionOption({ host }) {
|
|
93
|
+
const metadata = {
|
|
94
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
95
|
+
method: "GET",
|
|
96
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOption",
|
|
97
|
+
packageName: PACKAGE_NAME,
|
|
98
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
99
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
100
|
+
),
|
|
101
|
+
params: toURLSearchParams(payload),
|
|
102
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
103
|
+
{
|
|
104
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
105
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
106
|
+
}
|
|
107
|
+
])
|
|
108
|
+
};
|
|
109
|
+
return metadata;
|
|
110
|
+
}
|
|
111
|
+
return __getSubscriptionOption;
|
|
112
|
+
}
|
|
113
|
+
function getSubscriptionOptionsForProduct(payload) {
|
|
114
|
+
function __getSubscriptionOptionsForProduct({ host }) {
|
|
115
|
+
const metadata = {
|
|
116
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
117
|
+
method: "GET",
|
|
118
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetSubscriptionOptionsForProduct",
|
|
119
|
+
packageName: PACKAGE_NAME,
|
|
120
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
121
|
+
{
|
|
122
|
+
protoPath: "/v1/subscription-options/byProduct/{productId}",
|
|
123
|
+
data: payload,
|
|
124
|
+
host
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
params: toURLSearchParams(payload),
|
|
128
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
129
|
+
{
|
|
130
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
131
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
132
|
+
}
|
|
133
|
+
])
|
|
134
|
+
};
|
|
135
|
+
return metadata;
|
|
136
|
+
}
|
|
137
|
+
return __getSubscriptionOptionsForProduct;
|
|
138
|
+
}
|
|
139
|
+
function getProductIdsForSubscriptionOption(payload) {
|
|
140
|
+
function __getProductIdsForSubscriptionOption({ host }) {
|
|
141
|
+
const metadata = {
|
|
142
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
143
|
+
method: "GET",
|
|
144
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetProductIdsForSubscriptionOption",
|
|
145
|
+
packageName: PACKAGE_NAME,
|
|
146
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
147
|
+
{
|
|
148
|
+
protoPath: "/v1/subscription-options/{id}/productIds",
|
|
149
|
+
data: payload,
|
|
150
|
+
host
|
|
151
|
+
}
|
|
152
|
+
),
|
|
153
|
+
params: toURLSearchParams(payload)
|
|
154
|
+
};
|
|
155
|
+
return metadata;
|
|
156
|
+
}
|
|
157
|
+
return __getProductIdsForSubscriptionOption;
|
|
158
|
+
}
|
|
159
|
+
function getOneTimePurchasesStatus(payload) {
|
|
160
|
+
function __getOneTimePurchasesStatus({ host }) {
|
|
161
|
+
const metadata = {
|
|
162
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
163
|
+
method: "GET",
|
|
164
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsReadApi.GetOneTimePurchasesStatus",
|
|
165
|
+
packageName: PACKAGE_NAME,
|
|
166
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsReadApiUrl(
|
|
167
|
+
{
|
|
168
|
+
protoPath: "/v1/subscription-options/product/{productId}/oneTimePurchasesStatus",
|
|
169
|
+
data: payload,
|
|
170
|
+
host
|
|
171
|
+
}
|
|
172
|
+
),
|
|
173
|
+
params: toURLSearchParams(payload)
|
|
174
|
+
};
|
|
175
|
+
return metadata;
|
|
176
|
+
}
|
|
177
|
+
return __getOneTimePurchasesStatus;
|
|
178
|
+
}
|
|
179
|
+
function createSubscriptionOption(payload) {
|
|
180
|
+
function __createSubscriptionOption({ host }) {
|
|
181
|
+
const serializedData = transformPaths(payload, [
|
|
182
|
+
{
|
|
183
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
184
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
185
|
+
}
|
|
186
|
+
]);
|
|
187
|
+
const metadata = {
|
|
188
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
189
|
+
method: "POST",
|
|
190
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.CreateSubscriptionOption",
|
|
191
|
+
packageName: PACKAGE_NAME,
|
|
192
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
193
|
+
{ protoPath: "/v1/subscription-options", data: serializedData, host }
|
|
194
|
+
),
|
|
195
|
+
data: serializedData,
|
|
196
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
197
|
+
{
|
|
198
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
199
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
200
|
+
}
|
|
201
|
+
])
|
|
202
|
+
};
|
|
203
|
+
return metadata;
|
|
204
|
+
}
|
|
205
|
+
return __createSubscriptionOption;
|
|
206
|
+
}
|
|
207
|
+
function updateSubscriptionOption(payload) {
|
|
208
|
+
function __updateSubscriptionOption({ host }) {
|
|
209
|
+
const serializedData = transformPaths(payload, [
|
|
210
|
+
{
|
|
211
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
212
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
213
|
+
}
|
|
214
|
+
]);
|
|
215
|
+
const metadata = {
|
|
216
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
217
|
+
method: "PATCH",
|
|
218
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.UpdateSubscriptionOption",
|
|
219
|
+
packageName: PACKAGE_NAME,
|
|
220
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
221
|
+
{
|
|
222
|
+
protoPath: "/v1/subscription-options/{subscriptionOption.id}",
|
|
223
|
+
data: serializedData,
|
|
224
|
+
host
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
data: serializedData,
|
|
228
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
229
|
+
{
|
|
230
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
231
|
+
paths: [{ path: "subscriptionOption.discount.value" }]
|
|
232
|
+
}
|
|
233
|
+
])
|
|
234
|
+
};
|
|
235
|
+
return metadata;
|
|
236
|
+
}
|
|
237
|
+
return __updateSubscriptionOption;
|
|
238
|
+
}
|
|
239
|
+
function deleteSubscriptionOption(payload) {
|
|
240
|
+
function __deleteSubscriptionOption({ host }) {
|
|
241
|
+
const metadata = {
|
|
242
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
243
|
+
method: "DELETE",
|
|
244
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.DeleteSubscriptionOption",
|
|
245
|
+
packageName: PACKAGE_NAME,
|
|
246
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
247
|
+
{ protoPath: "/v1/subscription-options/{id}", data: payload, host }
|
|
248
|
+
),
|
|
249
|
+
params: toURLSearchParams(payload)
|
|
250
|
+
};
|
|
251
|
+
return metadata;
|
|
252
|
+
}
|
|
253
|
+
return __deleteSubscriptionOption;
|
|
254
|
+
}
|
|
255
|
+
function bulkCreateSubscriptionOptions(payload) {
|
|
256
|
+
function __bulkCreateSubscriptionOptions({ host }) {
|
|
257
|
+
const serializedData = transformPaths(payload, [
|
|
258
|
+
{
|
|
259
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
260
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
261
|
+
}
|
|
262
|
+
]);
|
|
263
|
+
const metadata = {
|
|
264
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
265
|
+
method: "POST",
|
|
266
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkCreateSubscriptionOptions",
|
|
267
|
+
packageName: PACKAGE_NAME,
|
|
268
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
269
|
+
{
|
|
270
|
+
protoPath: "/v1/subscription-options/createBulk",
|
|
271
|
+
data: serializedData,
|
|
272
|
+
host
|
|
273
|
+
}
|
|
274
|
+
),
|
|
275
|
+
data: serializedData,
|
|
276
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
277
|
+
{
|
|
278
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
279
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
280
|
+
}
|
|
281
|
+
])
|
|
282
|
+
};
|
|
283
|
+
return metadata;
|
|
284
|
+
}
|
|
285
|
+
return __bulkCreateSubscriptionOptions;
|
|
286
|
+
}
|
|
287
|
+
function bulkUpdateSubscriptionOptions(payload) {
|
|
288
|
+
function __bulkUpdateSubscriptionOptions({ host }) {
|
|
289
|
+
const serializedData = transformPaths(payload, [
|
|
290
|
+
{
|
|
291
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
292
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
293
|
+
}
|
|
294
|
+
]);
|
|
295
|
+
const metadata = {
|
|
296
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
297
|
+
method: "PATCH",
|
|
298
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkUpdateSubscriptionOptions",
|
|
299
|
+
packageName: PACKAGE_NAME,
|
|
300
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
301
|
+
{ protoPath: "/v1/subscription-options", data: serializedData, host }
|
|
302
|
+
),
|
|
303
|
+
data: serializedData,
|
|
304
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
305
|
+
{
|
|
306
|
+
transformFn: transformRESTFloatToSDKFloat,
|
|
307
|
+
paths: [{ path: "subscriptionOptions.discount.value" }]
|
|
308
|
+
}
|
|
309
|
+
])
|
|
310
|
+
};
|
|
311
|
+
return metadata;
|
|
312
|
+
}
|
|
313
|
+
return __bulkUpdateSubscriptionOptions;
|
|
314
|
+
}
|
|
315
|
+
function bulkDeleteSubscriptionOptions(payload) {
|
|
316
|
+
function __bulkDeleteSubscriptionOptions({ host }) {
|
|
317
|
+
const metadata = {
|
|
318
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
319
|
+
method: "POST",
|
|
320
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.BulkDeleteSubscriptionOptions",
|
|
321
|
+
packageName: PACKAGE_NAME,
|
|
322
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
323
|
+
{
|
|
324
|
+
protoPath: "/v1/subscription-options/deleteBulk",
|
|
325
|
+
data: payload,
|
|
326
|
+
host
|
|
327
|
+
}
|
|
328
|
+
),
|
|
329
|
+
data: payload
|
|
330
|
+
};
|
|
331
|
+
return metadata;
|
|
332
|
+
}
|
|
333
|
+
return __bulkDeleteSubscriptionOptions;
|
|
334
|
+
}
|
|
335
|
+
function assignSubscriptionOptionsToProduct(payload) {
|
|
336
|
+
function __assignSubscriptionOptionsToProduct({ host }) {
|
|
337
|
+
const serializedData = transformPaths(payload, [
|
|
338
|
+
{
|
|
339
|
+
transformFn: transformSDKFloatToRESTFloat,
|
|
340
|
+
paths: [{ path: "assignedSubscriptionOptions.discount.value" }]
|
|
341
|
+
}
|
|
342
|
+
]);
|
|
343
|
+
const metadata = {
|
|
344
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
345
|
+
method: "POST",
|
|
346
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.AssignSubscriptionOptionsToProduct",
|
|
347
|
+
packageName: PACKAGE_NAME,
|
|
348
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
349
|
+
{
|
|
350
|
+
protoPath: "/v1/subscription-options/product/{productId}/assign",
|
|
351
|
+
data: serializedData,
|
|
352
|
+
host
|
|
353
|
+
}
|
|
354
|
+
),
|
|
355
|
+
data: serializedData
|
|
356
|
+
};
|
|
357
|
+
return metadata;
|
|
358
|
+
}
|
|
359
|
+
return __assignSubscriptionOptionsToProduct;
|
|
360
|
+
}
|
|
361
|
+
function allowOneTimePurchases(payload) {
|
|
362
|
+
function __allowOneTimePurchases({ host }) {
|
|
363
|
+
const metadata = {
|
|
364
|
+
entityFqdn: "wix.stores.v1.subscription_option",
|
|
365
|
+
method: "PATCH",
|
|
366
|
+
methodFqn: "wix.ecommerce.subscription.option.api.v1.SubscriptionOptionsWriteApi.AllowOneTimePurchases",
|
|
367
|
+
packageName: PACKAGE_NAME,
|
|
368
|
+
url: resolveWixEcommerceSubscriptionOptionApiV1SubscriptionOptionsWriteApiUrl(
|
|
369
|
+
{
|
|
370
|
+
protoPath: "/v1/subscription-options/product/{productId}/allowOneTimePurchase",
|
|
371
|
+
data: payload,
|
|
372
|
+
host
|
|
373
|
+
}
|
|
374
|
+
),
|
|
375
|
+
data: payload
|
|
376
|
+
};
|
|
377
|
+
return metadata;
|
|
378
|
+
}
|
|
379
|
+
return __allowOneTimePurchases;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// src/stores-v1-subscription-option-subscription-options.universal.ts
|
|
383
|
+
var SubscriptionFrequency = /* @__PURE__ */ ((SubscriptionFrequency2) => {
|
|
384
|
+
SubscriptionFrequency2["UNDEFINED"] = "UNDEFINED";
|
|
385
|
+
SubscriptionFrequency2["DAY"] = "DAY";
|
|
386
|
+
SubscriptionFrequency2["WEEK"] = "WEEK";
|
|
387
|
+
SubscriptionFrequency2["MONTH"] = "MONTH";
|
|
388
|
+
SubscriptionFrequency2["YEAR"] = "YEAR";
|
|
389
|
+
return SubscriptionFrequency2;
|
|
390
|
+
})(SubscriptionFrequency || {});
|
|
391
|
+
var DiscountType = /* @__PURE__ */ ((DiscountType2) => {
|
|
392
|
+
DiscountType2["UNDEFINED"] = "UNDEFINED";
|
|
393
|
+
DiscountType2["AMOUNT"] = "AMOUNT";
|
|
394
|
+
DiscountType2["PERCENT"] = "PERCENT";
|
|
395
|
+
return DiscountType2;
|
|
396
|
+
})(DiscountType || {});
|
|
397
|
+
async function getSubscriptionOption2(_id) {
|
|
398
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
399
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
400
|
+
const reqOpts = getSubscriptionOption(payload);
|
|
401
|
+
sideEffects?.onSiteCall?.();
|
|
402
|
+
try {
|
|
403
|
+
const result = await httpClient.request(reqOpts);
|
|
404
|
+
sideEffects?.onSuccess?.(result);
|
|
405
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
406
|
+
} catch (err) {
|
|
407
|
+
const transformedError = sdkTransformError(
|
|
408
|
+
err,
|
|
409
|
+
{
|
|
410
|
+
spreadPathsToArguments: {},
|
|
411
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
412
|
+
singleArgumentUnchanged: false
|
|
413
|
+
},
|
|
414
|
+
["_id"]
|
|
415
|
+
);
|
|
416
|
+
sideEffects?.onError?.(err);
|
|
417
|
+
throw transformedError;
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
async function getSubscriptionOptionsForProduct2(productId, options) {
|
|
421
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
422
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
423
|
+
productId,
|
|
424
|
+
includeHiddenSubscriptionOptions: options?.includeHiddenSubscriptionOptions
|
|
425
|
+
});
|
|
426
|
+
const reqOpts = getSubscriptionOptionsForProduct(
|
|
427
|
+
payload
|
|
428
|
+
);
|
|
429
|
+
sideEffects?.onSiteCall?.();
|
|
430
|
+
try {
|
|
431
|
+
const result = await httpClient.request(reqOpts);
|
|
432
|
+
sideEffects?.onSuccess?.(result);
|
|
433
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
434
|
+
} catch (err) {
|
|
435
|
+
const transformedError = sdkTransformError(
|
|
436
|
+
err,
|
|
437
|
+
{
|
|
438
|
+
spreadPathsToArguments: {},
|
|
439
|
+
explicitPathsToArguments: {
|
|
440
|
+
productId: "$[0]",
|
|
441
|
+
includeHiddenSubscriptionOptions: "$[1].includeHiddenSubscriptionOptions"
|
|
442
|
+
},
|
|
443
|
+
singleArgumentUnchanged: false
|
|
444
|
+
},
|
|
445
|
+
["productId", "options"]
|
|
446
|
+
);
|
|
447
|
+
sideEffects?.onError?.(err);
|
|
448
|
+
throw transformedError;
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
async function getProductIdsForSubscriptionOption2(_id, options) {
|
|
452
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
453
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
454
|
+
id: _id,
|
|
455
|
+
includeHiddenProducts: options?.includeHiddenProducts,
|
|
456
|
+
paging: options?.paging
|
|
457
|
+
});
|
|
458
|
+
const reqOpts = getProductIdsForSubscriptionOption(
|
|
459
|
+
payload
|
|
460
|
+
);
|
|
461
|
+
sideEffects?.onSiteCall?.();
|
|
462
|
+
try {
|
|
463
|
+
const result = await httpClient.request(reqOpts);
|
|
464
|
+
sideEffects?.onSuccess?.(result);
|
|
465
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
466
|
+
} catch (err) {
|
|
467
|
+
const transformedError = sdkTransformError(
|
|
468
|
+
err,
|
|
469
|
+
{
|
|
470
|
+
spreadPathsToArguments: {},
|
|
471
|
+
explicitPathsToArguments: {
|
|
472
|
+
id: "$[0]",
|
|
473
|
+
includeHiddenProducts: "$[1].includeHiddenProducts",
|
|
474
|
+
paging: "$[1].paging"
|
|
475
|
+
},
|
|
476
|
+
singleArgumentUnchanged: false
|
|
477
|
+
},
|
|
478
|
+
["_id", "options"]
|
|
479
|
+
);
|
|
480
|
+
sideEffects?.onError?.(err);
|
|
481
|
+
throw transformedError;
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
async function getOneTimePurchasesStatus2(productId) {
|
|
485
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
486
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
487
|
+
productId
|
|
488
|
+
});
|
|
489
|
+
const reqOpts = getOneTimePurchasesStatus(payload);
|
|
490
|
+
sideEffects?.onSiteCall?.();
|
|
491
|
+
try {
|
|
492
|
+
const result = await httpClient.request(reqOpts);
|
|
493
|
+
sideEffects?.onSuccess?.(result);
|
|
494
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
495
|
+
} catch (err) {
|
|
496
|
+
const transformedError = sdkTransformError(
|
|
497
|
+
err,
|
|
498
|
+
{
|
|
499
|
+
spreadPathsToArguments: {},
|
|
500
|
+
explicitPathsToArguments: { productId: "$[0]" },
|
|
501
|
+
singleArgumentUnchanged: false
|
|
502
|
+
},
|
|
503
|
+
["productId"]
|
|
504
|
+
);
|
|
505
|
+
sideEffects?.onError?.(err);
|
|
506
|
+
throw transformedError;
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
async function createSubscriptionOption2(subscriptionOption) {
|
|
510
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
511
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
512
|
+
subscriptionOption
|
|
513
|
+
});
|
|
514
|
+
const reqOpts = createSubscriptionOption(payload);
|
|
515
|
+
sideEffects?.onSiteCall?.();
|
|
516
|
+
try {
|
|
517
|
+
const result = await httpClient.request(reqOpts);
|
|
518
|
+
sideEffects?.onSuccess?.(result);
|
|
519
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
520
|
+
} catch (err) {
|
|
521
|
+
const transformedError = sdkTransformError(
|
|
522
|
+
err,
|
|
523
|
+
{
|
|
524
|
+
spreadPathsToArguments: {},
|
|
525
|
+
explicitPathsToArguments: { subscriptionOption: "$[0]" },
|
|
526
|
+
singleArgumentUnchanged: false
|
|
527
|
+
},
|
|
528
|
+
["subscriptionOption"]
|
|
529
|
+
);
|
|
530
|
+
sideEffects?.onError?.(err);
|
|
531
|
+
throw transformedError;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
async function updateSubscriptionOption2(_id, subscriptionOption) {
|
|
535
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
536
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
537
|
+
subscriptionOption: { ...subscriptionOption, id: _id }
|
|
538
|
+
});
|
|
539
|
+
const reqOpts = updateSubscriptionOption(payload);
|
|
540
|
+
sideEffects?.onSiteCall?.();
|
|
541
|
+
try {
|
|
542
|
+
const result = await httpClient.request(reqOpts);
|
|
543
|
+
sideEffects?.onSuccess?.(result);
|
|
544
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.subscriptionOption;
|
|
545
|
+
} catch (err) {
|
|
546
|
+
const transformedError = sdkTransformError(
|
|
547
|
+
err,
|
|
548
|
+
{
|
|
549
|
+
spreadPathsToArguments: { subscriptionOption: "$[1]" },
|
|
550
|
+
explicitPathsToArguments: { "subscriptionOption.id": "$[0]" },
|
|
551
|
+
singleArgumentUnchanged: false
|
|
552
|
+
},
|
|
553
|
+
["_id", "subscriptionOption"]
|
|
554
|
+
);
|
|
555
|
+
sideEffects?.onError?.(err);
|
|
556
|
+
throw transformedError;
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
async function deleteSubscriptionOption2(_id) {
|
|
560
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
561
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
562
|
+
const reqOpts = deleteSubscriptionOption(payload);
|
|
563
|
+
sideEffects?.onSiteCall?.();
|
|
564
|
+
try {
|
|
565
|
+
const result = await httpClient.request(reqOpts);
|
|
566
|
+
sideEffects?.onSuccess?.(result);
|
|
567
|
+
} catch (err) {
|
|
568
|
+
const transformedError = sdkTransformError(
|
|
569
|
+
err,
|
|
570
|
+
{
|
|
571
|
+
spreadPathsToArguments: {},
|
|
572
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
573
|
+
singleArgumentUnchanged: false
|
|
574
|
+
},
|
|
575
|
+
["_id"]
|
|
576
|
+
);
|
|
577
|
+
sideEffects?.onError?.(err);
|
|
578
|
+
throw transformedError;
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
async function bulkCreateSubscriptionOptions2(subscriptionOptions) {
|
|
582
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
583
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
584
|
+
subscriptionOptions
|
|
585
|
+
});
|
|
586
|
+
const reqOpts = bulkCreateSubscriptionOptions(
|
|
587
|
+
payload
|
|
588
|
+
);
|
|
589
|
+
sideEffects?.onSiteCall?.();
|
|
590
|
+
try {
|
|
591
|
+
const result = await httpClient.request(reqOpts);
|
|
592
|
+
sideEffects?.onSuccess?.(result);
|
|
593
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
594
|
+
} catch (err) {
|
|
595
|
+
const transformedError = sdkTransformError(
|
|
596
|
+
err,
|
|
597
|
+
{
|
|
598
|
+
spreadPathsToArguments: {},
|
|
599
|
+
explicitPathsToArguments: { subscriptionOptions: "$[0]" },
|
|
600
|
+
singleArgumentUnchanged: false
|
|
601
|
+
},
|
|
602
|
+
["subscriptionOptions"]
|
|
603
|
+
);
|
|
604
|
+
sideEffects?.onError?.(err);
|
|
605
|
+
throw transformedError;
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
async function bulkUpdateSubscriptionOptions2(subscriptionOptions) {
|
|
609
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
610
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
611
|
+
subscriptionOptions
|
|
612
|
+
});
|
|
613
|
+
const reqOpts = bulkUpdateSubscriptionOptions(
|
|
614
|
+
payload
|
|
615
|
+
);
|
|
616
|
+
sideEffects?.onSiteCall?.();
|
|
617
|
+
try {
|
|
618
|
+
const result = await httpClient.request(reqOpts);
|
|
619
|
+
sideEffects?.onSuccess?.(result);
|
|
620
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
621
|
+
} catch (err) {
|
|
622
|
+
const transformedError = sdkTransformError(
|
|
623
|
+
err,
|
|
624
|
+
{
|
|
625
|
+
spreadPathsToArguments: {},
|
|
626
|
+
explicitPathsToArguments: { subscriptionOptions: "$[0]" },
|
|
627
|
+
singleArgumentUnchanged: false
|
|
628
|
+
},
|
|
629
|
+
["subscriptionOptions"]
|
|
630
|
+
);
|
|
631
|
+
sideEffects?.onError?.(err);
|
|
632
|
+
throw transformedError;
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
async function bulkDeleteSubscriptionOptions2(ids) {
|
|
636
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
637
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ ids });
|
|
638
|
+
const reqOpts = bulkDeleteSubscriptionOptions(
|
|
639
|
+
payload
|
|
640
|
+
);
|
|
641
|
+
sideEffects?.onSiteCall?.();
|
|
642
|
+
try {
|
|
643
|
+
const result = await httpClient.request(reqOpts);
|
|
644
|
+
sideEffects?.onSuccess?.(result);
|
|
645
|
+
} catch (err) {
|
|
646
|
+
const transformedError = sdkTransformError(
|
|
647
|
+
err,
|
|
648
|
+
{
|
|
649
|
+
spreadPathsToArguments: {},
|
|
650
|
+
explicitPathsToArguments: { ids: "$[0]" },
|
|
651
|
+
singleArgumentUnchanged: false
|
|
652
|
+
},
|
|
653
|
+
["ids"]
|
|
654
|
+
);
|
|
655
|
+
sideEffects?.onError?.(err);
|
|
656
|
+
throw transformedError;
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
async function assignSubscriptionOptionsToProduct2(productId, options) {
|
|
660
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
661
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
662
|
+
productId,
|
|
663
|
+
assignedSubscriptionOptions: options?.assignedSubscriptionOptions
|
|
664
|
+
});
|
|
665
|
+
const reqOpts = assignSubscriptionOptionsToProduct(
|
|
666
|
+
payload
|
|
667
|
+
);
|
|
668
|
+
sideEffects?.onSiteCall?.();
|
|
669
|
+
try {
|
|
670
|
+
const result = await httpClient.request(reqOpts);
|
|
671
|
+
sideEffects?.onSuccess?.(result);
|
|
672
|
+
} catch (err) {
|
|
673
|
+
const transformedError = sdkTransformError(
|
|
674
|
+
err,
|
|
675
|
+
{
|
|
676
|
+
spreadPathsToArguments: {},
|
|
677
|
+
explicitPathsToArguments: {
|
|
678
|
+
productId: "$[0]",
|
|
679
|
+
assignedSubscriptionOptions: "$[1].assignedSubscriptionOptions"
|
|
680
|
+
},
|
|
681
|
+
singleArgumentUnchanged: false
|
|
682
|
+
},
|
|
683
|
+
["productId", "options"]
|
|
684
|
+
);
|
|
685
|
+
sideEffects?.onError?.(err);
|
|
686
|
+
throw transformedError;
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
async function allowOneTimePurchases2(productId, allowed) {
|
|
690
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
691
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
692
|
+
productId,
|
|
693
|
+
allowed
|
|
694
|
+
});
|
|
695
|
+
const reqOpts = allowOneTimePurchases(payload);
|
|
696
|
+
sideEffects?.onSiteCall?.();
|
|
697
|
+
try {
|
|
698
|
+
const result = await httpClient.request(reqOpts);
|
|
699
|
+
sideEffects?.onSuccess?.(result);
|
|
700
|
+
} catch (err) {
|
|
701
|
+
const transformedError = sdkTransformError(
|
|
702
|
+
err,
|
|
703
|
+
{
|
|
704
|
+
spreadPathsToArguments: {},
|
|
705
|
+
explicitPathsToArguments: { productId: "$[0]", allowed: "$[1]" },
|
|
706
|
+
singleArgumentUnchanged: false
|
|
707
|
+
},
|
|
708
|
+
["productId", "allowed"]
|
|
709
|
+
);
|
|
710
|
+
sideEffects?.onError?.(err);
|
|
711
|
+
throw transformedError;
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// src/stores-v1-subscription-option-subscription-options.public.ts
|
|
716
|
+
function getSubscriptionOption3(httpClient) {
|
|
717
|
+
return (_id) => getSubscriptionOption2(
|
|
718
|
+
_id,
|
|
719
|
+
// @ts-ignore
|
|
720
|
+
{ httpClient }
|
|
721
|
+
);
|
|
722
|
+
}
|
|
723
|
+
function getSubscriptionOptionsForProduct3(httpClient) {
|
|
724
|
+
return (productId, options) => getSubscriptionOptionsForProduct2(
|
|
725
|
+
productId,
|
|
726
|
+
options,
|
|
727
|
+
// @ts-ignore
|
|
728
|
+
{ httpClient }
|
|
729
|
+
);
|
|
730
|
+
}
|
|
731
|
+
function getProductIdsForSubscriptionOption3(httpClient) {
|
|
732
|
+
return (_id, options) => getProductIdsForSubscriptionOption2(
|
|
733
|
+
_id,
|
|
734
|
+
options,
|
|
735
|
+
// @ts-ignore
|
|
736
|
+
{ httpClient }
|
|
737
|
+
);
|
|
738
|
+
}
|
|
739
|
+
function getOneTimePurchasesStatus3(httpClient) {
|
|
740
|
+
return (productId) => getOneTimePurchasesStatus2(
|
|
741
|
+
productId,
|
|
742
|
+
// @ts-ignore
|
|
743
|
+
{ httpClient }
|
|
744
|
+
);
|
|
745
|
+
}
|
|
746
|
+
function createSubscriptionOption3(httpClient) {
|
|
747
|
+
return (subscriptionOption) => createSubscriptionOption2(
|
|
748
|
+
subscriptionOption,
|
|
749
|
+
// @ts-ignore
|
|
750
|
+
{ httpClient }
|
|
751
|
+
);
|
|
752
|
+
}
|
|
753
|
+
function updateSubscriptionOption3(httpClient) {
|
|
754
|
+
return (_id, subscriptionOption) => updateSubscriptionOption2(
|
|
755
|
+
_id,
|
|
756
|
+
subscriptionOption,
|
|
757
|
+
// @ts-ignore
|
|
758
|
+
{ httpClient }
|
|
759
|
+
);
|
|
760
|
+
}
|
|
761
|
+
function deleteSubscriptionOption3(httpClient) {
|
|
762
|
+
return (_id) => deleteSubscriptionOption2(
|
|
763
|
+
_id,
|
|
764
|
+
// @ts-ignore
|
|
765
|
+
{ httpClient }
|
|
766
|
+
);
|
|
767
|
+
}
|
|
768
|
+
function bulkCreateSubscriptionOptions3(httpClient) {
|
|
769
|
+
return (subscriptionOptions) => bulkCreateSubscriptionOptions2(
|
|
770
|
+
subscriptionOptions,
|
|
771
|
+
// @ts-ignore
|
|
772
|
+
{ httpClient }
|
|
773
|
+
);
|
|
774
|
+
}
|
|
775
|
+
function bulkUpdateSubscriptionOptions3(httpClient) {
|
|
776
|
+
return (subscriptionOptions) => bulkUpdateSubscriptionOptions2(
|
|
777
|
+
subscriptionOptions,
|
|
778
|
+
// @ts-ignore
|
|
779
|
+
{ httpClient }
|
|
780
|
+
);
|
|
781
|
+
}
|
|
782
|
+
function bulkDeleteSubscriptionOptions3(httpClient) {
|
|
783
|
+
return (ids) => bulkDeleteSubscriptionOptions2(
|
|
784
|
+
ids,
|
|
785
|
+
// @ts-ignore
|
|
786
|
+
{ httpClient }
|
|
787
|
+
);
|
|
788
|
+
}
|
|
789
|
+
function assignSubscriptionOptionsToProduct3(httpClient) {
|
|
790
|
+
return (productId, options) => assignSubscriptionOptionsToProduct2(
|
|
791
|
+
productId,
|
|
792
|
+
options,
|
|
793
|
+
// @ts-ignore
|
|
794
|
+
{ httpClient }
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
function allowOneTimePurchases3(httpClient) {
|
|
798
|
+
return (productId, allowed) => allowOneTimePurchases2(
|
|
799
|
+
productId,
|
|
800
|
+
allowed,
|
|
801
|
+
// @ts-ignore
|
|
802
|
+
{ httpClient }
|
|
803
|
+
);
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
// src/stores-v1-subscription-option-subscription-options.context.ts
|
|
807
|
+
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
808
|
+
var getSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getSubscriptionOption3);
|
|
809
|
+
var getSubscriptionOptionsForProduct4 = /* @__PURE__ */ createRESTModule(getSubscriptionOptionsForProduct3);
|
|
810
|
+
var getProductIdsForSubscriptionOption4 = /* @__PURE__ */ createRESTModule(getProductIdsForSubscriptionOption3);
|
|
811
|
+
var getOneTimePurchasesStatus4 = /* @__PURE__ */ createRESTModule(getOneTimePurchasesStatus3);
|
|
812
|
+
var createSubscriptionOption4 = /* @__PURE__ */ createRESTModule(createSubscriptionOption3);
|
|
813
|
+
var updateSubscriptionOption4 = /* @__PURE__ */ createRESTModule(updateSubscriptionOption3);
|
|
814
|
+
var deleteSubscriptionOption4 = /* @__PURE__ */ createRESTModule(deleteSubscriptionOption3);
|
|
815
|
+
var bulkCreateSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkCreateSubscriptionOptions3);
|
|
816
|
+
var bulkUpdateSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkUpdateSubscriptionOptions3);
|
|
817
|
+
var bulkDeleteSubscriptionOptions4 = /* @__PURE__ */ createRESTModule(bulkDeleteSubscriptionOptions3);
|
|
818
|
+
var assignSubscriptionOptionsToProduct4 = /* @__PURE__ */ createRESTModule(assignSubscriptionOptionsToProduct3);
|
|
819
|
+
var allowOneTimePurchases4 = /* @__PURE__ */ createRESTModule(allowOneTimePurchases3);
|
|
820
|
+
export {
|
|
821
|
+
DiscountType,
|
|
822
|
+
SubscriptionFrequency,
|
|
823
|
+
allowOneTimePurchases4 as allowOneTimePurchases,
|
|
824
|
+
assignSubscriptionOptionsToProduct4 as assignSubscriptionOptionsToProduct,
|
|
825
|
+
bulkCreateSubscriptionOptions4 as bulkCreateSubscriptionOptions,
|
|
826
|
+
bulkDeleteSubscriptionOptions4 as bulkDeleteSubscriptionOptions,
|
|
827
|
+
bulkUpdateSubscriptionOptions4 as bulkUpdateSubscriptionOptions,
|
|
828
|
+
createSubscriptionOption4 as createSubscriptionOption,
|
|
829
|
+
deleteSubscriptionOption4 as deleteSubscriptionOption,
|
|
830
|
+
getOneTimePurchasesStatus4 as getOneTimePurchasesStatus,
|
|
831
|
+
getProductIdsForSubscriptionOption4 as getProductIdsForSubscriptionOption,
|
|
832
|
+
getSubscriptionOption4 as getSubscriptionOption,
|
|
833
|
+
getSubscriptionOptionsForProduct4 as getSubscriptionOptionsForProduct,
|
|
834
|
+
updateSubscriptionOption4 as updateSubscriptionOption
|
|
835
|
+
};
|
|
836
|
+
//# sourceMappingURL=index.mjs.map
|