import { SKED_API_SERVER_KEY, SKED_STATIC_TOKEN_KEY } from '../constants'; export type LambdaHttpStatus = number; export type Variables = { [variable: string]: string; }; export declare enum CustomFunctionStatus { SUCCESS = "success", ERROR = "error" } export declare enum CustomFunctionPaths { SAVE_PATH = "/save", FETCH_PATH = "/fetch", STATIC_FETCH_PATH = "/static", VALIDATE_PATH = "/validate", SEARCH_PATH = "/search", RESOURCE_FETCH_PATH = "/resource_fetch", RESOURCE_DESCRIPTOR_PATH = "/resource_descriptor", CHANGESET_PATH = "/changeset", CHANGESET_AFTER_PATH = "/changeset_after" } export type V2ResourceScope = 'Instance' | 'Static'; export type V2ResourceDescriptor = { name: string; scope: V2ResourceScope; }; export type SharedResourceScopeMap = Partial>; export type SharedResourceInput = SharedResourceScopeMap | V2ResourceDescriptor[]; export type CustomFunctionRequestHeaders = { 'Content-Type': 'application/json'; Authorization: string; [SKED_API_SERVER_KEY]: string; [SKED_STATIC_TOKEN_KEY]: string; [key: string]: string; }; export type CustomFunctionInput = CustomFetchInput | CustomStaticFetchInput | CustomValidationInput | CustomSaveInput | CustomSearchInput | CustomResourceFetchInput | { [key: string]: any; }; export type UploadedFile = { fieldname: string; originalname: string; encoding: string; mimetype: string; buffer: Buffer; size: number; }; export type CustomFunctionRequestBase = { method: 'get' | 'post' | 'put' | 'delete' | 'head' | string; headers: CustomFunctionRequestHeaders; path: string; querystring?: string | null; body: CustomFunctionInput; files?: UploadedFile[]; }; export type ObjectDataResult = { __typename: string; UID?: string; [key: string]: any; }; export type ObjectDataInput = { __typename: string; UID: string; [key: string]: any; }; export type NormalizedInstanceData = { [key: string]: { [key: string]: ObjectDataInput; }; }; export type CustomSaveInput0_0_1 = { instanceData: NormalizedInstanceData; newInstanceData: NormalizedInstanceData; staticData?: { [key: string]: any; }; objectMapping?: { [key: string]: string; }; variables?: Variables; }; export type CustomSaveInput0_0_19 = { metadata: { [key: string]: any; }; instanceData: { [key: string]: any; }; newInstanceData: { [key: string]: any; }; staticData?: { [key: string]: any; }; objectMapping?: { [key: string]: string; }; variables?: Variables; }; export type CustomSaveInput0_0_26 = { contextObject: string; contextObjectId: string; metadata: { [key: string]: any; }; instanceData: { [key: string]: any; }; newInstanceData: { [key: string]: any; }; staticData?: { [key: string]: any; }; objectMapping?: { [key: string]: string; }; variables?: Variables; }; export type CustomSaveInput = CustomSaveInput0_0_26; export type SupportedCustomSaveInput = CustomSaveInput0_0_1 | CustomSaveInput0_0_19 | CustomSaveInput0_0_26; export type CustomFetchInput = { contextObject: string; contextObjectId: string; variables?: Variables; }; export type SupportedCustomFetchInput = CustomFetchInput; export type CustomStaticFetchInput_0_0_1 = { contextObject: string; contextObjectId: string; variables?: Variables; }; export type CustomStaticFetchInput_0_0_31 = { variables?: Variables; adminUserVendorAccessInfo?: { accessToken?: string; instanceUrl?: string; }; }; export type CustomStaticFetchInput = CustomStaticFetchInput_0_0_31; export type SupportedCustomStaticFetchInput = CustomStaticFetchInput_0_0_1 | CustomStaticFetchInput_0_0_31; export type CustomValidationInput = CustomSaveInput; export type SupportedCustomValidationInput = SupportedCustomSaveInput; export type CustomSearchInput = { label: string; variables?: Variables; }; export type SupportedCustomSearchInput = CustomSearchInput; export type CustomResourceFetchInput = { names: string[]; contextObjectId?: string; variables?: Variables; }; export type SharedResourceFetchRequest = { resources?: V2ResourceDescriptor[]; names?: string[]; contextObjectId?: string; variables?: Variables; }; export type SupportedCustomResourceFetchInput = CustomResourceFetchInput; export type SharedResourceDescriptorResult = { features: CustomFunctionFeatures; }; export type ChangeSetOperation = 'insert' | 'update' | 'delete' | 'upsert'; export type ChangeSetChange = { op: ChangeSetOperation; type: string; uid: string; fields?: { [key: string]: unknown; }; keyField?: string; hasAttachments?: boolean; }; export type CustomChangeSetInput = { name: string; changes: ChangeSetChange[]; contextObjectId?: string; objectMapping?: { [key: string]: string; }; variables?: Variables; }; export type SupportedCustomChangeSetInput = CustomChangeSetInput; export type CustomChangeSetAfterInput = { name: string; changes: ChangeSetChange[]; resolvedMap: { [uid: string]: string | null; }; contextObjectId?: string; variables?: Variables; }; export type SupportedCustomChangeSetAfterInput = CustomChangeSetAfterInput; export type ChangeSetChangeOutcome = { uid: string; handled: false; } | { uid: string; handled: true; resolvedUid: string; linkedAttachment?: boolean; }; export type CustomChangeSetResult = { changes: ChangeSetChangeOutcome[]; attachmentParentIds?: string[]; }; export type ChangeSetDescriptor = { name: string; }; export type CustomRawInput = { method: 'get' | 'post' | 'put' | 'delete' | 'head' | string; path: string; querystring?: string | null; body: { [key: string]: any; }; }; export type BaseResult = { status: CustomFunctionStatus; message?: any; }; export type CustomResult = T & BaseResult; export type CustomFunctionResult = CustomFetchResult | CustomStaticFetchResult | CustomSearchResult | CustomSaveResult | CustomValidationResult | CustomResourceFetchResult; export type CustomFetchResult = { data: { [key: string]: any; }; attachmentParentIds?: string[]; }; export type CustomSaveResult = { objectMapping: { [key: string]: string; }; attachmentParentIds?: string[]; }; export type CustomStaticFetchResult = { data: { [key: string]: any; }; attachmentParentIds?: string[]; }; export type CustomSearchResult = { data: any; attachmentParentIds?: string[]; }; export type CustomValidationResult = {}; export type MexDataV2Body = { data?: unknown; materializedAt?: string; hasError?: boolean; error?: { code: string; message: string; details?: unknown; }; }; export type CustomResourceFetchResult = { results: { [name: string]: MexDataV2Body; }; }; export type CustomFunctionInfo = { libVersion: string; features: CustomFunctionFeatures; }; export type CustomFunctionFeatures = { fetchFunction?: boolean; saveFunction?: boolean; validateFunction?: boolean; staticFunction?: boolean; searchFunction?: boolean; resourceFetchFunction?: boolean; resources?: V2ResourceDescriptor[]; changeSetFunction?: boolean; changeSetAfterFunction?: boolean; changeSets?: ChangeSetDescriptor[]; }; //# sourceMappingURL=customFunction.d.ts.map