@ai-stack/payloadcms 3.2.12-beta → 3.2.13-beta
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/types.d.ts +6 -15
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JSONSchema } from 'openai/lib/jsonschema';
|
|
2
2
|
import type { ImageGenerateParams } from 'openai/resources/images';
|
|
3
|
-
import type { Endpoint, Field, GroupField, PayloadRequest } from 'payload';
|
|
3
|
+
import type { CollectionSlug, DataFromCollectionSlug, Endpoint, Field, File, GroupField, PayloadRequest } from 'payload';
|
|
4
4
|
import type { CSSProperties, MouseEventHandler } from 'react';
|
|
5
5
|
export interface PluginConfigAccess {
|
|
6
6
|
settings?: ({ req }: {
|
|
@@ -11,16 +11,13 @@ export type PluginConfigMediaUploadFunction = (result: {
|
|
|
11
11
|
data: Record<any, any>;
|
|
12
12
|
file: File;
|
|
13
13
|
}, { collection, request, }: {
|
|
14
|
-
collection:
|
|
14
|
+
collection: CollectionSlug;
|
|
15
15
|
request: PayloadRequest;
|
|
16
|
-
}) => Promise<
|
|
17
|
-
alt?: string;
|
|
18
|
-
id: number | string;
|
|
19
|
-
}>;
|
|
16
|
+
}) => Promise<DataFromCollectionSlug<CollectionSlug>>;
|
|
20
17
|
export interface PluginConfig {
|
|
21
18
|
access?: PluginConfigAccess;
|
|
22
19
|
collections: {
|
|
23
|
-
[key:
|
|
20
|
+
[key: CollectionSlug]: boolean;
|
|
24
21
|
};
|
|
25
22
|
debugging?: boolean;
|
|
26
23
|
disableSponsorMessage?: boolean;
|
|
@@ -33,7 +30,7 @@ export interface PluginConfig {
|
|
|
33
30
|
globals?: string[];
|
|
34
31
|
interfaceName?: string;
|
|
35
32
|
mediaUpload?: PluginConfigMediaUploadFunction;
|
|
36
|
-
uploadCollectionSlug?:
|
|
33
|
+
uploadCollectionSlug?: CollectionSlug;
|
|
37
34
|
}
|
|
38
35
|
export interface GenerationModel {
|
|
39
36
|
fields: string[];
|
|
@@ -50,18 +47,12 @@ export interface GenerationConfig {
|
|
|
50
47
|
provider: string;
|
|
51
48
|
}
|
|
52
49
|
export type GenerateTextarea<T = any> = (args: {
|
|
53
|
-
collectionSlug:
|
|
50
|
+
collectionSlug: CollectionSlug;
|
|
54
51
|
doc: T;
|
|
55
52
|
documentId?: number | string;
|
|
56
53
|
locale?: string;
|
|
57
54
|
options?: any;
|
|
58
55
|
}) => Promise<string> | string;
|
|
59
|
-
export interface Instructions {
|
|
60
|
-
'collection-slug': string;
|
|
61
|
-
id: string;
|
|
62
|
-
'model-id': string;
|
|
63
|
-
prompt: string;
|
|
64
|
-
}
|
|
65
56
|
export interface Endpoints {
|
|
66
57
|
textarea: Omit<Endpoint, 'root'>;
|
|
67
58
|
upload: Omit<Endpoint, 'root'>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAClE,OAAO,KAAK,EAAE,cAAc,EAAE,sBAAsB,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACx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AAE,mBAAmB,CAAC,OAAO,CAAC,CAAA;CACvC,CAAA"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { JSONSchema } from 'openai/lib/jsonschema'\nimport type { ImageGenerateParams } from 'openai/resources/images'\nimport type { Endpoint, Field, GroupField, PayloadRequest } from 'payload'\nimport type { CSSProperties, MouseEventHandler } from 'react'\n\nexport interface PluginConfigAccess {\n settings?: ({ req }: { req: PayloadRequest }) => Promise<boolean> | boolean\n}\n\nexport type PluginConfigMediaUploadFunction = (\n result: { data: Record<any, any>; file: File },\n {\n collection,\n request,\n }: {\n collection:
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { JSONSchema } from 'openai/lib/jsonschema'\nimport type { ImageGenerateParams } from 'openai/resources/images'\nimport type { CollectionSlug, DataFromCollectionSlug, Endpoint, Field, File, GroupField, PayloadRequest } from 'payload'\nimport type { CSSProperties, MouseEventHandler } from 'react'\n\nexport interface PluginConfigAccess {\n settings?: ({ req }: { req: PayloadRequest }) => Promise<boolean> | boolean\n}\n\nexport type PluginConfigMediaUploadFunction = (\n result: { data: Record<any, any>; file: File },\n {\n collection,\n request,\n }: {\n collection: CollectionSlug\n request: PayloadRequest\n },\n) => Promise<DataFromCollectionSlug<CollectionSlug>>\n\nexport interface PluginConfig {\n access?: PluginConfigAccess\n collections: {\n [key: CollectionSlug]: boolean\n }\n debugging?: boolean\n disableSponsorMessage?: boolean\n editorConfig?: { nodes: JSONSchema[] }\n fields?: Field[]\n generatePromptOnInit?: boolean\n generationModels?: ((defaultModels: GenerationModel[]) => GenerationModel[]) | GenerationModel[]\n globals?: string[]\n interfaceName?: string\n mediaUpload?: PluginConfigMediaUploadFunction\n uploadCollectionSlug?: CollectionSlug\n}\n\nexport interface GenerationModel {\n fields: string[]\n generateText?: (prompt: string, system: string) => Promise<string>\n handler?: (prompt: string, options: any) => Promise<any> | Response\n id: string\n name: string\n output: 'audio' | 'file' | 'image' | 'json' | 'text' | 'video'\n settings?: GroupField\n supportsPromptOptimization?: boolean\n}\n\nexport interface GenerationConfig {\n models: GenerationModel[]\n provider: string\n}\n\nexport type GenerateTextarea<T = any> = (args: {\n collectionSlug: CollectionSlug\n doc: T\n documentId?: number | string\n locale?: string\n options?: any\n}) => Promise<string> | string\n\nexport interface Endpoints {\n textarea: Omit<Endpoint, 'root'>\n upload: Omit<Endpoint, 'root'>\n}\n\nexport type ActionMenuItems =\n | 'Compose'\n | 'Expand'\n | 'Proofread'\n | 'Rephrase'\n | 'Settings'\n | 'Simplify'\n | 'Summarize'\n | 'Tone'\n | 'Translate'\n\nexport type ActionMenuEvents =\n | 'onCompose'\n | 'onExpand'\n | 'onProofread'\n | 'onRephrase'\n | 'onSettings'\n | 'onSimplify'\n | 'onSummarize'\n | 'onTone'\n | 'onTranslate'\n\nexport type UseMenuEvents = {\n [key in ActionMenuEvents]?: (data?: unknown) => void\n}\n\nexport type UseMenuOptions = {\n isConfigAllowed: boolean\n}\n\nexport type BaseItemProps<T = any> = {\n children?: React.ReactNode\n disabled?: boolean\n hideIcon?: boolean\n isActive?: boolean\n isMenu?: boolean\n onClick: (data?: unknown) => void\n onMouseEnter?: MouseEventHandler<T> | undefined\n onMouseLeave?: MouseEventHandler<T> | undefined\n style?: CSSProperties | undefined\n title?: string\n}\n\nexport type ImageReference = {\n data: Blob\n name: string\n size: number\n type: string\n url: string\n}\n\nexport type GenerateImageParams = {\n images?: ImageReference[]\n size?: ImageGenerateParams['size']\n style?: ImageGenerateParams['style']\n version?: ImageGenerateParams['model']\n}\n"],"names":[],"mappings":"AAqHA,WAKC"}
|