@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.cjs
CHANGED
|
@@ -116,7 +116,8 @@ var manifestSchema = import_zod2.z.object({
|
|
|
116
116
|
files: import_zod2.z.object({
|
|
117
117
|
name: import_zod2.z.string(),
|
|
118
118
|
path: import_zod2.z.string()
|
|
119
|
-
}).array()
|
|
119
|
+
}).array(),
|
|
120
|
+
licensePath: import_zod2.z.string().nullable()
|
|
120
121
|
});
|
|
121
122
|
var downloadSchema = import_zod2.z.object({
|
|
122
123
|
name: import_zod2.z.string(),
|
|
@@ -151,6 +152,7 @@ var storefrontProductSchema = import_zod3.z.object({
|
|
|
151
152
|
id: import_zod3.z.string(),
|
|
152
153
|
name: import_zod3.z.string(),
|
|
153
154
|
tagline: import_zod3.z.string(),
|
|
155
|
+
description: import_zod3.z.string(),
|
|
154
156
|
iconUrl: import_zod3.z.string().nullable(),
|
|
155
157
|
website: import_zod3.z.string().nullish(),
|
|
156
158
|
owned: import_zod3.z.boolean(),
|
|
@@ -164,6 +166,7 @@ var storefrontBundleSchema = import_zod3.z.object({
|
|
|
164
166
|
id: import_zod3.z.string(),
|
|
165
167
|
name: import_zod3.z.string(),
|
|
166
168
|
tagline: import_zod3.z.string(),
|
|
169
|
+
description: import_zod3.z.string(),
|
|
167
170
|
iconUrl: import_zod3.z.string().nullable(),
|
|
168
171
|
owned: import_zod3.z.boolean(),
|
|
169
172
|
partial: import_zod3.z.boolean(),
|
|
@@ -618,11 +621,15 @@ function utmToObject(utm) {
|
|
|
618
621
|
|
|
619
622
|
// src/storefront/endpoints.ts
|
|
620
623
|
var StorefrontEndpoints = class {
|
|
621
|
-
constructor(api) {
|
|
624
|
+
constructor(api, configuration) {
|
|
622
625
|
this.api = api;
|
|
626
|
+
this.configuration = configuration;
|
|
623
627
|
}
|
|
624
628
|
async get(utm) {
|
|
625
|
-
const query = new URLSearchParams(
|
|
629
|
+
const query = new URLSearchParams(this.configuration.includeManifests ? {
|
|
630
|
+
includeManifests: "true",
|
|
631
|
+
...utmToObject(utm)
|
|
632
|
+
} : utmToObject(utm));
|
|
626
633
|
const response = await this.api.fetch(`/api/customer/storefront?${query.toString()}`, storefrontSchema);
|
|
627
634
|
return response.data;
|
|
628
635
|
}
|
|
@@ -972,7 +979,7 @@ var MoonbaseClient = class {
|
|
|
972
979
|
this.configuration.endpoint = this.configuration.endpoint.replace(/\/$/, "");
|
|
973
980
|
this.tokenStore = new TokenStore(configuration);
|
|
974
981
|
const api = new MoonbaseApi(this.configuration.endpoint, this.tokenStore);
|
|
975
|
-
this.storefront = new StorefrontEndpoints(api);
|
|
982
|
+
this.storefront = new StorefrontEndpoints(api, this.configuration);
|
|
976
983
|
this.identity = new IdentityEndpoints(api, this.tokenStore);
|
|
977
984
|
this.vouchers = new VoucherEndpoints(api);
|
|
978
985
|
this.orders = new OrderEndpoints(api);
|