import { QueryDefinition, ObjectTypeDefinition, InterfaceDefinition } from '@osdk/client'; /** * Declare which resources a function needs access to. * * For `objects`, `interfaces` and `queries`, you may provide either: * - A string alias from resources.json (e.g. `"myObject"`) * - An OSDK type reference imported from your generated ontology SDK (e.g. `Employee`) * * For `links`, `datasets`, `streams`, `mediasets` and `models`, only string aliases are supported. */ interface ScopeResources { queries?: Array; objects?: Array; interfaces?: Array; links?: string[]; models?: string[]; datasets?: string[]; mediasets?: string[]; streams?: string[]; } /** * Helpers for declaring resource scope. * * Or use these helpers: * `resources: ScopeResources.defaultScopeResources` — use the repo's default scope from resources.json */ declare namespace ScopeResources { /** * Sentinel value: discovery populates scope from `defaultResources` declared in functions.json. */ const defaultResources: unique symbol; } /** * Declare read-only marking requirements for callers of this function. */ interface ScopeReadAuthorization { read: string[]; } /** * Declare read and write marking requirements for callers of this function. */ interface ScopeReadWriteAuthorization extends ScopeReadAuthorization { write: string[]; } /** * Helpers for declaring authorization scope. * * Or use these helpers: * `authorization: ScopeAuthorization.defaultRead` — use the repo's default read authorization from functions.json */ declare namespace ScopeAuthorization { /** * Sentinel value: discovery uses `defaultAuthorization.read` declared in functions.json. */ const defaultRead: unique symbol; } /** * The scope declaration for a function. * Accepts plain object literals or the sentinel/factory helpers from `ScopeResources` and `ReadOnlyAuthorization`. */ interface Scope { resources: ScopeResources | typeof ScopeResources.defaultResources; authorization: ScopeReadAuthorization | ScopeReadWriteAuthorization | typeof ScopeAuthorization.defaultRead; } export { type Scope as S, ScopeAuthorization as a, type ScopeReadAuthorization as b, type ScopeReadWriteAuthorization as c, ScopeResources as d };