@sanity/sdk 3.4.0 → 3.5.0-next.20260922190712
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/_exports/_internal.d.ts +3 -3
- package/dist/_exports/_internal.d.ts.map +1 -1
- package/dist/_exports/_internal.js +1 -1
- package/dist/_exports/_internal.js.map +1 -1
- package/dist/_exports/comlink.d.ts +1 -1
- package/dist/_exports/dashboard.d.ts +2 -2
- package/dist/{applications-Bb-0Kgkc.d.ts → applications-CBb2hFzg.d.ts} +12 -5
- package/dist/applications-CBb2hFzg.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/{topicStore-fPK2CfqH.d.ts → topicStore-BcXGGrbc.d.ts} +22 -5
- package/dist/topicStore-BcXGGrbc.d.ts.map +1 -0
- package/dist/topicStore-CPhGph6z.js.map +1 -1
- package/dist/{version-C7m7OAy9.js → version-DU5YxpGn.js} +3 -3
- package/dist/{version-C7m7OAy9.js.map → version-DU5YxpGn.js.map} +1 -1
- package/package.json +1 -1
- package/src/_exports/dashboard.ts +1 -0
- package/src/applications/applicationOrigin.ts +3 -1
- package/src/auth/oauth/oauthActions.test.ts +19 -4
- package/src/auth/oauth/oauthActions.ts +23 -6
- package/src/dashboard/messageBus/topics.test.ts +9 -2
- package/src/dashboard/messageBus/topics.ts +20 -2
- package/src/installations/installations.ts +4 -0
- package/dist/applications-Bb-0Kgkc.d.ts.map +0 -1
- package/dist/topicStore-fPK2CfqH.d.ts.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { m as SanityConfig, s as DocumentResource, t as SanityInstance } from "../createSanityInstance-BQIqyGLX.js";
|
|
2
|
-
import { Ai as CacheWriter, Ar as getCommentsOptionsKey, Bi as BoundStoreAction, Et as GetUsersOptions, Fi as MutationResult, G as getQueryKey, Ii as defineFetcher, Li as defineMutation, Mi as FetcherDefinition, Mr as parseCommentsOptionsKey, Ni as FetcherSnapshot, Pi as MutationDefinition, Sr as createLogger, ct as PreviewValue, ji as Fetcher, ki as CacheTag, q as parseQueryKey, r as ApplicationBase, st as PreviewQueryResult } from "../applications-
|
|
3
|
-
import { D as ApplicationStatus,
|
|
2
|
+
import { Ai as CacheWriter, Ar as getCommentsOptionsKey, Bi as BoundStoreAction, Et as GetUsersOptions, Fi as MutationResult, G as getQueryKey, Ii as defineFetcher, Li as defineMutation, Mi as FetcherDefinition, Mr as parseCommentsOptionsKey, Ni as FetcherSnapshot, Pi as MutationDefinition, Sr as createLogger, ct as PreviewValue, ji as Fetcher, ki as CacheTag, q as parseQueryKey, r as ApplicationBase, st as PreviewQueryResult } from "../applications-CBb2hFzg.js";
|
|
3
|
+
import { D as ApplicationStatus, I as MessageBusTopics, O as ApplicationStatusUpdate, S as resetMessageBus, i as resolveTopic, o as InstallMessageBusOptions, r as getTopicState, u as MessageBusConnection, x as installMessageBus } from "../topicStore-BcXGGrbc.js";
|
|
4
4
|
import { ClientError, SanityClient } from "@sanity/client";
|
|
5
5
|
import { Observable } from "rxjs";
|
|
6
6
|
import { CurrentUser } from "@sanity/types";
|
|
@@ -11,7 +11,7 @@ import { CurrentUser } from "@sanity/types";
|
|
|
11
11
|
*
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
|
-
export declare function getApplicationOrigin(application: ApplicationBase): string | null;
|
|
14
|
+
export declare function getApplicationOrigin(application: Pick<ApplicationBase, 'externalUrl' | 'slug' | 'isSingleton' | 'organizationId'>): string | null;
|
|
15
15
|
/**
|
|
16
16
|
* Returns `true` when the config indicates the SDK is running inside a Studio.
|
|
17
17
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_internal.d.ts","names":[],"sources":["../../src/applications/applicationOrigin.ts","../../src/auth/authMode.ts","../../src/auth/utils.ts","../../src/dashboard/messageBus/store.ts","../../src/preview/previewConstants.ts","../../src/preview/previewProjectionUtils.ts","../../src/telemetry/telemetryManager.ts","../../src/telemetry/initTelemetry.ts","../../src/users/reducers.ts","../../src/utils/createGroqSearchFilter.ts","../../src/utils/ids.ts","../../src/utils/object.ts"],"mappings":";;;;;;;;;;;;;wBAWgB,
|
|
1
|
+
{"version":3,"file":"_internal.d.ts","names":[],"sources":["../../src/applications/applicationOrigin.ts","../../src/auth/authMode.ts","../../src/auth/utils.ts","../../src/dashboard/messageBus/store.ts","../../src/preview/previewConstants.ts","../../src/preview/previewProjectionUtils.ts","../../src/telemetry/telemetryManager.ts","../../src/telemetry/initTelemetry.ts","../../src/users/reducers.ts","../../src/utils/createGroqSearchFilter.ts","../../src/utils/ids.ts","../../src/utils/object.ts"],"mappings":";;;;;;;;;;;;;wBAWgB,qBACd,aAAa,KAAK;;;;;;wBC+BJ,eAAe,QAAQ;;KCqI3B;EACV;IAAS;IAAe;;EACxB;EACA;EACA;;;wBAIc,sBAAsB,OAAO,cAAc;;wBAM3C,sBAAsB,OAAO;;wBAM7B,6BAA6B,OAAO;;wBAMpC,iCAAiC,OAAO;UCrM9C;EACR,aAAa;;;;;;;;;;;;qBA2BF,wBAAsB,iBAAA,2BAAA,gCAAA,qBAAA;;;;;;wBAkBnB,2BACd,UAAU,gBACV,iBACC;;;;;;;;;;wBAiBa;;;;;;;qBCjDH;;;;;;;;;;wBCiDG,6BACd,UAAU,gBACV,kBAAkB,oBAClB,WAAW,mBACV;;;;;;;;;;;;UC3Cc;;;;;;;EAOf,gBAAgB;;EAGhB,kBAAkB;IAAO;IAAmB;IAAqB;;;EAGjE,iBAAiB;;EAGjB,SAAS,mBAAmB;;EAG5B;;EAGA;;WAGS,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;wBCXN,cAAc,UAAU,gBAAgB;;;;;;;wBAoIxC,oBAAoB,UAAU,iBAAiB;;;;;;;;wBAW/C,iBAAiB,UAAU,gBAAgB;;qBCvL9C,cACX,UAAU,kBACV,cAAA,gBAAA,WAAA,WAAA,WAMG;;qBAWQ,gBACX;EAEA;EACA;EACA;EACA;EACA;;;;;;;;;;;;;;;wBCYc,uBAAuB;;;;;;;;;;;wBChCvB,SAAS;;;;;;;;;;;wBAsBT;;;;;;wBCIA,eAAe,kBAAkB,gBAAgB,GAC/D,OAAO,GACP,eAAe,MACd,KAAK,GAAG;;;;;;;;wBA2DK,YAAY,GAAG,MAAM,GAAG,OAAO"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { A as __exportAll, C as isStudioConfig, _ as getClientErrorApiDescription, g as getClientErrorApiBody, k as createLogger, n as getClient, v as getClientErrorApiType, x as isProjectUserNotFoundClientError } from "../clientStore-CD-USpIU.js";
|
|
2
|
-
import { G as defineMutation, K as randomId, S as getCommentsOptionsKey, W as defineFetcher, d as getUsersKey, i as parseQueryKey, n as getQueryKey, p as parseUsersKey, q as randomUuid, t as CORE_SDK_VERSION, w as parseCommentsOptionsKey } from "../version-
|
|
2
|
+
import { G as defineMutation, K as randomId, S as getCommentsOptionsKey, W as defineFetcher, d as getUsersKey, i as parseQueryKey, n as getQueryKey, p as parseUsersKey, q as randomUuid, t as CORE_SDK_VERSION, w as parseCommentsOptionsKey } from "../version-DU5YxpGn.js";
|
|
3
3
|
import { i as pickProperties, n as isObject, t as isDeepEqual } from "../object-CxXlSVg7.js";
|
|
4
4
|
import { a as isDashboardEnvironment, i as getDashboardMessageBus, l as installMessageBus, n as getTopicState, o as requireDashboardMessageBus, r as resolveTopic, u as resetMessageBus } from "../topicStore-CPhGph6z.js";
|
|
5
5
|
import "@sanity/client";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_internal.js","names":[],"sources":["../../src/applications/applicationOrigin.ts","../../src/preview/previewConstants.ts","../../src/preview/previewProjectionUtils.ts","../../src/telemetry/environment.ts","../../src/telemetry/events.ts","../../src/telemetry/telemetryManager.ts","../../src/telemetry/initTelemetry.ts","../../src/utils/createGroqSearchFilter.ts"],"sourcesContent":["import {type ApplicationBase} from './applications'\n\ntype SanityGlobal = typeof globalThis & {__SANITY_STAGING__?: boolean}\n\n/**\n * The origin an application is served from, or `null` when it has neither an external URL nor\n * a slug to derive one from. Callers treat `null` as \"nothing to load\" rather than failing the\n * whole list on one bad record.\n *\n * @internal\n */\nexport function getApplicationOrigin(application: ApplicationBase): string | null {\n if (application.externalUrl !== null) return new URL(application.externalUrl).origin\n if (application.slug === null) return null\n\n // Read at runtime, not via a bundler define: a remote is built once and runs in whichever\n // host page loaded it, and the host sets this flag. Mirrors workbench's `getSanityEnv`.\n const staging = (globalThis as SanityGlobal).__SANITY_STAGING__ === true\n if (application.isSingleton) {\n const domain = staging ? 'run.sanity.work' : 'sanity.run'\n return `https://${application.slug}-apps-${application.organizationId}.${domain}`\n }\n\n const domain = staging ? 'studio.sanity.work' : 'sanity.studio'\n return `https://${application.slug}.${domain}`\n}\n","/**\n * The fields to check for a title.\n * The order of the items in the array defines the priority.\n *\n * @internal\n */\nexport const TITLE_CANDIDATES = ['title', 'name', 'label', 'heading', 'header', 'caption']\n\n/**\n * The fields to check for a subtitle.\n * The order of the items in the array defines the priority.\n *\n * @internal\n */\nexport const SUBTITLE_CANDIDATES = ['description', 'subtitle', ...TITLE_CANDIDATES]\n\n/**\n * Generates a GROQ projection for preview data without requiring a schema.\n * Uses common field names to make educated guesses about which fields to use.\n *\n * @internal\n */\nexport const PREVIEW_PROJECTION = `{\n // Get all potential title fields\n \"titleCandidates\": {\n ${TITLE_CANDIDATES.map((field) => `\"${field}\": ${field}`).join(',\\n ')}\n },\n // Get all potential subtitle fields\n \"subtitleCandidates\": {\n ${SUBTITLE_CANDIDATES.map((field) => `\"${field}\": ${field}`).join(',\\n ')}\n },\n \"media\": coalesce(\n select(\n defined(asset) => {\"type\": \"image-asset\", \"_ref\": asset._ref},\n defined(image.asset) => {\"type\": \"image-asset\", \"_ref\": image.asset._ref},\n defined(mainImage.asset) => {\"type\": \"image-asset\", \"_ref\": mainImage.asset._ref},\n null\n )\n ),\n _type,\n _id,\n _updatedAt\n}`\n","import {type SanityClient} from '@sanity/client'\nimport {createImageUrlBuilder} from '@sanity/image-url'\n\nimport {getClient} from '../client/clientStore'\nimport {type DocumentResource} from '../config/sanityConfig'\nimport {type SanityInstance} from '../store/createSanityInstance'\nimport {isObject} from '../utils/object'\nimport {SUBTITLE_CANDIDATES, TITLE_CANDIDATES} from './previewConstants'\nimport {type PreviewQueryResult, type PreviewValue} from './types'\n\nconst API_VERSION = 'v2025-05-06'\n\n/**\n * Checks if the provided value has `_ref` property that is a string and starts with `image-`\n */\nfunction hasImageRef<T>(value: unknown): value is T & {_ref: string} {\n return isObject(value) && '_ref' in value && typeof (value as {_ref: unknown})._ref === 'string'\n}\n\n/**\n * Normalizes a media asset to a preview value.\n * Adds a url to a media asset reference using `@sanity/image-url`.\n *\n * @internal\n */\nexport function normalizeMedia(media: unknown, client: SanityClient): PreviewValue['media'] {\n if (!media) return null\n if (!hasImageRef(media)) return null\n\n const builder = createImageUrlBuilder(client)\n const url = builder.image({_ref: media._ref}).url()\n\n return {\n type: 'image-asset',\n _ref: media._ref,\n url,\n }\n}\n\n/**\n * Finds a single field value from a set of candidates based on a priority list of field names.\n * Returns the first non-empty string value found from the candidates matching the priority list order.\n *\n * @internal\n */\nfunction findFirstDefined(\n fieldsToSearch: string[],\n candidates: Record<string, unknown>,\n exclude?: unknown,\n): string | undefined {\n if (!candidates) return undefined\n\n for (const field of fieldsToSearch) {\n const value = candidates[field]\n if (typeof value === 'string' && value.trim() !== '' && value !== exclude) {\n return value\n }\n }\n\n return undefined\n}\n\n/**\n * Transforms a projection result (with titleCandidates, subtitleCandidates, media)\n * into a PreviewValue (with title, subtitle, media).\n *\n * @param projectionResult - The raw projection result from GROQ\n * @param instance - The Sanity instance to use for client configuration\n * @param resource - Data resource for the preview\n * @internal\n */\nexport function transformProjectionToPreview(\n instance: SanityInstance,\n projectionResult: PreviewQueryResult,\n resource?: DocumentResource,\n): PreviewValue {\n const title = findFirstDefined(TITLE_CANDIDATES, projectionResult.titleCandidates)\n const subtitle = findFirstDefined(SUBTITLE_CANDIDATES, projectionResult.subtitleCandidates, title)\n\n // Get a client for the resource (if provided) or use the instance config\n const client = getClient(instance, {\n apiVersion: API_VERSION,\n resource,\n })\n\n return {\n title: String(title || `${projectionResult._type}: ${projectionResult._id}`),\n subtitle: subtitle || undefined,\n media: normalizeMedia(projectionResult.media, client),\n ...(projectionResult._status && {_status: projectionResult._status}),\n }\n}\n","/**\n * Telemetry environment classification.\n *\n * - `'development'` — the SDK is running on the local developer's machine\n * (`localhost` / `127.0.0.1` in the browser, or `NODE_ENV=development`\n * in Node). These are the original dev-only telemetry sessions.\n *\n * - `'production'` — the SDK is running on a production Sanity-controlled\n * domain (Studio deployments on `*.sanity.studio`, the dashboard on\n * `*.sanity.io`) where end users are authenticated Sanity users with\n * Populus consent records. Production telemetry is gated to this\n * allowlist; SDK apps deployed to customer-controlled domains do not\n * emit telemetry. Staging (`*.sanity.work`) and preview\n * (`*.sanity.dev`) hosts are deliberately excluded.\n *\n * @internal\n */\nexport type TelemetryEnvironment = 'development' | 'production'\n\n/**\n * Hostname suffixes that count as Sanity-controlled for the purposes of\n * production telemetry. A user reaching one of these hosts in the\n * browser is authenticated against Sanity and has a Populus consent\n * record, so we apply the same telemetry rules as the Studio's\n * `telemetry-sink`.\n *\n * The leading `.` is required: it ensures suffix matches hit a real\n * subdomain boundary, so apex matches (`sanity.io`, `sanity.studio`)\n * and lookalikes (`evilsanity.studio`) are excluded. Only production\n * hosts are listed; staging (`*.sanity.work`) and preview\n * (`*.sanity.dev`) hosts are excluded by omission.\n *\n * @internal\n */\nconst SANITY_CONTROLLED_HOST_SUFFIXES = ['.sanity.studio', '.sanity.io'] as const\n\nfunction getBrowserHostname(win: Window): string | null {\n const hostname = win.location?.hostname\n return typeof hostname === 'string' && hostname.length > 0 ? hostname.toLowerCase() : null\n}\n\nfunction isLocalHostname(hostname: string): boolean {\n return hostname === 'localhost' || hostname === '127.0.0.1'\n}\n\nfunction isSanityControlledHostname(hostname: string): boolean {\n return SANITY_CONTROLLED_HOST_SUFFIXES.some((suffix) => hostname.endsWith(suffix))\n}\n\n/**\n * Returns the telemetry environment for the current runtime, or `null`\n * when telemetry should not run at all.\n *\n * Browser:\n * - `localhost` / `127.0.0.1` → `'development'`\n * - host matches the Sanity-controlled allowlist → `'production'`\n * - anything else (customer domains, unknown contexts) → `null`\n *\n * Node (scripts, SSR, tests):\n * - `NODE_ENV=development` → `'development'`\n * - otherwise → `null`. Production-side server runtimes don't carry the\n * browser-authenticated user/consent assumption, so we don't enable\n * them under the production gate.\n *\n * Bracket-notation `process.env['NODE_ENV']` is used to avoid bundler\n * dead-code replacement.\n *\n * @internal\n */\nexport function getTelemetryEnvironment(): TelemetryEnvironment | null {\n if (typeof window !== 'undefined') {\n const hostname = getBrowserHostname(window)\n if (!hostname) return null\n if (isLocalHostname(hostname)) return 'development'\n if (isSanityControlledHostname(hostname)) return 'production'\n return null\n }\n\n if (typeof process !== 'undefined' && process.env?.['NODE_ENV'] === 'development') {\n return 'development'\n }\n return null\n}\n\n/**\n * Convenience predicate for \"telemetry can run in this environment\".\n *\n * @internal\n */\nexport function isTelemetryEnabled(): boolean {\n return getTelemetryEnvironment() !== null\n}\n","import {defineEvent} from '@sanity/telemetry'\n\n/** @internal */\nexport const SDKSessionStarted = defineEvent<{\n version: string\n projectId: string\n perspective: string\n authMethod: string\n}>({\n name: 'SDK Session Started',\n version: 1,\n description: 'SDK instance created (environment is recorded in the event context)',\n})\n\n/** @internal */\nexport const SDKHookMounted = defineEvent<{\n hookName: string\n}>({\n name: 'SDK Hook Mounted',\n version: 1,\n description: 'An SDK hook was mounted for the first time in this session',\n})\n\n/** @internal */\nexport const SDKSessionEnded = defineEvent<{\n durationSeconds: number\n hooksUsed: string[]\n}>({\n name: 'SDK Session Ended',\n version: 1,\n description: 'SDK instance disposed (environment is recorded in the event context)',\n})\n\n/** @internal */\nexport const SDKError = defineEvent<{\n errorType: string\n hookName: string\n}>({\n name: 'SDK Error',\n version: 1,\n description: 'Runtime error caught in the SDK',\n})\n","import {type SanityClient} from '@sanity/client'\nimport {\n type ConsentStatus,\n createBatchedStore,\n type SessionId,\n type TelemetryEvent,\n type TelemetryLogger,\n type TelemetryStore,\n} from '@sanity/telemetry'\n\nimport {createLogger} from '../utils/logger'\nimport {CORE_SDK_VERSION} from '../version'\nimport {type TelemetryEnvironment} from './environment'\nimport {SDKError, SDKHookMounted, SDKSessionEnded, SDKSessionStarted} from './events'\n\nconst FLUSH_INTERVAL_MS = 30_000\nconst CONSENT_TAG = 'telemetry-consent.sdk'\nconst BATCH_TAG = 'telemetry.batch'\n\nconst log = createLogger('telemetry')\n\n/**\n * Manages telemetry for a single SDK instance.\n *\n * Wraps `@sanity/telemetry`'s batched store with SDK-specific concerns:\n * consent caching, session lifecycle events, and hook usage tracking.\n * The `environment` is captured at construction time and recorded in\n * the event context so downstream pipelines can distinguish dev and\n * production sessions.\n *\n * @internal\n */\nexport interface TelemetryManager {\n /**\n * Eagerly resolve and cache the user's consent status.\n * Returns true only when the user has explicitly opted in (`granted`).\n * Call this before logging any events to avoid buffering events that\n * will be dropped on the first flush.\n */\n checkConsent(): Promise<boolean>\n\n /** Log a \"SDK Session Started\" event */\n logSessionStarted(data: {projectId: string; perspective: string; authMethod: string}): void\n\n /** Log a \"SDK Hook Mounted\" event (deduplicated per hook name) */\n logHookFirstUsed(hookName: string): void\n\n /** Log a \"SDK Error\" event */\n logError(errorType: string, hookName: string): void\n\n /** Log a \"SDK Session Ended\" event and tear down the store */\n endSession(): void\n\n /** Tear down the store without logging a session-end event */\n dispose(): void\n\n /** The set of hook names used during this session */\n readonly hooksUsed: ReadonlySet<string>\n}\n\ninterface TelemetryManagerOptions {\n sessionId: string\n getClient: () => SanityClient\n projectId: string\n environment: TelemetryEnvironment\n}\n\n/**\n * Creates a telemetry manager for a single SDK instance session.\n *\n * The manager initializes a `createBatchedStore` from `@sanity/telemetry`,\n * caches the consent check for the lifetime of the session, and provides\n * typed methods for each SDK telemetry event.\n *\n * @internal\n */\nexport function createTelemetryManager(options: TelemetryManagerOptions): TelemetryManager {\n const {sessionId, getClient, projectId, environment} = options\n const startedAt = Date.now()\n const emittedHooks = new Set<string>()\n\n let cachedConsent: {status: ConsentStatus} | null = null\n\n const resolveConsent = async (): Promise<{status: ConsentStatus}> => {\n if (cachedConsent) return cachedConsent\n try {\n const client = getClient()\n const result = await client.request<{status: ConsentStatus}>({\n url: '/intake/telemetry-status',\n tag: CONSENT_TAG,\n })\n cachedConsent = result\n } catch {\n cachedConsent = {status: 'undetermined'}\n }\n return cachedConsent\n }\n\n const enrichBatch = (batch: TelemetryEvent[]) =>\n batch.map((event) => {\n // Trace events (`trace.start` / `trace.log` / `trace.error` /\n // `trace.complete`) arrive with their own caller-provided `context`.\n // Log / userProperties events don't. Narrow via `in` so `event`\n // stays typed as `TelemetryEvent`, then merge so we don't drop the\n // trace context. SDK-owned fields below win on conflict.\n const existing =\n 'context' in event ? (event.context as Record<string, unknown> | undefined) : undefined\n return {\n ...event,\n context: {\n ...existing,\n version: CORE_SDK_VERSION,\n environment,\n origin: typeof window !== 'undefined' ? window.location.origin : 'node',\n },\n }\n })\n\n const sendEvents = async (batch: TelemetryEvent[]): Promise<unknown> => {\n const client = getClient()\n log.debug('sending event batch', {batchSize: batch.length, environment})\n return client.request({\n url: '/intake/batch',\n method: 'POST',\n body: {projectId, batch: enrichBatch(batch)},\n tag: BATCH_TAG,\n })\n }\n\n const store: TelemetryStore<Record<string, unknown>> = createBatchedStore(\n sessionId as SessionId,\n {\n flushInterval: FLUSH_INTERVAL_MS,\n resolveConsent,\n sendEvents,\n },\n )\n\n const logger: TelemetryLogger<Record<string, unknown>> = store.logger\n\n return {\n async checkConsent() {\n const {status} = await resolveConsent()\n return status === 'granted'\n },\n\n logSessionStarted(data) {\n log.debug('event: SDK Session Started', {\n projectId: data.projectId,\n perspective: data.perspective,\n authMethod: data.authMethod,\n version: CORE_SDK_VERSION,\n environment,\n })\n logger.log(SDKSessionStarted, {\n version: CORE_SDK_VERSION,\n ...data,\n })\n },\n\n logHookFirstUsed(hookName: string) {\n if (emittedHooks.has(hookName)) return\n emittedHooks.add(hookName)\n log.debug('event: SDK Hook Mounted', {hookName})\n logger.log(SDKHookMounted, {hookName})\n },\n\n logError(errorType: string, hookName: string) {\n log.debug('event: SDK Error', {errorType, hookName})\n logger.log(SDKError, {errorType, hookName})\n },\n\n endSession() {\n const durationSeconds = Math.round((Date.now() - startedAt) / 1000)\n log.debug('event: SDK Session Ended', {\n durationSeconds,\n hooksUsed: [...emittedHooks],\n environment,\n })\n logger.log(SDKSessionEnded, {\n durationSeconds,\n hooksUsed: [...emittedHooks],\n })\n\n store.flush().catch(() => {\n // Best-effort flush on dispose; swallow errors\n })\n store.end()\n },\n\n dispose() {\n store.end()\n },\n\n get hooksUsed(): ReadonlySet<string> {\n return emittedHooks\n },\n }\n}\n","import {type SanityInstance} from '../store/createSanityInstance'\nimport {createLogger} from '../utils/logger'\nimport {getTelemetryEnvironment} from './environment'\nimport {type TelemetryManager} from './telemetryManager'\n\nconst DEFAULT_TELEMETRY_API_VERSION = '2024-11-12'\n\nconst logger = createLogger('telemetry')\n\n/**\n * Per-instance map of active telemetry managers. Allows the React\n * package (and other consumers) to look up the manager for a given\n * instance and log hook usage / errors without importing the full\n * telemetry module themselves.\n *\n * @internal\n */\nconst telemetryManagers = new WeakMap<SanityInstance, TelemetryManager>()\nconst pendingHooks = new WeakMap<SanityInstance, Set<string>>()\nconst initInFlight = new WeakSet<SanityInstance>()\n\n/**\n * Initializes telemetry for a SDK instance if the runtime environment\n * qualifies. The environment is resolved by `getTelemetryEnvironment()`:\n *\n * - `'development'` — local dev servers (`localhost` / `127.0.0.1`, or\n * Node with `NODE_ENV=development`). This is the original opt-in\n * surface.\n * - `'production'` — apps deployed to Sanity-controlled domains\n * (e.g. `*.sanity.studio`, the dashboard). End users are\n * authenticated Sanity users with Populus consent records, so we\n * apply the same consent gate as the Studio's `telemetry-sink`.\n *\n * Apps on customer-controlled domains return `null` and skip telemetry\n * entirely.\n *\n * `telemetryManager` and `clientStore` are dynamically imported so the\n * telemetry code path stays out of production bundles for apps that\n * don't qualify. Only the lightweight environment check runs at boot.\n *\n * The `projectId` must be passed explicitly because the resource\n * configuration is typically set by the React layer after the\n * instance has already been created.\n *\n * @internal\n */\nexport function initTelemetry(instance: SanityInstance, projectId: string): void {\n const environment = getTelemetryEnvironment()\n if (!environment) {\n logger.trace('initTelemetry skipped: environment not eligible', {internal: true})\n return\n }\n if (!projectId) {\n logger.trace('initTelemetry skipped: no projectId', {internal: true})\n return\n }\n if (telemetryManagers.has(instance) || initInFlight.has(instance)) {\n return\n }\n initInFlight.add(instance)\n\n logger.debug('initializing telemetry', {projectId, environment})\n\n Promise.all([\n import('./telemetryManager'),\n import('../client/clientStore'),\n import('../auth/authStore'),\n ])\n .then(async ([{createTelemetryManager}, {getClient}, {getTokenState}]) => {\n if (instance.isDisposed()) {\n initInFlight.delete(instance)\n logger.debug('telemetry skipped: instance disposed before imports resolved')\n return\n }\n\n // Wait for the auth store to resolve a token. The client needs a\n // Bearer token for the consent check and batch POSTs. If the token\n // is already available (e.g. static token config), this resolves\n // immediately. For OAuth/localStorage discovery it waits for the\n // first emission. For unauthenticated apps the promise never\n // resolves, which is fine since telemetry requires auth anyway.\n const token = getTokenState(instance).getCurrent()\n logger.trace('auth token check', {tokenPresent: !!token, internal: true})\n\n if (!token) {\n logger.debug('waiting for auth token')\n const hasToken = await new Promise<boolean>((resolve) => {\n if (instance.isDisposed()) return resolve(false)\n const cleanup = {unsubscribe: () => {}}\n const unsub = instance.onDispose(() => {\n cleanup.unsubscribe()\n resolve(false)\n })\n // The token observable is a `shareReplay({bufferSize: 1, refCount: true})`\n // (see `createStateSourceAction`), so it can deliver a buffered value\n // synchronously while we're still inside `.subscribe(cb)`. At that\n // moment `sub` is in the TDZ, so the callback can't reach it. We\n // gate on a `received` flag and let the post-subscribe block do the\n // unsubscribe in the sync-emission case.\n let received = false\n const sub = getTokenState(instance).observable.subscribe((t) => {\n if (received || !t) return\n received = true\n logger.debug('auth token received')\n unsub()\n resolve(true)\n cleanup.unsubscribe()\n })\n cleanup.unsubscribe = () => sub.unsubscribe()\n if (received) cleanup.unsubscribe()\n })\n if (!hasToken || instance.isDisposed()) {\n initInFlight.delete(instance)\n logger.debug('telemetry skipped: no token resolved or instance disposed')\n return\n }\n }\n\n const manager = createTelemetryManager({\n sessionId: instance.instanceId,\n getClient: () => getClient(instance, {apiVersion: DEFAULT_TELEMETRY_API_VERSION}),\n projectId,\n environment,\n })\n\n const consented = await manager.checkConsent()\n logger.debug('consent check complete', {consented})\n if (!consented || instance.isDisposed()) {\n initInFlight.delete(instance)\n manager.dispose()\n return\n }\n\n initInFlight.delete(instance)\n telemetryManagers.set(instance, manager)\n\n const buffered = pendingHooks.get(instance)\n if (buffered) {\n logger.debug('flushing buffered hooks', {hooks: Array.from(buffered)})\n for (const hookName of buffered) {\n manager.logHookFirstUsed(hookName)\n }\n pendingHooks.delete(instance)\n }\n\n const config = instance.config\n const perspective = typeof config.perspective === 'string' ? config.perspective : 'published'\n const authMethod = config.auth?.token\n ? 'token'\n : config.studio?.auth?.token\n ? 'studio'\n : 'default'\n\n logger.info('telemetry session started', {projectId, perspective, authMethod, environment})\n manager.logSessionStarted({\n projectId,\n perspective,\n authMethod,\n })\n\n instance.onDispose(() => {\n manager.endSession()\n telemetryManagers.delete(instance)\n logger.debug('telemetry session ended')\n })\n })\n .catch((err) => {\n initInFlight.delete(instance)\n logger.warn('telemetry init failed', {error: err})\n })\n}\n\n/**\n * Retrieves the telemetry manager for an instance, if one exists.\n * Returns undefined when telemetry is disabled or not yet initialized.\n *\n * @internal\n */\nexport function getTelemetryManager(instance: SanityInstance): TelemetryManager | undefined {\n return telemetryManagers.get(instance)\n}\n\n/**\n * Record a hook name for an instance. If the telemetry manager is\n * already initialized the event is logged immediately. Otherwise\n * the name is buffered and flushed when init completes.\n *\n * @internal\n */\nexport function trackHookMounted(instance: SanityInstance, hookName: string): void {\n if (!getTelemetryEnvironment()) return\n\n const manager = findManager(instance)\n if (manager) {\n logger.trace('hook mounted (logged)', {hookName, internal: true})\n manager.logHookFirstUsed(hookName)\n return\n }\n\n const root = getRootInstance(instance)\n let hooks = pendingHooks.get(root)\n if (!hooks) {\n hooks = new Set()\n pendingHooks.set(root, hooks)\n }\n if (!hooks.has(hookName)) {\n logger.trace('hook mounted (buffered)', {hookName, internal: true})\n }\n hooks.add(hookName)\n}\n\nfunction findManager(instance: SanityInstance): TelemetryManager | undefined {\n return telemetryManagers.get(instance)\n}\n\nfunction getRootInstance(instance: SanityInstance): SanityInstance {\n return instance\n}\n","const WILDCARD_TOKEN = '*'\nconst NEGATION_TOKEN = '-'\n// This regex handles simple cases including quoted phrases.\n// More complex query syntaxes might need a more robust parser.\nconst TOKEN_REGEX = /(?:[^\\s\"]+|\"[^\"]*\")+/g\n\n/**\n * @internal\n * Checks if a token starts with the negation character.\n */\nfunction isNegationToken(token: string | undefined): boolean {\n return typeof token !== 'undefined' && token.trim().startsWith(NEGATION_TOKEN)\n}\n\n/**\n * @internal\n * Checks if a token ends with the wildcard character.\n */\nfunction isPrefixToken(token: string | undefined): boolean {\n return typeof token !== 'undefined' && token.trim().endsWith(WILDCARD_TOKEN)\n}\n\n/**\n * @internal\n * Checks if a token is enclosed in double quotes.\n */\nfunction isExactMatchToken(token: string | undefined): boolean {\n // Ensure the token exists, has at least 2 characters, and starts/ends with \"\n return !!token && token.length >= 2 && token.startsWith('\"') && token.endsWith('\"')\n}\n\n/**\n * Creates a GROQ search filter string (`[@] match text::query(\"...\")`)\n * from a raw search query string.\n *\n * It applies wildcard ('*') logic to the last eligible token and escapes\n * backslashes and double quotes within the search term.\n *\n * If the input query is empty or only whitespace, it returns an empty string.\n *\n * @param query - The raw input search string.\n * @returns The GROQ search filter string, or an empty string.\n * @internal\n */\nexport function createGroqSearchFilter(query: string): string {\n // Trim leading/trailing whitespace from the overall query first\n const trimmedQuery = query.trim()\n if (!trimmedQuery) {\n return '' // Return empty if query is empty or just whitespace\n }\n\n // Extract tokens using the regex\n const tokens = trimmedQuery.match(TOKEN_REGEX) ?? []\n\n // Find the index of the last token eligible for wildcard appending\n const reversedTokens = [...tokens].reverse()\n const reversedIndex = reversedTokens.findIndex(\n (token: string) => !isNegationToken(token) && !isExactMatchToken(token),\n )\n const finalIncrementalTokenIndex = reversedIndex === -1 ? -1 : tokens.length - 1 - reversedIndex\n\n // Get the actual token based on the found index\n const finalIncrementalToken = tokens[finalIncrementalTokenIndex]\n\n const processedTokens = [...tokens]\n // If a suitable token was found and it doesn't already end with a wildcard,\n // apply the wildcard.\n if (finalIncrementalToken !== undefined && !isPrefixToken(finalIncrementalToken)) {\n // Replace the identified token with its wildcarded version\n processedTokens.splice(\n finalIncrementalTokenIndex,\n 1,\n `${finalIncrementalToken}${WILDCARD_TOKEN}`,\n )\n }\n\n // Join the tokens back into a space-separated string\n const wildcardSearch = processedTokens.join(' ')\n\n // Escape backslashes and double quotes within the final search term for the\n // GROQ query. Backslashes go first, so the escapes added for quotes are not\n // themselves escaped. Without this a trailing backslash would escape the\n // closing quote and let the input break out of the string literal.\n const escapedSearch = wildcardSearch.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n\n // Construct the final GROQ filter clause\n return `[@] match text::query(\"${escapedSearch}\")`\n}\n"],"mappings":";;;;;;;;;;;;;;AAWA,SAAgB,qBAAqB,aAA6C;CAChF,IAAI,YAAY,gBAAgB,MAAM,OAAO,IAAI,IAAI,YAAY,WAAW,CAAC,CAAC;CAC9E,IAAI,YAAY,SAAS,MAAM,OAAO;CAItC,IAAM,UAAW,WAA4B,uBAAuB;CACpE,IAAI,YAAY,aAAa;EAC3B,IAAM,SAAS,UAAU,oBAAoB;EAC7C,OAAO,WAAW,YAAY,KAAK,QAAQ,YAAY,eAAe,GAAG;CAC3E;CAEA,IAAM,SAAS,UAAU,uBAAuB;CAChD,OAAO,WAAW,YAAY,KAAK,GAAG;AACxC;;;;;;;ACnBA,MAAa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OAAc,UAAU,UAAe,MAAM,KAAK,CAAC,CAAC,WAAW,GAAc;AAC/E;;;;;AAMA,SAAS,cAAc,OAAoC;CACzD,OAAc,UAAU,UAAe,MAAM,KAAK,CAAC,CAAC,SAAS,GAAc;AAC7E;;;;;AAMA,SAAS,kBAAkB,OAAoC;CAE7D,OAAO,CAAC,CAAC,SAAS,MAAM,UAAU,KAAK,MAAM,WAAW,IAAG,KAAK,MAAM,SAAS,IAAG;AACpF;;;;;;;;;;;;;;AAeA,SAAgB,uBAAuB,OAAuB;CAE5D,IAAM,eAAe,MAAM,KAAK;CAChC,IAAI,CAAC,cACH,OAAO;CAIT,IAAM,SAAS,aAAa,MAAM,WAAW,KAAK,CAAC,GAI7C,gBADiB,CAAC,GAAG,MAAM,CAAC,CAAC,QACA,CAAC,CAAC,WAClC,UAAkB,CAAC,gBAAgB,KAAK,KAAK,CAAC,kBAAkB,KAAK,CACxE,GACM,6BAA6B,kBAAkB,KAAK,KAAK,OAAO,SAAS,IAAI,eAG7E,wBAAwB,OAAO,6BAE/B,kBAAkB,CAAC,GAAG,MAAM;CAsBlC,OAnBI,0BAA0B,KAAA,KAAa,CAAC,cAAc,qBAAqB,KAE7E,gBAAgB,OACd,4BACA,GACA,GAAG,wBACL,GAaK,0BATgB,gBAAgB,KAAK,GAMT,CAAC,CAAC,QAAQ,OAAO,MAAM,CAAC,CAAC,QAAQ,MAAM,MAG7B,EAAE;AACjD"}
|
|
1
|
+
{"version":3,"file":"_internal.js","names":[],"sources":["../../src/applications/applicationOrigin.ts","../../src/preview/previewConstants.ts","../../src/preview/previewProjectionUtils.ts","../../src/telemetry/environment.ts","../../src/telemetry/events.ts","../../src/telemetry/telemetryManager.ts","../../src/telemetry/initTelemetry.ts","../../src/utils/createGroqSearchFilter.ts"],"sourcesContent":["import {type ApplicationBase} from './applications'\n\ntype SanityGlobal = typeof globalThis & {__SANITY_STAGING__?: boolean}\n\n/**\n * The origin an application is served from, or `null` when it has neither an external URL nor\n * a slug to derive one from. Callers treat `null` as \"nothing to load\" rather than failing the\n * whole list on one bad record.\n *\n * @internal\n */\nexport function getApplicationOrigin(\n application: Pick<ApplicationBase, 'externalUrl' | 'slug' | 'isSingleton' | 'organizationId'>,\n): string | null {\n if (application.externalUrl !== null) return new URL(application.externalUrl).origin\n if (application.slug === null) return null\n\n // Read at runtime, not via a bundler define: a remote is built once and runs in whichever\n // host page loaded it, and the host sets this flag. Mirrors workbench's `getSanityEnv`.\n const staging = (globalThis as SanityGlobal).__SANITY_STAGING__ === true\n if (application.isSingleton) {\n const domain = staging ? 'run.sanity.work' : 'sanity.run'\n return `https://${application.slug}-apps-${application.organizationId}.${domain}`\n }\n\n const domain = staging ? 'studio.sanity.work' : 'sanity.studio'\n return `https://${application.slug}.${domain}`\n}\n","/**\n * The fields to check for a title.\n * The order of the items in the array defines the priority.\n *\n * @internal\n */\nexport const TITLE_CANDIDATES = ['title', 'name', 'label', 'heading', 'header', 'caption']\n\n/**\n * The fields to check for a subtitle.\n * The order of the items in the array defines the priority.\n *\n * @internal\n */\nexport const SUBTITLE_CANDIDATES = ['description', 'subtitle', ...TITLE_CANDIDATES]\n\n/**\n * Generates a GROQ projection for preview data without requiring a schema.\n * Uses common field names to make educated guesses about which fields to use.\n *\n * @internal\n */\nexport const PREVIEW_PROJECTION = `{\n // Get all potential title fields\n \"titleCandidates\": {\n ${TITLE_CANDIDATES.map((field) => `\"${field}\": ${field}`).join(',\\n ')}\n },\n // Get all potential subtitle fields\n \"subtitleCandidates\": {\n ${SUBTITLE_CANDIDATES.map((field) => `\"${field}\": ${field}`).join(',\\n ')}\n },\n \"media\": coalesce(\n select(\n defined(asset) => {\"type\": \"image-asset\", \"_ref\": asset._ref},\n defined(image.asset) => {\"type\": \"image-asset\", \"_ref\": image.asset._ref},\n defined(mainImage.asset) => {\"type\": \"image-asset\", \"_ref\": mainImage.asset._ref},\n null\n )\n ),\n _type,\n _id,\n _updatedAt\n}`\n","import {type SanityClient} from '@sanity/client'\nimport {createImageUrlBuilder} from '@sanity/image-url'\n\nimport {getClient} from '../client/clientStore'\nimport {type DocumentResource} from '../config/sanityConfig'\nimport {type SanityInstance} from '../store/createSanityInstance'\nimport {isObject} from '../utils/object'\nimport {SUBTITLE_CANDIDATES, TITLE_CANDIDATES} from './previewConstants'\nimport {type PreviewQueryResult, type PreviewValue} from './types'\n\nconst API_VERSION = 'v2025-05-06'\n\n/**\n * Checks if the provided value has `_ref` property that is a string and starts with `image-`\n */\nfunction hasImageRef<T>(value: unknown): value is T & {_ref: string} {\n return isObject(value) && '_ref' in value && typeof (value as {_ref: unknown})._ref === 'string'\n}\n\n/**\n * Normalizes a media asset to a preview value.\n * Adds a url to a media asset reference using `@sanity/image-url`.\n *\n * @internal\n */\nexport function normalizeMedia(media: unknown, client: SanityClient): PreviewValue['media'] {\n if (!media) return null\n if (!hasImageRef(media)) return null\n\n const builder = createImageUrlBuilder(client)\n const url = builder.image({_ref: media._ref}).url()\n\n return {\n type: 'image-asset',\n _ref: media._ref,\n url,\n }\n}\n\n/**\n * Finds a single field value from a set of candidates based on a priority list of field names.\n * Returns the first non-empty string value found from the candidates matching the priority list order.\n *\n * @internal\n */\nfunction findFirstDefined(\n fieldsToSearch: string[],\n candidates: Record<string, unknown>,\n exclude?: unknown,\n): string | undefined {\n if (!candidates) return undefined\n\n for (const field of fieldsToSearch) {\n const value = candidates[field]\n if (typeof value === 'string' && value.trim() !== '' && value !== exclude) {\n return value\n }\n }\n\n return undefined\n}\n\n/**\n * Transforms a projection result (with titleCandidates, subtitleCandidates, media)\n * into a PreviewValue (with title, subtitle, media).\n *\n * @param projectionResult - The raw projection result from GROQ\n * @param instance - The Sanity instance to use for client configuration\n * @param resource - Data resource for the preview\n * @internal\n */\nexport function transformProjectionToPreview(\n instance: SanityInstance,\n projectionResult: PreviewQueryResult,\n resource?: DocumentResource,\n): PreviewValue {\n const title = findFirstDefined(TITLE_CANDIDATES, projectionResult.titleCandidates)\n const subtitle = findFirstDefined(SUBTITLE_CANDIDATES, projectionResult.subtitleCandidates, title)\n\n // Get a client for the resource (if provided) or use the instance config\n const client = getClient(instance, {\n apiVersion: API_VERSION,\n resource,\n })\n\n return {\n title: String(title || `${projectionResult._type}: ${projectionResult._id}`),\n subtitle: subtitle || undefined,\n media: normalizeMedia(projectionResult.media, client),\n ...(projectionResult._status && {_status: projectionResult._status}),\n }\n}\n","/**\n * Telemetry environment classification.\n *\n * - `'development'` — the SDK is running on the local developer's machine\n * (`localhost` / `127.0.0.1` in the browser, or `NODE_ENV=development`\n * in Node). These are the original dev-only telemetry sessions.\n *\n * - `'production'` — the SDK is running on a production Sanity-controlled\n * domain (Studio deployments on `*.sanity.studio`, the dashboard on\n * `*.sanity.io`) where end users are authenticated Sanity users with\n * Populus consent records. Production telemetry is gated to this\n * allowlist; SDK apps deployed to customer-controlled domains do not\n * emit telemetry. Staging (`*.sanity.work`) and preview\n * (`*.sanity.dev`) hosts are deliberately excluded.\n *\n * @internal\n */\nexport type TelemetryEnvironment = 'development' | 'production'\n\n/**\n * Hostname suffixes that count as Sanity-controlled for the purposes of\n * production telemetry. A user reaching one of these hosts in the\n * browser is authenticated against Sanity and has a Populus consent\n * record, so we apply the same telemetry rules as the Studio's\n * `telemetry-sink`.\n *\n * The leading `.` is required: it ensures suffix matches hit a real\n * subdomain boundary, so apex matches (`sanity.io`, `sanity.studio`)\n * and lookalikes (`evilsanity.studio`) are excluded. Only production\n * hosts are listed; staging (`*.sanity.work`) and preview\n * (`*.sanity.dev`) hosts are excluded by omission.\n *\n * @internal\n */\nconst SANITY_CONTROLLED_HOST_SUFFIXES = ['.sanity.studio', '.sanity.io'] as const\n\nfunction getBrowserHostname(win: Window): string | null {\n const hostname = win.location?.hostname\n return typeof hostname === 'string' && hostname.length > 0 ? hostname.toLowerCase() : null\n}\n\nfunction isLocalHostname(hostname: string): boolean {\n return hostname === 'localhost' || hostname === '127.0.0.1'\n}\n\nfunction isSanityControlledHostname(hostname: string): boolean {\n return SANITY_CONTROLLED_HOST_SUFFIXES.some((suffix) => hostname.endsWith(suffix))\n}\n\n/**\n * Returns the telemetry environment for the current runtime, or `null`\n * when telemetry should not run at all.\n *\n * Browser:\n * - `localhost` / `127.0.0.1` → `'development'`\n * - host matches the Sanity-controlled allowlist → `'production'`\n * - anything else (customer domains, unknown contexts) → `null`\n *\n * Node (scripts, SSR, tests):\n * - `NODE_ENV=development` → `'development'`\n * - otherwise → `null`. Production-side server runtimes don't carry the\n * browser-authenticated user/consent assumption, so we don't enable\n * them under the production gate.\n *\n * Bracket-notation `process.env['NODE_ENV']` is used to avoid bundler\n * dead-code replacement.\n *\n * @internal\n */\nexport function getTelemetryEnvironment(): TelemetryEnvironment | null {\n if (typeof window !== 'undefined') {\n const hostname = getBrowserHostname(window)\n if (!hostname) return null\n if (isLocalHostname(hostname)) return 'development'\n if (isSanityControlledHostname(hostname)) return 'production'\n return null\n }\n\n if (typeof process !== 'undefined' && process.env?.['NODE_ENV'] === 'development') {\n return 'development'\n }\n return null\n}\n\n/**\n * Convenience predicate for \"telemetry can run in this environment\".\n *\n * @internal\n */\nexport function isTelemetryEnabled(): boolean {\n return getTelemetryEnvironment() !== null\n}\n","import {defineEvent} from '@sanity/telemetry'\n\n/** @internal */\nexport const SDKSessionStarted = defineEvent<{\n version: string\n projectId: string\n perspective: string\n authMethod: string\n}>({\n name: 'SDK Session Started',\n version: 1,\n description: 'SDK instance created (environment is recorded in the event context)',\n})\n\n/** @internal */\nexport const SDKHookMounted = defineEvent<{\n hookName: string\n}>({\n name: 'SDK Hook Mounted',\n version: 1,\n description: 'An SDK hook was mounted for the first time in this session',\n})\n\n/** @internal */\nexport const SDKSessionEnded = defineEvent<{\n durationSeconds: number\n hooksUsed: string[]\n}>({\n name: 'SDK Session Ended',\n version: 1,\n description: 'SDK instance disposed (environment is recorded in the event context)',\n})\n\n/** @internal */\nexport const SDKError = defineEvent<{\n errorType: string\n hookName: string\n}>({\n name: 'SDK Error',\n version: 1,\n description: 'Runtime error caught in the SDK',\n})\n","import {type SanityClient} from '@sanity/client'\nimport {\n type ConsentStatus,\n createBatchedStore,\n type SessionId,\n type TelemetryEvent,\n type TelemetryLogger,\n type TelemetryStore,\n} from '@sanity/telemetry'\n\nimport {createLogger} from '../utils/logger'\nimport {CORE_SDK_VERSION} from '../version'\nimport {type TelemetryEnvironment} from './environment'\nimport {SDKError, SDKHookMounted, SDKSessionEnded, SDKSessionStarted} from './events'\n\nconst FLUSH_INTERVAL_MS = 30_000\nconst CONSENT_TAG = 'telemetry-consent.sdk'\nconst BATCH_TAG = 'telemetry.batch'\n\nconst log = createLogger('telemetry')\n\n/**\n * Manages telemetry for a single SDK instance.\n *\n * Wraps `@sanity/telemetry`'s batched store with SDK-specific concerns:\n * consent caching, session lifecycle events, and hook usage tracking.\n * The `environment` is captured at construction time and recorded in\n * the event context so downstream pipelines can distinguish dev and\n * production sessions.\n *\n * @internal\n */\nexport interface TelemetryManager {\n /**\n * Eagerly resolve and cache the user's consent status.\n * Returns true only when the user has explicitly opted in (`granted`).\n * Call this before logging any events to avoid buffering events that\n * will be dropped on the first flush.\n */\n checkConsent(): Promise<boolean>\n\n /** Log a \"SDK Session Started\" event */\n logSessionStarted(data: {projectId: string; perspective: string; authMethod: string}): void\n\n /** Log a \"SDK Hook Mounted\" event (deduplicated per hook name) */\n logHookFirstUsed(hookName: string): void\n\n /** Log a \"SDK Error\" event */\n logError(errorType: string, hookName: string): void\n\n /** Log a \"SDK Session Ended\" event and tear down the store */\n endSession(): void\n\n /** Tear down the store without logging a session-end event */\n dispose(): void\n\n /** The set of hook names used during this session */\n readonly hooksUsed: ReadonlySet<string>\n}\n\ninterface TelemetryManagerOptions {\n sessionId: string\n getClient: () => SanityClient\n projectId: string\n environment: TelemetryEnvironment\n}\n\n/**\n * Creates a telemetry manager for a single SDK instance session.\n *\n * The manager initializes a `createBatchedStore` from `@sanity/telemetry`,\n * caches the consent check for the lifetime of the session, and provides\n * typed methods for each SDK telemetry event.\n *\n * @internal\n */\nexport function createTelemetryManager(options: TelemetryManagerOptions): TelemetryManager {\n const {sessionId, getClient, projectId, environment} = options\n const startedAt = Date.now()\n const emittedHooks = new Set<string>()\n\n let cachedConsent: {status: ConsentStatus} | null = null\n\n const resolveConsent = async (): Promise<{status: ConsentStatus}> => {\n if (cachedConsent) return cachedConsent\n try {\n const client = getClient()\n const result = await client.request<{status: ConsentStatus}>({\n url: '/intake/telemetry-status',\n tag: CONSENT_TAG,\n })\n cachedConsent = result\n } catch {\n cachedConsent = {status: 'undetermined'}\n }\n return cachedConsent\n }\n\n const enrichBatch = (batch: TelemetryEvent[]) =>\n batch.map((event) => {\n // Trace events (`trace.start` / `trace.log` / `trace.error` /\n // `trace.complete`) arrive with their own caller-provided `context`.\n // Log / userProperties events don't. Narrow via `in` so `event`\n // stays typed as `TelemetryEvent`, then merge so we don't drop the\n // trace context. SDK-owned fields below win on conflict.\n const existing =\n 'context' in event ? (event.context as Record<string, unknown> | undefined) : undefined\n return {\n ...event,\n context: {\n ...existing,\n version: CORE_SDK_VERSION,\n environment,\n origin: typeof window !== 'undefined' ? window.location.origin : 'node',\n },\n }\n })\n\n const sendEvents = async (batch: TelemetryEvent[]): Promise<unknown> => {\n const client = getClient()\n log.debug('sending event batch', {batchSize: batch.length, environment})\n return client.request({\n url: '/intake/batch',\n method: 'POST',\n body: {projectId, batch: enrichBatch(batch)},\n tag: BATCH_TAG,\n })\n }\n\n const store: TelemetryStore<Record<string, unknown>> = createBatchedStore(\n sessionId as SessionId,\n {\n flushInterval: FLUSH_INTERVAL_MS,\n resolveConsent,\n sendEvents,\n },\n )\n\n const logger: TelemetryLogger<Record<string, unknown>> = store.logger\n\n return {\n async checkConsent() {\n const {status} = await resolveConsent()\n return status === 'granted'\n },\n\n logSessionStarted(data) {\n log.debug('event: SDK Session Started', {\n projectId: data.projectId,\n perspective: data.perspective,\n authMethod: data.authMethod,\n version: CORE_SDK_VERSION,\n environment,\n })\n logger.log(SDKSessionStarted, {\n version: CORE_SDK_VERSION,\n ...data,\n })\n },\n\n logHookFirstUsed(hookName: string) {\n if (emittedHooks.has(hookName)) return\n emittedHooks.add(hookName)\n log.debug('event: SDK Hook Mounted', {hookName})\n logger.log(SDKHookMounted, {hookName})\n },\n\n logError(errorType: string, hookName: string) {\n log.debug('event: SDK Error', {errorType, hookName})\n logger.log(SDKError, {errorType, hookName})\n },\n\n endSession() {\n const durationSeconds = Math.round((Date.now() - startedAt) / 1000)\n log.debug('event: SDK Session Ended', {\n durationSeconds,\n hooksUsed: [...emittedHooks],\n environment,\n })\n logger.log(SDKSessionEnded, {\n durationSeconds,\n hooksUsed: [...emittedHooks],\n })\n\n store.flush().catch(() => {\n // Best-effort flush on dispose; swallow errors\n })\n store.end()\n },\n\n dispose() {\n store.end()\n },\n\n get hooksUsed(): ReadonlySet<string> {\n return emittedHooks\n },\n }\n}\n","import {type SanityInstance} from '../store/createSanityInstance'\nimport {createLogger} from '../utils/logger'\nimport {getTelemetryEnvironment} from './environment'\nimport {type TelemetryManager} from './telemetryManager'\n\nconst DEFAULT_TELEMETRY_API_VERSION = '2024-11-12'\n\nconst logger = createLogger('telemetry')\n\n/**\n * Per-instance map of active telemetry managers. Allows the React\n * package (and other consumers) to look up the manager for a given\n * instance and log hook usage / errors without importing the full\n * telemetry module themselves.\n *\n * @internal\n */\nconst telemetryManagers = new WeakMap<SanityInstance, TelemetryManager>()\nconst pendingHooks = new WeakMap<SanityInstance, Set<string>>()\nconst initInFlight = new WeakSet<SanityInstance>()\n\n/**\n * Initializes telemetry for a SDK instance if the runtime environment\n * qualifies. The environment is resolved by `getTelemetryEnvironment()`:\n *\n * - `'development'` — local dev servers (`localhost` / `127.0.0.1`, or\n * Node with `NODE_ENV=development`). This is the original opt-in\n * surface.\n * - `'production'` — apps deployed to Sanity-controlled domains\n * (e.g. `*.sanity.studio`, the dashboard). End users are\n * authenticated Sanity users with Populus consent records, so we\n * apply the same consent gate as the Studio's `telemetry-sink`.\n *\n * Apps on customer-controlled domains return `null` and skip telemetry\n * entirely.\n *\n * `telemetryManager` and `clientStore` are dynamically imported so the\n * telemetry code path stays out of production bundles for apps that\n * don't qualify. Only the lightweight environment check runs at boot.\n *\n * The `projectId` must be passed explicitly because the resource\n * configuration is typically set by the React layer after the\n * instance has already been created.\n *\n * @internal\n */\nexport function initTelemetry(instance: SanityInstance, projectId: string): void {\n const environment = getTelemetryEnvironment()\n if (!environment) {\n logger.trace('initTelemetry skipped: environment not eligible', {internal: true})\n return\n }\n if (!projectId) {\n logger.trace('initTelemetry skipped: no projectId', {internal: true})\n return\n }\n if (telemetryManagers.has(instance) || initInFlight.has(instance)) {\n return\n }\n initInFlight.add(instance)\n\n logger.debug('initializing telemetry', {projectId, environment})\n\n Promise.all([\n import('./telemetryManager'),\n import('../client/clientStore'),\n import('../auth/authStore'),\n ])\n .then(async ([{createTelemetryManager}, {getClient}, {getTokenState}]) => {\n if (instance.isDisposed()) {\n initInFlight.delete(instance)\n logger.debug('telemetry skipped: instance disposed before imports resolved')\n return\n }\n\n // Wait for the auth store to resolve a token. The client needs a\n // Bearer token for the consent check and batch POSTs. If the token\n // is already available (e.g. static token config), this resolves\n // immediately. For OAuth/localStorage discovery it waits for the\n // first emission. For unauthenticated apps the promise never\n // resolves, which is fine since telemetry requires auth anyway.\n const token = getTokenState(instance).getCurrent()\n logger.trace('auth token check', {tokenPresent: !!token, internal: true})\n\n if (!token) {\n logger.debug('waiting for auth token')\n const hasToken = await new Promise<boolean>((resolve) => {\n if (instance.isDisposed()) return resolve(false)\n const cleanup = {unsubscribe: () => {}}\n const unsub = instance.onDispose(() => {\n cleanup.unsubscribe()\n resolve(false)\n })\n // The token observable is a `shareReplay({bufferSize: 1, refCount: true})`\n // (see `createStateSourceAction`), so it can deliver a buffered value\n // synchronously while we're still inside `.subscribe(cb)`. At that\n // moment `sub` is in the TDZ, so the callback can't reach it. We\n // gate on a `received` flag and let the post-subscribe block do the\n // unsubscribe in the sync-emission case.\n let received = false\n const sub = getTokenState(instance).observable.subscribe((t) => {\n if (received || !t) return\n received = true\n logger.debug('auth token received')\n unsub()\n resolve(true)\n cleanup.unsubscribe()\n })\n cleanup.unsubscribe = () => sub.unsubscribe()\n if (received) cleanup.unsubscribe()\n })\n if (!hasToken || instance.isDisposed()) {\n initInFlight.delete(instance)\n logger.debug('telemetry skipped: no token resolved or instance disposed')\n return\n }\n }\n\n const manager = createTelemetryManager({\n sessionId: instance.instanceId,\n getClient: () => getClient(instance, {apiVersion: DEFAULT_TELEMETRY_API_VERSION}),\n projectId,\n environment,\n })\n\n const consented = await manager.checkConsent()\n logger.debug('consent check complete', {consented})\n if (!consented || instance.isDisposed()) {\n initInFlight.delete(instance)\n manager.dispose()\n return\n }\n\n initInFlight.delete(instance)\n telemetryManagers.set(instance, manager)\n\n const buffered = pendingHooks.get(instance)\n if (buffered) {\n logger.debug('flushing buffered hooks', {hooks: Array.from(buffered)})\n for (const hookName of buffered) {\n manager.logHookFirstUsed(hookName)\n }\n pendingHooks.delete(instance)\n }\n\n const config = instance.config\n const perspective = typeof config.perspective === 'string' ? config.perspective : 'published'\n const authMethod = config.auth?.token\n ? 'token'\n : config.studio?.auth?.token\n ? 'studio'\n : 'default'\n\n logger.info('telemetry session started', {projectId, perspective, authMethod, environment})\n manager.logSessionStarted({\n projectId,\n perspective,\n authMethod,\n })\n\n instance.onDispose(() => {\n manager.endSession()\n telemetryManagers.delete(instance)\n logger.debug('telemetry session ended')\n })\n })\n .catch((err) => {\n initInFlight.delete(instance)\n logger.warn('telemetry init failed', {error: err})\n })\n}\n\n/**\n * Retrieves the telemetry manager for an instance, if one exists.\n * Returns undefined when telemetry is disabled or not yet initialized.\n *\n * @internal\n */\nexport function getTelemetryManager(instance: SanityInstance): TelemetryManager | undefined {\n return telemetryManagers.get(instance)\n}\n\n/**\n * Record a hook name for an instance. If the telemetry manager is\n * already initialized the event is logged immediately. Otherwise\n * the name is buffered and flushed when init completes.\n *\n * @internal\n */\nexport function trackHookMounted(instance: SanityInstance, hookName: string): void {\n if (!getTelemetryEnvironment()) return\n\n const manager = findManager(instance)\n if (manager) {\n logger.trace('hook mounted (logged)', {hookName, internal: true})\n manager.logHookFirstUsed(hookName)\n return\n }\n\n const root = getRootInstance(instance)\n let hooks = pendingHooks.get(root)\n if (!hooks) {\n hooks = new Set()\n pendingHooks.set(root, hooks)\n }\n if (!hooks.has(hookName)) {\n logger.trace('hook mounted (buffered)', {hookName, internal: true})\n }\n hooks.add(hookName)\n}\n\nfunction findManager(instance: SanityInstance): TelemetryManager | undefined {\n return telemetryManagers.get(instance)\n}\n\nfunction getRootInstance(instance: SanityInstance): SanityInstance {\n return instance\n}\n","const WILDCARD_TOKEN = '*'\nconst NEGATION_TOKEN = '-'\n// This regex handles simple cases including quoted phrases.\n// More complex query syntaxes might need a more robust parser.\nconst TOKEN_REGEX = /(?:[^\\s\"]+|\"[^\"]*\")+/g\n\n/**\n * @internal\n * Checks if a token starts with the negation character.\n */\nfunction isNegationToken(token: string | undefined): boolean {\n return typeof token !== 'undefined' && token.trim().startsWith(NEGATION_TOKEN)\n}\n\n/**\n * @internal\n * Checks if a token ends with the wildcard character.\n */\nfunction isPrefixToken(token: string | undefined): boolean {\n return typeof token !== 'undefined' && token.trim().endsWith(WILDCARD_TOKEN)\n}\n\n/**\n * @internal\n * Checks if a token is enclosed in double quotes.\n */\nfunction isExactMatchToken(token: string | undefined): boolean {\n // Ensure the token exists, has at least 2 characters, and starts/ends with \"\n return !!token && token.length >= 2 && token.startsWith('\"') && token.endsWith('\"')\n}\n\n/**\n * Creates a GROQ search filter string (`[@] match text::query(\"...\")`)\n * from a raw search query string.\n *\n * It applies wildcard ('*') logic to the last eligible token and escapes\n * backslashes and double quotes within the search term.\n *\n * If the input query is empty or only whitespace, it returns an empty string.\n *\n * @param query - The raw input search string.\n * @returns The GROQ search filter string, or an empty string.\n * @internal\n */\nexport function createGroqSearchFilter(query: string): string {\n // Trim leading/trailing whitespace from the overall query first\n const trimmedQuery = query.trim()\n if (!trimmedQuery) {\n return '' // Return empty if query is empty or just whitespace\n }\n\n // Extract tokens using the regex\n const tokens = trimmedQuery.match(TOKEN_REGEX) ?? []\n\n // Find the index of the last token eligible for wildcard appending\n const reversedTokens = [...tokens].reverse()\n const reversedIndex = reversedTokens.findIndex(\n (token: string) => !isNegationToken(token) && !isExactMatchToken(token),\n )\n const finalIncrementalTokenIndex = reversedIndex === -1 ? -1 : tokens.length - 1 - reversedIndex\n\n // Get the actual token based on the found index\n const finalIncrementalToken = tokens[finalIncrementalTokenIndex]\n\n const processedTokens = [...tokens]\n // If a suitable token was found and it doesn't already end with a wildcard,\n // apply the wildcard.\n if (finalIncrementalToken !== undefined && !isPrefixToken(finalIncrementalToken)) {\n // Replace the identified token with its wildcarded version\n processedTokens.splice(\n finalIncrementalTokenIndex,\n 1,\n `${finalIncrementalToken}${WILDCARD_TOKEN}`,\n )\n }\n\n // Join the tokens back into a space-separated string\n const wildcardSearch = processedTokens.join(' ')\n\n // Escape backslashes and double quotes within the final search term for the\n // GROQ query. Backslashes go first, so the escapes added for quotes are not\n // themselves escaped. Without this a trailing backslash would escape the\n // closing quote and let the input break out of the string literal.\n const escapedSearch = wildcardSearch.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n\n // Construct the final GROQ filter clause\n return `[@] match text::query(\"${escapedSearch}\")`\n}\n"],"mappings":";;;;;;;;;;;;;;AAWA,SAAgB,qBACd,aACe;CACf,IAAI,YAAY,gBAAgB,MAAM,OAAO,IAAI,IAAI,YAAY,WAAW,CAAC,CAAC;CAC9E,IAAI,YAAY,SAAS,MAAM,OAAO;CAItC,IAAM,UAAW,WAA4B,uBAAuB;CACpE,IAAI,YAAY,aAAa;EAC3B,IAAM,SAAS,UAAU,oBAAoB;EAC7C,OAAO,WAAW,YAAY,KAAK,QAAQ,YAAY,eAAe,GAAG;CAC3E;CAEA,IAAM,SAAS,UAAU,uBAAuB;CAChD,OAAO,WAAW,YAAY,KAAK,GAAG;AACxC;;;;;;;ACrBA,MAAa,mBAAmB;CAAC;CA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MAAM,KAAK,CAAC,CAAC,WAAW,GAAc;AAC/E;;;;;AAMA,SAAS,cAAc,OAAoC;CACzD,OAAc,UAAU,UAAe,MAAM,KAAK,CAAC,CAAC,SAAS,GAAc;AAC7E;;;;;AAMA,SAAS,kBAAkB,OAAoC;CAE7D,OAAO,CAAC,CAAC,SAAS,MAAM,UAAU,KAAK,MAAM,WAAW,IAAG,KAAK,MAAM,SAAS,IAAG;AACpF;;;;;;;;;;;;;;AAeA,SAAgB,uBAAuB,OAAuB;CAE5D,IAAM,eAAe,MAAM,KAAK;CAChC,IAAI,CAAC,cACH,OAAO;CAIT,IAAM,SAAS,aAAa,MAAM,WAAW,KAAK,CAAC,GAI7C,gBADiB,CAAC,GAAG,MAAM,CAAC,CAAC,QACA,CAAC,CAAC,WAClC,UAAkB,CAAC,gBAAgB,KAAK,KAAK,CAAC,kBAAkB,KAAK,CACxE,GACM,6BAA6B,kBAAkB,KAAK,KAAK,OAAO,SAAS,IAAI,eAG7E,wBAAwB,OAAO,6BAE/B,kBAAkB,CAAC,GAAG,MAAM;CAsBlC,OAnBI,0BAA0B,KAAA,KAAa,CAAC,cAAc,qBAAqB,KAE7E,gBAAgB,OACd,4BACA,GACA,GAAG,wBACL,GAaK,0BATgB,gBAAgB,KAAK,GAMT,CAAC,CAAC,QAAQ,OAAO,MAAM,CAAC,CAAC,QAAQ,MAAM,MAG7B,EAAE;AACjD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bi as BoundStoreAction, zi as StateSource } from "../applications-
|
|
1
|
+
import { Bi as BoundStoreAction, zi as StateSource } from "../applications-CBb2hFzg.js";
|
|
2
2
|
import { ChannelInput, ChannelInstance, Controller, Message, Node, NodeInput, Status } from "@sanity/comlink";
|
|
3
3
|
/**
|
|
4
4
|
* Message sent from a containing app to an iframe
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as CapabilityRecord, B as
|
|
2
|
-
export { type ApplicationActivity, type ApplicationConfig, type ApplicationConfigAppType, type ApplicationContext, type Capability, type CapabilityRecord, type ConnectMessageBusOptions, type DashboardTopics, type DocumentActivity, type EventTopic, type EventTopicDef, type MessageBus, type MessageBusAbortOptions, type MessageBusClient, type MessageBusConnection, type MessageBusEmitOptions, type MessageBusEmitResult, MessageBusError, type MessageBusErrorCode, type MessageBusHost, type MessageBusMessage, type MessageBusMeta, type MessageBusQueryOptions, type MessageBusStateSource, type NavigationLocation, type NavigationTarget, type PayloadOf, type RemoteModuleRef, type ReplyOf, type StateTopic, type StateTopicDef, type TopicData, TopicError, type TopicName, type TopicResult, type Topics, type ValueOf, capabilities, connectMessageBus };
|
|
1
|
+
import { A as CapabilityRecord, B as RemoteModuleRef, C as ApplicationActivity, E as ApplicationContext, F as LocalApplication, G as TopicResult, H as StateTopic, J as capabilities, K as Topics, L as NavigationLocation, M as DocumentActivity, N as EventTopic, P as EventTopicDef, R as NavigationTarget, T as ApplicationConfigAppType, U as StateTopicDef, V as ReplyOf, W as TopicName, _ as MessageBusMeta, a as ConnectMessageBusOptions, b as connectMessageBus, c as MessageBusAbortOptions, d as MessageBusEmitOptions, f as MessageBusEmitResult, g as MessageBusMessage, h as MessageBusHost, j as DashboardTopics, k as Capability, l as MessageBusClient, m as MessageBusErrorCode, n as TopicError, p as MessageBusError, q as ValueOf, s as MessageBus, t as TopicData, u as MessageBusConnection, v as MessageBusQueryOptions, w as ApplicationConfig, y as MessageBusStateSource, z as PayloadOf } from "../topicStore-BcXGGrbc.js";
|
|
2
|
+
export { type ApplicationActivity, type ApplicationConfig, type ApplicationConfigAppType, type ApplicationContext, type Capability, type CapabilityRecord, type ConnectMessageBusOptions, type DashboardTopics, type DocumentActivity, type EventTopic, type EventTopicDef, type LocalApplication, type MessageBus, type MessageBusAbortOptions, type MessageBusClient, type MessageBusConnection, type MessageBusEmitOptions, type MessageBusEmitResult, MessageBusError, type MessageBusErrorCode, type MessageBusHost, type MessageBusMessage, type MessageBusMeta, type MessageBusQueryOptions, type MessageBusStateSource, type NavigationLocation, type NavigationTarget, type PayloadOf, type RemoteModuleRef, type ReplyOf, type StateTopic, type StateTopicDef, type TopicData, TopicError, type TopicName, type TopicResult, type Topics, type ValueOf, capabilities, connectMessageBus };
|
|
@@ -563,11 +563,12 @@ declare const handleOAuthCallback: BoundStoreAction<AuthStoreState, [locationHre
|
|
|
563
563
|
* callers share a single in-flight request. An unrecoverable failure (a 4xx
|
|
564
564
|
* rejecting the refresh token) clears the tokens and transitions to
|
|
565
565
|
* `LOGGED_OUT`; transient failures (network, 5xx, rate limits) leave the
|
|
566
|
-
* session intact and rethrow so the caller can retry.
|
|
566
|
+
* session intact and rethrow so the caller can retry. The resolved tokens omit
|
|
567
|
+
* the refresh token, which core retains internally for subsequent refreshes.
|
|
567
568
|
*
|
|
568
569
|
* @public
|
|
569
570
|
*/
|
|
570
|
-
declare const refreshOAuthTokens: BoundStoreAction<AuthStoreState, [], Promise<OAuthTokens | null>>;
|
|
571
|
+
declare const refreshOAuthTokens: BoundStoreAction<AuthStoreState, [], Promise<Omit<OAuthTokens, "refreshToken"> | null>>;
|
|
571
572
|
/**
|
|
572
573
|
* Revokes the OAuth tokens then clears local storage and transitions to `LOGGED_OUT`.
|
|
573
574
|
* Local state is cleared even if the revoke request fails.
|
|
@@ -577,11 +578,13 @@ declare const refreshOAuthTokens: BoundStoreAction<AuthStoreState, [], Promise<O
|
|
|
577
578
|
declare const revokeOAuthTokens: BoundStoreAction<AuthStoreState, [], Promise<void>>;
|
|
578
579
|
/**
|
|
579
580
|
* A state source exposing the current OAuth tokens (including expiry), or
|
|
580
|
-
* `null` when not logged in via OAuth.
|
|
581
|
+
* `null` when not logged in via OAuth. The refresh token is omitted — it is a
|
|
582
|
+
* long-lived credential held internally by core for `refreshOAuthTokens`, not
|
|
583
|
+
* part of the app-facing token view.
|
|
581
584
|
*
|
|
582
585
|
* @public
|
|
583
586
|
*/
|
|
584
|
-
declare const getOAuthTokensState: BoundStoreAction<AuthStoreState, [], StateSource<OAuthTokens | null>>;
|
|
587
|
+
declare const getOAuthTokensState: BoundStoreAction<AuthStoreState, [], StateSource<Omit<OAuthTokens, "refreshToken"> | null>>;
|
|
585
588
|
type AllowedClientConfigKey = 'useCdn' | 'token' | 'perspective' | 'apiHost' | 'proxy' | 'withCredentials' | 'timeout' | 'maxRetries' | 'dataset' | 'projectId' | 'requestTagPrefix' | 'useProjectHostname';
|
|
586
589
|
/**
|
|
587
590
|
* States tracked by the client store
|
|
@@ -2485,6 +2488,10 @@ interface InstallationBase {
|
|
|
2485
2488
|
/** Qualified, globally-unique handle of the installed singleton (e.g. `sanity/<name>`). */
|
|
2486
2489
|
reference: string;
|
|
2487
2490
|
slug: string | null;
|
|
2491
|
+
/** Sanitized SVG icon markup, or `null` when the singleton has no icon. */
|
|
2492
|
+
icon: string | null;
|
|
2493
|
+
/** The singleton's publishing organization; the top-level `organizationId` is the installing one. */
|
|
2494
|
+
organizationId: string;
|
|
2488
2495
|
};
|
|
2489
2496
|
}
|
|
2490
2497
|
/**
|
|
@@ -3618,4 +3625,4 @@ interface DeleteApplicationInput {
|
|
|
3618
3625
|
*/
|
|
3619
3626
|
declare const deleteApplication: (instance: SanityInstance, input: DeleteApplicationInput) => Promise<MutationResult<DeletedResult>>;
|
|
3620
3627
|
export { Project as $, createRelease as $n, ClientOptions as $r, FavoriteStatusResponse as $t, stringifyPath$1 as A, CacheWriter as Ai, patchOperations as An, getCommentsOptionsKey as Ar, SanityUser as At, getPerspectiveState as B, BoundStoreAction as Bi, DocumentAction as Bn, createComment as Br, OrganizationMember as Bt, SanityDocument$3 as C, getTokenState as Ci, resolveDocument as Cn, createDatasetHandle as Cr, TransportEvent as Ct, joinPaths as D, AccessResourceType as Di, PermissionDeniedReason as Dn, CommentsOptions as Dr, Membership as Dt, getPathDepth as E, AuthStateType as Ei, DocumentPermissionsResult as En, createProjectHandle as Er, GetUsersOptions as Et, getUsersState as F, MutationResult as Fi, CreateDocumentAction as Fn, CreateCommentOptions as Fr, Organizations as Ft, getQueryKey as G, PublishReleaseAction as Gn, Comment as Gr, InstallationActiveConfig as Gt, getActiveReleasesState as H, EditDocumentOptions as Hn, replyToComment as Hr, organization as Ht, loadMoreUsers as I, defineFetcher as Ii, CreateReleaseAction as In, RemoveCommentOptions as Ir, OrganizationsOptions as It, resolveQuery as J, UnarchiveReleaseAction as Jn, CommentReaction as Jr, InstallationsOptions as Jt, getQueryState as K, ReleaseAction as Kn, CommentLocalState as Kr, InstallationBase as Kt, resolveUser as L, defineMutation as Li, DeleteDocumentAction as Ln, ReplyToCommentOptions as Lr, organizations as Lt, isImportError as M, FetcherDefinition as Mi, JsonMatch as Mn, parseCommentsOptionsKey as Mr, UserProfile as Mt, getCorsErrorProjectId as N, FetcherSnapshot as Ni, Action as Nn, resolveCommentThreads as Nr, UsersGroupState as Nt, jsonMatch$1 as O, checkPermissions as Oi, DocumentSet as On, ResolveCommentsOptions as Or, ResolveUserOptions as Ot, getUserState as P, MutationDefinition as Pi, ArchiveReleaseAction as Pn, resolveComments as Pr, UsersStoreState as Pt, getProjectionState as Q, createDocument as Qn, CommentThread as Qr, FavoriteDocumentContext as Qt, resolveUsers as R, Selector as Ri, DeleteReleaseAction as Rn, SetCommentStatusOptions as Rr, Organization as Rt, Role as S, getLoginUrlState as Si, getPermissionsState as Sn, createLogger as Sr, StateEvent as St, getIndexForKey$1 as T, OAuthTokens as Ti, subscribeDocumentEvents as Tn, createDocumentTypeHandle as Tr, GetUserOptions as Tt, getAllReleasesState as U, EditReleaseAction as Un, setCommentStatus as Ur, Installation as Ut, ReleaseState as V, EditDocumentAction as Vn, removeComment as Vr, OrganizationOptions as Vt, QueryOptions as W, PublishDocumentAction as Wn, updateComment as Wr, InstallationAccess as Wt, projects as X, UnscheduleReleaseAction as Xn, CommentTextSelection as Xr, installation as Xt, ProjectsOptions as Y, UnpublishDocumentAction as Yn, CommentStatus as Yr, InstallationsResponse as Yt, resolveProjection as Z, archiveRelease as Zn, CommentTextSelectionItem as Zr, installations as Zt, applications as _, LoggingInAuthState as _i, TransactionAcceptedEvent as _n, LogContext as _r, PresencePerspectiveOptions as _t, ApplicationInclude as a, refreshOAuthTokens as ai, ApplyDocumentActionsOptions as an, publishDocument as ar, project as at, CurrentUser$1 as b, getDashboardOrganizationId as bi, getDocumentState as bn, Logger as br, ReportPresenceOptions as bt, ApplicationStudioConfig as c, logout as ci, DocumentCreatedEvent as cn, unarchiveRelease as cr, PreviewValue as ct, ApplicationsOptions as d, OrgVerificationResult as di, DocumentEditedEvent as dn, ResolveDocument as dr, getPresence as dt, ClientStoreState as ei, SetFavoriteInput as en, deleteDocument as er, ProjectBase as et, ApplicationsResponse as f, AuthState as fi, DocumentEvent as fn, ResolveProjectionResult as fr, reportPresence as ft, application as g, LoggedOutAuthState as gi, DocumentUnpublishedEvent as gn, InstanceContext as gr, PresenceLocation as gt, UpdateApplicationInput as h, LoggedInAuthState as hi, DocumentTransactionSubmissionResult as hn, configureLogging as hr, DocumentPresenceOptions as ht, ApplicationDeployment as i, handleOAuthCallback as ii, ActionsResult as in, editRelease as ir, ProjectOptions as it, CORE_SDK_VERSION as j, Fetcher as ji, processMutations as jn, getCommentsState as jr, SanityUserResponse as jt, slicePath$1 as k, CacheTag as ki, ProcessMutationsOptions as kn, getCommentThreadsState as kr, ResolveUsersOptions as kt, ApplicationVisibility as l, handleAuthCallback as li, DocumentDeletedEvent as ln, unpublishDocument as lr, ProjectionValuePending as lt, DeletedResult as m, ErrorAuthState as mi, DocumentRemotePatchesEvent as mn, datasets as mr, DocumentPresence as mt, ApplicationAccess as n, getClientState as ni, setFavorite as nn, discardDocument as nr, ProjectMemberRole as nt, ApplicationInterface as o, revokeOAuthTokens as oi, applyDocumentActions as on, publishRelease as or, PreviewMedia as ot, DeleteApplicationInput as p, AuthStoreState as pi, DocumentPublishedEvent as pn, ResolveQueryResult as pr, DisconnectEvent as pt, parseQueryKey as q, ScheduleReleaseAction as qn, CommentMessage as qr, InstallationInclude as qt, ApplicationBase as r, getOAuthTokensState as ri, getReleaseDocumentId as rn, editDocument as rr, ProjectMetadata as rt, ApplicationInterfacePlacementMetadata as s, startOAuthAuthorization as si, ActionErrorEvent as sn, scheduleRelease as sr, PreviewQueryResult as st, Application as t, getClient as ti, favorites as tn, deleteRelease as tr, ProjectMember as tt, ApplicationWorkspace as u, observeOrganizationVerificationState as ui, DocumentDiscardedEvent as un, unscheduleRelease as ur, getDocumentPresence as ut, deleteApplication as v, getAuthState as vi, TransactionRevertedEvent as vn, LogLevel as vr, PresenceSelection as vt, SanityProject$1 as w, setAuthToken as wi, resolvePermissions as wn, createDocumentHandle as wr, UserPresence as wt, ReleaseDocument$1 as x, getIsInDashboardState as xi, getDocumentSyncStatus as xn, LoggerConfig as xr, RollCallEvent as xt, updateApplication as y, getCurrentUserState as yi, DocumentOptions as yn, LogNamespace as yr, PresenceSelectionPoint as yt, defineProjection as z, StateSource as zi, DiscardDocumentAction as zn, UpdateCommentOptions as zr, OrganizationBase as zt };
|
|
3621
|
-
//# sourceMappingURL=applications-
|
|
3628
|
+
//# sourceMappingURL=applications-CBb2hFzg.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"applications-CBb2hFzg.d.ts","names":[],"sources":["../src/store/createStoreState.ts","../src/store/defineStore.ts","../src/store/createActionBinder.ts","../src/store/createStateSourceAction.ts","../src/store/fetcherStore.ts","../src/access/checkPermissions.ts","../src/auth/authStateType.ts","../src/auth/oauth/types.ts","../src/auth/authStore.ts","../src/project/organizationVerification.ts","../src/auth/getOrganizationVerificationState.ts","../src/auth/handleAuthCallback.ts","../src/auth/logout.ts","../src/auth/oauth/oauthActions.ts","../src/client/clientStore.ts","../src/comments/types.ts","../src/comments/commentActions.ts","../src/comments/commentsStore.ts","../src/config/handles.ts","../src/utils/logger.ts","../src/config/loggingConfig.ts","../src/datasets/datasets.ts","../src/typegen/groqCompat.ts","../src/typegen/resolve.ts","../src/document/actions.ts","../src/document/patchOperations.ts","../src/document/processMutations.ts","../src/document/permissions.ts","../src/document/sharedListener.ts","../src/document/documentStore.ts","../src/document/reducers.ts","../src/document/events.ts","../src/document/applyDocumentActions.ts","../src/document/processActions/releaseUtil.ts","../src/favorites/favorites.ts","../src/utils/includeShape.ts","../src/installations/installations.ts","../src/organization/organization.ts","../src/organizations/organizations.ts","../src/users/types.ts","../src/presence/types.ts","../src/presence/presenceStore.ts","../src/projection/types.ts","../src/preview/types.ts","../src/project/project.ts","../src/projection/getProjectionState.ts","../src/projection/resolveProjection.ts","../src/projects/projects.ts","../src/query/queryStore.ts","../src/releases/releasesStore.ts","../src/releases/getPerspectiveState.ts","../src/typegen/defineProjection.ts","../src/users/usersStore.ts","../src/utils/getCorsErrorProjectId.ts","../src/utils/isImportError.ts","../src/version.ts","../src/_exports/index.ts","../src/applications/applications.ts"],"mappings":";;;;;;;;;;;;;UAOiB,WAAW;;;;;;;EAO1B,WAAW;;;;;;;;;;EAWX,MAAM,cAAc,cAAc,QAAQ,YAAY,GAAG,WAAW,QAAQ;;;;;;;;;EAU5E,YAAY,WAAW;;;;;UC7BR,aAAa,QAAQ;;;;;;;EAOpC,UAAU;;;;;;;EAQV,OAAO,WAAW;;;;EAKlB,KAAK;;;;;KCAK,YAAY,QAAQ,2BAA2B,SAAS,mBAClE,SAAS,aAAa,QAAQ,UAC3B,QAAQ,YACR;;;;KAKO,iBAAiB,SAAS,2BAA2B,YAC/D,UAAU,mBACP,QAAQ,YACR;;;;;;;;;;;;UCpBY,YAAY;;;;;;EAM3B,YAAY;;;;;;;;EASZ,kBAAkB;;;;;;;;;;EAWlB,YAAY,WAAW;;;;;;;;;;;;;;;;;;;;;;;UAwBR,gBAAgB;;;;EAI/B,OAAO;;;;EAKP,UAAU;;;;;;KAOA,SAAS,QAAQ,2BAA2B,YACtD,SAAS,gBAAgB,YACtB,QAAQ,YACR;;;;;;;;;;;;;;UCzDY;EACf;;EAEA;;;;;;;;;;;;;;KAeU,gBAAgB;;EAGtB;EACA;EACA;EACA;EACA;;;EAIA;EACA,MAAM;;EAE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;;;;UASe,qBAAqB,gBAAgB;EACpD;EACA,MAAM,YAAY;;;;;;;;;cAeP,cAAY,SAAA,SAAA,oBAAA,sBAAA,qBAAA;;;;;;;;;cA2CZ,aAkBX,SAlBsB,uBAAA;EACuB,UAAA;gBAiB7C,YAAA;;;;;;;UAQe;EACf;;;;;;;;KASU,wBAAwB;;;;;;;;KASxB;EAA0B;IAAyB,QAC7D,KAAK;;;;;;;;cAUM,oBAAiB,UAAjB,gBAAiB,OAAA,2BAAA,QAAA,eAAA;;;;;;UA0Bb;EACf;;;;;;;;;cAUW,oBAAiB,UAAjB,gBAAiB,OAAA,2BAAA,QAAA,eAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { _ as isCanvasResource, a as DatasetResource, b as AuthConfig, c as DocumentTypeHandle, d as ProjectHandle, f as ReleaseHandle, g as TokenSource, h as StudioConfig, i as DatasetHandle, l as MediaLibraryResource, m as SanityConfig, n as createSanityInstance, o as DocumentHandle, p as ReleasePerspective, r as CanvasResource, s as DocumentResource, t as SanityInstance, u as PerspectiveHandle, v as isDatasetResource, x as AuthProvider, y as isMediaLibraryResource } from "./createSanityInstance-BQIqyGLX.js";
|
|
2
|
-
import { $ as Project, $n as createRelease, $r as ClientOptions, $t as FavoriteStatusResponse, A as stringifyPath, An as patchOperations, At as SanityUser, B as getPerspectiveState, Bn as DocumentAction, Br as createComment, Bt as OrganizationMember, C as SanityDocument, Ci as getTokenState, Cn as resolveDocument, Cr as createDatasetHandle, Ct as TransportEvent, D as joinPaths, Di as AccessResourceType, Dn as PermissionDeniedReason, Dr as CommentsOptions, Dt as Membership, E as getPathDepth, Ei as AuthStateType, En as DocumentPermissionsResult, Er as createProjectHandle, Et as GetUsersOptions, F as getUsersState, Fn as CreateDocumentAction, Fr as CreateCommentOptions, Ft as Organizations, Gn as PublishReleaseAction, Gr as Comment, Gt as InstallationActiveConfig, H as getActiveReleasesState, Hn as EditDocumentOptions, Hr as replyToComment, Ht as organization, I as loadMoreUsers, In as CreateReleaseAction, Ir as RemoveCommentOptions, It as OrganizationsOptions, J as resolveQuery, Jn as UnarchiveReleaseAction, Jr as CommentReaction, Jt as InstallationsOptions, K as getQueryState, Kn as ReleaseAction, Kr as CommentLocalState, Kt as InstallationBase, L as resolveUser, Ln as DeleteDocumentAction, Lr as ReplyToCommentOptions, Lt as organizations, M as isImportError, Mn as JsonMatch, Mt as UserProfile, N as getCorsErrorProjectId, Nn as Action, Nr as resolveCommentThreads, Nt as UsersGroupState, O as jsonMatch, Oi as checkPermissions, On as DocumentSet, Or as ResolveCommentsOptions, Ot as ResolveUserOptions, P as getUserState, Pn as ArchiveReleaseAction, Pr as resolveComments, Pt as UsersStoreState, Q as getProjectionState, Qn as createDocument, Qr as CommentThread, Qt as FavoriteDocumentContext, R as resolveUsers, Ri as Selector, Rn as DeleteReleaseAction, Rr as SetCommentStatusOptions, Rt as Organization, S as Role, Si as getLoginUrlState, Sn as getPermissionsState, St as StateEvent, T as getIndexForKey, Ti as OAuthTokens, Tn as subscribeDocumentEvents, Tr as createDocumentTypeHandle, Tt as GetUserOptions, U as getAllReleasesState, Un as EditReleaseAction, Ur as setCommentStatus, Ut as Installation, V as ReleaseState, Vn as EditDocumentAction, Vr as removeComment, Vt as OrganizationOptions, W as QueryOptions, Wn as PublishDocumentAction, Wr as updateComment, Wt as InstallationAccess, X as projects, Xn as UnscheduleReleaseAction, Xr as CommentTextSelection, Xt as installation, Y as ProjectsOptions, Yn as UnpublishDocumentAction, Yr as CommentStatus, Yt as InstallationsResponse, Z as resolveProjection, Zn as archiveRelease, Zr as CommentTextSelectionItem, Zt as installations, _ as applications, _i as LoggingInAuthState, _n as TransactionAcceptedEvent, _r as LogContext, _t as PresencePerspectiveOptions, a as ApplicationInclude, ai as refreshOAuthTokens, an as ApplyDocumentActionsOptions, ar as publishDocument, at as project, b as CurrentUser, bi as getDashboardOrganizationId, bn as getDocumentState, br as Logger, bt as ReportPresenceOptions, c as ApplicationStudioConfig, ci as logout, cn as DocumentCreatedEvent, cr as unarchiveRelease, ct as PreviewValue, d as ApplicationsOptions, di as OrgVerificationResult, dn as DocumentEditedEvent, dr as ResolveDocument, dt as getPresence, ei as ClientStoreState, en as SetFavoriteInput, er as deleteDocument, et as ProjectBase, f as ApplicationsResponse, fi as AuthState, fn as DocumentEvent, fr as ResolveProjectionResult, ft as reportPresence, g as application, gi as LoggedOutAuthState, gn as DocumentUnpublishedEvent, gr as InstanceContext, gt as PresenceLocation, h as UpdateApplicationInput, hi as LoggedInAuthState, hn as DocumentTransactionSubmissionResult, hr as configureLogging, ht as DocumentPresenceOptions, i as ApplicationDeployment, ii as handleOAuthCallback, in as ActionsResult, ir as editRelease, it as ProjectOptions, j as CORE_SDK_VERSION, jn as processMutations, jr as getCommentsState, jt as SanityUserResponse, k as slicePath, kn as ProcessMutationsOptions, kr as getCommentThreadsState, kt as ResolveUsersOptions, l as ApplicationVisibility, li as handleAuthCallback, ln as DocumentDeletedEvent, lr as unpublishDocument, lt as ProjectionValuePending, m as DeletedResult, mi as ErrorAuthState, mn as DocumentRemotePatchesEvent, mr as datasets, mt as DocumentPresence, n as ApplicationAccess, ni as getClientState, nn as setFavorite, nr as discardDocument, nt as ProjectMemberRole, o as ApplicationInterface, oi as revokeOAuthTokens, on as applyDocumentActions, or as publishRelease, ot as PreviewMedia, p as DeleteApplicationInput, pi as AuthStoreState, pn as DocumentPublishedEvent, pr as ResolveQueryResult, pt as DisconnectEvent, qn as ScheduleReleaseAction, qr as CommentMessage, qt as InstallationInclude, r as ApplicationBase, ri as getOAuthTokensState, rn as getReleaseDocumentId, rr as editDocument, rt as ProjectMetadata, s as ApplicationInterfacePlacementMetadata, si as startOAuthAuthorization, sn as ActionErrorEvent, sr as scheduleRelease, st as PreviewQueryResult, t as Application, ti as getClient, tn as favorites, tr as deleteRelease, tt as ProjectMember, u as ApplicationWorkspace, ui as observeOrganizationVerificationState, un as DocumentDiscardedEvent, ur as unscheduleRelease, ut as getDocumentPresence, v as deleteApplication, vi as getAuthState, vn as TransactionRevertedEvent, vr as LogLevel, vt as PresenceSelection, w as SanityProject, wi as setAuthToken, wn as resolvePermissions, wr as createDocumentHandle, wt as UserPresence, x as ReleaseDocument, xi as getIsInDashboardState, xn as getDocumentSyncStatus, xr as LoggerConfig, xt as RollCallEvent, y as updateApplication, yi as getCurrentUserState, yn as DocumentOptions, yr as LogNamespace, yt as PresenceSelectionPoint, z as defineProjection, zi as StateSource, zn as DiscardDocumentAction, zr as UpdateCommentOptions, zt as OrganizationBase } from "./applications-
|
|
2
|
+
import { $ as Project, $n as createRelease, $r as ClientOptions, $t as FavoriteStatusResponse, A as stringifyPath, An as patchOperations, At as SanityUser, B as getPerspectiveState, Bn as DocumentAction, Br as createComment, Bt as OrganizationMember, C as SanityDocument, Ci as getTokenState, Cn as resolveDocument, Cr as createDatasetHandle, Ct as TransportEvent, D as joinPaths, Di as AccessResourceType, Dn as PermissionDeniedReason, Dr as CommentsOptions, Dt as Membership, E as getPathDepth, Ei as AuthStateType, En as DocumentPermissionsResult, Er as createProjectHandle, Et as GetUsersOptions, F as getUsersState, Fn as CreateDocumentAction, Fr as CreateCommentOptions, Ft as Organizations, Gn as PublishReleaseAction, Gr as Comment, Gt as InstallationActiveConfig, H as getActiveReleasesState, Hn as EditDocumentOptions, Hr as replyToComment, Ht as organization, I as loadMoreUsers, In as CreateReleaseAction, Ir as RemoveCommentOptions, It as OrganizationsOptions, J as resolveQuery, Jn as UnarchiveReleaseAction, Jr as CommentReaction, Jt as InstallationsOptions, K as getQueryState, Kn as ReleaseAction, Kr as CommentLocalState, Kt as InstallationBase, L as resolveUser, Ln as DeleteDocumentAction, Lr as ReplyToCommentOptions, Lt as organizations, M as isImportError, Mn as JsonMatch, Mt as UserProfile, N as getCorsErrorProjectId, Nn as Action, Nr as resolveCommentThreads, Nt as UsersGroupState, O as jsonMatch, Oi as checkPermissions, On as DocumentSet, Or as ResolveCommentsOptions, Ot as ResolveUserOptions, P as getUserState, Pn as ArchiveReleaseAction, Pr as resolveComments, Pt as UsersStoreState, Q as getProjectionState, Qn as createDocument, Qr as CommentThread, Qt as FavoriteDocumentContext, R as resolveUsers, Ri as Selector, Rn as DeleteReleaseAction, Rr as SetCommentStatusOptions, Rt as Organization, S as Role, Si as getLoginUrlState, Sn as getPermissionsState, St as StateEvent, T as getIndexForKey, Ti as OAuthTokens, Tn as subscribeDocumentEvents, Tr as createDocumentTypeHandle, Tt as GetUserOptions, U as getAllReleasesState, Un as EditReleaseAction, Ur as setCommentStatus, Ut as Installation, V as ReleaseState, Vn as EditDocumentAction, Vr as removeComment, Vt as OrganizationOptions, W as QueryOptions, Wn as PublishDocumentAction, Wr as updateComment, Wt as InstallationAccess, X as projects, Xn as UnscheduleReleaseAction, Xr as CommentTextSelection, Xt as installation, Y as ProjectsOptions, Yn as UnpublishDocumentAction, Yr as CommentStatus, Yt as InstallationsResponse, Z as resolveProjection, Zn as archiveRelease, Zr as CommentTextSelectionItem, Zt as installations, _ as applications, _i as LoggingInAuthState, _n as TransactionAcceptedEvent, _r as LogContext, _t as PresencePerspectiveOptions, a as ApplicationInclude, ai as refreshOAuthTokens, an as ApplyDocumentActionsOptions, ar as publishDocument, at as project, b as CurrentUser, bi as getDashboardOrganizationId, bn as getDocumentState, br as Logger, bt as ReportPresenceOptions, c as ApplicationStudioConfig, ci as logout, cn as DocumentCreatedEvent, cr as unarchiveRelease, ct as PreviewValue, d as ApplicationsOptions, di as OrgVerificationResult, dn as DocumentEditedEvent, dr as ResolveDocument, dt as getPresence, ei as ClientStoreState, en as SetFavoriteInput, er as deleteDocument, et as ProjectBase, f as ApplicationsResponse, fi as AuthState, fn as DocumentEvent, fr as ResolveProjectionResult, ft as reportPresence, g as application, gi as LoggedOutAuthState, gn as DocumentUnpublishedEvent, gr as InstanceContext, gt as PresenceLocation, h as UpdateApplicationInput, hi as LoggedInAuthState, hn as DocumentTransactionSubmissionResult, hr as configureLogging, ht as DocumentPresenceOptions, i as ApplicationDeployment, ii as handleOAuthCallback, in as ActionsResult, ir as editRelease, it as ProjectOptions, j as CORE_SDK_VERSION, jn as processMutations, jr as getCommentsState, jt as SanityUserResponse, k as slicePath, kn as ProcessMutationsOptions, kr as getCommentThreadsState, kt as ResolveUsersOptions, l as ApplicationVisibility, li as handleAuthCallback, ln as DocumentDeletedEvent, lr as unpublishDocument, lt as ProjectionValuePending, m as DeletedResult, mi as ErrorAuthState, mn as DocumentRemotePatchesEvent, mr as datasets, mt as DocumentPresence, n as ApplicationAccess, ni as getClientState, nn as setFavorite, nr as discardDocument, nt as ProjectMemberRole, o as ApplicationInterface, oi as revokeOAuthTokens, on as applyDocumentActions, or as publishRelease, ot as PreviewMedia, p as DeleteApplicationInput, pi as AuthStoreState, pn as DocumentPublishedEvent, pr as ResolveQueryResult, pt as DisconnectEvent, qn as ScheduleReleaseAction, qr as CommentMessage, qt as InstallationInclude, r as ApplicationBase, ri as getOAuthTokensState, rn as getReleaseDocumentId, rr as editDocument, rt as ProjectMetadata, s as ApplicationInterfacePlacementMetadata, si as startOAuthAuthorization, sn as ActionErrorEvent, sr as scheduleRelease, st as PreviewQueryResult, t as Application, ti as getClient, tn as favorites, tr as deleteRelease, tt as ProjectMember, u as ApplicationWorkspace, ui as observeOrganizationVerificationState, un as DocumentDiscardedEvent, ur as unscheduleRelease, ut as getDocumentPresence, v as deleteApplication, vi as getAuthState, vn as TransactionRevertedEvent, vr as LogLevel, vt as PresenceSelection, w as SanityProject, wi as setAuthToken, wn as resolvePermissions, wr as createDocumentHandle, wt as UserPresence, x as ReleaseDocument, xi as getIsInDashboardState, xn as getDocumentSyncStatus, xr as LoggerConfig, xt as RollCallEvent, y as updateApplication, yi as getCurrentUserState, yn as DocumentOptions, yr as LogNamespace, yt as PresenceSelectionPoint, z as defineProjection, zi as StateSource, zn as DiscardDocumentAction, zr as UpdateCommentOptions, zt as OrganizationBase } from "./applications-CBb2hFzg.js";
|
|
3
3
|
export { type AccessResourceType, type Action, type ActionErrorEvent, type ActionsResult, type Application, type ApplicationAccess, type ApplicationBase, type ApplicationDeployment, type ApplicationInclude, type ApplicationInterface, type ApplicationInterfacePlacementMetadata, type ApplicationStudioConfig, type ApplicationVisibility, type ApplicationWorkspace, type ApplicationsOptions, type ApplicationsResponse, type ApplyDocumentActionsOptions, type ArchiveReleaseAction, type AuthConfig, type AuthProvider, type AuthState, AuthStateType, type AuthStoreState, CORE_SDK_VERSION, type CanvasResource, type ClientOptions, type ClientStoreState as ClientState, type Comment, type CommentLocalState, type CommentMessage, type CommentReaction, type CommentStatus, type CommentTextSelection, type CommentTextSelectionItem, type CommentThread, type CommentsOptions, type CreateCommentOptions, type CreateDocumentAction, type CreateReleaseAction, type CurrentUser, type DatasetHandle, type DatasetResource, type DeleteApplicationInput, type DeleteDocumentAction, type DeleteReleaseAction, type DeletedResult, type DiscardDocumentAction, type DisconnectEvent, type DocumentAction, type DocumentCreatedEvent, type DocumentDeletedEvent, type DocumentDiscardedEvent, type DocumentEditedEvent, type DocumentEvent, type DocumentHandle, type DocumentOptions, type DocumentPermissionsResult, type DocumentPresence, type DocumentPresenceOptions, type DocumentPublishedEvent, type DocumentRemotePatchesEvent, type DocumentResource, type DocumentSet, type DocumentTransactionSubmissionResult, type DocumentTypeHandle, type DocumentUnpublishedEvent, type EditDocumentAction, type EditDocumentOptions, type EditReleaseAction, type ErrorAuthState, type FavoriteDocumentContext, type FavoriteStatusResponse, type GetUserOptions, type GetUsersOptions, type Installation, type InstallationAccess, type InstallationActiveConfig, type InstallationBase, type InstallationInclude, type InstallationsOptions, type InstallationsResponse, type InstanceContext, type JsonMatch, type LogContext, type LogLevel, type LogNamespace, type LoggedInAuthState, type LoggedOutAuthState, type Logger, type LoggerConfig, type LoggingInAuthState, type MediaLibraryResource, type Membership, type OAuthTokens, type OrgVerificationResult, type Organization, type OrganizationBase, type OrganizationMember, type OrganizationOptions, type Organizations, type OrganizationsOptions, type PermissionDeniedReason, type PerspectiveHandle, type PresenceLocation, type PresencePerspectiveOptions, type PresenceSelection, type PresenceSelectionPoint, type PreviewMedia, type PreviewQueryResult, type PreviewValue, type ProcessMutationsOptions, type Project, type ProjectBase, type ProjectHandle, type ProjectMember, type ProjectMemberRole, type ProjectMetadata, type ProjectOptions, type ProjectionValuePending, type ProjectsOptions, type PublishDocumentAction, type PublishReleaseAction, type QueryOptions, type ReleaseAction, type ReleaseDocument, type ReleaseHandle, type ReleasePerspective, type ReleaseState, type RemoveCommentOptions, type ReplyToCommentOptions, type ReportPresenceOptions, type ResolveCommentsOptions, type ResolveDocument, type ResolveProjectionResult, type ResolveQueryResult, type ResolveUserOptions, type ResolveUsersOptions, type Role, type RollCallEvent, type SanityConfig, type SanityDocument, type SanityInstance, SanityProject, type SanityUser, type SanityUserResponse, type ScheduleReleaseAction, type Selector, type SetCommentStatusOptions, type SetFavoriteInput, type StateEvent, type StateSource, type StudioConfig, type TokenSource, type TransactionAcceptedEvent, type TransactionRevertedEvent, type TransportEvent, type UnarchiveReleaseAction, type UnpublishDocumentAction, type UnscheduleReleaseAction, type UpdateApplicationInput, type UpdateCommentOptions, type UserPresence, type UserProfile, type UsersGroupState, type UsersStoreState, application, applications, applyDocumentActions, archiveRelease, checkPermissions, configureLogging, createComment, createDatasetHandle, createDocument, createDocumentHandle, createDocumentTypeHandle, createProjectHandle, createRelease, createSanityInstance, datasets, defineProjection, deleteApplication, deleteDocument, deleteRelease, discardDocument, editDocument, editRelease, favorites, getActiveReleasesState, getAllReleasesState, getAuthState, getClient, getClientState, getCommentThreadsState, getCommentsState, getCorsErrorProjectId, getCurrentUserState, getDashboardOrganizationId, getDocumentPresence, getDocumentState, getDocumentSyncStatus, getIndexForKey, getIsInDashboardState, getLoginUrlState, getOAuthTokensState, getPathDepth, getPermissionsState, getPerspectiveState, getPresence, getProjectionState, getQueryState, getReleaseDocumentId, getTokenState, getUserState, getUsersState, handleAuthCallback, handleOAuthCallback, installation, installations, isCanvasResource, isDatasetResource, isImportError, isMediaLibraryResource, joinPaths, jsonMatch, loadMoreUsers, logout, observeOrganizationVerificationState, organization, organizations, patchOperations, processMutations, project, projects, publishDocument, publishRelease, refreshOAuthTokens, removeComment, replyToComment, reportPresence, resolveCommentThreads, resolveComments, resolveDocument, resolvePermissions, resolveProjection, resolveQuery, resolveUser, resolveUsers, revokeOAuthTokens, scheduleRelease, setAuthToken, setCommentStatus, setFavorite, slicePath, startOAuthAuthorization, stringifyPath, subscribeDocumentEvents, unarchiveRelease, unpublishDocument, unscheduleRelease, updateApplication, updateComment };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { D as getAuthLogger, E as REQUEST_TAG_PREFIX, O as configureLogging$1, S as AuthStateType, T as DEFAULT_BASE, b as getTokenFromLocation, c as getDashboardOrganizationId, d as getTokenState, f as setAuthToken, h as getCleanedUrl, i as authStore, k as createLogger, l as getIsInDashboardState, m as getAuthCode, n as getClient, o as getAuthState, p as createLoggedInAuthState, r as getClientState, s as getCurrentUserState, u as getLoginUrlState, w as DEFAULT_API_VERSION, y as getDefaultLocation } from "./clientStore-CD-USpIU.js";
|
|
2
2
|
import { c as isReleasePerspective, d as isMediaLibraryResource, i as bindActionGlobally, l as isCanvasResource, n as bindActionByResource, o as defineStore, r as bindActionByResourceAndPerspective, t as createStateSourceAction, u as isDatasetResource } from "./createStateSourceAction-DdAhEfnZ.js";
|
|
3
|
-
import { A as clearPendingTransaction, B as assertDatasetResource, C as getCommentsState, D as toCommentsKeyParts, E as resolveComments, F as rollbackCommentUpdate, G as defineMutation, H as provisionAddonDataset, I as setCommentCreateError, K as randomId, L as setPendingTransaction, M as receiveComment, N as removeCommentById, O as addComment, P as restoreComments, R as normalizeComment, T as resolveCommentThreads, U as COMMENTS_API_VERSION, V as getAddonDatasetState, W as defineFetcher, _ as updateLastLoadMoreRequest, a as resolveQuery, b as commentsStore, c as getAllReleasesState, d as getUsersKey, f as initializeRequest, g as setUsersError, h as setUsersData, j as getCommentsKey, k as applyCommentUpdate, l as addSubscription, m as removeSubscription, o as getPerspectiveState, p as parseUsersKey, q as randomUuid, r as getQueryState, s as getActiveReleasesState, t as CORE_SDK_VERSION, u as cancelRequest, v as PROJECT_API_VERSION, x as getCommentThreadsState, y as USERS_STATE_CLEAR_DELAY, z as toCommentFieldPath } from "./version-
|
|
3
|
+
import { A as clearPendingTransaction, B as assertDatasetResource, C as getCommentsState, D as toCommentsKeyParts, E as resolveComments, F as rollbackCommentUpdate, G as defineMutation, H as provisionAddonDataset, I as setCommentCreateError, K as randomId, L as setPendingTransaction, M as receiveComment, N as removeCommentById, O as addComment, P as restoreComments, R as normalizeComment, T as resolveCommentThreads, U as COMMENTS_API_VERSION, V as getAddonDatasetState, W as defineFetcher, _ as updateLastLoadMoreRequest, a as resolveQuery, b as commentsStore, c as getAllReleasesState, d as getUsersKey, f as initializeRequest, g as setUsersError, h as setUsersData, j as getCommentsKey, k as applyCommentUpdate, l as addSubscription, m as removeSubscription, o as getPerspectiveState, p as parseUsersKey, q as randomUuid, r as getQueryState, s as getActiveReleasesState, t as CORE_SDK_VERSION, u as cancelRequest, v as PROJECT_API_VERSION, x as getCommentThreadsState, y as USERS_STATE_CLEAR_DELAY, z as toCommentFieldPath } from "./version-DU5YxpGn.js";
|
|
4
4
|
import { r as omitProperty, t as isDeepEqual } from "./object-CxXlSVg7.js";
|
|
5
5
|
import { n as setCleanupTimeout } from "./setCleanupTimeout-BiM6q1KF.js";
|
|
6
6
|
import { t as _defineProperty } from "./defineProperty-Bho9Ngsi.js";
|
|
@@ -8,6 +8,7 @@ import { t as getNodeState } from "./getNodeState-B4nG0sjm.js";
|
|
|
8
8
|
import { ClientError, CorsOriginError, ServerError } from "@sanity/client";
|
|
9
9
|
import { EMPTY, NEVER, Observable, Subject, Subscription, auditTime, catchError, combineLatest, concat, concatMap, debounceTime, defer, distinctUntilChanged, filter, first, firstValueFrom, from, fromEvent, groupBy, map, merge, mergeMap, of, pairwise, partition, race, retry, share, shareReplay, skip, startWith, switchMap, take, takeUntil, tap, throttle, throwError, timer, withLatestFrom } from "rxjs";
|
|
10
10
|
import { isKeySegment, isKeyedObject } from "@sanity/types";
|
|
11
|
+
import { createSelector } from "reselect";
|
|
11
12
|
import { DocumentId, getDraftId, getPublishedId, getVersionId, isDraftId, isPublishedId, isVersionId } from "@sanity/id-utils";
|
|
12
13
|
import { getIndexForKey, getIndexForKey as getIndexForKey$1, getPathDepth, joinPaths, jsonMatch, jsonMatch as jsonMatch$1, slicePath, slicePath as slicePath$1, stringifyPath, stringifyPath as stringifyPath$1 } from "@sanity/json-match";
|
|
13
14
|
import { SanityEncoder } from "@sanity/mutate";
|
|
@@ -15,7 +16,6 @@ import { createDocumentLoaderFromClient } from "@sanity/mutate/_unstable_store";
|
|
|
15
16
|
import { evaluateSync, parse } from "groq-js";
|
|
16
17
|
import { catchError as catchError$1, distinctUntilChanged as distinctUntilChanged$1, map as map$1, mergeMap as mergeMap$1, retry as retry$1, scan, share as share$1, switchMap as switchMap$1 } from "rxjs/operators";
|
|
17
18
|
import { applyPatches, parsePatch } from "@sanity/diff-match-patch";
|
|
18
|
-
import { createSelector } from "reselect";
|
|
19
19
|
import { diffValue } from "@sanity/diff-patch";
|
|
20
20
|
import { SDK_CHANNEL_NAME, SDK_NODE_NAME } from "@sanity/message-protocol";
|
|
21
21
|
import { fromUrl } from "@sanity/bifur-client";
|
|
@@ -574,7 +574,8 @@ let refreshInFlight = null;
|
|
|
574
574
|
* callers share a single in-flight request. An unrecoverable failure (a 4xx
|
|
575
575
|
* rejecting the refresh token) clears the tokens and transitions to
|
|
576
576
|
* `LOGGED_OUT`; transient failures (network, 5xx, rate limits) leave the
|
|
577
|
-
* session intact and rethrow so the caller can retry.
|
|
577
|
+
* session intact and rethrow so the caller can retry. The resolved tokens omit
|
|
578
|
+
* the refresh token, which core retains internally for subsequent refreshes.
|
|
578
579
|
*
|
|
579
580
|
* @public
|
|
580
581
|
*/
|
|
@@ -603,10 +604,12 @@ async function doRefreshOAuthTokens({ state, instance }) {
|
|
|
603
604
|
body: params.toString(),
|
|
604
605
|
tag: "oauth.refresh"
|
|
605
606
|
}));
|
|
606
|
-
|
|
607
|
+
tokens.refreshToken ||= current.refreshToken, options.storageArea?.setItem(options.storageKey, serializeTokens(tokens)), logger.info("OAuth tokens refreshed"), state.set("oauthRefreshed", {
|
|
607
608
|
authState: createLoggedInAuthState(tokens.accessToken, null),
|
|
608
609
|
oauthTokens: tokens
|
|
609
|
-
})
|
|
610
|
+
});
|
|
611
|
+
let { refreshToken: _refreshToken, ...publicTokens } = tokens;
|
|
612
|
+
return publicTokens;
|
|
610
613
|
} catch (error) {
|
|
611
614
|
throw isUnrecoverableRefreshError(error) ? (logger.error("OAuth token refresh failed — logging out", { error }), options.storageArea?.removeItem(options.storageKey), state.set("oauthRefreshFailed", {
|
|
612
615
|
authState: {
|
|
@@ -650,7 +653,11 @@ const revokeOAuthTokens = bindActionGlobally(authStore, async ({ state, instance
|
|
|
650
653
|
oauthTokens: void 0
|
|
651
654
|
});
|
|
652
655
|
}
|
|
653
|
-
}),
|
|
656
|
+
}), selectPublicOAuthTokens = createSelector((state) => state.oauthTokens, (oauthTokens) => {
|
|
657
|
+
if (!oauthTokens) return null;
|
|
658
|
+
let { refreshToken: _refreshToken, ...tokens } = oauthTokens;
|
|
659
|
+
return tokens;
|
|
660
|
+
}), getOAuthTokensState = bindActionGlobally(authStore, createStateSourceAction(({ state }) => selectPublicOAuthTokens(state)));
|
|
654
661
|
/** Removes the transient PKCE artifacts from session storage. */
|
|
655
662
|
function clearOAuthArtifacts(session) {
|
|
656
663
|
session?.removeItem(OAUTH_VERIFIER_KEY), session?.removeItem(OAUTH_STATE_KEY);
|