@turbofy-ai/app-runtime 0.0.11 → 0.0.13
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/src/api/actions.d.ts +7 -0
- package/dist/src/api/hooks.d.ts +8 -1
- package/dist/src/api/index.d.ts +3 -2
- package/dist/src/api/types.d.ts +24 -1
- package/dist/src/dsl.d.ts +37 -6
- package/dist/src/dsl.js +463 -1197
- package/dist/src/lib/auth-actions.d.ts +33 -0
- package/dist/src/lib/auth.d.ts +36 -3
- package/dist/src/lib/auth.test.d.ts +1 -0
- package/dist/src/lib/preview-auth.d.ts +6 -0
- package/package.json +2 -2
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IRunActionResult } from "./types";
|
|
2
|
+
/**
|
|
3
|
+
* Runs a stack action (`auth-login`, …) through the console host, which calls
|
|
4
|
+
* the workspace gateway and keeps the preview session in memory. Non-2xx
|
|
5
|
+
* outcomes resolve with their status; only transport failures reject.
|
|
6
|
+
*/
|
|
7
|
+
export declare const runAction: (action: string, body?: Record<string, unknown>) => Promise<IRunActionResult>;
|
package/dist/src/api/hooks.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IApiError, ICreateTypeInput, ICreateTypeResult, IDeleteTypeInput, IDeleteTypeResult, IFileDocumentResult, IGenericItem, IGetTypeResult, IInfiniteQueryState, ILinkParam, IListTypesOptions, IListTypesRequestOptions, IListTypesResult, IMutationState, IQueryState, ISearchTypesOptions, ISearchTypesResult, ITranslationParam, IUpdateTypeInput, IUpdateTypeResult, IUploadFileInput, IUploadFileResult, IWsEvent, IWsOperation } from "./types";
|
|
1
|
+
import { IApiError, ICreateTypeInput, ICreateTypeResult, IDeleteTypeInput, IDeleteTypeResult, IFileDocumentResult, IGenericItem, IGetTypeResult, IInfiniteQueryState, ILinkParam, IListTypesOptions, IListTypesRequestOptions, IListTypesResult, IMutationState, IQueryState, IQueryTypesOptions, IQueryTypesResult, ISearchTypesOptions, ISearchTypesResult, ITranslationParam, IUpdateTypeInput, IUpdateTypeResult, IUploadFileInput, IUploadFileResult, IWsEvent, IWsOperation } from "./types";
|
|
2
2
|
type IUseCreateTypeOptions = {
|
|
3
3
|
ofType: string;
|
|
4
4
|
};
|
|
@@ -22,6 +22,7 @@ export declare const getType: (typeId: string, id: string, dynamicArgs?: Record<
|
|
|
22
22
|
export declare const listTypes: (typeId: string, options?: IListTypesRequestOptions) => Promise<IListTypesResult>;
|
|
23
23
|
export declare const listTypesByParent: (typeId: string, parentType: string, parentId: string, options?: IListTypesRequestOptions) => Promise<IListTypesResult>;
|
|
24
24
|
export declare const searchTypes: (typeId: string, query: string, fields: string[], options?: ISearchTypesOptions) => Promise<ISearchTypesResult>;
|
|
25
|
+
export declare const queryTypes: (typeId: string, options?: IQueryTypesOptions) => Promise<IQueryTypesResult>;
|
|
25
26
|
export declare const useTypeQuery: (typeId: string, id: string) => IUseQueryResult<IGetTypeResult>;
|
|
26
27
|
type IUseListTypesResult = IInfiniteQueryState<IGenericItem[]> & {
|
|
27
28
|
refetch: () => void;
|
|
@@ -54,5 +55,11 @@ type IUseSearchTypesResult = {
|
|
|
54
55
|
error: IApiError | null;
|
|
55
56
|
};
|
|
56
57
|
export declare const useSearchTypes: (typeId: string, query: string, fields: string[], options?: ISearchTypesOptions) => IUseSearchTypesResult;
|
|
58
|
+
type IUseQueryTypesResult = {
|
|
59
|
+
isPending: boolean;
|
|
60
|
+
data: IQueryTypesResult | null;
|
|
61
|
+
error: IApiError | null;
|
|
62
|
+
};
|
|
63
|
+
export declare const useQueryTypes: (typeId: string, options?: IQueryTypesOptions) => IUseQueryTypesResult;
|
|
57
64
|
export declare const useUploadFile: () => IUseMutationResult<IUploadFileInput, IUploadFileResult>;
|
|
58
65
|
export {};
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { runAction } from "./actions";
|
|
2
|
+
export { getType, listTypes, listTypesByParent, queryTypes, searchTypes, useCreateType, useDeleteType, useFileDocuments, useLinks, useListTypes, useListTypesByParent, useQueryTypes, useSearchTypes, useTranslations, useTypeQuery, useUpdateType, useUploadFile, useWsSubscription, } from "./hooks";
|
|
2
3
|
export { cancelAllPendingRequests, sendApiRequest } from "./request-manager";
|
|
3
4
|
export { sendAction, subscribe, unsubscribe } from "./subscription-manager";
|
|
4
|
-
export type { IApiError, IApiOperation, IApiRequestPayload, IApiResponsePayload, ICreateTypeInput, ICreateTypeResult, IDeleteTypeInput, IDeleteTypeResult, IFileDocumentResult, IGenericItem, IGetTypeResult, IInfiniteQueryState, ILinkParam, IListTypesOptions, IListTypesRequestOptions, IListTypesResult, IMutationState, IQueryState, IQueryType, IQueryUpdatePayload, IQueryUpdateState, ISearchTypesOptions, ISearchTypesResult, ITranslationParam, IUpdateTypeInput, IUpdateTypeResult, IUploadFileInput, IUploadFileResult, IWsEvent, IWsEventPayload, IWsOperation, IWsSubscribePayload, } from "./types";
|
|
5
|
+
export type { IApiError, IApiOperation, IApiRequestPayload, IApiResponsePayload, ICreateTypeInput, ICreateTypeResult, IDeleteTypeInput, IDeleteTypeResult, IFileDocumentResult, IGenericItem, IGetTypeResult, IInfiniteQueryState, ILinkParam, IListTypesOptions, IListTypesRequestOptions, IListTypesResult, IMutationState, IQueryState, IQueryType, IQueryTypesOptions, IQueryTypesResult, IQueryUpdatePayload, IQueryUpdateState, IRunActionParams, IRunActionResult, ISearchTypesOptions, ISearchTypesResult, ITranslationParam, IUpdateTypeInput, IUpdateTypeResult, IUploadFileInput, IUploadFileResult, IWsEvent, IWsEventPayload, IWsOperation, IWsSubscribePayload, } from "./types";
|
|
5
6
|
export { wsSubscribe, wsUnsubscribe } from "./ws-subscription-manager";
|
package/dist/src/api/types.d.ts
CHANGED
|
@@ -52,7 +52,30 @@ export type ISearchTypesResult = {
|
|
|
52
52
|
total: number;
|
|
53
53
|
error?: string;
|
|
54
54
|
};
|
|
55
|
-
export type
|
|
55
|
+
export type IQueryTypesOptions = {
|
|
56
|
+
where?: Record<string, unknown>;
|
|
57
|
+
orderBy?: string;
|
|
58
|
+
order?: "ASC" | "DESC";
|
|
59
|
+
limit?: number;
|
|
60
|
+
offset?: number;
|
|
61
|
+
dynamicArgs?: Record<string, unknown>;
|
|
62
|
+
};
|
|
63
|
+
export type IQueryTypesResult = {
|
|
64
|
+
items: IGenericItem[];
|
|
65
|
+
total: number;
|
|
66
|
+
error?: string;
|
|
67
|
+
};
|
|
68
|
+
export type IApiOperation = "createType" | "updateType" | "deleteType" | "getType" | "listTypes" | "listTypesByParent" | "searchTypes" | "queryTypes" | "getLinks" | "getTranslations" | "uploadFile" | "createFileDocument" | "runAction";
|
|
69
|
+
export type IRunActionParams = {
|
|
70
|
+
/** Action id, e.g. `auth-login`. */
|
|
71
|
+
action: string;
|
|
72
|
+
body?: Record<string, unknown>;
|
|
73
|
+
};
|
|
74
|
+
/** The action's HTTP outcome; non-2xx statuses are outcomes, not errors. */
|
|
75
|
+
export type IRunActionResult = {
|
|
76
|
+
status: number;
|
|
77
|
+
data: Record<string, unknown>;
|
|
78
|
+
};
|
|
56
79
|
export type ILinkParam = {
|
|
57
80
|
pageId: string;
|
|
58
81
|
path: string;
|
package/dist/src/dsl.d.ts
CHANGED
|
@@ -55,6 +55,16 @@ declare const enumTypeDeclarationSchema: z.ZodObject<{
|
|
|
55
55
|
values: z.ZodArray<z.ZodString>;
|
|
56
56
|
}, z.core.$strip>;
|
|
57
57
|
export type IEnumTypeDeclaration = z.infer<typeof enumTypeDeclarationSchema>;
|
|
58
|
+
declare const queryIndexFieldConfigSchema: z.ZodObject<{
|
|
59
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
60
|
+
indexKeys: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
keyTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
62
|
+
number: "number";
|
|
63
|
+
boolean: "boolean";
|
|
64
|
+
text: "text";
|
|
65
|
+
}>>>;
|
|
66
|
+
}, z.core.$strip>;
|
|
67
|
+
export type IQueryIndexFieldConfig = z.infer<typeof queryIndexFieldConfigSchema>;
|
|
58
68
|
declare enum ArchiveTypeEnum {
|
|
59
69
|
ASSET = "ASSET",
|
|
60
70
|
S3BUCKET = "S3BUCKET"
|
|
@@ -153,10 +163,19 @@ declare const objectTypeDeclarationSchema: z.ZodObject<{
|
|
|
153
163
|
id: z.ZodString;
|
|
154
164
|
}, z.core.$strip>,
|
|
155
165
|
z.ZodObject<{
|
|
156
|
-
fullTextSearch: z.ZodObject<{
|
|
166
|
+
fullTextSearch: z.ZodOptional<z.ZodObject<{
|
|
157
167
|
mappingOverride: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
158
168
|
codeNormalize: z.ZodString;
|
|
159
|
-
}, z.core.$strip
|
|
169
|
+
}, z.core.$strip>>;
|
|
170
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
171
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
172
|
+
indexKeys: z.ZodOptional<z.ZodBoolean>;
|
|
173
|
+
keyTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
174
|
+
number: "number";
|
|
175
|
+
boolean: "boolean";
|
|
176
|
+
text: "text";
|
|
177
|
+
}>>>;
|
|
178
|
+
}, z.core.$strip>>>;
|
|
160
179
|
}, z.core.$strip>
|
|
161
180
|
]>>;
|
|
162
181
|
}, z.core.$strip>;
|
|
@@ -531,16 +550,19 @@ declare const fields: {
|
|
|
531
550
|
*
|
|
532
551
|
* - Reference variant points the table at another table that owns the
|
|
533
552
|
* indexed records.
|
|
534
|
-
* - Source variant defines the
|
|
553
|
+
* - Source variant defines the search settings inline: `fullTextSearch` on
|
|
554
|
+
* OpenSearch-backed stacks, per-field `fields` on SQLite-query-index
|
|
555
|
+
* stacks.
|
|
535
556
|
*/
|
|
536
557
|
export type TableSearchConfig = {
|
|
537
558
|
recordId: string;
|
|
538
559
|
table: IObjectTypeDeclaration;
|
|
539
560
|
} | {
|
|
540
|
-
fullTextSearch
|
|
561
|
+
fullTextSearch?: {
|
|
541
562
|
mappingOverride: Record<string, unknown>;
|
|
542
563
|
codeNormalize: string;
|
|
543
564
|
};
|
|
565
|
+
fields?: Record<string, IQueryIndexFieldConfig>;
|
|
544
566
|
};
|
|
545
567
|
/**
|
|
546
568
|
* Options for object type (table) creation.
|
|
@@ -737,10 +759,19 @@ export declare const dataSchemaDeclarationSchema: z.ZodObject<{
|
|
|
737
759
|
id: z.ZodString;
|
|
738
760
|
}, z.core.$strip>,
|
|
739
761
|
z.ZodObject<{
|
|
740
|
-
fullTextSearch: z.ZodObject<{
|
|
762
|
+
fullTextSearch: z.ZodOptional<z.ZodObject<{
|
|
741
763
|
mappingOverride: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
742
764
|
codeNormalize: z.ZodString;
|
|
743
|
-
}, z.core.$strip
|
|
765
|
+
}, z.core.$strip>>;
|
|
766
|
+
fields: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
767
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
768
|
+
indexKeys: z.ZodOptional<z.ZodBoolean>;
|
|
769
|
+
keyTypes: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
770
|
+
number: "number";
|
|
771
|
+
boolean: "boolean";
|
|
772
|
+
text: "text";
|
|
773
|
+
}>>>;
|
|
774
|
+
}, z.core.$strip>>>;
|
|
744
775
|
}, z.core.$strip>
|
|
745
776
|
]>>;
|
|
746
777
|
}, z.core.$strip>>>;
|