added /dist
This commit is contained in:
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Thin wrapper over payload.findGlobal that keeps locale/depth handling in one
|
||||
* place. The plugin never calls getPayload itself — the caller passes the
|
||||
* instance (from getPayload in their app, or req.payload in a hook), matching
|
||||
* the plugin's data-access rule: logic here, instance from outside.
|
||||
*/ export { };
|
||||
|
||||
//# sourceMappingURL=getGlobal.d.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["getGlobal.d.ts"],"sourcesContent":["import type { BasePayload } from 'payload';\n/** Locale argument accepted by the global helpers. */\nexport type GlobalQueryOptions = {\n /** Relationship population depth. Defaults to Payload's config default. */\n depth?: number;\n /** Locale to fetch, or 'all' for every locale's values. Defaults to Payload's default. */\n locale?: string;\n};\n/**\n * Thin wrapper over payload.findGlobal that keeps locale/depth handling in one\n * place. The plugin never calls getPayload itself — the caller passes the\n * instance (from getPayload in their app, or req.payload in a hook), matching\n * the plugin's data-access rule: logic here, instance from outside.\n */\nexport declare function getGlobal<T = Record<string, unknown>>(payload: BasePayload, slug: string, options?: GlobalQueryOptions): Promise<T>;\n"],"names":[],"mappings":"AAQA;;;;;CAKC,GACD,WAA6I"}
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
import type { BasePayload } from 'payload';
|
||||
/** Locale argument accepted by the global helpers. */
|
||||
export type GlobalQueryOptions = {
|
||||
/** Relationship population depth. Defaults to Payload's config default. */
|
||||
depth?: number;
|
||||
/** Locale to fetch, or 'all' for every locale's values. Defaults to Payload's default. */
|
||||
locale?: string;
|
||||
};
|
||||
/**
|
||||
* Thin wrapper over payload.findGlobal that keeps locale/depth handling in one
|
||||
* place. The plugin never calls getPayload itself — the caller passes the
|
||||
* instance (from getPayload in their app, or req.payload in a hook), matching
|
||||
* the plugin's data-access rule: logic here, instance from outside.
|
||||
*/
|
||||
export declare function getGlobal<T = Record<string, unknown>>(payload: BasePayload, slug: string, options?: GlobalQueryOptions): Promise<T>;
|
||||
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Thin wrapper over payload.findGlobal that keeps locale/depth handling in one
|
||||
* place. The plugin never calls getPayload itself — the caller passes the
|
||||
* instance (from getPayload in their app, or req.payload in a hook), matching
|
||||
* the plugin's data-access rule: logic here, instance from outside.
|
||||
*/ export async function getGlobal(payload, slug, options = {}) {
|
||||
const result = await payload.findGlobal({
|
||||
slug,
|
||||
...options.locale ? {
|
||||
locale: options.locale
|
||||
} : {},
|
||||
...typeof options.depth === 'number' ? {
|
||||
depth: options.depth
|
||||
} : {}
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getGlobal.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/payload/getGlobal.ts"],"sourcesContent":["import type { BasePayload } from 'payload'\n\n/** Locale argument accepted by the global helpers. */\nexport type GlobalQueryOptions = {\n /** Relationship population depth. Defaults to Payload's config default. */\n depth?: number\n /** Locale to fetch, or 'all' for every locale's values. Defaults to Payload's default. */\n locale?: string\n}\n\n/**\n * Thin wrapper over payload.findGlobal that keeps locale/depth handling in one\n * place. The plugin never calls getPayload itself — the caller passes the\n * instance (from getPayload in their app, or req.payload in a hook), matching\n * the plugin's data-access rule: logic here, instance from outside.\n */\nexport async function getGlobal<T = Record<string, unknown>>(\n payload: BasePayload,\n slug: string,\n options: GlobalQueryOptions = {},\n): Promise<T> {\n const result = await payload.findGlobal({\n slug,\n ...(options.locale ? { locale: options.locale as never } : {}),\n ...(typeof options.depth === 'number' ? { depth: options.depth } : {}),\n })\n\n return result as T\n}\n"],"names":["getGlobal","payload","slug","options","result","findGlobal","locale","depth"],"mappings":"AAUA;;;;;CAKC,GACD,OAAO,eAAeA,UACpBC,OAAoB,EACpBC,IAAY,EACZC,UAA8B,CAAC,CAAC;IAEhC,MAAMC,SAAS,MAAMH,QAAQI,UAAU,CAAC;QACtCH;QACA,GAAIC,QAAQG,MAAM,GAAG;YAAEA,QAAQH,QAAQG,MAAM;QAAU,IAAI,CAAC,CAAC;QAC7D,GAAI,OAAOH,QAAQI,KAAK,KAAK,WAAW;YAAEA,OAAOJ,QAAQI,KAAK;QAAC,IAAI,CAAC,CAAC;IACvE;IAEA,OAAOH;AACT"}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* Fetches the SiteIntegrations global.
|
||||
*
|
||||
* This global is admin-only through access control, but the Local API bypasses
|
||||
* access control by default (overrideAccess: true), so server-side callers get
|
||||
* the secrets they need (SMTP password, Turnstile secret, R2 keys). Never
|
||||
* expose the raw result to the client — read the specific values you need
|
||||
* server-side and pass only what's safe to the browser.
|
||||
*
|
||||
* Generic over the return type so the client can pass their generated
|
||||
* `SiteIntegration` type.
|
||||
*
|
||||
* @example
|
||||
* import type { SiteIntegration } from '@/payload-types'
|
||||
* const integrations = await getSiteIntegrations<SiteIntegration>(payload)
|
||||
*/ export { };
|
||||
|
||||
//# sourceMappingURL=getSiteIntegrations.d.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["getSiteIntegrations.d.ts"],"sourcesContent":["import type { BasePayload } from 'payload';\nimport type { GlobalQueryOptions } from './getGlobal.js';\n/** Slug of the SiteIntegrations global defined by the plugin. */\nexport declare const SITE_INTEGRATIONS_SLUG = \"site-integrations\";\n/**\n * Fetches the SiteIntegrations global.\n *\n * This global is admin-only through access control, but the Local API bypasses\n * access control by default (overrideAccess: true), so server-side callers get\n * the secrets they need (SMTP password, Turnstile secret, R2 keys). Never\n * expose the raw result to the client — read the specific values you need\n * server-side and pass only what's safe to the browser.\n *\n * Generic over the return type so the client can pass their generated\n * `SiteIntegration` type.\n *\n * @example\n * import type { SiteIntegration } from '@/payload-types'\n * const integrations = await getSiteIntegrations<SiteIntegration>(payload)\n */\nexport declare function getSiteIntegrations<T = Record<string, unknown>>(payload: BasePayload, options?: GlobalQueryOptions): Promise<T>;\n"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;CAeC,GACD,WAAyI"}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
import type { BasePayload } from 'payload';
|
||||
import type { GlobalQueryOptions } from './getGlobal.js';
|
||||
/** Slug of the SiteIntegrations global defined by the plugin. */
|
||||
export declare const SITE_INTEGRATIONS_SLUG = "site-integrations";
|
||||
/**
|
||||
* Fetches the SiteIntegrations global.
|
||||
*
|
||||
* This global is admin-only through access control, but the Local API bypasses
|
||||
* access control by default (overrideAccess: true), so server-side callers get
|
||||
* the secrets they need (SMTP password, Turnstile secret, R2 keys). Never
|
||||
* expose the raw result to the client — read the specific values you need
|
||||
* server-side and pass only what's safe to the browser.
|
||||
*
|
||||
* Generic over the return type so the client can pass their generated
|
||||
* `SiteIntegration` type.
|
||||
*
|
||||
* @example
|
||||
* import type { SiteIntegration } from '@/payload-types'
|
||||
* const integrations = await getSiteIntegrations<SiteIntegration>(payload)
|
||||
*/
|
||||
export declare function getSiteIntegrations<T = Record<string, unknown>>(payload: BasePayload, options?: GlobalQueryOptions): Promise<T>;
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
import { getGlobal } from './getGlobal.js';
|
||||
/** Slug of the SiteIntegrations global defined by the plugin. */ export const SITE_INTEGRATIONS_SLUG = 'site-integrations';
|
||||
/**
|
||||
* Fetches the SiteIntegrations global.
|
||||
*
|
||||
* This global is admin-only through access control, but the Local API bypasses
|
||||
* access control by default (overrideAccess: true), so server-side callers get
|
||||
* the secrets they need (SMTP password, Turnstile secret, R2 keys). Never
|
||||
* expose the raw result to the client — read the specific values you need
|
||||
* server-side and pass only what's safe to the browser.
|
||||
*
|
||||
* Generic over the return type so the client can pass their generated
|
||||
* `SiteIntegration` type.
|
||||
*
|
||||
* @example
|
||||
* import type { SiteIntegration } from '@/payload-types'
|
||||
* const integrations = await getSiteIntegrations<SiteIntegration>(payload)
|
||||
*/ export function getSiteIntegrations(payload, options) {
|
||||
return getGlobal(payload, SITE_INTEGRATIONS_SLUG, options);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getSiteIntegrations.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/payload/getSiteIntegrations.ts"],"sourcesContent":["import type { BasePayload } from 'payload'\n\nimport type { GlobalQueryOptions } from './getGlobal.js'\n\nimport { getGlobal } from './getGlobal.js'\n\n/** Slug of the SiteIntegrations global defined by the plugin. */\nexport const SITE_INTEGRATIONS_SLUG = 'site-integrations'\n\n/**\n * Fetches the SiteIntegrations global.\n *\n * This global is admin-only through access control, but the Local API bypasses\n * access control by default (overrideAccess: true), so server-side callers get\n * the secrets they need (SMTP password, Turnstile secret, R2 keys). Never\n * expose the raw result to the client — read the specific values you need\n * server-side and pass only what's safe to the browser.\n *\n * Generic over the return type so the client can pass their generated\n * `SiteIntegration` type.\n *\n * @example\n * import type { SiteIntegration } from '@/payload-types'\n * const integrations = await getSiteIntegrations<SiteIntegration>(payload)\n */\nexport function getSiteIntegrations<T = Record<string, unknown>>(\n payload: BasePayload,\n options?: GlobalQueryOptions,\n): Promise<T> {\n return getGlobal<T>(payload, SITE_INTEGRATIONS_SLUG, options)\n}\n"],"names":["getGlobal","SITE_INTEGRATIONS_SLUG","getSiteIntegrations","payload","options"],"mappings":"AAIA,SAASA,SAAS,QAAQ,iBAAgB;AAE1C,+DAA+D,GAC/D,OAAO,MAAMC,yBAAyB,oBAAmB;AAEzD;;;;;;;;;;;;;;;CAeC,GACD,OAAO,SAASC,oBACdC,OAAoB,EACpBC,OAA4B;IAE5B,OAAOJ,UAAaG,SAASF,wBAAwBG;AACvD"}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
/**
|
||||
* Fetches the SiteSettings global.
|
||||
*
|
||||
* Generic over the return type so the client can pass their generated
|
||||
* `SiteSetting` type for full type safety, while still working without it.
|
||||
*
|
||||
* @example
|
||||
* import type { SiteSetting } from '@/payload-types'
|
||||
* const settings = await getSiteSettings<SiteSetting>(payload, { locale: 'pl' })
|
||||
*/ export { };
|
||||
|
||||
//# sourceMappingURL=getSiteSettings.d.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["getSiteSettings.d.ts"],"sourcesContent":["import type { BasePayload } from 'payload';\nimport type { GlobalQueryOptions } from './getGlobal.js';\n/** Slug of the SiteSettings global defined by the plugin. */\nexport declare const SITE_SETTINGS_SLUG = \"site-settings\";\n/**\n * Fetches the SiteSettings global.\n *\n * Generic over the return type so the client can pass their generated\n * `SiteSetting` type for full type safety, while still working without it.\n *\n * @example\n * import type { SiteSetting } from '@/payload-types'\n * const settings = await getSiteSettings<SiteSetting>(payload, { locale: 'pl' })\n */\nexport declare function getSiteSettings<T = Record<string, unknown>>(payload: BasePayload, options?: GlobalQueryOptions): Promise<T>;\n"],"names":[],"mappings":"AAIA;;;;;;;;;CASC,GACD,WAAqI"}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import type { BasePayload } from 'payload';
|
||||
import type { GlobalQueryOptions } from './getGlobal.js';
|
||||
/** Slug of the SiteSettings global defined by the plugin. */
|
||||
export declare const SITE_SETTINGS_SLUG = "site-settings";
|
||||
/**
|
||||
* Fetches the SiteSettings global.
|
||||
*
|
||||
* Generic over the return type so the client can pass their generated
|
||||
* `SiteSetting` type for full type safety, while still working without it.
|
||||
*
|
||||
* @example
|
||||
* import type { SiteSetting } from '@/payload-types'
|
||||
* const settings = await getSiteSettings<SiteSetting>(payload, { locale: 'pl' })
|
||||
*/
|
||||
export declare function getSiteSettings<T = Record<string, unknown>>(payload: BasePayload, options?: GlobalQueryOptions): Promise<T>;
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
import { getGlobal } from './getGlobal.js';
|
||||
/** Slug of the SiteSettings global defined by the plugin. */ export const SITE_SETTINGS_SLUG = 'site-settings';
|
||||
/**
|
||||
* Fetches the SiteSettings global.
|
||||
*
|
||||
* Generic over the return type so the client can pass their generated
|
||||
* `SiteSetting` type for full type safety, while still working without it.
|
||||
*
|
||||
* @example
|
||||
* import type { SiteSetting } from '@/payload-types'
|
||||
* const settings = await getSiteSettings<SiteSetting>(payload, { locale: 'pl' })
|
||||
*/ export function getSiteSettings(payload, options) {
|
||||
return getGlobal(payload, SITE_SETTINGS_SLUG, options);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=getSiteSettings.js.map
|
||||
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/payload/getSiteSettings.ts"],"sourcesContent":["import type { BasePayload } from 'payload'\n\nimport type { GlobalQueryOptions } from './getGlobal.js'\n\nimport { getGlobal } from './getGlobal.js'\n\n/** Slug of the SiteSettings global defined by the plugin. */\nexport const SITE_SETTINGS_SLUG = 'site-settings'\n\n/**\n * Fetches the SiteSettings global.\n *\n * Generic over the return type so the client can pass their generated\n * `SiteSetting` type for full type safety, while still working without it.\n *\n * @example\n * import type { SiteSetting } from '@/payload-types'\n * const settings = await getSiteSettings<SiteSetting>(payload, { locale: 'pl' })\n */\nexport function getSiteSettings<T = Record<string, unknown>>(\n payload: BasePayload,\n options?: GlobalQueryOptions,\n): Promise<T> {\n return getGlobal<T>(payload, SITE_SETTINGS_SLUG, options)\n}\n"],"names":["getGlobal","SITE_SETTINGS_SLUG","getSiteSettings","payload","options"],"mappings":"AAIA,SAASA,SAAS,QAAQ,iBAAgB;AAE1C,2DAA2D,GAC3D,OAAO,MAAMC,qBAAqB,gBAAe;AAEjD;;;;;;;;;CASC,GACD,OAAO,SAASC,gBACdC,OAAoB,EACpBC,OAA4B;IAE5B,OAAOJ,UAAaG,SAASF,oBAAoBG;AACnD"}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
export { getGlobal } from './getGlobal.js';
|
||||
export { getSiteIntegrations, SITE_INTEGRATIONS_SLUG } from './getSiteIntegrations.js';
|
||||
export { getSiteSettings, SITE_SETTINGS_SLUG } from './getSiteSettings.js';
|
||||
|
||||
//# sourceMappingURL=index.d.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["index.d.ts"],"sourcesContent":["export type { GlobalQueryOptions } from './getGlobal.js';\nexport { getGlobal } from './getGlobal.js';\nexport { getSiteIntegrations, SITE_INTEGRATIONS_SLUG } from './getSiteIntegrations.js';\nexport { getSiteSettings, SITE_SETTINGS_SLUG } from './getSiteSettings.js';\n"],"names":["getGlobal","getSiteIntegrations","SITE_INTEGRATIONS_SLUG","getSiteSettings","SITE_SETTINGS_SLUG"],"mappings":"AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,mBAAmB,EAAEC,sBAAsB,QAAQ,2BAA2B;AACvF,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,uBAAuB"}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
export type { GlobalQueryOptions } from './getGlobal.js';
|
||||
export { getGlobal } from './getGlobal.js';
|
||||
export { getSiteIntegrations, SITE_INTEGRATIONS_SLUG } from './getSiteIntegrations.js';
|
||||
export { getSiteSettings, SITE_SETTINGS_SLUG } from './getSiteSettings.js';
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
export { getGlobal } from './getGlobal.js';
|
||||
export { getSiteIntegrations, SITE_INTEGRATIONS_SLUG } from './getSiteIntegrations.js';
|
||||
export { getSiteSettings, SITE_SETTINGS_SLUG } from './getSiteSettings.js';
|
||||
|
||||
//# sourceMappingURL=index.js.map
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
{"version":3,"sources":["../../../src/modules/payload/index.ts"],"sourcesContent":["export type { GlobalQueryOptions } from './getGlobal.js'\nexport { getGlobal } from './getGlobal.js'\nexport { getSiteIntegrations, SITE_INTEGRATIONS_SLUG } from './getSiteIntegrations.js'\nexport { getSiteSettings, SITE_SETTINGS_SLUG } from './getSiteSettings.js'\n"],"names":["getGlobal","getSiteIntegrations","SITE_INTEGRATIONS_SLUG","getSiteSettings","SITE_SETTINGS_SLUG"],"mappings":"AACA,SAASA,SAAS,QAAQ,iBAAgB;AAC1C,SAASC,mBAAmB,EAAEC,sBAAsB,QAAQ,2BAA0B;AACtF,SAASC,eAAe,EAAEC,kBAAkB,QAAQ,uBAAsB"}
|
||||
Reference in New Issue
Block a user