@merkaly/nuxt 0.7.1 → 0.7.2
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/module.json
CHANGED
|
@@ -81,8 +81,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
81
81
|
}>, {
|
|
82
82
|
mode: PlaceTypes;
|
|
83
83
|
disabled: boolean;
|
|
84
|
-
countries: string[];
|
|
85
84
|
placeholder: string;
|
|
85
|
+
countries: string[];
|
|
86
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
87
87
|
declare const _default: typeof __VLS_export;
|
|
88
88
|
export default _default;
|
|
@@ -81,8 +81,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
81
81
|
}>, {
|
|
82
82
|
mode: PlaceTypes;
|
|
83
83
|
disabled: boolean;
|
|
84
|
-
countries: string[];
|
|
85
84
|
placeholder: string;
|
|
85
|
+
countries: string[];
|
|
86
86
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
87
87
|
declare const _default: typeof __VLS_export;
|
|
88
88
|
export default _default;
|
|
@@ -41,6 +41,7 @@ export interface ParamsOptions {
|
|
|
41
41
|
headers?: FetchOptions['headers'];
|
|
42
42
|
method?: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
43
43
|
query?: FetchOptions['query'];
|
|
44
|
+
requiresTenant?: boolean;
|
|
44
45
|
timeout?: FetchOptions['timeout'];
|
|
45
46
|
}
|
|
46
47
|
export type ApiOptions<TData = unknown, TMeta = Record<string, unknown>, TParams = object> = ParamsOptions & HooksOptions<TData, TMeta, TParams> & RefOptions & {
|
|
@@ -5,7 +5,8 @@ export default defineNuxtPlugin(({ provide }) => provide("api", async (url, opti
|
|
|
5
5
|
const { token } = useAuth();
|
|
6
6
|
const { tenant } = useTenant();
|
|
7
7
|
const { public: { merkaly } } = useRuntimeConfig();
|
|
8
|
-
|
|
8
|
+
const requiresTenant = options.requiresTenant ?? merkaly.auth0.requiresTenant;
|
|
9
|
+
if (!tenant.value && !options.global && requiresTenant) {
|
|
9
10
|
throw new Error(
|
|
10
11
|
`[api] Tenant context is required but not set for: ${url}
|
|
11
12
|
This surface has requiresTenant: true. Possible causes:
|