@scayle/omnichannel-nuxt 4.3.0 → 4.3.1
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 +6 -0
- package/dist/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/composables/useStoreLocator.d.ts +1 -1
- package/dist/runtime/composables/useVariantStores.d.ts +2 -2
- package/dist/runtime/lib/init.d.ts +2 -8
- package/dist/runtime/rpc/storeLocator.d.ts +2 -2
- package/dist/runtime/types/index.d.ts +7 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @scayle/omnichannel-nuxt
|
|
2
2
|
|
|
3
|
+
## 4.3.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Consistently type the `getStoresForVariant` RPC method, to avoid possible type errors when calling it directly or through the `useVariantStores` composable.
|
|
8
|
+
|
|
3
9
|
## 4.3.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineNuxtModule, isNuxtMajorVersion, createResolver, addImportsDir } from '@nuxt/kit';
|
|
2
2
|
|
|
3
3
|
const PACKAGE_NAME = "@scayle/omnichannel-nuxt";
|
|
4
|
-
const PACKAGE_VERSION = "4.3.
|
|
4
|
+
const PACKAGE_VERSION = "4.3.1";
|
|
5
5
|
const module = defineNuxtModule({
|
|
6
6
|
meta: {
|
|
7
7
|
name: PACKAGE_NAME,
|
|
@@ -5,5 +5,5 @@ export declare function useStoreLocator(key?: string, withProperties?: StoreWith
|
|
|
5
5
|
storeVariantData: import("vue").ComputedRef<import("../types/index.js").StoreAvailabilityCheck | null>;
|
|
6
6
|
refreshStoreVariant: (variantId: number, storeId: number) => Promise<void>;
|
|
7
7
|
variantStoresData: import("vue").ComputedRef<import("../types/index.js").VariantLocation | null>;
|
|
8
|
-
refreshVariantStores: (searchParams: import("../types/index.js").
|
|
8
|
+
refreshVariantStores: (searchParams: import("../types/index.js").GetStoresForVariantOptions) => Promise<void>;
|
|
9
9
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { GetStoresForVariantOptions, VariantLocation, StoreWithProperty } from '../types/index.js';
|
|
2
2
|
export declare function useVariantStores(key?: string, withProperties?: StoreWithProperty[]): {
|
|
3
3
|
data: import("vue").ComputedRef<VariantLocation | null>;
|
|
4
|
-
getData: (searchParams:
|
|
4
|
+
getData: (searchParams: GetStoresForVariantOptions) => Promise<void>;
|
|
5
5
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { StoreLocationResponse, StoreLocatorConfig, StoreLocatorSearchParams, StoreAvailabilityCheckResponse, VariantLocationResponse,
|
|
1
|
+
import type { StoreLocationResponse, StoreLocatorConfig, StoreLocatorSearchParams, StoreAvailabilityCheckResponse, VariantLocationResponse, FetchStoreVariantByIdParams, GetStoresForVariantOptions } from '../types/index.js';
|
|
2
2
|
/**
|
|
3
3
|
* A custom Error type for errors that occur in a fetch() request
|
|
4
4
|
* Contains the Response object from the request, and optionally the response data
|
|
@@ -8,7 +8,6 @@ export declare class FetchError extends Error {
|
|
|
8
8
|
data?: unknown;
|
|
9
9
|
constructor(response: Response, data?: unknown);
|
|
10
10
|
}
|
|
11
|
-
type DistributiveOmit<T, K extends PropertyKey> = T extends T ? Omit<T, K> : never;
|
|
12
11
|
export declare class OmnichannelClient {
|
|
13
12
|
private readonly host;
|
|
14
13
|
private readonly token;
|
|
@@ -17,12 +16,7 @@ export declare class OmnichannelClient {
|
|
|
17
16
|
get headers(): HeadersInit;
|
|
18
17
|
private handleResponse;
|
|
19
18
|
getStores(options: StoreLocatorSearchParams): Promise<StoreLocationResponse>;
|
|
20
|
-
getStoresForVariant(options:
|
|
21
|
-
filters: DistributiveOmit<VariantLocatorSearchParams['filters'], 'radius'> & {
|
|
22
|
-
radius?: number;
|
|
23
|
-
};
|
|
24
|
-
}): Promise<VariantLocationResponse>;
|
|
19
|
+
getStoresForVariant(options: GetStoresForVariantOptions): Promise<VariantLocationResponse>;
|
|
25
20
|
getStoreVariantById(options: FetchStoreVariantByIdParams): Promise<StoreAvailabilityCheckResponse>;
|
|
26
21
|
}
|
|
27
22
|
export declare const init: (config?: StoreLocatorConfig) => OmnichannelClient | null;
|
|
28
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { RpcContext } from '@scayle/storefront-nuxt';
|
|
2
|
-
import type { StoreLocatorSearchParams,
|
|
2
|
+
import type { StoreLocatorSearchParams, FetchStoreVariantByIdParams, VariantLocationResponse, StoreAvailabilityCheckResponse, StoreLocationResponse, GetStoresForVariantOptions } from '../types/index.js';
|
|
3
3
|
export declare const getStores: (options: StoreLocatorSearchParams, context: RpcContext) => Promise<StoreLocationResponse>;
|
|
4
|
-
export declare const getStoresForVariant: (options:
|
|
4
|
+
export declare const getStoresForVariant: (options: GetStoresForVariantOptions, context: RpcContext) => Promise<VariantLocationResponse>;
|
|
5
5
|
export declare const getStoreVariantById: (options: FetchStoreVariantByIdParams, context: RpcContext) => Promise<StoreAvailabilityCheckResponse>;
|
|
@@ -151,3 +151,10 @@ export interface FetchStoreVariantByIdParams {
|
|
|
151
151
|
variantId: number;
|
|
152
152
|
with?: StoreWithProperty[];
|
|
153
153
|
}
|
|
154
|
+
type DistributiveOmit<T, K extends PropertyKey> = T extends T ? Omit<T, K> : never;
|
|
155
|
+
export type GetStoresForVariantOptions = Omit<VariantLocatorSearchParams, 'filters'> & {
|
|
156
|
+
filters: DistributiveOmit<VariantLocatorSearchParams['filters'], 'radius'> & {
|
|
157
|
+
radius?: number;
|
|
158
|
+
};
|
|
159
|
+
};
|
|
160
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scayle/omnichannel-nuxt",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.1",
|
|
4
4
|
"description": "Collection of essential utilities to work with omnichannel",
|
|
5
5
|
"author": "SCAYLE Commerce Engine",
|
|
6
6
|
"license": "MIT",
|
|
@@ -68,20 +68,20 @@
|
|
|
68
68
|
"@arethetypeswrong/cli": "0.17.4",
|
|
69
69
|
"@nuxt/eslint": "1.3.0",
|
|
70
70
|
"@nuxt/module-builder": "1.0.1",
|
|
71
|
-
"@nuxt/schema": "3.
|
|
71
|
+
"@nuxt/schema": "3.16.2",
|
|
72
72
|
"@scayle/eslint-config-storefront": "4.5.0",
|
|
73
|
-
"@scayle/storefront-nuxt": "8.24.
|
|
73
|
+
"@scayle/storefront-nuxt": "8.24.1",
|
|
74
74
|
"@types/node": "22.14.1",
|
|
75
75
|
"@types/qs": "6.9.18",
|
|
76
76
|
"dprint": "0.49.1",
|
|
77
77
|
"eslint-formatter-gitlab": "5.1.0",
|
|
78
|
-
"eslint": "9.
|
|
78
|
+
"eslint": "9.25.1",
|
|
79
79
|
"h3": "1.15.0",
|
|
80
80
|
"nuxi": "3.24.1",
|
|
81
|
-
"nuxt": "3.
|
|
81
|
+
"nuxt": "3.16.2",
|
|
82
82
|
"typescript": "5.8.3",
|
|
83
83
|
"unbuild": "2.0.0",
|
|
84
|
-
"vitest": "3.1.
|
|
84
|
+
"vitest": "3.1.2",
|
|
85
85
|
"vue-tsc": "2.2.8",
|
|
86
86
|
"vue": "3.5.13"
|
|
87
87
|
},
|