@moonbase.sh/storefront-api 0.2.83 → 0.2.84
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 +25 -14
- package/dist/index.d.cts +635 -8
- package/dist/index.d.ts +635 -8
- package/dist/index.js +25 -14
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -112,17 +112,25 @@ var Platform = /* @__PURE__ */ ((Platform2) => {
|
|
|
112
112
|
})(Platform || {});
|
|
113
113
|
|
|
114
114
|
// src/inventory/products/schemas.ts
|
|
115
|
+
var manifestSchema = import_zod2.z.object({
|
|
116
|
+
files: import_zod2.z.object({
|
|
117
|
+
name: import_zod2.z.string(),
|
|
118
|
+
path: import_zod2.z.string()
|
|
119
|
+
}).array()
|
|
120
|
+
});
|
|
115
121
|
var downloadSchema = import_zod2.z.object({
|
|
116
122
|
name: import_zod2.z.string(),
|
|
117
123
|
key: import_zod2.z.string(),
|
|
118
124
|
platform: import_zod2.z.nativeEnum(Platform),
|
|
119
125
|
size: import_zod2.z.number(),
|
|
120
|
-
path: import_zod2.z.string().nullable()
|
|
126
|
+
path: import_zod2.z.string().nullable(),
|
|
127
|
+
manifest: manifestSchema.optional()
|
|
121
128
|
});
|
|
122
129
|
var productSummarySchema = import_zod2.z.object({
|
|
123
130
|
id: import_zod2.z.string(),
|
|
124
131
|
name: import_zod2.z.string(),
|
|
125
132
|
tagline: import_zod2.z.string(),
|
|
133
|
+
description: import_zod2.z.string().nullish(),
|
|
126
134
|
website: import_zod2.z.string().optional(),
|
|
127
135
|
iconUrl: import_zod2.z.string().optional(),
|
|
128
136
|
numberOfLicenses: import_zod2.z.number().optional(),
|
|
@@ -851,11 +859,12 @@ var activationSchema = import_zod10.z.object({
|
|
|
851
859
|
|
|
852
860
|
// src/inventory/activation/endpoints.ts
|
|
853
861
|
var ActivationEndpoints = class {
|
|
854
|
-
constructor(api) {
|
|
862
|
+
constructor(api, configuration) {
|
|
855
863
|
this.api = api;
|
|
864
|
+
this.configuration = configuration;
|
|
856
865
|
}
|
|
857
866
|
async activate(deviceToken, activationMethod) {
|
|
858
|
-
const response = await this.api.authenticatedFetch(`/api/customer/inventory/activate?method=${activationMethod}`, licenseSchema, {
|
|
867
|
+
const response = await this.api.authenticatedFetch(`/api/customer/inventory/activate?method=${activationMethod}${this.configuration.includeManifests ? "&includeManifests=true" : ""}`, licenseSchema, {
|
|
859
868
|
method: "POST",
|
|
860
869
|
body: deviceToken,
|
|
861
870
|
contentType: "text/plain"
|
|
@@ -869,11 +878,12 @@ var ActivationEndpoints = class {
|
|
|
869
878
|
|
|
870
879
|
// src/inventory/licenses/endpoints.ts
|
|
871
880
|
var LicenseEndpoints = class {
|
|
872
|
-
constructor(api) {
|
|
881
|
+
constructor(api, configuration) {
|
|
873
882
|
this.api = api;
|
|
883
|
+
this.configuration = configuration;
|
|
874
884
|
}
|
|
875
885
|
async get(nextUrl) {
|
|
876
|
-
const response = await this.api.authenticatedFetch(nextUrl ||
|
|
886
|
+
const response = await this.api.authenticatedFetch(nextUrl || `/api/customer/inventory/licenses${this.configuration.includeManifests ? "?includeManifests=true" : ""}`, paged(licenseSchema));
|
|
877
887
|
return response.data;
|
|
878
888
|
}
|
|
879
889
|
async getActivations(licenseId, nextUrl) {
|
|
@@ -891,19 +901,20 @@ var LicenseEndpoints = class {
|
|
|
891
901
|
// src/inventory/products/endpoints.ts
|
|
892
902
|
var import_zod12 = require("zod");
|
|
893
903
|
var ProductEndpoints = class {
|
|
894
|
-
constructor(api) {
|
|
904
|
+
constructor(api, configuration) {
|
|
895
905
|
this.api = api;
|
|
906
|
+
this.configuration = configuration;
|
|
896
907
|
}
|
|
897
908
|
async get(productId, version) {
|
|
898
|
-
const response = await this.api.fetch(`/api/customer/inventory/products/${productId}${version ? `?version=${version}` : ""}`, productSummarySchema);
|
|
909
|
+
const response = await this.api.fetch(`/api/customer/inventory/products/${productId}${version ? `?version=${version}${this.configuration.includeManifests ? "&includeManifests=true" : ""}` : this.configuration.includeManifests ? "?includeManifests=true" : ""}`, productSummarySchema);
|
|
899
910
|
return response.data;
|
|
900
911
|
}
|
|
901
912
|
async getOwned(nextUrl) {
|
|
902
|
-
const response = await this.api.authenticatedFetch(nextUrl ||
|
|
913
|
+
const response = await this.api.authenticatedFetch(nextUrl || `/api/customer/inventory/products${this.configuration.includeManifests ? "?includeManifests=true" : ""}`, paged(productSummarySchema));
|
|
903
914
|
return response.data;
|
|
904
915
|
}
|
|
905
916
|
async getLicenses(productId, nextUrl) {
|
|
906
|
-
const response = await this.api.authenticatedFetch(nextUrl || `/api/customer/inventory/products/${productId}/licenses`, paged(licenseSchema));
|
|
917
|
+
const response = await this.api.authenticatedFetch(nextUrl || `/api/customer/inventory/products/${productId}/licenses${this.configuration.includeManifests ? "?includeManifests=true" : ""}`, paged(licenseSchema));
|
|
907
918
|
return response.data;
|
|
908
919
|
}
|
|
909
920
|
async getActivations(productId, nextUrl) {
|
|
@@ -922,10 +933,10 @@ var ProductEndpoints = class {
|
|
|
922
933
|
|
|
923
934
|
// src/inventory/index.ts
|
|
924
935
|
var InventoryEndpoints = class {
|
|
925
|
-
constructor(api) {
|
|
926
|
-
this.licenses = new LicenseEndpoints(api);
|
|
927
|
-
this.products = new ProductEndpoints(api);
|
|
928
|
-
this.activation = new ActivationEndpoints(api);
|
|
936
|
+
constructor(api, configuration) {
|
|
937
|
+
this.licenses = new LicenseEndpoints(api, configuration);
|
|
938
|
+
this.products = new ProductEndpoints(api, configuration);
|
|
939
|
+
this.activation = new ActivationEndpoints(api, configuration);
|
|
929
940
|
}
|
|
930
941
|
};
|
|
931
942
|
|
|
@@ -965,7 +976,7 @@ var MoonbaseClient = class {
|
|
|
965
976
|
this.identity = new IdentityEndpoints(api, this.tokenStore);
|
|
966
977
|
this.vouchers = new VoucherEndpoints(api);
|
|
967
978
|
this.orders = new OrderEndpoints(api);
|
|
968
|
-
this.inventory = new InventoryEndpoints(api);
|
|
979
|
+
this.inventory = new InventoryEndpoints(api, this.configuration);
|
|
969
980
|
this.activationRequests = new ActivationRequestEndpoints(api);
|
|
970
981
|
this.vendor = new VendorEndpoints(api);
|
|
971
982
|
}
|