@turbofy-ai/app-runtime 0.0.15 → 0.0.17
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/hooks.test.d.ts +1 -0
- package/dist/src/api/index.d.ts +2 -1
- package/dist/src/api/query-cache-data.d.ts +7 -0
- package/dist/src/api/query-cache.d.ts +4 -0
- package/dist/src/api/query-cache.test.d.ts +1 -0
- package/dist/src/api/types.d.ts +4 -1
- package/dist/src/dsl.d.ts +118 -1
- package/dist/src/dsl.js +140 -28
- package/dist/src/generated/auth-config.d.ts +1 -0
- package/dist/src/lib/auth.d.ts +16 -8
- package/dist/src/lib/current-user-store.d.ts +37 -0
- package/dist/src/lib/current-user-store.test.d.ts +1 -0
- package/dist/src/lib/login-form.d.ts +7 -0
- package/dist/src/lib/login-form.test.d.ts +1 -0
- package/dist/src/lib/page-redirect.d.ts +12 -0
- package/dist/src/lib/preview-auth.d.ts +7 -0
- package/dist/src/lib/route-params.d.ts +12 -1
- package/dist/src/lib/user-identity.d.ts +8 -0
- package/dist/src/lib/user-identity.test.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/api/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { runAction } from "./actions";
|
|
2
2
|
export { getType, listTypes, listTypesByParent, queryTypes, searchTypes, useCreateType, useDeleteType, useFileDocuments, useLinks, useListTypes, useListTypesByParent, useQueryTypes, useSearchTypes, useTranslations, useTypeQuery, useUpdateType, useUploadFile, useWsSubscription, } from "./hooks";
|
|
3
|
+
export { setListTypesByParentQueryData, setListTypesQueryData, setTypeQueryData, } from "./query-cache";
|
|
3
4
|
export { cancelAllPendingRequests, sendApiRequest } from "./request-manager";
|
|
4
5
|
export { sendAction, subscribe, unsubscribe } from "./subscription-manager";
|
|
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";
|
|
6
|
+
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, ISetQueryDataOptions, ITranslationParam, IUpdateTypeInput, IUpdateTypeResult, IUploadFileInput, IUploadFileResult, IWsEvent, IWsEventPayload, IWsOperation, IWsSubscribePayload, } from "./types";
|
|
6
7
|
export { wsSubscribe, wsUnsubscribe } from "./ws-subscription-manager";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IGetTypeResult, IListTypesResult, ISetQueryDataOptions } from "./types";
|
|
2
|
+
export declare const validateCacheTimestamp: (options?: ISetQueryDataOptions) => void;
|
|
3
|
+
export declare const validateTypeQueryData: (id: string, data: IGetTypeResult) => void;
|
|
4
|
+
export declare const listQueryData: (pages: IListTypesResult[]) => {
|
|
5
|
+
pages: IListTypesResult[];
|
|
6
|
+
pageParams: (string | undefined)[];
|
|
7
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { IGetTypeResult, IListTypesOptions, IListTypesResult, ISetQueryDataOptions } from "./types";
|
|
2
|
+
export declare const setTypeQueryData: (typeId: string, id: string, data: IGetTypeResult, options?: ISetQueryDataOptions) => Promise<void>;
|
|
3
|
+
export declare const setListTypesQueryData: (typeId: string, pages: IListTypesResult[], options?: IListTypesOptions & ISetQueryDataOptions) => Promise<void>;
|
|
4
|
+
export declare const setListTypesByParentQueryData: (typeId: string, parentType: string, parentId: string, pages: IListTypesResult[], options?: Omit<IListTypesOptions, "sortRange"> & ISetQueryDataOptions) => Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/api/types.d.ts
CHANGED
|
@@ -26,6 +26,9 @@ export type IListTypesResult = {
|
|
|
26
26
|
items: IGenericItem[];
|
|
27
27
|
nextToken?: string | null;
|
|
28
28
|
};
|
|
29
|
+
export type ISetQueryDataOptions = {
|
|
30
|
+
updatedAt?: number;
|
|
31
|
+
};
|
|
29
32
|
export type IListTypesOptions = {
|
|
30
33
|
limit?: number;
|
|
31
34
|
sortOrder?: "ASC" | "DESC";
|
|
@@ -65,7 +68,7 @@ export type IQueryTypesResult = {
|
|
|
65
68
|
total: number;
|
|
66
69
|
error?: string;
|
|
67
70
|
};
|
|
68
|
-
export type IApiOperation = "createType" | "updateType" | "deleteType" | "getType" | "listTypes" | "listTypesByParent" | "searchTypes" | "queryTypes" | "getLinks" | "getTranslations" | "uploadFile" | "createFileDocument" | "runAction";
|
|
71
|
+
export type IApiOperation = "createType" | "updateType" | "deleteType" | "getType" | "setTypeQueryData" | "setListTypesQueryData" | "setListTypesByParentQueryData" | "listTypes" | "listTypesByParent" | "searchTypes" | "queryTypes" | "getLinks" | "getTranslations" | "uploadFile" | "createFileDocument" | "runAction";
|
|
69
72
|
export type IRunActionParams = {
|
|
70
73
|
/** Action id, e.g. `auth-login`. */
|
|
71
74
|
action: string;
|
package/dist/src/dsl.d.ts
CHANGED
|
@@ -1541,6 +1541,55 @@ export type IGenericAIParams = {
|
|
|
1541
1541
|
model: string;
|
|
1542
1542
|
};
|
|
1543
1543
|
value: string;
|
|
1544
|
+
} | {
|
|
1545
|
+
operation: "generateImage";
|
|
1546
|
+
apiKey: string;
|
|
1547
|
+
temperature?: number;
|
|
1548
|
+
model: {
|
|
1549
|
+
provider: "openai";
|
|
1550
|
+
model: string;
|
|
1551
|
+
} | {
|
|
1552
|
+
provider: "google";
|
|
1553
|
+
model: string;
|
|
1554
|
+
} | {
|
|
1555
|
+
provider: "xai";
|
|
1556
|
+
model: string;
|
|
1557
|
+
} | {
|
|
1558
|
+
provider: "fal";
|
|
1559
|
+
model: string;
|
|
1560
|
+
} | {
|
|
1561
|
+
provider: "deepinfra";
|
|
1562
|
+
model: string;
|
|
1563
|
+
} | {
|
|
1564
|
+
provider: "replicate";
|
|
1565
|
+
model: string;
|
|
1566
|
+
} | {
|
|
1567
|
+
provider: "fireworks";
|
|
1568
|
+
model: string;
|
|
1569
|
+
} | {
|
|
1570
|
+
provider: "luma";
|
|
1571
|
+
model: string;
|
|
1572
|
+
} | {
|
|
1573
|
+
provider: "togetherai";
|
|
1574
|
+
model: string;
|
|
1575
|
+
} | {
|
|
1576
|
+
provider: "blackForestLabs";
|
|
1577
|
+
model: string;
|
|
1578
|
+
};
|
|
1579
|
+
prompt: string;
|
|
1580
|
+
images?: string[];
|
|
1581
|
+
/**
|
|
1582
|
+
* Image URL or data URL
|
|
1583
|
+
*/
|
|
1584
|
+
mask?: string;
|
|
1585
|
+
n?: number;
|
|
1586
|
+
size?: string;
|
|
1587
|
+
aspectRatio?: string;
|
|
1588
|
+
seed?: number;
|
|
1589
|
+
outputFilename?: string;
|
|
1590
|
+
providerOptions?: {
|
|
1591
|
+
[k: string]: unknown;
|
|
1592
|
+
};
|
|
1544
1593
|
};
|
|
1545
1594
|
export type IGenericAIResult = {
|
|
1546
1595
|
type: "result";
|
|
@@ -1576,10 +1625,74 @@ export type IGenericAIResult = {
|
|
|
1576
1625
|
} | {
|
|
1577
1626
|
type: "embeddingResult";
|
|
1578
1627
|
value: number[];
|
|
1628
|
+
} | {
|
|
1629
|
+
type: "imageResult";
|
|
1630
|
+
value: {
|
|
1631
|
+
images: {
|
|
1632
|
+
url: string;
|
|
1633
|
+
key: string;
|
|
1634
|
+
mimeType: string;
|
|
1635
|
+
}[];
|
|
1636
|
+
warnings: string[];
|
|
1637
|
+
};
|
|
1579
1638
|
} | {
|
|
1580
1639
|
type: "error";
|
|
1581
1640
|
error: string;
|
|
1582
1641
|
};
|
|
1642
|
+
export interface IStripeSyncParams {
|
|
1643
|
+
eventId: string;
|
|
1644
|
+
appId: string;
|
|
1645
|
+
secretId: string;
|
|
1646
|
+
livemode: boolean;
|
|
1647
|
+
plans?: {
|
|
1648
|
+
[k: string]: string;
|
|
1649
|
+
};
|
|
1650
|
+
subscriptions?: {
|
|
1651
|
+
ofType?: string;
|
|
1652
|
+
fields?: {
|
|
1653
|
+
userId?: string;
|
|
1654
|
+
planId?: string;
|
|
1655
|
+
customerId?: string;
|
|
1656
|
+
subscriptionId?: string;
|
|
1657
|
+
checkoutSessionId?: string;
|
|
1658
|
+
invoiceId?: string;
|
|
1659
|
+
status?: string;
|
|
1660
|
+
amountTotal?: string;
|
|
1661
|
+
currency?: string;
|
|
1662
|
+
lineItems?: string;
|
|
1663
|
+
renewsAt?: string;
|
|
1664
|
+
expiresAt?: string;
|
|
1665
|
+
cancelAtPeriodEnd?: string;
|
|
1666
|
+
livemode?: string;
|
|
1667
|
+
};
|
|
1668
|
+
};
|
|
1669
|
+
purchases?: {
|
|
1670
|
+
ofType?: string;
|
|
1671
|
+
fields?: {
|
|
1672
|
+
userId?: string;
|
|
1673
|
+
planId?: string;
|
|
1674
|
+
customerId?: string;
|
|
1675
|
+
subscriptionId?: string;
|
|
1676
|
+
checkoutSessionId?: string;
|
|
1677
|
+
invoiceId?: string;
|
|
1678
|
+
status?: string;
|
|
1679
|
+
amountTotal?: string;
|
|
1680
|
+
currency?: string;
|
|
1681
|
+
lineItems?: string;
|
|
1682
|
+
renewsAt?: string;
|
|
1683
|
+
expiresAt?: string;
|
|
1684
|
+
cancelAtPeriodEnd?: string;
|
|
1685
|
+
livemode?: string;
|
|
1686
|
+
};
|
|
1687
|
+
};
|
|
1688
|
+
}
|
|
1689
|
+
export interface IStripeSyncResult {
|
|
1690
|
+
status: "synced" | "unchanged" | "skipped";
|
|
1691
|
+
eventId: string;
|
|
1692
|
+
reason?: string;
|
|
1693
|
+
ofType?: string;
|
|
1694
|
+
recordId?: string;
|
|
1695
|
+
}
|
|
1583
1696
|
export type IStepParamsMap = {
|
|
1584
1697
|
batchCreateType: IBatchCreateTypeParams;
|
|
1585
1698
|
batchGetType: IBatchGetTypeParams;
|
|
@@ -1600,6 +1713,7 @@ export type IStepParamsMap = {
|
|
|
1600
1713
|
extractImageMetadata: IExtractImageMetadataParams;
|
|
1601
1714
|
cloudFunction: ICloudFunctionParams;
|
|
1602
1715
|
genericAI: IGenericAIParams;
|
|
1716
|
+
stripeSync: IStripeSyncParams;
|
|
1603
1717
|
};
|
|
1604
1718
|
export type IStepResultMap = {
|
|
1605
1719
|
batchCreateType: IBatchCreateTypeResult;
|
|
@@ -1621,6 +1735,7 @@ export type IStepResultMap = {
|
|
|
1621
1735
|
extractImageMetadata: IExtractImageMetadataResult;
|
|
1622
1736
|
cloudFunction: ICloudFunctionResult;
|
|
1623
1737
|
genericAI: IGenericAIResult;
|
|
1738
|
+
stripeSync: IStripeSyncResult;
|
|
1624
1739
|
};
|
|
1625
1740
|
declare enum StepType {
|
|
1626
1741
|
batchCreateType = "batchCreateType",
|
|
@@ -1641,7 +1756,8 @@ declare enum StepType {
|
|
|
1641
1756
|
updateType = "updateType",
|
|
1642
1757
|
extractImageMetadata = "extractImageMetadata",
|
|
1643
1758
|
cloudFunction = "cloudFunction",
|
|
1644
|
-
genericAI = "genericAI"
|
|
1759
|
+
genericAI = "genericAI",
|
|
1760
|
+
stripeSync = "stripeSync"
|
|
1645
1761
|
}
|
|
1646
1762
|
declare const webhookConfigSchema: z.ZodObject<{
|
|
1647
1763
|
verification: z.ZodDiscriminatedUnion<[
|
|
@@ -2153,6 +2269,7 @@ declare const step: {
|
|
|
2153
2269
|
extractImageMetadata: (name: string, opts: IFlowStepOptions<StepType.extractImageMetadata>) => IFlowStepDefinition<StepType.extractImageMetadata>;
|
|
2154
2270
|
cloudFunction: (name: string, opts: IFlowStepOptions<StepType.cloudFunction>) => IFlowStepDefinition<StepType.cloudFunction>;
|
|
2155
2271
|
genericAI: (name: string, opts: IFlowStepOptions<StepType.genericAI>) => IFlowStepDefinition<StepType.genericAI>;
|
|
2272
|
+
stripeSync: (name: string, opts: IFlowStepOptions<StepType.stripeSync>) => IFlowStepDefinition<StepType.stripeSync>;
|
|
2156
2273
|
};
|
|
2157
2274
|
export interface IFlowOptions {
|
|
2158
2275
|
/** Flow record name — stored next to the declaration, not inside it. */
|
package/dist/src/dsl.js
CHANGED
|
@@ -3609,10 +3609,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3609
3609
|
const shape = def.shape;
|
|
3610
3610
|
const propValues = {};
|
|
3611
3611
|
for (const key in shape) {
|
|
3612
|
-
const
|
|
3613
|
-
if (
|
|
3612
|
+
const field2 = shape[key]._zod;
|
|
3613
|
+
if (field2.values) {
|
|
3614
3614
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3615
|
-
for (const v of
|
|
3615
|
+
for (const v of field2.values)
|
|
3616
3616
|
propValues[key].add(v);
|
|
3617
3617
|
}
|
|
3618
3618
|
}
|
|
@@ -14688,9 +14688,9 @@ var dataSchemaDeclarationSchema = external_exports.object({
|
|
|
14688
14688
|
for (const type of schema.types ?? []) {
|
|
14689
14689
|
typeIdMap.set(type.id, type.name);
|
|
14690
14690
|
const ids = /* @__PURE__ */ new Set();
|
|
14691
|
-
for (const
|
|
14692
|
-
if (
|
|
14693
|
-
ids.add(
|
|
14691
|
+
for (const field2 of type.fields) {
|
|
14692
|
+
if (field2.id) {
|
|
14693
|
+
ids.add(field2.id);
|
|
14694
14694
|
}
|
|
14695
14695
|
}
|
|
14696
14696
|
typeFieldIdsByName.set(type.name, ids);
|
|
@@ -14745,8 +14745,8 @@ var dataSchemaDeclarationSchema = external_exports.object({
|
|
|
14745
14745
|
continue;
|
|
14746
14746
|
}
|
|
14747
14747
|
for (let fi = 0; fi < type.fields.length; fi++) {
|
|
14748
|
-
const
|
|
14749
|
-
const t =
|
|
14748
|
+
const field2 = type.fields[fi];
|
|
14749
|
+
const t = field2.type;
|
|
14750
14750
|
if (typeof t === "string" && !(t in FieldTypeEnum) && !enumNameMap.has(t)) {
|
|
14751
14751
|
ctx.addIssue({
|
|
14752
14752
|
path: ["types", ti, "fields", fi, "type"],
|
|
@@ -14792,14 +14792,14 @@ var dataSchemaDeclarationSchema = external_exports.object({
|
|
|
14792
14792
|
});
|
|
14793
14793
|
}
|
|
14794
14794
|
for (let fi = 0; fi < type.fields.length; fi++) {
|
|
14795
|
-
const
|
|
14796
|
-
const dfc =
|
|
14795
|
+
const field2 = type.fields[fi];
|
|
14796
|
+
const dfc = field2.dynamicFieldConfig;
|
|
14797
14797
|
if (dfc && "ofType" in dfc) {
|
|
14798
14798
|
if (!typeNameMap.has(dfc.ofType)) {
|
|
14799
14799
|
ctx.addIssue({
|
|
14800
14800
|
path: ["types", ti, "fields", fi, "dynamicFieldConfig", "ofType"],
|
|
14801
14801
|
code: "custom",
|
|
14802
|
-
message: `dynamicFieldConfig.ofType "${dfc.ofType}" does not reference an existing type in field "${
|
|
14802
|
+
message: `dynamicFieldConfig.ofType "${dfc.ofType}" does not reference an existing type in field "${field2.name}" of type "${type.name}"`
|
|
14803
14803
|
});
|
|
14804
14804
|
} else {
|
|
14805
14805
|
const fieldIds = typeFieldIdsByName.get(dfc.ofType);
|
|
@@ -14807,7 +14807,7 @@ var dataSchemaDeclarationSchema = external_exports.object({
|
|
|
14807
14807
|
ctx.addIssue({
|
|
14808
14808
|
path: ["types", ti, "fields", fi, "dynamicFieldConfig", "id"],
|
|
14809
14809
|
code: "custom",
|
|
14810
|
-
message: `dynamicFieldConfig.id "${dfc.id}" does not match any field id in type "${dfc.ofType}" (field "${
|
|
14810
|
+
message: `dynamicFieldConfig.id "${dfc.id}" does not match any field id in type "${dfc.ofType}" (field "${field2.name}" of type "${type.name}")`
|
|
14811
14811
|
});
|
|
14812
14812
|
}
|
|
14813
14813
|
}
|
|
@@ -15028,6 +15028,46 @@ function build(schema) {
|
|
|
15028
15028
|
return finalSchema;
|
|
15029
15029
|
}
|
|
15030
15030
|
|
|
15031
|
+
// ../declarations/src/flows/schemas/stripe-sync.schema.ts
|
|
15032
|
+
var field = external_exports.string().min(1).optional();
|
|
15033
|
+
var destination = external_exports.object({
|
|
15034
|
+
ofType: external_exports.string().min(1).optional(),
|
|
15035
|
+
fields: external_exports.object({
|
|
15036
|
+
userId: field,
|
|
15037
|
+
planId: field,
|
|
15038
|
+
customerId: field,
|
|
15039
|
+
subscriptionId: field,
|
|
15040
|
+
checkoutSessionId: field,
|
|
15041
|
+
invoiceId: field,
|
|
15042
|
+
status: field,
|
|
15043
|
+
amountTotal: field,
|
|
15044
|
+
currency: field,
|
|
15045
|
+
lineItems: field,
|
|
15046
|
+
renewsAt: field,
|
|
15047
|
+
expiresAt: field,
|
|
15048
|
+
cancelAtPeriodEnd: field,
|
|
15049
|
+
livemode: field
|
|
15050
|
+
}).strict().optional()
|
|
15051
|
+
}).strict();
|
|
15052
|
+
var stripeSyncSchema = {
|
|
15053
|
+
params: external_exports.object({
|
|
15054
|
+
eventId: external_exports.string().regex(/^evt_[A-Za-z0-9]+$/),
|
|
15055
|
+
appId: external_exports.string().min(1),
|
|
15056
|
+
secretId: external_exports.string().regex(/^[A-Za-z0-9_-]{1,128}$/),
|
|
15057
|
+
livemode: external_exports.boolean(),
|
|
15058
|
+
plans: external_exports.record(external_exports.string(), external_exports.string().min(1)).optional(),
|
|
15059
|
+
subscriptions: destination.optional(),
|
|
15060
|
+
purchases: destination.optional()
|
|
15061
|
+
}).strict(),
|
|
15062
|
+
result: external_exports.object({
|
|
15063
|
+
status: external_exports.enum(["synced", "unchanged", "skipped"]),
|
|
15064
|
+
eventId: external_exports.string(),
|
|
15065
|
+
reason: external_exports.string().optional(),
|
|
15066
|
+
ofType: external_exports.string().optional(),
|
|
15067
|
+
recordId: external_exports.string().optional()
|
|
15068
|
+
})
|
|
15069
|
+
};
|
|
15070
|
+
|
|
15031
15071
|
// ../declarations/src/flows/schemas/batch-create-type.schema.ts
|
|
15032
15072
|
var paramsSchema = external_exports.object({
|
|
15033
15073
|
ofType: external_exports.string(),
|
|
@@ -15398,6 +15438,33 @@ var cohereProviderSchema = zod_default.object({
|
|
|
15398
15438
|
var googleProviderSchema = zod_default.object({
|
|
15399
15439
|
provider: zod_default.literal("google")
|
|
15400
15440
|
});
|
|
15441
|
+
var xaiProviderSchema = zod_default.object({
|
|
15442
|
+
provider: zod_default.literal("xai")
|
|
15443
|
+
});
|
|
15444
|
+
var falProviderSchema = zod_default.object({
|
|
15445
|
+
provider: zod_default.literal("fal")
|
|
15446
|
+
});
|
|
15447
|
+
var deepinfraProviderSchema = zod_default.object({
|
|
15448
|
+
provider: zod_default.literal("deepinfra")
|
|
15449
|
+
});
|
|
15450
|
+
var replicateProviderSchema = zod_default.object({
|
|
15451
|
+
provider: zod_default.literal("replicate")
|
|
15452
|
+
});
|
|
15453
|
+
var fireworksProviderSchema = zod_default.object({
|
|
15454
|
+
provider: zod_default.literal("fireworks")
|
|
15455
|
+
});
|
|
15456
|
+
var lumaProviderSchema = zod_default.object({
|
|
15457
|
+
provider: zod_default.literal("luma")
|
|
15458
|
+
});
|
|
15459
|
+
var togetheraiProviderSchema = zod_default.object({
|
|
15460
|
+
provider: zod_default.literal("togetherai")
|
|
15461
|
+
});
|
|
15462
|
+
var blackForestLabsProviderSchema = zod_default.object({
|
|
15463
|
+
provider: zod_default.literal("blackForestLabs")
|
|
15464
|
+
});
|
|
15465
|
+
var imageModelSchema = zod_default.object({
|
|
15466
|
+
model: zod_default.string()
|
|
15467
|
+
});
|
|
15401
15468
|
var sharedParamsSchema = zod_default.object({
|
|
15402
15469
|
apiKey: zod_default.string(),
|
|
15403
15470
|
temperature: zod_default.number().optional()
|
|
@@ -15414,6 +15481,9 @@ var streamTextParamsSchema = zod_default.object({
|
|
|
15414
15481
|
var embedParamsSchema = zod_default.object({
|
|
15415
15482
|
operation: zod_default.literal("embed")
|
|
15416
15483
|
});
|
|
15484
|
+
var generateImageParamsSchema = zod_default.object({
|
|
15485
|
+
operation: zod_default.literal("generateImage")
|
|
15486
|
+
});
|
|
15417
15487
|
var textModelsSchema = zod_default.object({
|
|
15418
15488
|
model: zod_default.discriminatedUnion("provider", [
|
|
15419
15489
|
openaiProviderSchema.merge(openAITextModelsSchema),
|
|
@@ -15432,6 +15502,21 @@ var embedModelsSchema = zod_default.object({
|
|
|
15432
15502
|
googleProviderSchema.merge(googleEmbedModelsSchema)
|
|
15433
15503
|
])
|
|
15434
15504
|
});
|
|
15505
|
+
var imageModelsSchema = zod_default.object({
|
|
15506
|
+
model: zod_default.discriminatedUnion("provider", [
|
|
15507
|
+
openaiProviderSchema.merge(imageModelSchema),
|
|
15508
|
+
googleProviderSchema.merge(imageModelSchema),
|
|
15509
|
+
xaiProviderSchema.merge(imageModelSchema),
|
|
15510
|
+
falProviderSchema.merge(imageModelSchema),
|
|
15511
|
+
deepinfraProviderSchema.merge(imageModelSchema),
|
|
15512
|
+
replicateProviderSchema.merge(imageModelSchema),
|
|
15513
|
+
fireworksProviderSchema.merge(imageModelSchema),
|
|
15514
|
+
lumaProviderSchema.merge(imageModelSchema),
|
|
15515
|
+
togetheraiProviderSchema.merge(imageModelSchema),
|
|
15516
|
+
blackForestLabsProviderSchema.merge(imageModelSchema)
|
|
15517
|
+
])
|
|
15518
|
+
});
|
|
15519
|
+
var imageInputSchema = zod_default.string().describe("Image URL or data URL");
|
|
15435
15520
|
var fullStreamTextParamsSchema = streamTextParamsSchema.extend({
|
|
15436
15521
|
...sharedParamsSchema.shape,
|
|
15437
15522
|
...textModelsSchema.shape,
|
|
@@ -15459,6 +15544,17 @@ var paramsSchema8 = zod_default.discriminatedUnion("operation", [
|
|
|
15459
15544
|
fullStreamTextParamsSchema,
|
|
15460
15545
|
embedParamsSchema.merge(sharedParamsSchema).merge(embedModelsSchema).extend({
|
|
15461
15546
|
value: zod_default.string()
|
|
15547
|
+
}),
|
|
15548
|
+
generateImageParamsSchema.merge(sharedParamsSchema).merge(imageModelsSchema).extend({
|
|
15549
|
+
prompt: zod_default.string(),
|
|
15550
|
+
images: zod_default.array(imageInputSchema).optional(),
|
|
15551
|
+
mask: imageInputSchema.optional(),
|
|
15552
|
+
n: zod_default.number().int().positive().optional(),
|
|
15553
|
+
size: zod_default.string().optional(),
|
|
15554
|
+
aspectRatio: zod_default.string().optional(),
|
|
15555
|
+
seed: zod_default.number().int().optional(),
|
|
15556
|
+
outputFilename: zod_default.string().optional(),
|
|
15557
|
+
providerOptions: zod_default.record(zod_default.string(), zod_default.any()).optional()
|
|
15462
15558
|
})
|
|
15463
15559
|
]);
|
|
15464
15560
|
var paramsNestedSchemas = {
|
|
@@ -15520,6 +15616,19 @@ var resultSchema8 = zod_default.discriminatedUnion("type", [
|
|
|
15520
15616
|
type: zod_default.literal("embeddingResult"),
|
|
15521
15617
|
value: zod_default.array(zod_default.number())
|
|
15522
15618
|
}),
|
|
15619
|
+
zod_default.object({
|
|
15620
|
+
type: zod_default.literal("imageResult"),
|
|
15621
|
+
value: zod_default.object({
|
|
15622
|
+
images: zod_default.array(
|
|
15623
|
+
zod_default.object({
|
|
15624
|
+
url: zod_default.string(),
|
|
15625
|
+
key: zod_default.string(),
|
|
15626
|
+
mimeType: zod_default.string()
|
|
15627
|
+
})
|
|
15628
|
+
),
|
|
15629
|
+
warnings: zod_default.array(zod_default.string())
|
|
15630
|
+
})
|
|
15631
|
+
}),
|
|
15523
15632
|
zod_default.object({
|
|
15524
15633
|
type: zod_default.literal("error"),
|
|
15525
15634
|
error: zod_default.string()
|
|
@@ -15904,7 +16013,8 @@ var schemas = {
|
|
|
15904
16013
|
updateType: updateTypeSchema,
|
|
15905
16014
|
extractImageMetadata: extractImageMetadataSchema,
|
|
15906
16015
|
cloudFunction: cloudFunctionTypeSchema,
|
|
15907
|
-
genericAI: genericAIStepSchema
|
|
16016
|
+
genericAI: genericAIStepSchema,
|
|
16017
|
+
stripeSync: stripeSyncSchema
|
|
15908
16018
|
};
|
|
15909
16019
|
|
|
15910
16020
|
// ../declarations/src/flows/schedule.ts
|
|
@@ -15935,10 +16045,10 @@ function validateCronExpression(cron) {
|
|
|
15935
16045
|
];
|
|
15936
16046
|
}
|
|
15937
16047
|
const errors = [];
|
|
15938
|
-
fields2.forEach((
|
|
15939
|
-
if (!CRON_FIELDS[index].pattern.test(
|
|
16048
|
+
fields2.forEach((field2, index) => {
|
|
16049
|
+
if (!CRON_FIELDS[index].pattern.test(field2)) {
|
|
15940
16050
|
errors.push(
|
|
15941
|
-
`Cron expression "${cron}": invalid ${CRON_FIELDS[index].label} field "${
|
|
16051
|
+
`Cron expression "${cron}": invalid ${CRON_FIELDS[index].label} field "${field2}"`
|
|
15942
16052
|
);
|
|
15943
16053
|
}
|
|
15944
16054
|
});
|
|
@@ -17536,21 +17646,21 @@ pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper
|
|
|
17536
17646
|
}
|
|
17537
17647
|
return this.finishNode(method, "MethodDefinition");
|
|
17538
17648
|
};
|
|
17539
|
-
pp$8.parseClassField = function(
|
|
17540
|
-
if (checkKeyName(
|
|
17541
|
-
this.raise(
|
|
17542
|
-
} else if (
|
|
17543
|
-
this.raise(
|
|
17649
|
+
pp$8.parseClassField = function(field2) {
|
|
17650
|
+
if (checkKeyName(field2, "constructor")) {
|
|
17651
|
+
this.raise(field2.key.start, "Classes can't have a field named 'constructor'");
|
|
17652
|
+
} else if (field2.static && checkKeyName(field2, "prototype")) {
|
|
17653
|
+
this.raise(field2.key.start, "Classes can't have a static field named 'prototype'");
|
|
17544
17654
|
}
|
|
17545
17655
|
if (this.eat(types$1.eq)) {
|
|
17546
17656
|
this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
|
|
17547
|
-
|
|
17657
|
+
field2.value = this.parseMaybeAssign();
|
|
17548
17658
|
this.exitScope();
|
|
17549
17659
|
} else {
|
|
17550
|
-
|
|
17660
|
+
field2.value = null;
|
|
17551
17661
|
}
|
|
17552
17662
|
this.semicolon();
|
|
17553
|
-
return this.finishNode(
|
|
17663
|
+
return this.finishNode(field2, "PropertyDefinition");
|
|
17554
17664
|
};
|
|
17555
17665
|
pp$8.parseClassStaticBlock = function(node) {
|
|
17556
17666
|
node.body = [];
|
|
@@ -22115,8 +22225,8 @@ function buildPages(pages, opts) {
|
|
|
22115
22225
|
}
|
|
22116
22226
|
if (slugField) {
|
|
22117
22227
|
const baseFieldName = slugField.replace(/\[.*$/, "");
|
|
22118
|
-
const
|
|
22119
|
-
if (!
|
|
22228
|
+
const field2 = collection.fields.find((f) => f.name === baseFieldName);
|
|
22229
|
+
if (!field2) {
|
|
22120
22230
|
throw new Error(
|
|
22121
22231
|
`buildPages: page "${p.name}" param "${paramKey}" references slugField "${slugField}" which does not exist in collection "${collection.name}"`
|
|
22122
22232
|
);
|
|
@@ -22367,7 +22477,8 @@ var KNOWN_SECRET_PARAMS = {
|
|
|
22367
22477
|
["elevenLabsTTS" /* elevenLabsTTS */]: ["apiKey"],
|
|
22368
22478
|
["googleSearch" /* googleSearch */]: ["apiKey"],
|
|
22369
22479
|
["openAIImageGeneration" /* openAIImageGeneration */]: ["apiKey"],
|
|
22370
|
-
["genericAI" /* genericAI */]: ["apiKey"]
|
|
22480
|
+
["genericAI" /* genericAI */]: ["apiKey"],
|
|
22481
|
+
["stripeSync" /* stripeSync */]: ["secretId"]
|
|
22371
22482
|
};
|
|
22372
22483
|
var WRITE_STEP_OPERATIONS = {
|
|
22373
22484
|
["createType" /* createType */]: "INSERT",
|
|
@@ -22853,7 +22964,8 @@ var step = {
|
|
|
22853
22964
|
updateType: createStepFactory("updateType" /* updateType */),
|
|
22854
22965
|
extractImageMetadata: createStepFactory("extractImageMetadata" /* extractImageMetadata */),
|
|
22855
22966
|
cloudFunction: createStepFactory("cloudFunction" /* cloudFunction */),
|
|
22856
|
-
genericAI: createStepFactory("genericAI" /* genericAI */)
|
|
22967
|
+
genericAI: createStepFactory("genericAI" /* genericAI */),
|
|
22968
|
+
stripeSync: createStepFactory("stripeSync" /* stripeSync */)
|
|
22857
22969
|
};
|
|
22858
22970
|
function buildDeclarationStep(definition, nextStep, errors) {
|
|
22859
22971
|
for (const paramName of KNOWN_SECRET_PARAMS[definition.type] ?? []) {
|
package/dist/src/lib/auth.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { ICurrentUser } from "@/lib/current-user-store";
|
|
1
2
|
import type { ISocialSignInOptions, ISocialSignInResult } from "@/lib/social-popup";
|
|
3
|
+
export type { ICurrentUser } from "@/lib/current-user-store";
|
|
2
4
|
export interface IAuthResult {
|
|
3
5
|
ok: boolean;
|
|
4
6
|
error?: string;
|
|
@@ -8,13 +10,11 @@ export interface IAuthResult {
|
|
|
8
10
|
signedIn?: boolean;
|
|
9
11
|
signInError?: string;
|
|
10
12
|
}
|
|
11
|
-
export interface ICurrentUser {
|
|
12
|
-
sub: string;
|
|
13
|
-
email?: string;
|
|
14
|
-
groups?: string[];
|
|
15
|
-
}
|
|
16
13
|
export interface ICurrentUserResult {
|
|
17
14
|
user: ICurrentUser | null;
|
|
15
|
+
userTypeId?: string;
|
|
16
|
+
expiresAt?: number;
|
|
17
|
+
invalidSession?: boolean;
|
|
18
18
|
error?: string;
|
|
19
19
|
}
|
|
20
20
|
export declare const login: (email: string, password: string) => Promise<IAuthResult>;
|
|
@@ -54,12 +54,20 @@ export declare const signInWithSocialProvider: (provider: string, options?: ISoc
|
|
|
54
54
|
export declare const logout: () => Promise<IAuthResult>;
|
|
55
55
|
/** The signed-in end user, or null without a valid session. */
|
|
56
56
|
export declare const currentUser: () => Promise<ICurrentUserResult>;
|
|
57
|
-
/**
|
|
58
|
-
export declare const useCurrentUser: (
|
|
59
|
-
|
|
57
|
+
/** Session identity is available independently of the workspace user profile. */
|
|
58
|
+
export declare const useCurrentUser: (options?: {
|
|
59
|
+
profile?: boolean;
|
|
60
|
+
}) => {
|
|
60
61
|
user: ICurrentUser | null;
|
|
61
62
|
isLoading: boolean;
|
|
63
|
+
isFetching: boolean;
|
|
62
64
|
error: string | null;
|
|
65
|
+
refetch: () => Promise<void>;
|
|
66
|
+
profile: import("@/api").IGenericItem | null;
|
|
67
|
+
isProfileLoading: boolean;
|
|
68
|
+
isProfileFetching: boolean;
|
|
69
|
+
profileError: import("@/api").IApiError | null;
|
|
70
|
+
refetchProfile: () => void;
|
|
63
71
|
};
|
|
64
72
|
/**
|
|
65
73
|
* Restrict post-auth redirects to same-site relative paths, rejecting
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { IGenericItem } from "@/api";
|
|
2
|
+
import { type ICurrentUser } from "@/lib/user-identity";
|
|
3
|
+
export { type ICurrentUser, readUser } from "@/lib/user-identity";
|
|
4
|
+
export type IIdentity = {
|
|
5
|
+
user: ICurrentUser | null;
|
|
6
|
+
userTypeId?: string;
|
|
7
|
+
expiresAt?: number;
|
|
8
|
+
};
|
|
9
|
+
type IState = {
|
|
10
|
+
identity?: IIdentity;
|
|
11
|
+
profile?: IGenericItem | null;
|
|
12
|
+
isFetching: boolean;
|
|
13
|
+
error: string | null;
|
|
14
|
+
};
|
|
15
|
+
export declare class CurrentUserStore {
|
|
16
|
+
private readonly scope;
|
|
17
|
+
private readonly preview;
|
|
18
|
+
private state;
|
|
19
|
+
private listeners;
|
|
20
|
+
private generation;
|
|
21
|
+
private pending?;
|
|
22
|
+
private previewIdentity?;
|
|
23
|
+
constructor(scope: string, preview: boolean);
|
|
24
|
+
private readStorage;
|
|
25
|
+
private syncPreview;
|
|
26
|
+
private emit;
|
|
27
|
+
getSnapshot: () => IState;
|
|
28
|
+
getServerSnapshot: () => IState;
|
|
29
|
+
subscribe: (listener: () => void) => () => void;
|
|
30
|
+
setIdentity(identity: IIdentity | undefined, persist?: boolean, keepProfile?: boolean): void;
|
|
31
|
+
setProfile(userId: string, profile: IGenericItem | null): void;
|
|
32
|
+
load(fetchIdentity: () => Promise<IIdentity & {
|
|
33
|
+
error?: string;
|
|
34
|
+
invalidSession?: boolean;
|
|
35
|
+
}>, force?: boolean): Promise<void>;
|
|
36
|
+
}
|
|
37
|
+
export declare const getCurrentUserStore: () => CurrentUserStore;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare const LoginForm: ({ nextPath, onSignedIn, }: {
|
|
2
|
+
nextPath?: string;
|
|
3
|
+
onSignedIn?: () => void;
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export declare const BuildingBlock: ({ searchParams, }: {
|
|
6
|
+
searchParams?: Record<string, string>;
|
|
7
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface IPageAuthConfig {
|
|
2
|
+
authEnabled: boolean;
|
|
3
|
+
locale: string;
|
|
4
|
+
rules: {
|
|
5
|
+
pattern: string;
|
|
6
|
+
visibility: string;
|
|
7
|
+
}[];
|
|
8
|
+
loginPath?: string;
|
|
9
|
+
defaultPath?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const getPageRedirect: (url: URL, signedIn: boolean, config: IPageAuthConfig) => string | null | undefined;
|
|
12
|
+
export {};
|
|
@@ -10,7 +10,18 @@ export declare const resolvedRouteParams: (config: {
|
|
|
10
10
|
params?: unknown;
|
|
11
11
|
notFound?: unknown;
|
|
12
12
|
}) => IRouteParamsState;
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const createRouteParamsCache: () => {
|
|
14
|
+
get: (key: string) => IRouteParamsState;
|
|
15
|
+
subscribe: (listener: () => void) => () => void;
|
|
16
|
+
load: (key: string, resolve: () => Promise<IRouteParamsState>) => Promise<void>;
|
|
17
|
+
reset: () => void;
|
|
18
|
+
};
|
|
19
|
+
export declare const createRouteParamsStore: (resolve: (slug: string[]) => Promise<IRouteParamsState>, cache?: {
|
|
20
|
+
get: (key: string) => IRouteParamsState;
|
|
21
|
+
subscribe: (listener: () => void) => () => void;
|
|
22
|
+
load: (key: string, resolve: () => Promise<IRouteParamsState>) => Promise<void>;
|
|
23
|
+
reset: () => void;
|
|
24
|
+
}, scope?: string) => {
|
|
14
25
|
getSnapshot: () => IRouteParamsState;
|
|
15
26
|
getSnapshotForPath: (pathname: string) => IRouteParamsState;
|
|
16
27
|
subscribe: (listener: () => void) => () => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ICurrentUser {
|
|
2
|
+
sub: string;
|
|
3
|
+
email?: string;
|
|
4
|
+
groups?: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare const readUser: (value: unknown) => ICurrentUser | null;
|
|
7
|
+
/** Decoding supplies a UI identity only; data requests still authenticate the session. */
|
|
8
|
+
export declare const readUserFromToken: (token: string) => ICurrentUser | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|