@moonbase.sh/storefront-api 0.2.84 → 0.2.87
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 +11 -4
- package/dist/index.d.cts +157 -2
- package/dist/index.d.ts +157 -2
- package/dist/index.js +11 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -74,7 +74,8 @@ var manifestSchema = z2.object({
|
|
|
74
74
|
files: z2.object({
|
|
75
75
|
name: z2.string(),
|
|
76
76
|
path: z2.string()
|
|
77
|
-
}).array()
|
|
77
|
+
}).array(),
|
|
78
|
+
licensePath: z2.string().nullable()
|
|
78
79
|
});
|
|
79
80
|
var downloadSchema = z2.object({
|
|
80
81
|
name: z2.string(),
|
|
@@ -109,6 +110,7 @@ var storefrontProductSchema = z3.object({
|
|
|
109
110
|
id: z3.string(),
|
|
110
111
|
name: z3.string(),
|
|
111
112
|
tagline: z3.string(),
|
|
113
|
+
description: z3.string(),
|
|
112
114
|
iconUrl: z3.string().nullable(),
|
|
113
115
|
website: z3.string().nullish(),
|
|
114
116
|
owned: z3.boolean(),
|
|
@@ -122,6 +124,7 @@ var storefrontBundleSchema = z3.object({
|
|
|
122
124
|
id: z3.string(),
|
|
123
125
|
name: z3.string(),
|
|
124
126
|
tagline: z3.string(),
|
|
127
|
+
description: z3.string(),
|
|
125
128
|
iconUrl: z3.string().nullable(),
|
|
126
129
|
owned: z3.boolean(),
|
|
127
130
|
partial: z3.boolean(),
|
|
@@ -576,11 +579,15 @@ function utmToObject(utm) {
|
|
|
576
579
|
|
|
577
580
|
// src/storefront/endpoints.ts
|
|
578
581
|
var StorefrontEndpoints = class {
|
|
579
|
-
constructor(api) {
|
|
582
|
+
constructor(api, configuration) {
|
|
580
583
|
this.api = api;
|
|
584
|
+
this.configuration = configuration;
|
|
581
585
|
}
|
|
582
586
|
async get(utm) {
|
|
583
|
-
const query = new URLSearchParams(
|
|
587
|
+
const query = new URLSearchParams(this.configuration.includeManifests ? {
|
|
588
|
+
includeManifests: "true",
|
|
589
|
+
...utmToObject(utm)
|
|
590
|
+
} : utmToObject(utm));
|
|
584
591
|
const response = await this.api.fetch(`/api/customer/storefront?${query.toString()}`, storefrontSchema);
|
|
585
592
|
return response.data;
|
|
586
593
|
}
|
|
@@ -930,7 +937,7 @@ var MoonbaseClient = class {
|
|
|
930
937
|
this.configuration.endpoint = this.configuration.endpoint.replace(/\/$/, "");
|
|
931
938
|
this.tokenStore = new TokenStore(configuration);
|
|
932
939
|
const api = new MoonbaseApi(this.configuration.endpoint, this.tokenStore);
|
|
933
|
-
this.storefront = new StorefrontEndpoints(api);
|
|
940
|
+
this.storefront = new StorefrontEndpoints(api, this.configuration);
|
|
934
941
|
this.identity = new IdentityEndpoints(api, this.tokenStore);
|
|
935
942
|
this.vouchers = new VoucherEndpoints(api);
|
|
936
943
|
this.orders = new OrderEndpoints(api);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/storefront-api",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.87",
|
|
5
5
|
"description": "Package to let you build storefronts with Moonbase.sh as payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|