@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.cjs
CHANGED
|
@@ -65,8 +65,15 @@ __export(index_exports, {
|
|
|
65
65
|
ShopifyVariant: () => ShopifyVariant,
|
|
66
66
|
StorefrontResource: () => StorefrontResource,
|
|
67
67
|
Swell: () => Swell,
|
|
68
|
+
SwellAccount: () => SwellAccount,
|
|
68
69
|
SwellBackendAPI: () => SwellBackendAPI,
|
|
70
|
+
SwellBlog: () => SwellBlog,
|
|
71
|
+
SwellBlogCategory: () => SwellBlogCategory,
|
|
72
|
+
SwellCart: () => SwellCart,
|
|
73
|
+
SwellCategory: () => SwellCategory,
|
|
69
74
|
SwellError: () => SwellError,
|
|
75
|
+
SwellOrder: () => SwellOrder,
|
|
76
|
+
SwellPage: () => SwellPage,
|
|
70
77
|
SwellProduct: () => SwellProduct,
|
|
71
78
|
SwellStorefrontCollection: () => SwellStorefrontCollection,
|
|
72
79
|
SwellStorefrontPagination: () => SwellStorefrontPagination,
|
|
@@ -7178,6 +7185,62 @@ var ThemeCache = class extends Cache {
|
|
|
7178
7185
|
}
|
|
7179
7186
|
};
|
|
7180
7187
|
|
|
7188
|
+
// src/resources/account.ts
|
|
7189
|
+
var SwellAccount = class extends SwellStorefrontSingleton {
|
|
7190
|
+
constructor(swell, getter) {
|
|
7191
|
+
super(swell, "account", getter);
|
|
7192
|
+
return this._getProxy();
|
|
7193
|
+
}
|
|
7194
|
+
};
|
|
7195
|
+
|
|
7196
|
+
// src/resources/blog_category.ts
|
|
7197
|
+
var SwellBlogCategory = class extends SwellStorefrontRecord {
|
|
7198
|
+
constructor(swell, id, query = {}, getter) {
|
|
7199
|
+
super(swell, "content/blog-categories", id, query, getter);
|
|
7200
|
+
return this._getProxy();
|
|
7201
|
+
}
|
|
7202
|
+
};
|
|
7203
|
+
|
|
7204
|
+
// src/resources/blog.ts
|
|
7205
|
+
var SwellBlog = class extends SwellStorefrontRecord {
|
|
7206
|
+
constructor(swell, id, query = {}, getter) {
|
|
7207
|
+
super(swell, "content/blogs", id, query, getter);
|
|
7208
|
+
return this._getProxy();
|
|
7209
|
+
}
|
|
7210
|
+
};
|
|
7211
|
+
|
|
7212
|
+
// src/resources/cart.ts
|
|
7213
|
+
var SwellCart = class extends SwellStorefrontSingleton {
|
|
7214
|
+
constructor(swell, getter) {
|
|
7215
|
+
super(swell, "cart", getter);
|
|
7216
|
+
return this._getProxy();
|
|
7217
|
+
}
|
|
7218
|
+
};
|
|
7219
|
+
|
|
7220
|
+
// src/resources/category.ts
|
|
7221
|
+
var SwellCategory = class extends SwellStorefrontRecord {
|
|
7222
|
+
constructor(swell, id, query = {}, getter) {
|
|
7223
|
+
super(swell, "categories", id, query, getter);
|
|
7224
|
+
return this._getProxy();
|
|
7225
|
+
}
|
|
7226
|
+
};
|
|
7227
|
+
|
|
7228
|
+
// src/resources/order.ts
|
|
7229
|
+
var SwellOrder = class extends SwellStorefrontRecord {
|
|
7230
|
+
constructor(swell, id, query = {}, getter) {
|
|
7231
|
+
super(swell, "orders", id, query, getter);
|
|
7232
|
+
return this._getProxy();
|
|
7233
|
+
}
|
|
7234
|
+
};
|
|
7235
|
+
|
|
7236
|
+
// src/resources/page.ts
|
|
7237
|
+
var SwellPage = class extends SwellStorefrontRecord {
|
|
7238
|
+
constructor(swell, id, query = {}, getter) {
|
|
7239
|
+
super(swell, "content/pages", id, query, getter);
|
|
7240
|
+
return this._getProxy();
|
|
7241
|
+
}
|
|
7242
|
+
};
|
|
7243
|
+
|
|
7181
7244
|
// src/resources/product_helpers.ts
|
|
7182
7245
|
function getAvailableVariants(product) {
|
|
7183
7246
|
return (product.variants?.results?.slice()?.reverse() || []).filter(
|
|
@@ -16124,7 +16187,11 @@ var ShopifyCompatibility3 = class {
|
|
|
16124
16187
|
({ from }) => from === key || from.startsWith(keyObject)
|
|
16125
16188
|
);
|
|
16126
16189
|
if (resourceMap && value instanceof StorefrontResource) {
|
|
16127
|
-
pageData[resourceMap.to] =
|
|
16190
|
+
pageData[resourceMap.to] = Object.assign(
|
|
16191
|
+
{},
|
|
16192
|
+
value.toObject(),
|
|
16193
|
+
resourceMap.object(this, value)
|
|
16194
|
+
);
|
|
16128
16195
|
}
|
|
16129
16196
|
}
|
|
16130
16197
|
}
|
|
@@ -20902,8 +20969,15 @@ function getResourceQuery(slug, query) {
|
|
|
20902
20969
|
ShopifyVariant,
|
|
20903
20970
|
StorefrontResource,
|
|
20904
20971
|
Swell,
|
|
20972
|
+
SwellAccount,
|
|
20905
20973
|
SwellBackendAPI,
|
|
20974
|
+
SwellBlog,
|
|
20975
|
+
SwellBlogCategory,
|
|
20976
|
+
SwellCart,
|
|
20977
|
+
SwellCategory,
|
|
20906
20978
|
SwellError,
|
|
20979
|
+
SwellOrder,
|
|
20980
|
+
SwellPage,
|
|
20907
20981
|
SwellProduct,
|
|
20908
20982
|
SwellStorefrontCollection,
|
|
20909
20983
|
SwellStorefrontPagination,
|