@swell/apps-sdk 1.0.133 → 1.0.134
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/dist/index.cjs +75 -1
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +61 -1
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +68 -1
- package/dist/index.mjs.map +3 -3
- package/dist/src/api.d.ts +1 -1
- package/dist/src/resources/index.d.ts +9 -0
- package/dist/src/resources/swell_types.d.ts +28 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7079,6 +7079,62 @@
|
|
|
7079
7079
|
}
|
|
7080
7080
|
};
|
|
7081
7081
|
|
|
7082
|
+
// src/resources/account.ts
|
|
7083
|
+
var SwellAccount = class extends SwellStorefrontSingleton {
|
|
7084
|
+
constructor(swell, getter) {
|
|
7085
|
+
super(swell, "account", getter);
|
|
7086
|
+
return this._getProxy();
|
|
7087
|
+
}
|
|
7088
|
+
};
|
|
7089
|
+
|
|
7090
|
+
// src/resources/blog_category.ts
|
|
7091
|
+
var SwellBlogCategory = class extends SwellStorefrontRecord {
|
|
7092
|
+
constructor(swell, id, query = {}, getter) {
|
|
7093
|
+
super(swell, "content/blog-categories", id, query, getter);
|
|
7094
|
+
return this._getProxy();
|
|
7095
|
+
}
|
|
7096
|
+
};
|
|
7097
|
+
|
|
7098
|
+
// src/resources/blog.ts
|
|
7099
|
+
var SwellBlog = class extends SwellStorefrontRecord {
|
|
7100
|
+
constructor(swell, id, query = {}, getter) {
|
|
7101
|
+
super(swell, "content/blogs", id, query, getter);
|
|
7102
|
+
return this._getProxy();
|
|
7103
|
+
}
|
|
7104
|
+
};
|
|
7105
|
+
|
|
7106
|
+
// src/resources/cart.ts
|
|
7107
|
+
var SwellCart = class extends SwellStorefrontSingleton {
|
|
7108
|
+
constructor(swell, getter) {
|
|
7109
|
+
super(swell, "cart", getter);
|
|
7110
|
+
return this._getProxy();
|
|
7111
|
+
}
|
|
7112
|
+
};
|
|
7113
|
+
|
|
7114
|
+
// src/resources/category.ts
|
|
7115
|
+
var SwellCategory = class extends SwellStorefrontRecord {
|
|
7116
|
+
constructor(swell, id, query = {}, getter) {
|
|
7117
|
+
super(swell, "categories", id, query, getter);
|
|
7118
|
+
return this._getProxy();
|
|
7119
|
+
}
|
|
7120
|
+
};
|
|
7121
|
+
|
|
7122
|
+
// src/resources/order.ts
|
|
7123
|
+
var SwellOrder = class extends SwellStorefrontRecord {
|
|
7124
|
+
constructor(swell, id, query = {}, getter) {
|
|
7125
|
+
super(swell, "orders", id, query, getter);
|
|
7126
|
+
return this._getProxy();
|
|
7127
|
+
}
|
|
7128
|
+
};
|
|
7129
|
+
|
|
7130
|
+
// src/resources/page.ts
|
|
7131
|
+
var SwellPage = class extends SwellStorefrontRecord {
|
|
7132
|
+
constructor(swell, id, query = {}, getter) {
|
|
7133
|
+
super(swell, "content/pages", id, query, getter);
|
|
7134
|
+
return this._getProxy();
|
|
7135
|
+
}
|
|
7136
|
+
};
|
|
7137
|
+
|
|
7082
7138
|
// src/resources/product_helpers.ts
|
|
7083
7139
|
function getAvailableVariants(product) {
|
|
7084
7140
|
return (product.variants?.results?.slice()?.reverse() || []).filter(
|
|
@@ -16025,7 +16081,11 @@ ${formattedMessage}`;
|
|
|
16025
16081
|
({ from }) => from === key || from.startsWith(keyObject)
|
|
16026
16082
|
);
|
|
16027
16083
|
if (resourceMap && value instanceof StorefrontResource) {
|
|
16028
|
-
pageData[resourceMap.to] =
|
|
16084
|
+
pageData[resourceMap.to] = Object.assign(
|
|
16085
|
+
{},
|
|
16086
|
+
value.toObject(),
|
|
16087
|
+
resourceMap.object(this, value)
|
|
16088
|
+
);
|
|
16029
16089
|
}
|
|
16030
16090
|
}
|
|
16031
16091
|
}
|