@turbofy-ai/app-runtime 0.0.19 → 0.0.21

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/dsl.d.ts CHANGED
@@ -826,6 +826,34 @@ export interface IPageMetaDictionary {
826
826
  "twitter:url"?: string;
827
827
  [key: string]: LocalizationValue | undefined;
828
828
  }
829
+ export interface IBranchParams {
830
+ branches: {
831
+ [k: string]: boolean;
832
+ };
833
+ }
834
+ export interface IBranchResult {
835
+ matchedSteps: string[];
836
+ }
837
+ export interface IForEachParams {
838
+ /**
839
+ * @maxItems 1000
840
+ */
841
+ items: unknown[];
842
+ bodyStep: string | null;
843
+ }
844
+ export type IForEachResult = {
845
+ /**
846
+ * @maxItems 1000
847
+ */
848
+ items: unknown[];
849
+ /**
850
+ * @maxItems 1000
851
+ */
852
+ result?: unknown[];
853
+ } | {
854
+ item: unknown;
855
+ index: number;
856
+ };
829
857
  export interface IBatchCreateTypeParams {
830
858
  ofType: string;
831
859
  namespace: string;
@@ -1138,31 +1166,6 @@ export interface INotifyWebSocketParams {
1138
1166
  export interface INotifyWebSocketResult {
1139
1167
  [k: string]: unknown;
1140
1168
  }
1141
- export type IOpenAIImageGenerationParams = {
1142
- model: "dall-e-3";
1143
- prompt: string;
1144
- quality?: "standard" | "hd";
1145
- size?: "1024x1024" | "1792x1024" | "1024x1792";
1146
- style?: "vivid" | "natural";
1147
- outputFilename?: string;
1148
- apiKey?: string;
1149
- } | {
1150
- model: "dall-e-2";
1151
- prompt: string;
1152
- size?: "256x256" | "512x512" | "1024x1024";
1153
- n?: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
1154
- outputFilename?: string;
1155
- apiKey?: string;
1156
- };
1157
- export type IOpenAIImageGenerationResult = {
1158
- type: "result";
1159
- url: string;
1160
- key: string;
1161
- mimeType: string;
1162
- } | {
1163
- type: "error";
1164
- value: string;
1165
- };
1166
1169
  export interface ITypeParams {
1167
1170
  id: string;
1168
1171
  ofType: string;
@@ -1276,7 +1279,7 @@ export type ICloudFunctionResult = {
1276
1279
  };
1277
1280
  export type IGenericAIParams = {
1278
1281
  operation: "generateObject";
1279
- apiKey: string;
1282
+ apiKey?: string;
1280
1283
  temperature?: number;
1281
1284
  model: {
1282
1285
  provider: "openai";
@@ -1293,6 +1296,12 @@ export type IGenericAIParams = {
1293
1296
  } | {
1294
1297
  provider: "google";
1295
1298
  model: string;
1299
+ } | {
1300
+ provider: "workspace";
1301
+ /**
1302
+ * Chat config id, or "auto" for the workspace default
1303
+ */
1304
+ model: string;
1296
1305
  };
1297
1306
  prompt: string;
1298
1307
  /**
@@ -1306,7 +1315,7 @@ export type IGenericAIParams = {
1306
1315
  };
1307
1316
  } | {
1308
1317
  operation: "generateText";
1309
- apiKey: string;
1318
+ apiKey?: string;
1310
1319
  temperature?: number;
1311
1320
  model: {
1312
1321
  provider: "openai";
@@ -1323,6 +1332,12 @@ export type IGenericAIParams = {
1323
1332
  } | {
1324
1333
  provider: "google";
1325
1334
  model: string;
1335
+ } | {
1336
+ provider: "workspace";
1337
+ /**
1338
+ * Chat config id, or "auto" for the workspace default
1339
+ */
1340
+ model: string;
1326
1341
  };
1327
1342
  /**
1328
1343
  * jsOnly
@@ -1414,7 +1429,7 @@ export type IGenericAIParams = {
1414
1429
  };
1415
1430
  } | {
1416
1431
  operation: "streamText";
1417
- apiKey: string;
1432
+ apiKey?: string;
1418
1433
  temperature?: number;
1419
1434
  model: {
1420
1435
  provider: "openai";
@@ -1431,6 +1446,12 @@ export type IGenericAIParams = {
1431
1446
  } | {
1432
1447
  provider: "google";
1433
1448
  model: string;
1449
+ } | {
1450
+ provider: "workspace";
1451
+ /**
1452
+ * Chat config id, or "auto" for the workspace default
1453
+ */
1454
+ model: string;
1434
1455
  };
1435
1456
  /**
1436
1457
  * jsOnly
@@ -1522,7 +1543,7 @@ export type IGenericAIParams = {
1522
1543
  };
1523
1544
  } | {
1524
1545
  operation: "embed";
1525
- apiKey: string;
1546
+ apiKey?: string;
1526
1547
  temperature?: number;
1527
1548
  model: {
1528
1549
  provider: "openai";
@@ -1543,7 +1564,7 @@ export type IGenericAIParams = {
1543
1564
  value: string;
1544
1565
  } | {
1545
1566
  operation: "generateImage";
1546
- apiKey: string;
1567
+ apiKey?: string;
1547
1568
  temperature?: number;
1548
1569
  model: {
1549
1570
  provider: "openai";
@@ -1694,6 +1715,8 @@ export interface IStripeSyncResult {
1694
1715
  recordId?: string;
1695
1716
  }
1696
1717
  export type IStepParamsMap = {
1718
+ branch: IBranchParams;
1719
+ forEach: IForEachParams;
1697
1720
  batchCreateType: IBatchCreateTypeParams;
1698
1721
  batchGetType: IBatchGetTypeParams;
1699
1722
  createType: ICreateTypeParams;
@@ -1707,7 +1730,6 @@ export type IStepParamsMap = {
1707
1730
  listTypeByParent: IListTypeByParentParams;
1708
1731
  listType: IListTypeParams;
1709
1732
  notifyWebSocket: INotifyWebSocketParams;
1710
- openAIImageGeneration: IOpenAIImageGenerationParams;
1711
1733
  type: ITypeParams;
1712
1734
  updateType: IUpdateTypeParams;
1713
1735
  extractImageMetadata: IExtractImageMetadataParams;
@@ -1716,6 +1738,8 @@ export type IStepParamsMap = {
1716
1738
  stripeSync: IStripeSyncParams;
1717
1739
  };
1718
1740
  export type IStepResultMap = {
1741
+ branch: IBranchResult;
1742
+ forEach: IForEachResult;
1719
1743
  batchCreateType: IBatchCreateTypeResult;
1720
1744
  batchGetType: IBatchGetTypeResult;
1721
1745
  createType: ICreateTypeResult;
@@ -1729,7 +1753,6 @@ export type IStepResultMap = {
1729
1753
  listTypeByParent: IListTypeByParentResult;
1730
1754
  listType: IListTypeResult;
1731
1755
  notifyWebSocket: INotifyWebSocketResult;
1732
- openAIImageGeneration: IOpenAIImageGenerationResult;
1733
1756
  type: ITypeResult;
1734
1757
  updateType: IUpdateTypeResult;
1735
1758
  extractImageMetadata: IExtractImageMetadataResult;
@@ -1738,6 +1761,8 @@ export type IStepResultMap = {
1738
1761
  stripeSync: IStripeSyncResult;
1739
1762
  };
1740
1763
  declare enum StepType {
1764
+ branch = "branch",
1765
+ forEach = "forEach",
1741
1766
  batchCreateType = "batchCreateType",
1742
1767
  batchGetType = "batchGetType",
1743
1768
  createType = "createType",
@@ -1751,7 +1776,6 @@ declare enum StepType {
1751
1776
  listTypeByParent = "listTypeByParent",
1752
1777
  listType = "listType",
1753
1778
  notifyWebSocket = "notifyWebSocket",
1754
- openAIImageGeneration = "openAIImageGeneration",
1755
1779
  type = "type",
1756
1780
  updateType = "updateType",
1757
1781
  extractImageMetadata = "extractImageMetadata",
@@ -1934,7 +1958,20 @@ export type IAppAuthSettings = {
1934
1958
  export type SemVer = `${number}.${number}.${number}`;
1935
1959
  export interface IDependencyInfo {
1936
1960
  version: SemVer;
1937
- url: string;
1961
+ /** Published bundle of the package root import. */
1962
+ url?: string;
1963
+ /** Import specifier (e.g. `chart.js/auto`) → its published bundle. */
1964
+ modules?: Record<string, string>;
1965
+ /**
1966
+ * Legacy per-package copy of {@link DEPENDENCY_BUNDLE_KEY}. New pushes store
1967
+ * the chunk map once on that key.
1968
+ */
1969
+ files?: Record<string, string>;
1970
+ /**
1971
+ * Legacy per-package copy of the bundle graph id. New pushes store it once
1972
+ * on {@link DEPENDENCY_BUNDLE_KEY}.
1973
+ */
1974
+ build?: string;
1938
1975
  }
1939
1976
  export type IDependenciesMap = Record<string, IDependencyInfo>;
1940
1977
  export interface IBlockTypeOptions {
@@ -1946,7 +1983,6 @@ export interface IBlockTypeOptions {
1946
1983
  defaultDynamicData?: string;
1947
1984
  sourceCodeUrl?: string;
1948
1985
  compiledCodeUrl?: string;
1949
- dependencies?: IDependenciesMap;
1950
1986
  /** Localization dictionaries keyed by language code. */
1951
1987
  localizations?: ILocalizationsByLocale;
1952
1988
  }
@@ -1957,7 +1993,6 @@ export interface IBlockTypeDefinition {
1957
1993
  defaultDynamicData?: string;
1958
1994
  sourceCodeUrl?: string;
1959
1995
  compiledCodeUrl?: string;
1960
- dependencies?: IDependenciesMap;
1961
1996
  localizations?: ILocalizationsByLocale;
1962
1997
  }
1963
1998
  export interface IBlockTypeOutput {
@@ -1967,6 +2002,7 @@ export interface IBlockTypeOutput {
1967
2002
  defaultDynamicData?: string;
1968
2003
  sourceCodeUrl?: string;
1969
2004
  compiledCodeUrl?: string;
2005
+ /** Set by app push from the package imports it detects in the block sources. */
1970
2006
  dependencies?: IDependenciesMap;
1971
2007
  localizations?: ILocalizationsByLocale;
1972
2008
  }
@@ -2038,7 +2074,6 @@ export interface FlattenBlocksOptions {
2038
2074
  declare function flattenBlocks(blocks: IBlockDefinition[], opts?: FlattenBlocksOptions): IBlockOutput[];
2039
2075
  export interface IPageParamConfig {
2040
2076
  collection: IObjectTypeDeclaration;
2041
- slugField?: string;
2042
2077
  }
2043
2078
  export interface IPageOptions {
2044
2079
  id?: string;
@@ -2065,6 +2100,12 @@ export interface IPageOptions {
2065
2100
  * end-user session; user/group permissions are enforced by the data layer.
2066
2101
  */
2067
2102
  visibility?: PageVisibility;
2103
+ /**
2104
+ * When false, a dynamic page is rendered on demand. Absent or true
2105
+ * pre-generates one URL per table entry while the table has fewer than
2106
+ * 100 entries.
2107
+ */
2108
+ pregenerate?: boolean;
2068
2109
  /** Building block instances on this page. */
2069
2110
  blocks?: IBlockDefinition[];
2070
2111
  }
@@ -2078,6 +2119,7 @@ export interface IPageDefinition {
2078
2119
  localizations?: ILocalizationsByLocale;
2079
2120
  localizedConfig?: string;
2080
2121
  visibility?: PageVisibility;
2122
+ pregenerate?: boolean;
2081
2123
  blocks: IBlockDefinition[];
2082
2124
  }
2083
2125
  export interface IPageSlugConfig {
@@ -2274,11 +2316,24 @@ export interface IFlowStepDefinition<T extends StepType = StepType> {
2274
2316
  type: T;
2275
2317
  description?: string;
2276
2318
  params: Record<string, unknown>;
2319
+ branches?: IFlowBranchDefinition[];
2320
+ steps?: IFlowStepDefinition[];
2277
2321
  next?: string | null;
2278
2322
  skipIf?: string;
2279
2323
  continueIf?: string;
2280
2324
  passThroughCondition?: string;
2281
2325
  }
2326
+ export interface IFlowBranchDefinition {
2327
+ when: DeepParam<boolean>;
2328
+ steps: IFlowStepDefinition[];
2329
+ }
2330
+ export interface IFlowBranchOptions extends Omit<IFlowStepOptions<StepType.branch>, "params" | "next"> {
2331
+ branches: IFlowBranchDefinition[];
2332
+ }
2333
+ export interface IFlowForEachOptions extends Omit<IFlowStepOptions<StepType.forEach>, "params"> {
2334
+ items: DeepParam<unknown[]>;
2335
+ steps: IFlowStepDefinition[];
2336
+ }
2282
2337
  declare const step: {
2283
2338
  batchCreateType: (name: string, opts: IFlowStepOptions<StepType.batchCreateType>) => IFlowStepDefinition<StepType.batchCreateType>;
2284
2339
  batchGetType: (name: string, opts: IFlowStepOptions<StepType.batchGetType>) => IFlowStepDefinition<StepType.batchGetType>;
@@ -2293,13 +2348,14 @@ declare const step: {
2293
2348
  listTypeByParent: (name: string, opts: IFlowStepOptions<StepType.listTypeByParent>) => IFlowStepDefinition<StepType.listTypeByParent>;
2294
2349
  listType: (name: string, opts: IFlowStepOptions<StepType.listType>) => IFlowStepDefinition<StepType.listType>;
2295
2350
  notifyWebSocket: (name: string, opts: IFlowStepOptions<StepType.notifyWebSocket>) => IFlowStepDefinition<StepType.notifyWebSocket>;
2296
- openAIImageGeneration: (name: string, opts: IFlowStepOptions<StepType.openAIImageGeneration>) => IFlowStepDefinition<StepType.openAIImageGeneration>;
2297
2351
  type: (name: string, opts: IFlowStepOptions<StepType.type>) => IFlowStepDefinition<StepType.type>;
2298
2352
  updateType: (name: string, opts: IFlowStepOptions<StepType.updateType>) => IFlowStepDefinition<StepType.updateType>;
2299
2353
  extractImageMetadata: (name: string, opts: IFlowStepOptions<StepType.extractImageMetadata>) => IFlowStepDefinition<StepType.extractImageMetadata>;
2300
2354
  cloudFunction: (name: string, opts: IFlowStepOptions<StepType.cloudFunction>) => IFlowStepDefinition<StepType.cloudFunction>;
2301
2355
  genericAI: (name: string, opts: IFlowStepOptions<StepType.genericAI>) => IFlowStepDefinition<StepType.genericAI>;
2302
2356
  stripeSync: (name: string, opts: IFlowStepOptions<StepType.stripeSync>) => IFlowStepDefinition<StepType.stripeSync>;
2357
+ forEach(name: string, opts: IFlowForEachOptions): IFlowStepDefinition<StepType.forEach>;
2358
+ branch(name: string, opts: IFlowBranchOptions): IFlowStepDefinition<StepType.branch>;
2303
2359
  };
2304
2360
  export interface IFlowOptions {
2305
2361
  /** Flow record name — stored next to the declaration, not inside it. */
@@ -2308,8 +2364,8 @@ export interface IFlowOptions {
2308
2364
  /** Executed in order; each step's nextStep defaults to the next entry. */
2309
2365
  steps: IFlowStepDefinition[];
2310
2366
  /**
2311
- * Steps not reachable from the main chain (each needs an explicit `next`).
2312
- * Exists for round-trip fidelity of pulled declarations — avoid in new flows.
2367
+ * Unconnected steps preserved on pull/push (each needs an explicit `next`).
2368
+ * Branch paths belong in the branch step's nested `branches` sequences.
2313
2369
  */
2314
2370
  detachedSteps?: IFlowStepDefinition[];
2315
2371
  debug?: boolean;
@@ -2354,7 +2410,7 @@ export interface IValidateFlowContext {
2354
2410
  */
2355
2411
  export declare function collectSecretIds(declaration: INonGenericIFlowDeclaration): string[];
2356
2412
  /**
2357
- * Validates a single flow declaration: linked-list step integrity, param
2413
+ * Validates a single flow declaration: step graph integrity, param
2358
2414
  * shapes, secret hygiene, and self-retriggering write steps.
2359
2415
  */
2360
2416
  export declare function validateFlow(declaration: INonGenericIFlowDeclaration, ctx?: IValidateFlowContext): IFlowValidationResult;
@@ -2378,7 +2434,7 @@ export interface IValidateFlowsOptions {
2378
2434
  export declare function validateFlows(flows: IValidatableFlow[], opts?: IValidateFlowsOptions): IFlowValidationResult;
2379
2435
 
2380
2436
  declare namespace flowBuilder {
2381
- export { IFlowOptions, IFlowOutput, IFlowStepDefinition, IFlowStepOptions, IFlowTriggerDefinition, IScheduleTriggerOptions, ISharedTriggerOptions, IStepParamsInput, ITableDataChangeTriggerOptions, TABLE_ID_PARAM_NAMES, buildFlow, js, secret, step, trigger };
2437
+ export { IFlowBranchDefinition, IFlowBranchOptions, IFlowForEachOptions, IFlowOptions, IFlowOutput, IFlowStepDefinition, IFlowStepOptions, IFlowTriggerDefinition, IScheduleTriggerOptions, ISharedTriggerOptions, IStepParamsInput, ITableDataChangeTriggerOptions, TABLE_ID_PARAM_NAMES, buildFlow, js, secret, step, trigger };
2382
2438
  }
2383
2439
  declare namespace dataBuilder {
2384
2440
  export { TableDef, TableOpts, TableSearchConfig, build, enumType, fields, table };