@haus-storefront-react/vendure-plugin-configs 1.0.4-next.5 → 1.0.4-next.7
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/CHANGELOG.md +793 -767
- package/lib/configs/vendure-badge-plugin.d.ts +10 -2
- package/lib/configs/vendure-badge-plugin.types.d.ts +0 -1
- package/lib/configs/vendure-campaign-plugin.d.ts +1 -1
- package/lib/configs/vendure-elastic-search-plugin.d.ts +1 -1
- package/lib/configs/vendure-packagesize-plugin.d.ts +1 -1
- package/lib/configs/vendure-product-popularity-plugin.d.ts +1 -1
- package/lib/configs/vendure-product-variant-specifications-plugin.d.ts +1 -1
- package/lib/configs/vendure-products-by-sku-plugin.d.ts +11 -0
- package/lib/configs/vendure-products-by-sku-plugin.types.d.ts +13 -0
- package/lib/configs/vendure-purchase-order-payment-plugin.d.ts +2 -2
- package/lib/exports/products-by-sku.d.ts +3 -0
- package/lib/plugin-config.d.ts +2 -1
- package/lib/strategies/quick-order-variant-sku-validation-strategy.d.ts +6 -0
- package/package.json +13 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Asset, Collection } from '@haus-storefront-react/shared-types';
|
|
1
|
+
import { Asset, Collection, ErrorResult, PaginatedList } from '@haus-storefront-react/shared-types';
|
|
2
2
|
import { VendurePluginConfig } from '../plugin-config';
|
|
3
3
|
import { BadgeFeatures, BadgePluginRequests, BadgePluginSettings } from './vendure-badge-plugin.types';
|
|
4
4
|
declare module '@haus-storefront-react/shared-types' {
|
|
@@ -15,7 +15,15 @@ declare module '@haus-storefront-react/shared-types' {
|
|
|
15
15
|
showBadges: BadgeFeatures['showBadges'];
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
declare module '@haus-storefront-react/core' {
|
|
19
|
+
interface VendureSDK {
|
|
20
|
+
/** Added by VendureBadgePlugin when enabled */
|
|
21
|
+
badges?: (options: {
|
|
22
|
+
collectionId: string;
|
|
23
|
+
}) => Promise<PaginatedList<Badge> | ErrorResult>;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export declare const VendureBadgePlugin: VendurePluginConfig<BadgeFeatures, BadgePluginRequests, BadgePluginSettings, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
|
|
19
27
|
export type Badge = {
|
|
20
28
|
id: string;
|
|
21
29
|
createdAt: string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Badge, ErrorResult, Maybe, PaginatedList, Product, ProductVariant, SearchResult } from '@haus-storefront-react/shared-types';
|
|
2
2
|
export interface BadgePluginRequests {
|
|
3
|
-
[key: string]: (...args: unknown[]) => unknown;
|
|
4
3
|
getBadges: () => Promise<PaginatedList<Badge> | ErrorResult>;
|
|
5
4
|
}
|
|
6
5
|
export interface BadgeFeatures {
|
|
@@ -18,5 +18,5 @@ declare module '@haus-storefront-react/shared-types' {
|
|
|
18
18
|
}
|
|
19
19
|
export declare const VendureCampaignPlugin: VendurePluginConfig<CampaignFeatures, Record<string, (...args: any[]) => any>, {
|
|
20
20
|
[x: string]: any;
|
|
21
|
-
}, import('
|
|
21
|
+
}, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
|
|
22
22
|
export declare const isCampaign: (ordinaryPrice: PriceRange | SinglePrice | number, currentPrice: PriceRange | SinglePrice | number) => boolean;
|
|
@@ -65,4 +65,4 @@ export declare const VendureElasticSearchPlugin: VendurePluginConfig<Partial<{
|
|
|
65
65
|
sortByPopularity: boolean;
|
|
66
66
|
}>, Record<string, (...args: any[]) => any>, {
|
|
67
67
|
[x: string]: any;
|
|
68
|
-
}, import('
|
|
68
|
+
}, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
|
|
@@ -33,4 +33,4 @@ declare module '@haus-storefront-react/shared-types' {
|
|
|
33
33
|
}
|
|
34
34
|
export declare const VendurePackageSizePlugin: VendurePluginConfig<PackageSizeFeatures, Record<string, (...args: any[]) => any>, {
|
|
35
35
|
[x: string]: any;
|
|
36
|
-
}, import('
|
|
36
|
+
}, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
|
|
@@ -40,4 +40,4 @@ declare module '@haus-storefront-react/shared-types' {
|
|
|
40
40
|
}
|
|
41
41
|
export declare const VendureProductPopularityPlugin: VendurePluginConfig<ProductPopularityFeatures, Record<string, (...args: any[]) => any>, {
|
|
42
42
|
[x: string]: any;
|
|
43
|
-
}, import('
|
|
43
|
+
}, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
|
|
@@ -52,4 +52,4 @@ export declare const VendureProductVariantSpecificationsPlugin: VendurePluginCon
|
|
|
52
52
|
sortByPopularity: boolean;
|
|
53
53
|
}>, Record<string, (...args: any[]) => any>, {
|
|
54
54
|
[x: string]: any;
|
|
55
|
-
}, import('
|
|
55
|
+
}, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { VendurePluginConfig } from '../plugin-config';
|
|
2
|
+
import { ProductVariantBySkuResult, ProductsBySkuPluginRequests } from './vendure-products-by-sku-plugin.types';
|
|
3
|
+
declare module '@haus-storefront-react/core' {
|
|
4
|
+
interface VendureSDK {
|
|
5
|
+
/** Added by VendureProductsBySkuPlugin when enabled */
|
|
6
|
+
productVariantsBySkus?: (skus: string[]) => Promise<ProductVariantBySkuResult>;
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export declare const VendureProductsBySkuPlugin: VendurePluginConfig<Record<string, never>, ProductsBySkuPluginRequests, {
|
|
10
|
+
[x: string]: any;
|
|
11
|
+
}, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ErrorResult } from '@haus-storefront-react/shared-types';
|
|
2
|
+
interface ProductVariantBySku {
|
|
3
|
+
sku: string;
|
|
4
|
+
variantId: string | null;
|
|
5
|
+
}
|
|
6
|
+
export interface ProductVariantBySkuResult {
|
|
7
|
+
variantIdsBySku: Array<ProductVariantBySku>;
|
|
8
|
+
errorResults: Array<ErrorResult>;
|
|
9
|
+
}
|
|
10
|
+
export interface ProductsBySkuPluginRequests {
|
|
11
|
+
productVariantsBySkus: (skus: string[]) => Promise<ProductVariantBySkuResult | ErrorResult>;
|
|
12
|
+
}
|
|
13
|
+
export {};
|
|
@@ -2,7 +2,7 @@ import { ErrorResult, Order } from '@haus-storefront-react/shared-types';
|
|
|
2
2
|
import { VendurePluginConfig } from '../plugin-config';
|
|
3
3
|
import { AddPurchaseOrderPaymentToOrderInput, PurchaseOrderPaymentPluginRequests } from './vendure-purchase-order-payment-plugin.types';
|
|
4
4
|
declare module '@haus-storefront-react/core' {
|
|
5
|
-
interface
|
|
5
|
+
interface VendureSDK {
|
|
6
6
|
addPurchaseOrderPaymentToOrder?: (input: AddPurchaseOrderPaymentToOrderInput) => Promise<Order | ErrorResult>;
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -11,4 +11,4 @@ declare module '@haus-storefront-react/core' {
|
|
|
11
11
|
*/
|
|
12
12
|
export declare const VendurePurchaseOrderPaymentPlugin: VendurePluginConfig<Record<string, never>, PurchaseOrderPaymentPluginRequests, {
|
|
13
13
|
[x: string]: any;
|
|
14
|
-
}, import('
|
|
14
|
+
}, import('../../../../../providers/src/vendure/index.ts').VendureSDK>;
|
package/lib/plugin-config.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BuilderQueryUpdates, IVendurePluginConfig, PluginFeatures, ProviderDataMap, IGraphQLSDK } from '@haus-storefront-react/shared-types';
|
|
2
|
+
import { VendureSDK } from '../../../../providers/src/vendure/index.ts';
|
|
2
3
|
type PluginSettings = Record<string, any>;
|
|
3
4
|
export type VendurePluginConfigInput<Features, R, S, T extends IGraphQLSDK = IGraphQLSDK> = {
|
|
4
5
|
name: string;
|
|
@@ -10,7 +11,7 @@ export type VendurePluginConfigInput<Features, R, S, T extends IGraphQLSDK = IGr
|
|
|
10
11
|
settings?: S;
|
|
11
12
|
onSdkReady?: (sdk: T) => void | Promise<void>;
|
|
12
13
|
};
|
|
13
|
-
export declare class VendurePluginConfig<Features extends PluginFeatures = PluginFeatures, R extends
|
|
14
|
+
export declare class VendurePluginConfig<Features extends PluginFeatures = PluginFeatures, R extends object = Record<string, (...args: any[]) => any>, S extends PluginSettings = PluginSettings, T extends VendureSDK = VendureSDK> implements IVendurePluginConfig<Features, R, S, T> {
|
|
14
15
|
sdk: T;
|
|
15
16
|
name: IVendurePluginConfig<Features, R, S, T>['name'];
|
|
16
17
|
enabled: boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { QuickOrderVariantValidationStrategy } from '@haus-storefront-react/strategies';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a validation strategy that resolves SKUs to variant IDs using productVariantsBySkus.
|
|
4
|
+
* Use with QuickOrder.Root validationStrategy prop when VendureProductsBySkuPlugin is enabled.
|
|
5
|
+
*/
|
|
6
|
+
export declare function quickOrderVariantSkuValidationStrategy(): QuickOrderVariantValidationStrategy;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@haus-storefront-react/vendure-plugin-configs",
|
|
3
|
-
"version": "1.0.4-next.
|
|
3
|
+
"version": "1.0.4-next.7",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"types": "./index.d.ts",
|
|
6
6
|
"exports": {
|
|
@@ -45,6 +45,12 @@
|
|
|
45
45
|
"require": "./product-popularity.js",
|
|
46
46
|
"default": "./product-popularity"
|
|
47
47
|
},
|
|
48
|
+
"./products-by-sku": {
|
|
49
|
+
"types": "./lib/exports/products-by-sku.d.ts",
|
|
50
|
+
"import": "./products-by-sku.mjs",
|
|
51
|
+
"require": "./products-by-sku.js",
|
|
52
|
+
"default": "./products-by-sku"
|
|
53
|
+
},
|
|
48
54
|
"./product-variant-specifications": {
|
|
49
55
|
"types": "./lib/exports/product-variant-specifications.d.ts",
|
|
50
56
|
"import": "./product-variant-specifications.mjs",
|
|
@@ -53,10 +59,12 @@
|
|
|
53
59
|
}
|
|
54
60
|
},
|
|
55
61
|
"dependencies": {
|
|
56
|
-
"@haus-storefront-react/common-utils": "1.0.4-next.
|
|
57
|
-
"@haus-storefront-react/core": "1.0.4-next.
|
|
58
|
-
"@haus-storefront-react/providers": "1.0.4-next.
|
|
59
|
-
"@haus-storefront-react/
|
|
62
|
+
"@haus-storefront-react/common-utils": "1.0.4-next.7",
|
|
63
|
+
"@haus-storefront-react/core": "1.0.4-next.7",
|
|
64
|
+
"@haus-storefront-react/providers": "1.0.4-next.7",
|
|
65
|
+
"@haus-storefront-react/quick-order": "1.0.0-next.1",
|
|
66
|
+
"@haus-storefront-react/shared-types": "1.0.4-next.7",
|
|
67
|
+
"@haus-storefront-react/strategies": "1.0.4-next.7"
|
|
60
68
|
},
|
|
61
69
|
"publishConfig": {
|
|
62
70
|
"access": "restricted"
|