@betterstore/sdk 0.3.61 → 0.3.63
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/CHANGELOG.md +12 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -23
- package/dist/index.mjs +1 -25
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -131,7 +131,7 @@ interface LineItem {
|
|
|
131
131
|
productData: ProductData;
|
|
132
132
|
metadata?: string;
|
|
133
133
|
}
|
|
134
|
-
interface LineItemCreate extends Omit<LineItem, "product" | "metadata"> {
|
|
134
|
+
interface LineItemCreate extends Omit<LineItem, "productData" | "product" | "metadata"> {
|
|
135
135
|
productId: string;
|
|
136
136
|
product?: Pick<Product, "title" | "priceInCents" | "images">;
|
|
137
137
|
metadata?: RecursiveRecord;
|
package/dist/index.d.ts
CHANGED
|
@@ -131,7 +131,7 @@ interface LineItem {
|
|
|
131
131
|
productData: ProductData;
|
|
132
132
|
metadata?: string;
|
|
133
133
|
}
|
|
134
|
-
interface LineItemCreate extends Omit<LineItem, "product" | "metadata"> {
|
|
134
|
+
interface LineItemCreate extends Omit<LineItem, "productData" | "product" | "metadata"> {
|
|
135
135
|
productId: string;
|
|
136
136
|
product?: Pick<Product, "title" | "priceInCents" | "images">;
|
|
137
137
|
metadata?: RecursiveRecord;
|
package/dist/index.js
CHANGED
|
@@ -1,27 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __defProps = Object.defineProperties;
|
|
5
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
7
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
10
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
8
|
var __export = (target, all) => {
|
|
26
9
|
for (var name in all)
|
|
27
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -128,14 +111,9 @@ var Checkout = class {
|
|
|
128
111
|
*/
|
|
129
112
|
create(params) {
|
|
130
113
|
return __async(this, null, function* () {
|
|
131
|
-
const formattedParams = __spreadProps(__spreadValues({}, params), {
|
|
132
|
-
lineItems: params.lineItems.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
133
|
-
metadata: JSON.stringify(item.metadata)
|
|
134
|
-
}))
|
|
135
|
-
});
|
|
136
114
|
const data = yield this.apiClient.post(
|
|
137
115
|
"/checkout",
|
|
138
|
-
|
|
116
|
+
params
|
|
139
117
|
);
|
|
140
118
|
return data;
|
|
141
119
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defProps = Object.defineProperties;
|
|
3
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
-
var __spreadValues = (a, b) => {
|
|
9
|
-
for (var prop in b || (b = {}))
|
|
10
|
-
if (__hasOwnProp.call(b, prop))
|
|
11
|
-
__defNormalProp(a, prop, b[prop]);
|
|
12
|
-
if (__getOwnPropSymbols)
|
|
13
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
-
if (__propIsEnum.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
}
|
|
17
|
-
return a;
|
|
18
|
-
};
|
|
19
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
1
|
var __async = (__this, __arguments, generator) => {
|
|
21
2
|
return new Promise((resolve, reject) => {
|
|
22
3
|
var fulfilled = (value) => {
|
|
@@ -92,14 +73,9 @@ var Checkout = class {
|
|
|
92
73
|
*/
|
|
93
74
|
create(params) {
|
|
94
75
|
return __async(this, null, function* () {
|
|
95
|
-
const formattedParams = __spreadProps(__spreadValues({}, params), {
|
|
96
|
-
lineItems: params.lineItems.map((item) => __spreadProps(__spreadValues({}, item), {
|
|
97
|
-
metadata: JSON.stringify(item.metadata)
|
|
98
|
-
}))
|
|
99
|
-
});
|
|
100
76
|
const data = yield this.apiClient.post(
|
|
101
77
|
"/checkout",
|
|
102
|
-
|
|
78
|
+
params
|
|
103
79
|
);
|
|
104
80
|
return data;
|
|
105
81
|
});
|