1 | import type { BasicMetaSysProps, CollectionProp, DefaultElements, MakeRequest, SysLink } from '../common-types';
|
2 | import type { ResourceType, UpsertResourceTypeProps } from './resource-type';
|
3 | export type ResourceProviderProps = {
|
4 | |
5 |
|
6 |
|
7 | sys: Omit<BasicMetaSysProps, 'version'> & {
|
8 | organization: SysLink;
|
9 | appDefinition: SysLink;
|
10 | };
|
11 | |
12 |
|
13 |
|
14 | type: 'function';
|
15 | |
16 |
|
17 |
|
18 | function: SysLink;
|
19 | };
|
20 | export type UpsertResourceProviderProps = Omit<ResourceProviderProps, 'sys'> & {
|
21 | sys: {
|
22 | id: string;
|
23 | };
|
24 | };
|
25 | export interface ResourceProvider extends ResourceProviderProps, DefaultElements<ResourceProviderProps> {
|
26 | upsert(): Promise<ResourceProvider>;
|
27 | delete(): Promise<void>;
|
28 | upsertResourceType(id: string, data: UpsertResourceTypeProps): Promise<ResourceType>;
|
29 | getResourceType(id: string): Promise<ResourceType>;
|
30 | getResourceTypes(): Promise<CollectionProp<ResourceType>>;
|
31 | }
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 | export declare function wrapResourceProvider(makeRequest: MakeRequest, data: ResourceProviderProps): ResourceProvider;
|