@moonbase.sh/vue 0.2.82 → 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 +22 -2
- package/dist/index.d.cts +67 -2
- package/dist/index.d.ts +67 -2
- package/dist/index.js +21 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -31,11 +31,12 @@ __export(src_exports, {
|
|
|
31
31
|
useInventory: () => useInventory,
|
|
32
32
|
useProduct: () => useProduct,
|
|
33
33
|
useProducts: () => useProducts,
|
|
34
|
+
useVendor: () => useVendor,
|
|
34
35
|
useVoucher: () => useVoucher
|
|
35
36
|
});
|
|
36
37
|
module.exports = __toCommonJS(src_exports);
|
|
37
38
|
var import_storefront_api6 = require("@moonbase.sh/storefront-api");
|
|
38
|
-
var
|
|
39
|
+
var import_vue12 = require("vue");
|
|
39
40
|
|
|
40
41
|
// src/context.ts
|
|
41
42
|
var import_uuid = require("uuid");
|
|
@@ -759,6 +760,24 @@ function useAuth(context) {
|
|
|
759
760
|
};
|
|
760
761
|
}
|
|
761
762
|
|
|
763
|
+
// src/composables/useVendor.ts
|
|
764
|
+
var import_vue11 = require("vue");
|
|
765
|
+
function useVendor(context) {
|
|
766
|
+
const storefront = context != null ? context : (0, import_vue11.inject)(storefrontKey);
|
|
767
|
+
if (!storefront)
|
|
768
|
+
throw new Error("No storefront configured");
|
|
769
|
+
const vendor = (0, import_vue11.ref)(null);
|
|
770
|
+
const loading = (0, import_vue11.ref)(true);
|
|
771
|
+
storefront.client.vendor.get().then((v) => {
|
|
772
|
+
vendor.value = v;
|
|
773
|
+
loading.value = false;
|
|
774
|
+
});
|
|
775
|
+
return {
|
|
776
|
+
vendor,
|
|
777
|
+
loading
|
|
778
|
+
};
|
|
779
|
+
}
|
|
780
|
+
|
|
762
781
|
// src/index.ts
|
|
763
782
|
function createStorefront(endpoint, stateFactory, config) {
|
|
764
783
|
const configuration = {
|
|
@@ -769,7 +788,7 @@ function createStorefront(endpoint, stateFactory, config) {
|
|
|
769
788
|
configuration,
|
|
770
789
|
new import_storefront_api6.MoonbaseClient(configuration),
|
|
771
790
|
// Default to vue refs but allow stuff like Nuxt useState wrappers
|
|
772
|
-
stateFactory || ((_, state) => (0,
|
|
791
|
+
stateFactory || ((_, state) => (0, import_vue12.ref)(state))
|
|
773
792
|
);
|
|
774
793
|
}
|
|
775
794
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -784,6 +803,7 @@ function createStorefront(endpoint, stateFactory, config) {
|
|
|
784
803
|
useInventory,
|
|
785
804
|
useProduct,
|
|
786
805
|
useProducts,
|
|
806
|
+
useVendor,
|
|
787
807
|
useVoucher,
|
|
788
808
|
...require("@moonbase.sh/storefront-api")
|
|
789
809
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _moonbase_sh_storefront_api from '@moonbase.sh/storefront-api';
|
|
2
|
-
import { MoonbaseConfiguration, Storefront, Order, User, UrchinTrackingModule, MoonbaseClient, CompletedOrder, StorefrontBundle, StorefrontProduct, ActivationMethod, Activation, Download, ActivationRequest, PricingVariation, CommunicationPreferences, LineItem } from '@moonbase.sh/storefront-api';
|
|
2
|
+
import { MoonbaseConfiguration, Storefront, Order, User, UrchinTrackingModule, MoonbaseClient, CompletedOrder, StorefrontBundle, StorefrontProduct, ActivationMethod, Activation, Download, ActivationRequest, PricingVariation, CommunicationPreferences, Vendor, LineItem } from '@moonbase.sh/storefront-api';
|
|
3
3
|
export * from '@moonbase.sh/storefront-api';
|
|
4
4
|
import * as vue from 'vue';
|
|
5
5
|
import { Plugin, Ref, App, UnwrapRef, InjectionKey } from 'vue';
|
|
@@ -56,6 +56,7 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
56
56
|
currentVersion: string | null;
|
|
57
57
|
downloadsNeedsUser: boolean;
|
|
58
58
|
downloadsNeedsOwnership: boolean;
|
|
59
|
+
description?: string | null | undefined;
|
|
59
60
|
website?: string | undefined;
|
|
60
61
|
iconUrl?: string | undefined;
|
|
61
62
|
numberOfLicenses?: number | undefined;
|
|
@@ -71,6 +72,12 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
71
72
|
key: string;
|
|
72
73
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
73
74
|
size: number;
|
|
75
|
+
manifest?: {
|
|
76
|
+
files: {
|
|
77
|
+
path: string;
|
|
78
|
+
name: string;
|
|
79
|
+
}[];
|
|
80
|
+
} | undefined;
|
|
74
81
|
}[] | undefined;
|
|
75
82
|
};
|
|
76
83
|
activeNumberOfActivations: number;
|
|
@@ -92,6 +99,7 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
92
99
|
currentVersion: string | null;
|
|
93
100
|
downloadsNeedsUser: boolean;
|
|
94
101
|
downloadsNeedsOwnership: boolean;
|
|
102
|
+
description?: string | null | undefined;
|
|
95
103
|
website?: string | undefined;
|
|
96
104
|
iconUrl?: string | undefined;
|
|
97
105
|
numberOfLicenses?: number | undefined;
|
|
@@ -107,6 +115,12 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
107
115
|
key: string;
|
|
108
116
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
109
117
|
size: number;
|
|
118
|
+
manifest?: {
|
|
119
|
+
files: {
|
|
120
|
+
path: string;
|
|
121
|
+
name: string;
|
|
122
|
+
}[];
|
|
123
|
+
} | undefined;
|
|
110
124
|
}[] | undefined;
|
|
111
125
|
}>;
|
|
112
126
|
getProducts: (nextUrl?: string) => Promise<_moonbase_sh_storefront_api.Page<{
|
|
@@ -116,6 +130,7 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
116
130
|
currentVersion: string | null;
|
|
117
131
|
downloadsNeedsUser: boolean;
|
|
118
132
|
downloadsNeedsOwnership: boolean;
|
|
133
|
+
description?: string | null | undefined;
|
|
119
134
|
website?: string | undefined;
|
|
120
135
|
iconUrl?: string | undefined;
|
|
121
136
|
numberOfLicenses?: number | undefined;
|
|
@@ -131,6 +146,12 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
131
146
|
key: string;
|
|
132
147
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
133
148
|
size: number;
|
|
149
|
+
manifest?: {
|
|
150
|
+
files: {
|
|
151
|
+
path: string;
|
|
152
|
+
name: string;
|
|
153
|
+
}[];
|
|
154
|
+
} | undefined;
|
|
134
155
|
}[] | undefined;
|
|
135
156
|
}>>;
|
|
136
157
|
getProductLicenses: (productId: string, nextUrl?: string) => Promise<_moonbase_sh_storefront_api.Page<{
|
|
@@ -143,6 +164,7 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
143
164
|
currentVersion: string | null;
|
|
144
165
|
downloadsNeedsUser: boolean;
|
|
145
166
|
downloadsNeedsOwnership: boolean;
|
|
167
|
+
description?: string | null | undefined;
|
|
146
168
|
website?: string | undefined;
|
|
147
169
|
iconUrl?: string | undefined;
|
|
148
170
|
numberOfLicenses?: number | undefined;
|
|
@@ -158,6 +180,12 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
158
180
|
key: string;
|
|
159
181
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
160
182
|
size: number;
|
|
183
|
+
manifest?: {
|
|
184
|
+
files: {
|
|
185
|
+
path: string;
|
|
186
|
+
name: string;
|
|
187
|
+
}[];
|
|
188
|
+
} | undefined;
|
|
161
189
|
}[] | undefined;
|
|
162
190
|
};
|
|
163
191
|
activeNumberOfActivations: number;
|
|
@@ -184,6 +212,7 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
184
212
|
currentVersion: string | null;
|
|
185
213
|
downloadsNeedsUser: boolean;
|
|
186
214
|
downloadsNeedsOwnership: boolean;
|
|
215
|
+
description?: string | null | undefined;
|
|
187
216
|
website?: string | undefined;
|
|
188
217
|
iconUrl?: string | undefined;
|
|
189
218
|
numberOfLicenses?: number | undefined;
|
|
@@ -199,6 +228,12 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
199
228
|
key: string;
|
|
200
229
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
201
230
|
size: number;
|
|
231
|
+
manifest?: {
|
|
232
|
+
files: {
|
|
233
|
+
path: string;
|
|
234
|
+
name: string;
|
|
235
|
+
}[];
|
|
236
|
+
} | undefined;
|
|
202
237
|
}[] | undefined;
|
|
203
238
|
};
|
|
204
239
|
activeNumberOfActivations: number;
|
|
@@ -246,6 +281,12 @@ declare function useVoucher(context?: StorefrontContext): {
|
|
|
246
281
|
key: string;
|
|
247
282
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
248
283
|
size: number;
|
|
284
|
+
manifest?: {
|
|
285
|
+
files: {
|
|
286
|
+
path: string;
|
|
287
|
+
name: string;
|
|
288
|
+
}[];
|
|
289
|
+
} | undefined;
|
|
249
290
|
}[] | undefined;
|
|
250
291
|
defaultVariation?: {
|
|
251
292
|
id: string;
|
|
@@ -316,6 +357,12 @@ declare function useVoucher(context?: StorefrontContext): {
|
|
|
316
357
|
key: string;
|
|
317
358
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
318
359
|
size: number;
|
|
360
|
+
manifest?: {
|
|
361
|
+
files: {
|
|
362
|
+
path: string;
|
|
363
|
+
name: string;
|
|
364
|
+
}[];
|
|
365
|
+
} | undefined;
|
|
319
366
|
}[] | undefined;
|
|
320
367
|
defaultVariation?: {
|
|
321
368
|
id: string;
|
|
@@ -430,6 +477,12 @@ declare function useVoucher(context?: StorefrontContext): {
|
|
|
430
477
|
key: string;
|
|
431
478
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
432
479
|
size: number;
|
|
480
|
+
manifest?: {
|
|
481
|
+
files: {
|
|
482
|
+
path: string;
|
|
483
|
+
name: string;
|
|
484
|
+
}[];
|
|
485
|
+
} | undefined;
|
|
433
486
|
}[] | undefined;
|
|
434
487
|
defaultVariation?: {
|
|
435
488
|
id: string;
|
|
@@ -500,6 +553,12 @@ declare function useVoucher(context?: StorefrontContext): {
|
|
|
500
553
|
key: string;
|
|
501
554
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
502
555
|
size: number;
|
|
556
|
+
manifest?: {
|
|
557
|
+
files: {
|
|
558
|
+
path: string;
|
|
559
|
+
name: string;
|
|
560
|
+
}[];
|
|
561
|
+
} | undefined;
|
|
503
562
|
}[] | undefined;
|
|
504
563
|
defaultVariation?: {
|
|
505
564
|
id: string;
|
|
@@ -825,6 +884,12 @@ declare function useAuth(context?: StorefrontContext): {
|
|
|
825
884
|
} | null>;
|
|
826
885
|
};
|
|
827
886
|
|
|
887
|
+
interface VendorComposable {
|
|
888
|
+
vendor: Ref<null | Vendor>;
|
|
889
|
+
loading: Ref<boolean>;
|
|
890
|
+
}
|
|
891
|
+
declare function useVendor(context?: StorefrontContext): VendorComposable;
|
|
892
|
+
|
|
828
893
|
declare const storefrontKey: InjectionKey<StorefrontContext>;
|
|
829
894
|
|
|
830
895
|
interface Cart {
|
|
@@ -833,4 +898,4 @@ interface Cart {
|
|
|
833
898
|
type CartItem = LineItem;
|
|
834
899
|
declare function createStorefront(endpoint: string, stateFactory?: StateFactory, config?: Omit<MoonbaseConfiguration, 'endpoint'>): StorefrontContext;
|
|
835
900
|
|
|
836
|
-
export { type ActivationRequestComposable, type Cart, type CartItem, createStorefront, storefrontKey, useActivationRequest, useAuth, useBundle, useBundles, useCart, useInventory, useProduct, useProducts, useVoucher };
|
|
901
|
+
export { type ActivationRequestComposable, type Cart, type CartItem, type VendorComposable, createStorefront, storefrontKey, useActivationRequest, useAuth, useBundle, useBundles, useCart, useInventory, useProduct, useProducts, useVendor, useVoucher };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _moonbase_sh_storefront_api from '@moonbase.sh/storefront-api';
|
|
2
|
-
import { MoonbaseConfiguration, Storefront, Order, User, UrchinTrackingModule, MoonbaseClient, CompletedOrder, StorefrontBundle, StorefrontProduct, ActivationMethod, Activation, Download, ActivationRequest, PricingVariation, CommunicationPreferences, LineItem } from '@moonbase.sh/storefront-api';
|
|
2
|
+
import { MoonbaseConfiguration, Storefront, Order, User, UrchinTrackingModule, MoonbaseClient, CompletedOrder, StorefrontBundle, StorefrontProduct, ActivationMethod, Activation, Download, ActivationRequest, PricingVariation, CommunicationPreferences, Vendor, LineItem } from '@moonbase.sh/storefront-api';
|
|
3
3
|
export * from '@moonbase.sh/storefront-api';
|
|
4
4
|
import * as vue from 'vue';
|
|
5
5
|
import { Plugin, Ref, App, UnwrapRef, InjectionKey } from 'vue';
|
|
@@ -56,6 +56,7 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
56
56
|
currentVersion: string | null;
|
|
57
57
|
downloadsNeedsUser: boolean;
|
|
58
58
|
downloadsNeedsOwnership: boolean;
|
|
59
|
+
description?: string | null | undefined;
|
|
59
60
|
website?: string | undefined;
|
|
60
61
|
iconUrl?: string | undefined;
|
|
61
62
|
numberOfLicenses?: number | undefined;
|
|
@@ -71,6 +72,12 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
71
72
|
key: string;
|
|
72
73
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
73
74
|
size: number;
|
|
75
|
+
manifest?: {
|
|
76
|
+
files: {
|
|
77
|
+
path: string;
|
|
78
|
+
name: string;
|
|
79
|
+
}[];
|
|
80
|
+
} | undefined;
|
|
74
81
|
}[] | undefined;
|
|
75
82
|
};
|
|
76
83
|
activeNumberOfActivations: number;
|
|
@@ -92,6 +99,7 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
92
99
|
currentVersion: string | null;
|
|
93
100
|
downloadsNeedsUser: boolean;
|
|
94
101
|
downloadsNeedsOwnership: boolean;
|
|
102
|
+
description?: string | null | undefined;
|
|
95
103
|
website?: string | undefined;
|
|
96
104
|
iconUrl?: string | undefined;
|
|
97
105
|
numberOfLicenses?: number | undefined;
|
|
@@ -107,6 +115,12 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
107
115
|
key: string;
|
|
108
116
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
109
117
|
size: number;
|
|
118
|
+
manifest?: {
|
|
119
|
+
files: {
|
|
120
|
+
path: string;
|
|
121
|
+
name: string;
|
|
122
|
+
}[];
|
|
123
|
+
} | undefined;
|
|
110
124
|
}[] | undefined;
|
|
111
125
|
}>;
|
|
112
126
|
getProducts: (nextUrl?: string) => Promise<_moonbase_sh_storefront_api.Page<{
|
|
@@ -116,6 +130,7 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
116
130
|
currentVersion: string | null;
|
|
117
131
|
downloadsNeedsUser: boolean;
|
|
118
132
|
downloadsNeedsOwnership: boolean;
|
|
133
|
+
description?: string | null | undefined;
|
|
119
134
|
website?: string | undefined;
|
|
120
135
|
iconUrl?: string | undefined;
|
|
121
136
|
numberOfLicenses?: number | undefined;
|
|
@@ -131,6 +146,12 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
131
146
|
key: string;
|
|
132
147
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
133
148
|
size: number;
|
|
149
|
+
manifest?: {
|
|
150
|
+
files: {
|
|
151
|
+
path: string;
|
|
152
|
+
name: string;
|
|
153
|
+
}[];
|
|
154
|
+
} | undefined;
|
|
134
155
|
}[] | undefined;
|
|
135
156
|
}>>;
|
|
136
157
|
getProductLicenses: (productId: string, nextUrl?: string) => Promise<_moonbase_sh_storefront_api.Page<{
|
|
@@ -143,6 +164,7 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
143
164
|
currentVersion: string | null;
|
|
144
165
|
downloadsNeedsUser: boolean;
|
|
145
166
|
downloadsNeedsOwnership: boolean;
|
|
167
|
+
description?: string | null | undefined;
|
|
146
168
|
website?: string | undefined;
|
|
147
169
|
iconUrl?: string | undefined;
|
|
148
170
|
numberOfLicenses?: number | undefined;
|
|
@@ -158,6 +180,12 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
158
180
|
key: string;
|
|
159
181
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
160
182
|
size: number;
|
|
183
|
+
manifest?: {
|
|
184
|
+
files: {
|
|
185
|
+
path: string;
|
|
186
|
+
name: string;
|
|
187
|
+
}[];
|
|
188
|
+
} | undefined;
|
|
161
189
|
}[] | undefined;
|
|
162
190
|
};
|
|
163
191
|
activeNumberOfActivations: number;
|
|
@@ -184,6 +212,7 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
184
212
|
currentVersion: string | null;
|
|
185
213
|
downloadsNeedsUser: boolean;
|
|
186
214
|
downloadsNeedsOwnership: boolean;
|
|
215
|
+
description?: string | null | undefined;
|
|
187
216
|
website?: string | undefined;
|
|
188
217
|
iconUrl?: string | undefined;
|
|
189
218
|
numberOfLicenses?: number | undefined;
|
|
@@ -199,6 +228,12 @@ declare function useInventory(context?: StorefrontContext): {
|
|
|
199
228
|
key: string;
|
|
200
229
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
201
230
|
size: number;
|
|
231
|
+
manifest?: {
|
|
232
|
+
files: {
|
|
233
|
+
path: string;
|
|
234
|
+
name: string;
|
|
235
|
+
}[];
|
|
236
|
+
} | undefined;
|
|
202
237
|
}[] | undefined;
|
|
203
238
|
};
|
|
204
239
|
activeNumberOfActivations: number;
|
|
@@ -246,6 +281,12 @@ declare function useVoucher(context?: StorefrontContext): {
|
|
|
246
281
|
key: string;
|
|
247
282
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
248
283
|
size: number;
|
|
284
|
+
manifest?: {
|
|
285
|
+
files: {
|
|
286
|
+
path: string;
|
|
287
|
+
name: string;
|
|
288
|
+
}[];
|
|
289
|
+
} | undefined;
|
|
249
290
|
}[] | undefined;
|
|
250
291
|
defaultVariation?: {
|
|
251
292
|
id: string;
|
|
@@ -316,6 +357,12 @@ declare function useVoucher(context?: StorefrontContext): {
|
|
|
316
357
|
key: string;
|
|
317
358
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
318
359
|
size: number;
|
|
360
|
+
manifest?: {
|
|
361
|
+
files: {
|
|
362
|
+
path: string;
|
|
363
|
+
name: string;
|
|
364
|
+
}[];
|
|
365
|
+
} | undefined;
|
|
319
366
|
}[] | undefined;
|
|
320
367
|
defaultVariation?: {
|
|
321
368
|
id: string;
|
|
@@ -430,6 +477,12 @@ declare function useVoucher(context?: StorefrontContext): {
|
|
|
430
477
|
key: string;
|
|
431
478
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
432
479
|
size: number;
|
|
480
|
+
manifest?: {
|
|
481
|
+
files: {
|
|
482
|
+
path: string;
|
|
483
|
+
name: string;
|
|
484
|
+
}[];
|
|
485
|
+
} | undefined;
|
|
433
486
|
}[] | undefined;
|
|
434
487
|
defaultVariation?: {
|
|
435
488
|
id: string;
|
|
@@ -500,6 +553,12 @@ declare function useVoucher(context?: StorefrontContext): {
|
|
|
500
553
|
key: string;
|
|
501
554
|
platform: _moonbase_sh_storefront_api.Platform;
|
|
502
555
|
size: number;
|
|
556
|
+
manifest?: {
|
|
557
|
+
files: {
|
|
558
|
+
path: string;
|
|
559
|
+
name: string;
|
|
560
|
+
}[];
|
|
561
|
+
} | undefined;
|
|
503
562
|
}[] | undefined;
|
|
504
563
|
defaultVariation?: {
|
|
505
564
|
id: string;
|
|
@@ -825,6 +884,12 @@ declare function useAuth(context?: StorefrontContext): {
|
|
|
825
884
|
} | null>;
|
|
826
885
|
};
|
|
827
886
|
|
|
887
|
+
interface VendorComposable {
|
|
888
|
+
vendor: Ref<null | Vendor>;
|
|
889
|
+
loading: Ref<boolean>;
|
|
890
|
+
}
|
|
891
|
+
declare function useVendor(context?: StorefrontContext): VendorComposable;
|
|
892
|
+
|
|
828
893
|
declare const storefrontKey: InjectionKey<StorefrontContext>;
|
|
829
894
|
|
|
830
895
|
interface Cart {
|
|
@@ -833,4 +898,4 @@ interface Cart {
|
|
|
833
898
|
type CartItem = LineItem;
|
|
834
899
|
declare function createStorefront(endpoint: string, stateFactory?: StateFactory, config?: Omit<MoonbaseConfiguration, 'endpoint'>): StorefrontContext;
|
|
835
900
|
|
|
836
|
-
export { type ActivationRequestComposable, type Cart, type CartItem, createStorefront, storefrontKey, useActivationRequest, useAuth, useBundle, useBundles, useCart, useInventory, useProduct, useProducts, useVoucher };
|
|
901
|
+
export { type ActivationRequestComposable, type Cart, type CartItem, type VendorComposable, createStorefront, storefrontKey, useActivationRequest, useAuth, useBundle, useBundles, useCart, useInventory, useProduct, useProducts, useVendor, useVoucher };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
import { MoonbaseClient } from "@moonbase.sh/storefront-api";
|
|
3
|
-
import { ref as
|
|
3
|
+
import { ref as ref3 } from "vue";
|
|
4
4
|
|
|
5
5
|
// src/context.ts
|
|
6
6
|
import { v4 as uuidv4 } from "uuid";
|
|
@@ -724,6 +724,24 @@ function useAuth(context) {
|
|
|
724
724
|
};
|
|
725
725
|
}
|
|
726
726
|
|
|
727
|
+
// src/composables/useVendor.ts
|
|
728
|
+
import { inject as inject10, ref as ref2 } from "vue";
|
|
729
|
+
function useVendor(context) {
|
|
730
|
+
const storefront = context != null ? context : inject10(storefrontKey);
|
|
731
|
+
if (!storefront)
|
|
732
|
+
throw new Error("No storefront configured");
|
|
733
|
+
const vendor = ref2(null);
|
|
734
|
+
const loading = ref2(true);
|
|
735
|
+
storefront.client.vendor.get().then((v) => {
|
|
736
|
+
vendor.value = v;
|
|
737
|
+
loading.value = false;
|
|
738
|
+
});
|
|
739
|
+
return {
|
|
740
|
+
vendor,
|
|
741
|
+
loading
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
|
|
727
745
|
// src/index.ts
|
|
728
746
|
function createStorefront(endpoint, stateFactory, config) {
|
|
729
747
|
const configuration = {
|
|
@@ -734,7 +752,7 @@ function createStorefront(endpoint, stateFactory, config) {
|
|
|
734
752
|
configuration,
|
|
735
753
|
new MoonbaseClient(configuration),
|
|
736
754
|
// Default to vue refs but allow stuff like Nuxt useState wrappers
|
|
737
|
-
stateFactory || ((_, state) =>
|
|
755
|
+
stateFactory || ((_, state) => ref3(state))
|
|
738
756
|
);
|
|
739
757
|
}
|
|
740
758
|
export {
|
|
@@ -748,5 +766,6 @@ export {
|
|
|
748
766
|
useInventory,
|
|
749
767
|
useProduct,
|
|
750
768
|
useProducts,
|
|
769
|
+
useVendor,
|
|
751
770
|
useVoucher
|
|
752
771
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moonbase.sh/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.84",
|
|
5
5
|
"description": "Package to let you build vue.js storefronts with Moonbase.sh as payment and delivery provider",
|
|
6
6
|
"author": "Tobias Lønnerød Madsen <m@dsen.tv>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@vue/devtools-api": "^6.6.3",
|
|
20
20
|
"uuid": "^9.0.1",
|
|
21
21
|
"zod": "^3.23.8",
|
|
22
|
-
"@moonbase.sh/storefront-api": "0.2.
|
|
22
|
+
"@moonbase.sh/storefront-api": "0.2.84"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/uuid": "^9.0.8",
|