@wix/auto_sdk_packages_packages 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/index.d.ts +273 -1
- package/build/cjs/index.js +953 -15
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/meta.d.ts +542 -1
- package/build/cjs/meta.js +574 -15
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/{src/premium-reseller-v1-packages-packages.types.d.ts → premium-reseller-v1-packages-packages.universal-CeJKqN8_.d.ts} +321 -199
- package/build/{internal/cjs/src/premium-reseller-v1-packages-packages.public.d.ts → es/index.d.mts} +36 -25
- package/build/es/index.mjs +906 -0
- package/build/es/index.mjs.map +1 -0
- package/build/es/meta.d.mts +542 -0
- package/build/es/meta.mjs +541 -0
- package/build/es/meta.mjs.map +1 -0
- package/build/{internal/cjs/src/premium-reseller-v1-packages-packages.types.d.ts → es/premium-reseller-v1-packages-packages.universal-CeJKqN8_.d.mts} +321 -199
- package/build/internal/cjs/index.d.ts +273 -1
- package/build/internal/cjs/index.js +953 -15
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +542 -1
- package/build/internal/cjs/meta.js +574 -15
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/{es/src/premium-reseller-v1-packages-packages.types.d.ts → cjs/premium-reseller-v1-packages-packages.universal-CeJKqN8_.d.ts} +321 -199
- package/build/{es/src/premium-reseller-v1-packages-packages.public.d.ts → internal/es/index.d.mts} +36 -25
- package/build/internal/es/index.mjs +906 -0
- package/build/internal/es/index.mjs.map +1 -0
- package/build/internal/es/meta.d.mts +542 -0
- package/build/internal/es/meta.mjs +541 -0
- package/build/internal/es/meta.mjs.map +1 -0
- package/build/{es/src/premium-reseller-v1-packages-packages.types.d.ts → internal/es/premium-reseller-v1-packages-packages.universal-CeJKqN8_.d.mts} +321 -199
- package/package.json +11 -10
- 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/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
- package/build/cjs/src/premium-reseller-v1-packages-packages.context.js +0 -34
- package/build/cjs/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
- package/build/cjs/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
- package/build/cjs/src/premium-reseller-v1-packages-packages.http.js +0 -563
- package/build/cjs/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
- package/build/cjs/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
- package/build/cjs/src/premium-reseller-v1-packages-packages.meta.js +0 -218
- package/build/cjs/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
- package/build/cjs/src/premium-reseller-v1-packages-packages.public.d.ts +0 -262
- package/build/cjs/src/premium-reseller-v1-packages-packages.public.js +0 -84
- package/build/cjs/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
- package/build/cjs/src/premium-reseller-v1-packages-packages.types.js +0 -155
- package/build/cjs/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
- package/build/cjs/src/premium-reseller-v1-packages-packages.universal.d.ts +0 -1865
- package/build/cjs/src/premium-reseller-v1-packages-packages.universal.js +0 -756
- package/build/cjs/src/premium-reseller-v1-packages-packages.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/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
- package/build/es/src/premium-reseller-v1-packages-packages.context.js +0 -14
- package/build/es/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
- package/build/es/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
- package/build/es/src/premium-reseller-v1-packages-packages.http.js +0 -550
- package/build/es/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
- package/build/es/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
- package/build/es/src/premium-reseller-v1-packages-packages.meta.js +0 -182
- package/build/es/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
- package/build/es/src/premium-reseller-v1-packages-packages.public.js +0 -54
- package/build/es/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
- package/build/es/src/premium-reseller-v1-packages-packages.types.js +0 -152
- package/build/es/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
- package/build/es/src/premium-reseller-v1-packages-packages.universal.d.ts +0 -1865
- package/build/es/src/premium-reseller-v1-packages-packages.universal.js +0 -720
- package/build/es/src/premium-reseller-v1-packages-packages.universal.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/src/premium-reseller-v1-packages-packages.context.d.ts +0 -14
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.context.js +0 -34
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.http.js +0 -563
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.meta.js +0 -218
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.public.js +0 -84
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.types.js +0 -155
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.universal.d.ts +0 -1865
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.universal.js +0 -756
- package/build/internal/cjs/src/premium-reseller-v1-packages-packages.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/premium-reseller-v1-packages-packages.context.d.ts +0 -14
- package/build/internal/es/src/premium-reseller-v1-packages-packages.context.js +0 -14
- package/build/internal/es/src/premium-reseller-v1-packages-packages.context.js.map +0 -1
- package/build/internal/es/src/premium-reseller-v1-packages-packages.http.d.ts +0 -219
- package/build/internal/es/src/premium-reseller-v1-packages-packages.http.js +0 -550
- package/build/internal/es/src/premium-reseller-v1-packages-packages.http.js.map +0 -1
- package/build/internal/es/src/premium-reseller-v1-packages-packages.meta.d.ts +0 -38
- package/build/internal/es/src/premium-reseller-v1-packages-packages.meta.js +0 -182
- package/build/internal/es/src/premium-reseller-v1-packages-packages.meta.js.map +0 -1
- package/build/internal/es/src/premium-reseller-v1-packages-packages.public.d.ts +0 -262
- package/build/internal/es/src/premium-reseller-v1-packages-packages.public.js +0 -54
- package/build/internal/es/src/premium-reseller-v1-packages-packages.public.js.map +0 -1
- package/build/internal/es/src/premium-reseller-v1-packages-packages.types.js +0 -152
- package/build/internal/es/src/premium-reseller-v1-packages-packages.types.js.map +0 -1
- package/build/internal/es/src/premium-reseller-v1-packages-packages.universal.d.ts +0 -1865
- package/build/internal/es/src/premium-reseller-v1-packages-packages.universal.js +0 -720
- package/build/internal/es/src/premium-reseller-v1-packages-packages.universal.js.map +0 -1
|
@@ -0,0 +1,906 @@
|
|
|
1
|
+
// src/premium-reseller-v1-packages-packages.universal.ts
|
|
2
|
+
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
+
import { queryBuilder } from "@wix/sdk-runtime/query-builder";
|
|
4
|
+
import {
|
|
5
|
+
renameKeysFromSDKRequestToRESTRequest,
|
|
6
|
+
renameKeysFromRESTResponseToSDKResponse
|
|
7
|
+
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
8
|
+
|
|
9
|
+
// src/premium-reseller-v1-packages-packages.http.ts
|
|
10
|
+
import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
|
|
11
|
+
import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
12
|
+
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
13
|
+
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
14
|
+
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
15
|
+
function resolveComWixpressPremiumResellerPackagesV1PackagesUrl(opts) {
|
|
16
|
+
const domainToMappings = {
|
|
17
|
+
"www.wixapis.com": [
|
|
18
|
+
{
|
|
19
|
+
srcPath: "/resellers/v1/packages",
|
|
20
|
+
destPath: "/v1/packages"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
srcPath: "/resellers/v2/packages",
|
|
24
|
+
destPath: "/v2/packages"
|
|
25
|
+
}
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
29
|
+
}
|
|
30
|
+
var PACKAGE_NAME = "@wix/auto_sdk_packages_packages";
|
|
31
|
+
function createPackage(payload) {
|
|
32
|
+
function __createPackage({ host }) {
|
|
33
|
+
const serializedData = transformPaths(payload, [
|
|
34
|
+
{
|
|
35
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
36
|
+
paths: [
|
|
37
|
+
{ path: "products.createdDate" },
|
|
38
|
+
{ path: "products.updatedDate" },
|
|
39
|
+
{ path: "products.expirationDate" }
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
]);
|
|
43
|
+
const metadata = {
|
|
44
|
+
entityFqdn: "wix.premium.reseller.v1.packages",
|
|
45
|
+
method: "POST",
|
|
46
|
+
methodFqn: "com.wixpress.premium.reseller.packages.v1.Packages.CreatePackage",
|
|
47
|
+
packageName: PACKAGE_NAME,
|
|
48
|
+
url: resolveComWixpressPremiumResellerPackagesV1PackagesUrl({
|
|
49
|
+
protoPath: "/v1/packages",
|
|
50
|
+
data: serializedData,
|
|
51
|
+
host
|
|
52
|
+
}),
|
|
53
|
+
data: serializedData,
|
|
54
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
55
|
+
{
|
|
56
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
57
|
+
paths: [
|
|
58
|
+
{ path: "package.createdDate" },
|
|
59
|
+
{ path: "package.updatedDate" },
|
|
60
|
+
{ path: "package.productInstances.createdDate" },
|
|
61
|
+
{ path: "package.productInstances.updatedDate" },
|
|
62
|
+
{ path: "package.productInstances.expirationDate" }
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
])
|
|
66
|
+
};
|
|
67
|
+
return metadata;
|
|
68
|
+
}
|
|
69
|
+
return __createPackage;
|
|
70
|
+
}
|
|
71
|
+
function createPackageV2(payload) {
|
|
72
|
+
function __createPackageV2({ host }) {
|
|
73
|
+
const serializedData = transformPaths(payload, [
|
|
74
|
+
{
|
|
75
|
+
transformFn: transformSDKTimestampToRESTTimestamp,
|
|
76
|
+
paths: [
|
|
77
|
+
{ path: "products.createdDate" },
|
|
78
|
+
{ path: "products.updatedDate" },
|
|
79
|
+
{ path: "products.expirationDate" }
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
]);
|
|
83
|
+
const metadata = {
|
|
84
|
+
entityFqdn: "wix.premium.reseller.v1.packages",
|
|
85
|
+
method: "POST",
|
|
86
|
+
methodFqn: "com.wixpress.premium.reseller.packages.v1.Packages.CreatePackageV2",
|
|
87
|
+
packageName: PACKAGE_NAME,
|
|
88
|
+
url: resolveComWixpressPremiumResellerPackagesV1PackagesUrl({
|
|
89
|
+
protoPath: "/v2/packages",
|
|
90
|
+
data: serializedData,
|
|
91
|
+
host
|
|
92
|
+
}),
|
|
93
|
+
data: serializedData,
|
|
94
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
95
|
+
{
|
|
96
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
97
|
+
paths: [
|
|
98
|
+
{ path: "package.createdDate" },
|
|
99
|
+
{ path: "package.updatedDate" },
|
|
100
|
+
{ path: "package.productInstances.createdDate" },
|
|
101
|
+
{ path: "package.productInstances.updatedDate" },
|
|
102
|
+
{ path: "package.productInstances.expirationDate" }
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
])
|
|
106
|
+
};
|
|
107
|
+
return metadata;
|
|
108
|
+
}
|
|
109
|
+
return __createPackageV2;
|
|
110
|
+
}
|
|
111
|
+
function cancelPackage(payload) {
|
|
112
|
+
function __cancelPackage({ host }) {
|
|
113
|
+
const metadata = {
|
|
114
|
+
entityFqdn: "wix.premium.reseller.v1.packages",
|
|
115
|
+
method: "DELETE",
|
|
116
|
+
methodFqn: "com.wixpress.premium.reseller.packages.v1.Packages.CancelPackage",
|
|
117
|
+
packageName: PACKAGE_NAME,
|
|
118
|
+
url: resolveComWixpressPremiumResellerPackagesV1PackagesUrl({
|
|
119
|
+
protoPath: "/v1/packages/{id}",
|
|
120
|
+
data: payload,
|
|
121
|
+
host
|
|
122
|
+
}),
|
|
123
|
+
params: toURLSearchParams(payload),
|
|
124
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
125
|
+
{
|
|
126
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
127
|
+
paths: [
|
|
128
|
+
{ path: "package.createdDate" },
|
|
129
|
+
{ path: "package.updatedDate" },
|
|
130
|
+
{ path: "package.productInstances.createdDate" },
|
|
131
|
+
{ path: "package.productInstances.updatedDate" },
|
|
132
|
+
{ path: "package.productInstances.expirationDate" }
|
|
133
|
+
]
|
|
134
|
+
}
|
|
135
|
+
])
|
|
136
|
+
};
|
|
137
|
+
return metadata;
|
|
138
|
+
}
|
|
139
|
+
return __cancelPackage;
|
|
140
|
+
}
|
|
141
|
+
function getPackage(payload) {
|
|
142
|
+
function __getPackage({ host }) {
|
|
143
|
+
const metadata = {
|
|
144
|
+
entityFqdn: "wix.premium.reseller.v1.packages",
|
|
145
|
+
method: "GET",
|
|
146
|
+
methodFqn: "com.wixpress.premium.reseller.packages.v1.Packages.GetPackage",
|
|
147
|
+
packageName: PACKAGE_NAME,
|
|
148
|
+
url: resolveComWixpressPremiumResellerPackagesV1PackagesUrl({
|
|
149
|
+
protoPath: "/v1/packages/{id}",
|
|
150
|
+
data: payload,
|
|
151
|
+
host
|
|
152
|
+
}),
|
|
153
|
+
params: toURLSearchParams(payload),
|
|
154
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
155
|
+
{
|
|
156
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
157
|
+
paths: [
|
|
158
|
+
{ path: "package.createdDate" },
|
|
159
|
+
{ path: "package.updatedDate" },
|
|
160
|
+
{ path: "package.productInstances.createdDate" },
|
|
161
|
+
{ path: "package.productInstances.updatedDate" },
|
|
162
|
+
{ path: "package.productInstances.expirationDate" }
|
|
163
|
+
]
|
|
164
|
+
}
|
|
165
|
+
])
|
|
166
|
+
};
|
|
167
|
+
return metadata;
|
|
168
|
+
}
|
|
169
|
+
return __getPackage;
|
|
170
|
+
}
|
|
171
|
+
function queryPackages(payload) {
|
|
172
|
+
function __queryPackages({ host }) {
|
|
173
|
+
const metadata = {
|
|
174
|
+
entityFqdn: "wix.premium.reseller.v1.packages",
|
|
175
|
+
method: "POST",
|
|
176
|
+
methodFqn: "com.wixpress.premium.reseller.packages.v1.Packages.QueryPackages",
|
|
177
|
+
packageName: PACKAGE_NAME,
|
|
178
|
+
url: resolveComWixpressPremiumResellerPackagesV1PackagesUrl({
|
|
179
|
+
protoPath: "/v1/packages/query",
|
|
180
|
+
data: payload,
|
|
181
|
+
host
|
|
182
|
+
}),
|
|
183
|
+
data: payload,
|
|
184
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
185
|
+
{
|
|
186
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
187
|
+
paths: [
|
|
188
|
+
{ path: "packages.createdDate" },
|
|
189
|
+
{ path: "packages.updatedDate" },
|
|
190
|
+
{ path: "packages.productInstances.createdDate" },
|
|
191
|
+
{ path: "packages.productInstances.updatedDate" },
|
|
192
|
+
{ path: "packages.productInstances.expirationDate" }
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
])
|
|
196
|
+
};
|
|
197
|
+
return metadata;
|
|
198
|
+
}
|
|
199
|
+
return __queryPackages;
|
|
200
|
+
}
|
|
201
|
+
function assignProductInstanceToSite(payload) {
|
|
202
|
+
function __assignProductInstanceToSite({ host }) {
|
|
203
|
+
const metadata = {
|
|
204
|
+
entityFqdn: "wix.premium.reseller.v1.packages",
|
|
205
|
+
method: "PATCH",
|
|
206
|
+
methodFqn: "com.wixpress.premium.reseller.packages.v1.Packages.AssignProductInstanceToSite",
|
|
207
|
+
packageName: PACKAGE_NAME,
|
|
208
|
+
url: resolveComWixpressPremiumResellerPackagesV1PackagesUrl({
|
|
209
|
+
protoPath: "/v1/packages/product-instances/{instanceId}/{siteId}",
|
|
210
|
+
data: payload,
|
|
211
|
+
host
|
|
212
|
+
}),
|
|
213
|
+
data: payload,
|
|
214
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
215
|
+
{
|
|
216
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
217
|
+
paths: [
|
|
218
|
+
{ path: "package.createdDate" },
|
|
219
|
+
{ path: "package.updatedDate" },
|
|
220
|
+
{ path: "package.productInstances.createdDate" },
|
|
221
|
+
{ path: "package.productInstances.updatedDate" },
|
|
222
|
+
{ path: "package.productInstances.expirationDate" }
|
|
223
|
+
]
|
|
224
|
+
}
|
|
225
|
+
])
|
|
226
|
+
};
|
|
227
|
+
return metadata;
|
|
228
|
+
}
|
|
229
|
+
return __assignProductInstanceToSite;
|
|
230
|
+
}
|
|
231
|
+
function unassignProductInstanceFromSite(payload) {
|
|
232
|
+
function __unassignProductInstanceFromSite({ host }) {
|
|
233
|
+
const metadata = {
|
|
234
|
+
entityFqdn: "wix.premium.reseller.v1.packages",
|
|
235
|
+
method: "PATCH",
|
|
236
|
+
methodFqn: "com.wixpress.premium.reseller.packages.v1.Packages.UnassignProductInstanceFromSite",
|
|
237
|
+
packageName: PACKAGE_NAME,
|
|
238
|
+
url: resolveComWixpressPremiumResellerPackagesV1PackagesUrl({
|
|
239
|
+
protoPath: "/v1/packages/product-instances/{instanceId}/unassign",
|
|
240
|
+
data: payload,
|
|
241
|
+
host
|
|
242
|
+
}),
|
|
243
|
+
data: payload,
|
|
244
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
245
|
+
{
|
|
246
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
247
|
+
paths: [
|
|
248
|
+
{ path: "package.createdDate" },
|
|
249
|
+
{ path: "package.updatedDate" },
|
|
250
|
+
{ path: "package.productInstances.createdDate" },
|
|
251
|
+
{ path: "package.productInstances.updatedDate" },
|
|
252
|
+
{ path: "package.productInstances.expirationDate" }
|
|
253
|
+
]
|
|
254
|
+
}
|
|
255
|
+
])
|
|
256
|
+
};
|
|
257
|
+
return metadata;
|
|
258
|
+
}
|
|
259
|
+
return __unassignProductInstanceFromSite;
|
|
260
|
+
}
|
|
261
|
+
function cancelProductInstance(payload) {
|
|
262
|
+
function __cancelProductInstance({ host }) {
|
|
263
|
+
const metadata = {
|
|
264
|
+
entityFqdn: "wix.premium.reseller.v1.packages",
|
|
265
|
+
method: "DELETE",
|
|
266
|
+
methodFqn: "com.wixpress.premium.reseller.packages.v1.Packages.CancelProductInstance",
|
|
267
|
+
packageName: PACKAGE_NAME,
|
|
268
|
+
url: resolveComWixpressPremiumResellerPackagesV1PackagesUrl({
|
|
269
|
+
protoPath: "/v1/packages/product-instances/{instanceId}",
|
|
270
|
+
data: payload,
|
|
271
|
+
host
|
|
272
|
+
}),
|
|
273
|
+
params: toURLSearchParams(payload),
|
|
274
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
275
|
+
{
|
|
276
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
277
|
+
paths: [
|
|
278
|
+
{ path: "package.createdDate" },
|
|
279
|
+
{ path: "package.updatedDate" },
|
|
280
|
+
{ path: "package.productInstances.createdDate" },
|
|
281
|
+
{ path: "package.productInstances.updatedDate" },
|
|
282
|
+
{ path: "package.productInstances.expirationDate" }
|
|
283
|
+
]
|
|
284
|
+
}
|
|
285
|
+
])
|
|
286
|
+
};
|
|
287
|
+
return metadata;
|
|
288
|
+
}
|
|
289
|
+
return __cancelProductInstance;
|
|
290
|
+
}
|
|
291
|
+
function adjustProductInstanceSpecifications(payload) {
|
|
292
|
+
function __adjustProductInstanceSpecifications({ host }) {
|
|
293
|
+
const metadata = {
|
|
294
|
+
entityFqdn: "wix.premium.reseller.v1.packages",
|
|
295
|
+
method: "PATCH",
|
|
296
|
+
methodFqn: "com.wixpress.premium.reseller.packages.v1.Packages.AdjustProductInstanceSpecifications",
|
|
297
|
+
packageName: PACKAGE_NAME,
|
|
298
|
+
url: resolveComWixpressPremiumResellerPackagesV1PackagesUrl({
|
|
299
|
+
protoPath: "/v1/packages/product-instances/{instanceId}",
|
|
300
|
+
data: payload,
|
|
301
|
+
host
|
|
302
|
+
}),
|
|
303
|
+
data: payload,
|
|
304
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
305
|
+
{
|
|
306
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
307
|
+
paths: [
|
|
308
|
+
{ path: "package.createdDate" },
|
|
309
|
+
{ path: "package.updatedDate" },
|
|
310
|
+
{ path: "package.productInstances.createdDate" },
|
|
311
|
+
{ path: "package.productInstances.updatedDate" },
|
|
312
|
+
{ path: "package.productInstances.expirationDate" }
|
|
313
|
+
]
|
|
314
|
+
}
|
|
315
|
+
])
|
|
316
|
+
};
|
|
317
|
+
return metadata;
|
|
318
|
+
}
|
|
319
|
+
return __adjustProductInstanceSpecifications;
|
|
320
|
+
}
|
|
321
|
+
function updatePackageExternalId(payload) {
|
|
322
|
+
function __updatePackageExternalId({ host }) {
|
|
323
|
+
const metadata = {
|
|
324
|
+
entityFqdn: "wix.premium.reseller.v1.packages",
|
|
325
|
+
method: "PATCH",
|
|
326
|
+
methodFqn: "com.wixpress.premium.reseller.packages.v1.Packages.UpdatePackageExternalId",
|
|
327
|
+
packageName: PACKAGE_NAME,
|
|
328
|
+
url: resolveComWixpressPremiumResellerPackagesV1PackagesUrl({
|
|
329
|
+
protoPath: "/v1/packages/update/{packageId}/{externalId}",
|
|
330
|
+
data: payload,
|
|
331
|
+
host
|
|
332
|
+
}),
|
|
333
|
+
data: payload,
|
|
334
|
+
transformResponse: (payload2) => transformPaths(payload2, [
|
|
335
|
+
{
|
|
336
|
+
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
337
|
+
paths: [
|
|
338
|
+
{ path: "updatedPackage.createdDate" },
|
|
339
|
+
{ path: "updatedPackage.updatedDate" },
|
|
340
|
+
{ path: "updatedPackage.productInstances.createdDate" },
|
|
341
|
+
{ path: "updatedPackage.productInstances.updatedDate" },
|
|
342
|
+
{ path: "updatedPackage.productInstances.expirationDate" }
|
|
343
|
+
]
|
|
344
|
+
}
|
|
345
|
+
])
|
|
346
|
+
};
|
|
347
|
+
return metadata;
|
|
348
|
+
}
|
|
349
|
+
return __updatePackageExternalId;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// src/premium-reseller-v1-packages-packages.universal.ts
|
|
353
|
+
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
354
|
+
var FailureReasonFailureReason = /* @__PURE__ */ ((FailureReasonFailureReason2) => {
|
|
355
|
+
FailureReasonFailureReason2["UNKNOWN"] = "UNKNOWN";
|
|
356
|
+
FailureReasonFailureReason2["DELIVERY_TIMEOUT"] = "DELIVERY_TIMEOUT";
|
|
357
|
+
FailureReasonFailureReason2["EXTERNAL_FAILURE"] = "EXTERNAL_FAILURE";
|
|
358
|
+
return FailureReasonFailureReason2;
|
|
359
|
+
})(FailureReasonFailureReason || {});
|
|
360
|
+
var IntervalIntervalUnit = /* @__PURE__ */ ((IntervalIntervalUnit2) => {
|
|
361
|
+
IntervalIntervalUnit2["UNKNOWN"] = "UNKNOWN";
|
|
362
|
+
IntervalIntervalUnit2["DAY"] = "DAY";
|
|
363
|
+
IntervalIntervalUnit2["WEEK"] = "WEEK";
|
|
364
|
+
IntervalIntervalUnit2["MONTH"] = "MONTH";
|
|
365
|
+
IntervalIntervalUnit2["YEAR"] = "YEAR";
|
|
366
|
+
return IntervalIntervalUnit2;
|
|
367
|
+
})(IntervalIntervalUnit || {});
|
|
368
|
+
var CycleDescriptorType = /* @__PURE__ */ ((CycleDescriptorType2) => {
|
|
369
|
+
CycleDescriptorType2["UNKNOWN"] = "UNKNOWN";
|
|
370
|
+
CycleDescriptorType2["ONE_TIME"] = "ONE_TIME";
|
|
371
|
+
CycleDescriptorType2["RECURRING"] = "RECURRING";
|
|
372
|
+
return CycleDescriptorType2;
|
|
373
|
+
})(CycleDescriptorType || {});
|
|
374
|
+
var Status = /* @__PURE__ */ ((Status2) => {
|
|
375
|
+
Status2["PENDING"] = "PENDING";
|
|
376
|
+
Status2["ENABLED"] = "ENABLED";
|
|
377
|
+
Status2["CANCELED"] = "CANCELED";
|
|
378
|
+
Status2["FAILED"] = "FAILED";
|
|
379
|
+
Status2["AWAITING_ACTION"] = "AWAITING_ACTION";
|
|
380
|
+
return Status2;
|
|
381
|
+
})(Status || {});
|
|
382
|
+
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
383
|
+
SortOrder2["ASC"] = "ASC";
|
|
384
|
+
SortOrder2["DESC"] = "DESC";
|
|
385
|
+
return SortOrder2;
|
|
386
|
+
})(SortOrder || {});
|
|
387
|
+
var ProviderName = /* @__PURE__ */ ((ProviderName2) => {
|
|
388
|
+
ProviderName2["UNKNOWN"] = "UNKNOWN";
|
|
389
|
+
ProviderName2["SBS"] = "SBS";
|
|
390
|
+
ProviderName2["LICENSER"] = "LICENSER";
|
|
391
|
+
ProviderName2["BASS"] = "BASS";
|
|
392
|
+
ProviderName2["RESELLER"] = "RESELLER";
|
|
393
|
+
ProviderName2["RECURRING_INVOICES"] = "RECURRING_INVOICES";
|
|
394
|
+
return ProviderName2;
|
|
395
|
+
})(ProviderName || {});
|
|
396
|
+
var IntervalUnit = /* @__PURE__ */ ((IntervalUnit2) => {
|
|
397
|
+
IntervalUnit2["UNKNOWN"] = "UNKNOWN";
|
|
398
|
+
IntervalUnit2["DAY"] = "DAY";
|
|
399
|
+
IntervalUnit2["WEEK"] = "WEEK";
|
|
400
|
+
IntervalUnit2["MONTH"] = "MONTH";
|
|
401
|
+
IntervalUnit2["YEAR"] = "YEAR";
|
|
402
|
+
return IntervalUnit2;
|
|
403
|
+
})(IntervalUnit || {});
|
|
404
|
+
var SubscriptionStatus = /* @__PURE__ */ ((SubscriptionStatus2) => {
|
|
405
|
+
SubscriptionStatus2["UNKNOWN"] = "UNKNOWN";
|
|
406
|
+
SubscriptionStatus2["AUTO_RENEW_ON"] = "AUTO_RENEW_ON";
|
|
407
|
+
SubscriptionStatus2["AUTO_RENEW_OFF"] = "AUTO_RENEW_OFF";
|
|
408
|
+
SubscriptionStatus2["MANUAL_RECURRING"] = "MANUAL_RECURRING";
|
|
409
|
+
SubscriptionStatus2["CANCELLED"] = "CANCELLED";
|
|
410
|
+
SubscriptionStatus2["TRANSFERRED"] = "TRANSFERRED";
|
|
411
|
+
return SubscriptionStatus2;
|
|
412
|
+
})(SubscriptionStatus || {});
|
|
413
|
+
var ReactivationReasonEnum = /* @__PURE__ */ ((ReactivationReasonEnum2) => {
|
|
414
|
+
ReactivationReasonEnum2["UNKNOWN"] = "UNKNOWN";
|
|
415
|
+
ReactivationReasonEnum2["BILLING_STATUS_CHANGE"] = "BILLING_STATUS_CHANGE";
|
|
416
|
+
ReactivationReasonEnum2["REACTIVATED_AFTER_CHARGEBACK"] = "REACTIVATED_AFTER_CHARGEBACK";
|
|
417
|
+
return ReactivationReasonEnum2;
|
|
418
|
+
})(ReactivationReasonEnum || {});
|
|
419
|
+
var Initiator = /* @__PURE__ */ ((Initiator2) => {
|
|
420
|
+
Initiator2["UNKNOWN"] = "UNKNOWN";
|
|
421
|
+
Initiator2["USER_REQUESTED"] = "USER_REQUESTED";
|
|
422
|
+
Initiator2["APP_MANAGED"] = "APP_MANAGED";
|
|
423
|
+
Initiator2["PASSIVE"] = "PASSIVE";
|
|
424
|
+
return Initiator2;
|
|
425
|
+
})(Initiator || {});
|
|
426
|
+
var UnassignReason = /* @__PURE__ */ ((UnassignReason2) => {
|
|
427
|
+
UnassignReason2["UNKNOWN"] = "UNKNOWN";
|
|
428
|
+
UnassignReason2["USER_REQUESTED"] = "USER_REQUESTED";
|
|
429
|
+
UnassignReason2["REPLACED_BY_ANOTHER_SUBSCRIPTION"] = "REPLACED_BY_ANOTHER_SUBSCRIPTION";
|
|
430
|
+
return UnassignReason2;
|
|
431
|
+
})(UnassignReason || {});
|
|
432
|
+
var ContractSwitchType = /* @__PURE__ */ ((ContractSwitchType2) => {
|
|
433
|
+
ContractSwitchType2["NOT_APPLICABLE"] = "NOT_APPLICABLE";
|
|
434
|
+
ContractSwitchType2["ADDITIONAL_QUANTITY"] = "ADDITIONAL_QUANTITY";
|
|
435
|
+
ContractSwitchType2["CREDIT_UNUSED_PERIOD"] = "CREDIT_UNUSED_PERIOD";
|
|
436
|
+
ContractSwitchType2["REFUND_PRICE_DIFF"] = "REFUND_PRICE_DIFF";
|
|
437
|
+
ContractSwitchType2["ADJUST_PERIOD_END"] = "ADJUST_PERIOD_END";
|
|
438
|
+
ContractSwitchType2["DOWNGRADE_GRACE_PERIOD"] = "DOWNGRADE_GRACE_PERIOD";
|
|
439
|
+
ContractSwitchType2["FULL_AMOUNT_PERIOD"] = "FULL_AMOUNT_PERIOD";
|
|
440
|
+
ContractSwitchType2["END_OF_PERIOD"] = "END_OF_PERIOD";
|
|
441
|
+
ContractSwitchType2["PENDING_CHANGES"] = "PENDING_CHANGES";
|
|
442
|
+
ContractSwitchType2["DOWNGRADE_RENEWAL"] = "DOWNGRADE_RENEWAL";
|
|
443
|
+
return ContractSwitchType2;
|
|
444
|
+
})(ContractSwitchType || {});
|
|
445
|
+
var ContractSwitchReason = /* @__PURE__ */ ((ContractSwitchReason2) => {
|
|
446
|
+
ContractSwitchReason2["EXTERNAL_PROVIDER_TRIGGER"] = "EXTERNAL_PROVIDER_TRIGGER";
|
|
447
|
+
ContractSwitchReason2["PRICE_INCREASE"] = "PRICE_INCREASE";
|
|
448
|
+
return ContractSwitchReason2;
|
|
449
|
+
})(ContractSwitchReason || {});
|
|
450
|
+
var PriceIncreaseTrigger = /* @__PURE__ */ ((PriceIncreaseTrigger2) => {
|
|
451
|
+
PriceIncreaseTrigger2["NEAR_RENEWAL"] = "NEAR_RENEWAL";
|
|
452
|
+
PriceIncreaseTrigger2["RECURRING_SUCCESS"] = "RECURRING_SUCCESS";
|
|
453
|
+
PriceIncreaseTrigger2["MANUAL"] = "MANUAL";
|
|
454
|
+
return PriceIncreaseTrigger2;
|
|
455
|
+
})(PriceIncreaseTrigger || {});
|
|
456
|
+
var ProductAdjustment = /* @__PURE__ */ ((ProductAdjustment2) => {
|
|
457
|
+
ProductAdjustment2["NOT_APPLICABLE"] = "NOT_APPLICABLE";
|
|
458
|
+
ProductAdjustment2["DOWNGRADE"] = "DOWNGRADE";
|
|
459
|
+
return ProductAdjustment2;
|
|
460
|
+
})(ProductAdjustment || {});
|
|
461
|
+
var FieldToUpdate = /* @__PURE__ */ ((FieldToUpdate2) => {
|
|
462
|
+
FieldToUpdate2["STATUS"] = "STATUS";
|
|
463
|
+
FieldToUpdate2["COUNTRY_CODE"] = "COUNTRY_CODE";
|
|
464
|
+
return FieldToUpdate2;
|
|
465
|
+
})(FieldToUpdate || {});
|
|
466
|
+
var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
467
|
+
WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
|
|
468
|
+
WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
|
|
469
|
+
WebhookIdentityType2["MEMBER"] = "MEMBER";
|
|
470
|
+
WebhookIdentityType2["WIX_USER"] = "WIX_USER";
|
|
471
|
+
WebhookIdentityType2["APP"] = "APP";
|
|
472
|
+
return WebhookIdentityType2;
|
|
473
|
+
})(WebhookIdentityType || {});
|
|
474
|
+
async function createPackage2(options) {
|
|
475
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
476
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
477
|
+
idempotencyKey: options?.idempotencyKey,
|
|
478
|
+
externalId: options?.externalId,
|
|
479
|
+
products: options?.products
|
|
480
|
+
});
|
|
481
|
+
const reqOpts = createPackage(payload);
|
|
482
|
+
sideEffects?.onSiteCall?.();
|
|
483
|
+
try {
|
|
484
|
+
const result = await httpClient.request(reqOpts);
|
|
485
|
+
sideEffects?.onSuccess?.(result);
|
|
486
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
487
|
+
} catch (err) {
|
|
488
|
+
const transformedError = sdkTransformError(
|
|
489
|
+
err,
|
|
490
|
+
{
|
|
491
|
+
spreadPathsToArguments: {},
|
|
492
|
+
explicitPathsToArguments: {
|
|
493
|
+
idempotencyKey: "$[0].idempotencyKey",
|
|
494
|
+
externalId: "$[0].externalId",
|
|
495
|
+
products: "$[0].products"
|
|
496
|
+
},
|
|
497
|
+
singleArgumentUnchanged: false
|
|
498
|
+
},
|
|
499
|
+
["options"]
|
|
500
|
+
);
|
|
501
|
+
sideEffects?.onError?.(err);
|
|
502
|
+
throw transformedError;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
async function createPackageV22(options) {
|
|
506
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
507
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
508
|
+
idempotencyKey: options?.idempotencyKey,
|
|
509
|
+
externalId: options?.externalId,
|
|
510
|
+
products: options?.products
|
|
511
|
+
});
|
|
512
|
+
const reqOpts = createPackageV2(payload);
|
|
513
|
+
sideEffects?.onSiteCall?.();
|
|
514
|
+
try {
|
|
515
|
+
const result = await httpClient.request(reqOpts);
|
|
516
|
+
sideEffects?.onSuccess?.(result);
|
|
517
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
518
|
+
} catch (err) {
|
|
519
|
+
const transformedError = sdkTransformError(
|
|
520
|
+
err,
|
|
521
|
+
{
|
|
522
|
+
spreadPathsToArguments: {},
|
|
523
|
+
explicitPathsToArguments: {
|
|
524
|
+
idempotencyKey: "$[0].idempotencyKey",
|
|
525
|
+
externalId: "$[0].externalId",
|
|
526
|
+
products: "$[0].products"
|
|
527
|
+
},
|
|
528
|
+
singleArgumentUnchanged: false
|
|
529
|
+
},
|
|
530
|
+
["options"]
|
|
531
|
+
);
|
|
532
|
+
sideEffects?.onError?.(err);
|
|
533
|
+
throw transformedError;
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
async function cancelPackage2(_id, options) {
|
|
537
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
538
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
539
|
+
id: _id,
|
|
540
|
+
idempotencyKey: options?.idempotencyKey
|
|
541
|
+
});
|
|
542
|
+
const reqOpts = cancelPackage(payload);
|
|
543
|
+
sideEffects?.onSiteCall?.();
|
|
544
|
+
try {
|
|
545
|
+
const result = await httpClient.request(reqOpts);
|
|
546
|
+
sideEffects?.onSuccess?.(result);
|
|
547
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
548
|
+
} catch (err) {
|
|
549
|
+
const transformedError = sdkTransformError(
|
|
550
|
+
err,
|
|
551
|
+
{
|
|
552
|
+
spreadPathsToArguments: {},
|
|
553
|
+
explicitPathsToArguments: {
|
|
554
|
+
id: "$[0]",
|
|
555
|
+
idempotencyKey: "$[1].idempotencyKey"
|
|
556
|
+
},
|
|
557
|
+
singleArgumentUnchanged: false
|
|
558
|
+
},
|
|
559
|
+
["_id", "options"]
|
|
560
|
+
);
|
|
561
|
+
sideEffects?.onError?.(err);
|
|
562
|
+
throw transformedError;
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
async function getPackage2(_id) {
|
|
566
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
567
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({ id: _id });
|
|
568
|
+
const reqOpts = getPackage(payload);
|
|
569
|
+
sideEffects?.onSiteCall?.();
|
|
570
|
+
try {
|
|
571
|
+
const result = await httpClient.request(reqOpts);
|
|
572
|
+
sideEffects?.onSuccess?.(result);
|
|
573
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data)?.package;
|
|
574
|
+
} catch (err) {
|
|
575
|
+
const transformedError = sdkTransformError(
|
|
576
|
+
err,
|
|
577
|
+
{
|
|
578
|
+
spreadPathsToArguments: {},
|
|
579
|
+
explicitPathsToArguments: { id: "$[0]" },
|
|
580
|
+
singleArgumentUnchanged: false
|
|
581
|
+
},
|
|
582
|
+
["_id"]
|
|
583
|
+
);
|
|
584
|
+
sideEffects?.onError?.(err);
|
|
585
|
+
throw transformedError;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
function queryPackages2() {
|
|
589
|
+
const { httpClient, sideEffects } = arguments[0];
|
|
590
|
+
return queryBuilder({
|
|
591
|
+
func: async (payload) => {
|
|
592
|
+
const reqOpts = queryPackages(payload);
|
|
593
|
+
sideEffects?.onSiteCall?.();
|
|
594
|
+
try {
|
|
595
|
+
const result = await httpClient.request(reqOpts);
|
|
596
|
+
sideEffects?.onSuccess?.(result);
|
|
597
|
+
return result;
|
|
598
|
+
} catch (err) {
|
|
599
|
+
sideEffects?.onError?.(err);
|
|
600
|
+
throw err;
|
|
601
|
+
}
|
|
602
|
+
},
|
|
603
|
+
requestTransformer: (query) => {
|
|
604
|
+
const args = [query, {}];
|
|
605
|
+
return renameKeysFromSDKRequestToRESTRequest({
|
|
606
|
+
...args?.[1],
|
|
607
|
+
query: args?.[0]
|
|
608
|
+
});
|
|
609
|
+
},
|
|
610
|
+
responseTransformer: ({ data }) => {
|
|
611
|
+
const transformedData = renameKeysFromRESTResponseToSDKResponse(
|
|
612
|
+
transformPaths2(data, [])
|
|
613
|
+
);
|
|
614
|
+
return {
|
|
615
|
+
items: transformedData?.packages,
|
|
616
|
+
pagingMetadata: transformedData?.metadata
|
|
617
|
+
};
|
|
618
|
+
},
|
|
619
|
+
errorTransformer: (err) => {
|
|
620
|
+
const transformedError = sdkTransformError(err, {
|
|
621
|
+
spreadPathsToArguments: {},
|
|
622
|
+
explicitPathsToArguments: { query: "$[0]" },
|
|
623
|
+
singleArgumentUnchanged: false
|
|
624
|
+
});
|
|
625
|
+
throw transformedError;
|
|
626
|
+
},
|
|
627
|
+
pagingMethod: "CURSOR",
|
|
628
|
+
transformationPaths: {}
|
|
629
|
+
});
|
|
630
|
+
}
|
|
631
|
+
async function assignProductInstanceToSite2(identifiers, options) {
|
|
632
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
633
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
634
|
+
instanceId: identifiers?.instanceId,
|
|
635
|
+
siteId: identifiers?.siteId,
|
|
636
|
+
idempotencyKey: options?.idempotencyKey
|
|
637
|
+
});
|
|
638
|
+
const reqOpts = assignProductInstanceToSite(payload);
|
|
639
|
+
sideEffects?.onSiteCall?.();
|
|
640
|
+
try {
|
|
641
|
+
const result = await httpClient.request(reqOpts);
|
|
642
|
+
sideEffects?.onSuccess?.(result);
|
|
643
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
644
|
+
} catch (err) {
|
|
645
|
+
const transformedError = sdkTransformError(
|
|
646
|
+
err,
|
|
647
|
+
{
|
|
648
|
+
spreadPathsToArguments: {},
|
|
649
|
+
explicitPathsToArguments: {
|
|
650
|
+
instanceId: "$[0].instanceId",
|
|
651
|
+
siteId: "$[0].siteId",
|
|
652
|
+
idempotencyKey: "$[1].idempotencyKey"
|
|
653
|
+
},
|
|
654
|
+
singleArgumentUnchanged: false
|
|
655
|
+
},
|
|
656
|
+
["identifiers", "options"]
|
|
657
|
+
);
|
|
658
|
+
sideEffects?.onError?.(err);
|
|
659
|
+
throw transformedError;
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
async function unassignProductInstanceFromSite2(instanceId, options) {
|
|
663
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
664
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
665
|
+
instanceId,
|
|
666
|
+
idempotencyKey: options?.idempotencyKey
|
|
667
|
+
});
|
|
668
|
+
const reqOpts = unassignProductInstanceFromSite(
|
|
669
|
+
payload
|
|
670
|
+
);
|
|
671
|
+
sideEffects?.onSiteCall?.();
|
|
672
|
+
try {
|
|
673
|
+
const result = await httpClient.request(reqOpts);
|
|
674
|
+
sideEffects?.onSuccess?.(result);
|
|
675
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
676
|
+
} catch (err) {
|
|
677
|
+
const transformedError = sdkTransformError(
|
|
678
|
+
err,
|
|
679
|
+
{
|
|
680
|
+
spreadPathsToArguments: {},
|
|
681
|
+
explicitPathsToArguments: {
|
|
682
|
+
instanceId: "$[0]",
|
|
683
|
+
idempotencyKey: "$[1].idempotencyKey"
|
|
684
|
+
},
|
|
685
|
+
singleArgumentUnchanged: false
|
|
686
|
+
},
|
|
687
|
+
["instanceId", "options"]
|
|
688
|
+
);
|
|
689
|
+
sideEffects?.onError?.(err);
|
|
690
|
+
throw transformedError;
|
|
691
|
+
}
|
|
692
|
+
}
|
|
693
|
+
async function cancelProductInstance2(instanceId, options) {
|
|
694
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
695
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
696
|
+
instanceId,
|
|
697
|
+
idempotencyKey: options?.idempotencyKey
|
|
698
|
+
});
|
|
699
|
+
const reqOpts = cancelProductInstance(payload);
|
|
700
|
+
sideEffects?.onSiteCall?.();
|
|
701
|
+
try {
|
|
702
|
+
const result = await httpClient.request(reqOpts);
|
|
703
|
+
sideEffects?.onSuccess?.(result);
|
|
704
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
705
|
+
} catch (err) {
|
|
706
|
+
const transformedError = sdkTransformError(
|
|
707
|
+
err,
|
|
708
|
+
{
|
|
709
|
+
spreadPathsToArguments: {},
|
|
710
|
+
explicitPathsToArguments: {
|
|
711
|
+
instanceId: "$[0]",
|
|
712
|
+
idempotencyKey: "$[1].idempotencyKey"
|
|
713
|
+
},
|
|
714
|
+
singleArgumentUnchanged: false
|
|
715
|
+
},
|
|
716
|
+
["instanceId", "options"]
|
|
717
|
+
);
|
|
718
|
+
sideEffects?.onError?.(err);
|
|
719
|
+
throw transformedError;
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
async function adjustProductInstanceSpecifications2(instanceId, options) {
|
|
723
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
724
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
725
|
+
instanceId,
|
|
726
|
+
idempotencyKey: options?.idempotencyKey,
|
|
727
|
+
catalogProductId: options?.catalogProductId,
|
|
728
|
+
billingInfo: options?.billingInfo,
|
|
729
|
+
discountCode: options?.discountCode
|
|
730
|
+
});
|
|
731
|
+
const reqOpts = adjustProductInstanceSpecifications(
|
|
732
|
+
payload
|
|
733
|
+
);
|
|
734
|
+
sideEffects?.onSiteCall?.();
|
|
735
|
+
try {
|
|
736
|
+
const result = await httpClient.request(reqOpts);
|
|
737
|
+
sideEffects?.onSuccess?.(result);
|
|
738
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
739
|
+
} catch (err) {
|
|
740
|
+
const transformedError = sdkTransformError(
|
|
741
|
+
err,
|
|
742
|
+
{
|
|
743
|
+
spreadPathsToArguments: {},
|
|
744
|
+
explicitPathsToArguments: {
|
|
745
|
+
instanceId: "$[0]",
|
|
746
|
+
idempotencyKey: "$[1].idempotencyKey",
|
|
747
|
+
catalogProductId: "$[1].catalogProductId",
|
|
748
|
+
billingInfo: "$[1].billingInfo",
|
|
749
|
+
discountCode: "$[1].discountCode"
|
|
750
|
+
},
|
|
751
|
+
singleArgumentUnchanged: false
|
|
752
|
+
},
|
|
753
|
+
["instanceId", "options"]
|
|
754
|
+
);
|
|
755
|
+
sideEffects?.onError?.(err);
|
|
756
|
+
throw transformedError;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
async function updatePackageExternalId2(identifiers) {
|
|
760
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
761
|
+
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
762
|
+
packageId: identifiers?.packageId,
|
|
763
|
+
externalId: identifiers?.externalId
|
|
764
|
+
});
|
|
765
|
+
const reqOpts = updatePackageExternalId(payload);
|
|
766
|
+
sideEffects?.onSiteCall?.();
|
|
767
|
+
try {
|
|
768
|
+
const result = await httpClient.request(reqOpts);
|
|
769
|
+
sideEffects?.onSuccess?.(result);
|
|
770
|
+
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
771
|
+
} catch (err) {
|
|
772
|
+
const transformedError = sdkTransformError(
|
|
773
|
+
err,
|
|
774
|
+
{
|
|
775
|
+
spreadPathsToArguments: {},
|
|
776
|
+
explicitPathsToArguments: {
|
|
777
|
+
packageId: "$[0].packageId",
|
|
778
|
+
externalId: "$[0].externalId"
|
|
779
|
+
},
|
|
780
|
+
singleArgumentUnchanged: false
|
|
781
|
+
},
|
|
782
|
+
["identifiers"]
|
|
783
|
+
);
|
|
784
|
+
sideEffects?.onError?.(err);
|
|
785
|
+
throw transformedError;
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
// src/premium-reseller-v1-packages-packages.public.ts
|
|
790
|
+
function createPackage3(httpClient) {
|
|
791
|
+
return (options) => createPackage2(
|
|
792
|
+
options,
|
|
793
|
+
// @ts-ignore
|
|
794
|
+
{ httpClient }
|
|
795
|
+
);
|
|
796
|
+
}
|
|
797
|
+
function createPackageV23(httpClient) {
|
|
798
|
+
return (options) => createPackageV22(
|
|
799
|
+
options,
|
|
800
|
+
// @ts-ignore
|
|
801
|
+
{ httpClient }
|
|
802
|
+
);
|
|
803
|
+
}
|
|
804
|
+
function cancelPackage3(httpClient) {
|
|
805
|
+
return (_id, options) => cancelPackage2(
|
|
806
|
+
_id,
|
|
807
|
+
options,
|
|
808
|
+
// @ts-ignore
|
|
809
|
+
{ httpClient }
|
|
810
|
+
);
|
|
811
|
+
}
|
|
812
|
+
function getPackage3(httpClient) {
|
|
813
|
+
return (_id) => getPackage2(
|
|
814
|
+
_id,
|
|
815
|
+
// @ts-ignore
|
|
816
|
+
{ httpClient }
|
|
817
|
+
);
|
|
818
|
+
}
|
|
819
|
+
function queryPackages3(httpClient) {
|
|
820
|
+
return () => queryPackages2(
|
|
821
|
+
// @ts-ignore
|
|
822
|
+
{ httpClient }
|
|
823
|
+
);
|
|
824
|
+
}
|
|
825
|
+
function assignProductInstanceToSite3(httpClient) {
|
|
826
|
+
return (identifiers, options) => assignProductInstanceToSite2(
|
|
827
|
+
identifiers,
|
|
828
|
+
options,
|
|
829
|
+
// @ts-ignore
|
|
830
|
+
{ httpClient }
|
|
831
|
+
);
|
|
832
|
+
}
|
|
833
|
+
function unassignProductInstanceFromSite3(httpClient) {
|
|
834
|
+
return (instanceId, options) => unassignProductInstanceFromSite2(
|
|
835
|
+
instanceId,
|
|
836
|
+
options,
|
|
837
|
+
// @ts-ignore
|
|
838
|
+
{ httpClient }
|
|
839
|
+
);
|
|
840
|
+
}
|
|
841
|
+
function cancelProductInstance3(httpClient) {
|
|
842
|
+
return (instanceId, options) => cancelProductInstance2(
|
|
843
|
+
instanceId,
|
|
844
|
+
options,
|
|
845
|
+
// @ts-ignore
|
|
846
|
+
{ httpClient }
|
|
847
|
+
);
|
|
848
|
+
}
|
|
849
|
+
function adjustProductInstanceSpecifications3(httpClient) {
|
|
850
|
+
return (instanceId, options) => adjustProductInstanceSpecifications2(
|
|
851
|
+
instanceId,
|
|
852
|
+
options,
|
|
853
|
+
// @ts-ignore
|
|
854
|
+
{ httpClient }
|
|
855
|
+
);
|
|
856
|
+
}
|
|
857
|
+
function updatePackageExternalId3(httpClient) {
|
|
858
|
+
return (identifiers) => updatePackageExternalId2(
|
|
859
|
+
identifiers,
|
|
860
|
+
// @ts-ignore
|
|
861
|
+
{ httpClient }
|
|
862
|
+
);
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
// src/premium-reseller-v1-packages-packages.context.ts
|
|
866
|
+
import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
|
|
867
|
+
var createPackage4 = /* @__PURE__ */ createRESTModule(createPackage3);
|
|
868
|
+
var createPackageV24 = /* @__PURE__ */ createRESTModule(createPackageV23);
|
|
869
|
+
var cancelPackage4 = /* @__PURE__ */ createRESTModule(cancelPackage3);
|
|
870
|
+
var getPackage4 = /* @__PURE__ */ createRESTModule(getPackage3);
|
|
871
|
+
var queryPackages4 = /* @__PURE__ */ createRESTModule(queryPackages3);
|
|
872
|
+
var assignProductInstanceToSite4 = /* @__PURE__ */ createRESTModule(assignProductInstanceToSite3);
|
|
873
|
+
var unassignProductInstanceFromSite4 = /* @__PURE__ */ createRESTModule(unassignProductInstanceFromSite3);
|
|
874
|
+
var cancelProductInstance4 = /* @__PURE__ */ createRESTModule(cancelProductInstance3);
|
|
875
|
+
var adjustProductInstanceSpecifications4 = /* @__PURE__ */ createRESTModule(adjustProductInstanceSpecifications3);
|
|
876
|
+
var updatePackageExternalId4 = /* @__PURE__ */ createRESTModule(updatePackageExternalId3);
|
|
877
|
+
export {
|
|
878
|
+
ContractSwitchReason,
|
|
879
|
+
ContractSwitchType,
|
|
880
|
+
CycleDescriptorType,
|
|
881
|
+
FailureReasonFailureReason,
|
|
882
|
+
FieldToUpdate,
|
|
883
|
+
Initiator,
|
|
884
|
+
IntervalIntervalUnit,
|
|
885
|
+
IntervalUnit,
|
|
886
|
+
PriceIncreaseTrigger,
|
|
887
|
+
ProductAdjustment,
|
|
888
|
+
ProviderName,
|
|
889
|
+
ReactivationReasonEnum,
|
|
890
|
+
SortOrder,
|
|
891
|
+
Status,
|
|
892
|
+
SubscriptionStatus,
|
|
893
|
+
UnassignReason,
|
|
894
|
+
WebhookIdentityType,
|
|
895
|
+
adjustProductInstanceSpecifications4 as adjustProductInstanceSpecifications,
|
|
896
|
+
assignProductInstanceToSite4 as assignProductInstanceToSite,
|
|
897
|
+
cancelPackage4 as cancelPackage,
|
|
898
|
+
cancelProductInstance4 as cancelProductInstance,
|
|
899
|
+
createPackage4 as createPackage,
|
|
900
|
+
createPackageV24 as createPackageV2,
|
|
901
|
+
getPackage4 as getPackage,
|
|
902
|
+
queryPackages4 as queryPackages,
|
|
903
|
+
unassignProductInstanceFromSite4 as unassignProductInstanceFromSite,
|
|
904
|
+
updatePackageExternalId4 as updatePackageExternalId
|
|
905
|
+
};
|
|
906
|
+
//# sourceMappingURL=index.mjs.map
|