feat(next-utils): support generic schema in directus client
All checks were successful
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 34s
Monorepo Pipeline / 🧪 Test (push) Successful in 43s
Monorepo Pipeline / 🧹 Lint (push) Successful in 1m6s
Monorepo Pipeline / 🏗️ Build (push) Successful in 1m50s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
All checks were successful
Monorepo Pipeline / ⚡ Prioritize Release (push) Successful in 34s
Monorepo Pipeline / 🧪 Test (push) Successful in 43s
Monorepo Pipeline / 🧹 Lint (push) Successful in 1m6s
Monorepo Pipeline / 🏗️ Build (push) Successful in 1m50s
Monorepo Pipeline / 🚀 Release (push) Has been skipped
Monorepo Pipeline / 🐳 Build Directus (Base) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Gatekeeper (Product) (push) Has been skipped
Monorepo Pipeline / 🐳 Build Build-Base (push) Has been skipped
Monorepo Pipeline / 🐳 Build Production Runtime (push) Has been skipped
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@mintel/next-utils",
|
"name": "@mintel/next-utils",
|
||||||
"version": "1.7.8",
|
"version": "1.7.9",
|
||||||
"publishConfig": {
|
"publishConfig": {
|
||||||
"access": "public",
|
"access": "public",
|
||||||
"registry": "https://npm.infra.mintel.me"
|
"registry": "https://npm.infra.mintel.me"
|
||||||
|
|||||||
@@ -7,15 +7,16 @@ import {
|
|||||||
AuthenticationClient,
|
AuthenticationClient,
|
||||||
} from "@directus/sdk";
|
} from "@directus/sdk";
|
||||||
|
|
||||||
export type MintelDirectusClient = DirectusClient<any> &
|
export type MintelDirectusClient<Schema extends object = any> =
|
||||||
RestClient<any> &
|
DirectusClient<Schema> & RestClient<Schema> & AuthenticationClient<Schema>;
|
||||||
AuthenticationClient<any>;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a Directus client configured with Mintel standards.
|
* Creates a Directus client configured with Mintel standards.
|
||||||
* Automatically handles internal vs. external URLs based on environment.
|
* Automatically handles internal vs. external URLs based on environment.
|
||||||
*/
|
*/
|
||||||
export function createMintelDirectusClient(url?: string): MintelDirectusClient {
|
export function createMintelDirectusClient<Schema extends object = any>(
|
||||||
|
url?: string,
|
||||||
|
): MintelDirectusClient<Schema> {
|
||||||
const isServer = typeof window === "undefined";
|
const isServer = typeof window === "undefined";
|
||||||
|
|
||||||
// 1. If an explicit URL is provided, use it.
|
// 1. If an explicit URL is provided, use it.
|
||||||
|
|||||||
Reference in New Issue
Block a user