@lunnoa/client 2.3.0 → 2.4.0
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/README.md +1 -1
- package/dist/cli.js +3 -0
- package/dist/index.cjs +73 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -3
- package/dist/index.d.ts +30 -3
- package/dist/index.js +73 -2
- package/dist/index.js.map +1 -1
- package/dist/react.cjs +3 -0
- package/dist/react.cjs.map +1 -1
- package/dist/react.d.cts +18 -2
- package/dist/react.d.ts +18 -2
- package/dist/react.js +3 -0
- package/dist/react.js.map +1 -1
- package/package.json +1 -1
- package/skills/lunnoa-client/SKILL.md +40 -2
- package/skills/lunnoa-solution-design/SKILL.md +8 -2
package/dist/index.d.cts
CHANGED
|
@@ -2299,13 +2299,18 @@ interface components {
|
|
|
2299
2299
|
requestedCount: number;
|
|
2300
2300
|
};
|
|
2301
2301
|
UpsertWorkflowStepDto: {
|
|
2302
|
+
/**
|
|
2303
|
+
* @description Name later steps use in ={{step:<key>,path}}. Keyed steps keep their node id across deploys. "trigger" is reserved.
|
|
2304
|
+
* @example loadCase
|
|
2305
|
+
*/
|
|
2306
|
+
key?: string;
|
|
2302
2307
|
/** @description Workflow app id (catalogue slug). */
|
|
2303
2308
|
appId: string;
|
|
2304
2309
|
/** @description Catalogue action id. */
|
|
2305
2310
|
actionId: string;
|
|
2306
2311
|
/** @description Connection instance UUID for this step. */
|
|
2307
2312
|
connectionId?: string;
|
|
2308
|
-
/** @description Action input / config fields. */
|
|
2313
|
+
/** @description Action input / config fields. String values may use ={{step:trigger,field}} or ={{step:<key>,path,to,value}}. */
|
|
2309
2314
|
input?: {
|
|
2310
2315
|
[key: string]: unknown;
|
|
2311
2316
|
};
|
|
@@ -3464,6 +3469,8 @@ interface components {
|
|
|
3464
3469
|
executionPath?: components["schemas"]["ExecutionPathStepDto"][];
|
|
3465
3470
|
};
|
|
3466
3471
|
RunStepDto: {
|
|
3472
|
+
/** @description Name later steps use in ={{step:<key>,path}}. Ad-hoc runs have no trigger. */
|
|
3473
|
+
key?: string;
|
|
3467
3474
|
/** @description Workflow app id (catalogue slug), e.g. `http`, `gmail`. */
|
|
3468
3475
|
appId: string;
|
|
3469
3476
|
/** @description Action id within the app, e.g. `http_action_send-request`. Discover via GET /workflow-apps. */
|
|
@@ -6716,9 +6723,14 @@ interface TriggerDefinition {
|
|
|
6716
6723
|
description?: string;
|
|
6717
6724
|
}
|
|
6718
6725
|
interface WorkflowStepDefinition {
|
|
6726
|
+
/**
|
|
6727
|
+
* Name later steps use with `ref.step(key, ...)`. Keyed steps keep their
|
|
6728
|
+
* node id across deploys. `trigger` is reserved.
|
|
6729
|
+
*/
|
|
6730
|
+
key?: string;
|
|
6719
6731
|
/** Action definition (or inline action-shaped object). */
|
|
6720
6732
|
use: ActionDefinition;
|
|
6721
|
-
/** Per-step input overrides. */
|
|
6733
|
+
/** Per-step input overrides. Values may contain `ref.trigger` / `ref.step`. */
|
|
6722
6734
|
input?: Record<string, unknown>;
|
|
6723
6735
|
name?: string;
|
|
6724
6736
|
}
|
|
@@ -6762,6 +6774,17 @@ declare function defineConnection(config?: Omit<ConnectionDefinition, 'kind'>):
|
|
|
6762
6774
|
declare function defineAiConnection(config?: Omit<AiConnectionDefinition, 'kind'>): AiConnectionDefinition;
|
|
6763
6775
|
declare function defineAction(config: Omit<ActionDefinition, 'kind'>): ActionDefinition;
|
|
6764
6776
|
declare function defineTrigger(config: Omit<TriggerDefinition, 'kind'>): TriggerDefinition;
|
|
6777
|
+
/**
|
|
6778
|
+
* References for step inputs. The server swaps them for the real node ids on
|
|
6779
|
+
* deploy, and the builder shows them as mapped fields from earlier nodes.
|
|
6780
|
+
* They are plain strings, so they also work inside text and nested objects.
|
|
6781
|
+
*/
|
|
6782
|
+
declare const ref: {
|
|
6783
|
+
/** A trigger output field, e.g. a Manually Run input id. */
|
|
6784
|
+
trigger: (field: string, ...path: Array<string | number>) => string;
|
|
6785
|
+
/** An earlier step's output, by its `key`. Array indexes are numbers. */
|
|
6786
|
+
step: (key: string, ...path: Array<string | number>) => string;
|
|
6787
|
+
};
|
|
6765
6788
|
declare function defineWorkflow(config: Omit<WorkflowDefinition, 'kind'>): WorkflowDefinition;
|
|
6766
6789
|
declare function defineAgent(config: Omit<AgentDefinition, 'kind'>): AgentDefinition;
|
|
6767
6790
|
interface EntityTypeDefinition {
|
|
@@ -7360,6 +7383,8 @@ declare class QueuesResource {
|
|
|
7360
7383
|
}
|
|
7361
7384
|
|
|
7362
7385
|
interface StartRunStep {
|
|
7386
|
+
/** Name later steps use with `ref.step(key, ...)`. */
|
|
7387
|
+
key?: string;
|
|
7363
7388
|
appId: string;
|
|
7364
7389
|
actionId: string;
|
|
7365
7390
|
connectionId?: string;
|
|
@@ -7512,6 +7537,8 @@ declare class VariablesResource {
|
|
|
7512
7537
|
}
|
|
7513
7538
|
|
|
7514
7539
|
interface UpsertWorkflowStepInput {
|
|
7540
|
+
/** Name later steps use in `={{step:<key>,path}}`. Keeps the node id stable. */
|
|
7541
|
+
key?: string;
|
|
7515
7542
|
appId: string;
|
|
7516
7543
|
actionId: string;
|
|
7517
7544
|
connectionId?: string;
|
|
@@ -7765,4 +7792,4 @@ interface CreateServerClientOptions {
|
|
|
7765
7792
|
*/
|
|
7766
7793
|
declare function createServerClient(options: CreateServerClientOptions): LunnoaClient;
|
|
7767
7794
|
|
|
7768
|
-
export { API_KEY_PREFIX, type ActionDefinition, ActionsResource, type AddQueueItemErrorInput, type Agent, AgentChatClient, AgentChatStream, type AgentDefinition, type AgentToolDefinition, AgentsResource, type AiConnection, type AiConnectionDefinition, type AiConnectionModel, AiConnectionsResource, type ApprovalInboxItem, ApprovalsResource, AuthResource, type AuthTokens, type BulkCreateQueueItemsInput, type BulkCreateQueueItemsResult, type ChangeEntityStateInput, type ChangeEntityStateResult, type ChatMode, type Connection, type ConnectionDefinition, ConnectionsResource, type CreateBrowserClientOptions, type CreateEntityInput, type CreateKnowledgeInput, type CreateQueueInput, type CreateQueueItemInput, type CreateServerClientOptions, type CreateTaskInput, type CreateVariableInput, type CurrentUser, DEFINE_KINDS, type DefineKind, type DeletedTask, DiscoveryResource, type EligibleApprover, type EnabledFeatures, EntitiesResource, type Entity, type EntityStateHistoryEntry, type EntityStateTransitions, type EntityType, type EntityTypeDefinition, type EntityTypeReadOptions, EntityTypesResource, type ExecuteWorkflowResult, type Execution, type ExecutionPathStep, type ExecutionProgress, type ExecutionProgressPayload, type ExecutionProgressStep, ExecutionProgressStream, type ExecutionStatus, type ExecutionStreamEvent, type ExecutionStreamEventType, ExecutionTimeoutError, ExecutionsResource, type ExportEntitiesInput, type FetchLike, HttpClient, type ImportEntitiesInput, type ImportEntitiesResult, type ImportTemplate, type Knowledge, type KnowledgeDocument, type KnowledgeDocumentGroup, KnowledgeResource, type ListEntitiesOptions, type ListQueryOptions, type ListQueueItemsByObjectOptions, type ListQueueItemsOptions, type LocalStorageTokenStoreOptions, type LoginRequires2FA, type LoginResult, type LoginSuccess, LunnoaApiError, LunnoaClient, type LunnoaClientOptions, type MessageTaskInput, type OffsetPagination, type PagePagination, type PaginatedEntities, type PendingInput, type PendingInputField, type QueryValue, type Queue, type QueueAllowedObjectType, type QueueItem, type QueueItemCreated, type QueueItemErrorEntry, type QueueItemFull, type QueueItemList, type QueueItemObjectSummary, type QueueItemStats, type QueueItemStatus, QueueItemsResource, type QueueStats, QueuesResource, type RecordMeasureValueInput, type RequestOptions, type RunActionInput, type RunActionOptions, type RunActionResult, RunsResource, type SaveUploadedTextInput, type Scorecard, type ScorecardMeasure, type ScorecardMeasureStatus, type ScorecardMeasureValue, type ScorecardObjective, type ScorecardSummary, ScorecardsResource, type SseEvent, SsoAuthResource, type SsoProviderSummary, type SsoProvidersResponse, type StartRunInput, type StartRunInputDto, type StartRunOptions, type StartRunStep, type StopStreamOptions, type StreamMessageOptions, type Table, TablesResource, type Task, type TaskListItem, TasksResource, type TokenStore, type TriggerDefinition, type TriggerInputFieldDefinition, type UpdateEntityInput, type UpdateKnowledgeInput, type UpdateQueueInput, type UpdateQueueItemInput, type UpdateTaskInput, type UpdateVariableInput, type UpsertAgentBySlugInput, type UpsertAgentBySlugInputDto, type UpsertAgentToolInput, type UpsertEntityTypeBySlugInput, type UpsertTableBySlugInput, type UpsertWorkflowBySlugInput, type UpsertWorkflowBySlugInputDto, type UpsertWorkflowStepInput, type UpsertWorkflowTriggerInput, type Variable, VariablesResource, type WaitUntilFinishedOptions, type WatchProgressOptions, type Workflow, type WorkflowApp, WorkflowAppsResource, type WorkflowDefinition, type WorkflowStepDefinition, WorkflowsResource, assertApiKeyAllowedInEnvironment, type components, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineTrigger, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, type operations, parseSseEvents, parseSseStream, type paths, resolveActionAppId, resolveActionId, resolveTriggerAppId, resolveTriggerId };
|
|
7795
|
+
export { API_KEY_PREFIX, type ActionDefinition, ActionsResource, type AddQueueItemErrorInput, type Agent, AgentChatClient, AgentChatStream, type AgentDefinition, type AgentToolDefinition, AgentsResource, type AiConnection, type AiConnectionDefinition, type AiConnectionModel, AiConnectionsResource, type ApprovalInboxItem, ApprovalsResource, AuthResource, type AuthTokens, type BulkCreateQueueItemsInput, type BulkCreateQueueItemsResult, type ChangeEntityStateInput, type ChangeEntityStateResult, type ChatMode, type Connection, type ConnectionDefinition, ConnectionsResource, type CreateBrowserClientOptions, type CreateEntityInput, type CreateKnowledgeInput, type CreateQueueInput, type CreateQueueItemInput, type CreateServerClientOptions, type CreateTaskInput, type CreateVariableInput, type CurrentUser, DEFINE_KINDS, type DefineKind, type DeletedTask, DiscoveryResource, type EligibleApprover, type EnabledFeatures, EntitiesResource, type Entity, type EntityStateHistoryEntry, type EntityStateTransitions, type EntityType, type EntityTypeDefinition, type EntityTypeReadOptions, EntityTypesResource, type ExecuteWorkflowResult, type Execution, type ExecutionPathStep, type ExecutionProgress, type ExecutionProgressPayload, type ExecutionProgressStep, ExecutionProgressStream, type ExecutionStatus, type ExecutionStreamEvent, type ExecutionStreamEventType, ExecutionTimeoutError, ExecutionsResource, type ExportEntitiesInput, type FetchLike, HttpClient, type ImportEntitiesInput, type ImportEntitiesResult, type ImportTemplate, type Knowledge, type KnowledgeDocument, type KnowledgeDocumentGroup, KnowledgeResource, type ListEntitiesOptions, type ListQueryOptions, type ListQueueItemsByObjectOptions, type ListQueueItemsOptions, type LocalStorageTokenStoreOptions, type LoginRequires2FA, type LoginResult, type LoginSuccess, LunnoaApiError, LunnoaClient, type LunnoaClientOptions, type MessageTaskInput, type OffsetPagination, type PagePagination, type PaginatedEntities, type PendingInput, type PendingInputField, type QueryValue, type Queue, type QueueAllowedObjectType, type QueueItem, type QueueItemCreated, type QueueItemErrorEntry, type QueueItemFull, type QueueItemList, type QueueItemObjectSummary, type QueueItemStats, type QueueItemStatus, QueueItemsResource, type QueueStats, QueuesResource, type RecordMeasureValueInput, type RequestOptions, type RunActionInput, type RunActionOptions, type RunActionResult, RunsResource, type SaveUploadedTextInput, type Scorecard, type ScorecardMeasure, type ScorecardMeasureStatus, type ScorecardMeasureValue, type ScorecardObjective, type ScorecardSummary, ScorecardsResource, type SseEvent, SsoAuthResource, type SsoProviderSummary, type SsoProvidersResponse, type StartRunInput, type StartRunInputDto, type StartRunOptions, type StartRunStep, type StopStreamOptions, type StreamMessageOptions, type Table, TablesResource, type Task, type TaskListItem, TasksResource, type TokenStore, type TriggerDefinition, type TriggerInputFieldDefinition, type UpdateEntityInput, type UpdateKnowledgeInput, type UpdateQueueInput, type UpdateQueueItemInput, type UpdateTaskInput, type UpdateVariableInput, type UpsertAgentBySlugInput, type UpsertAgentBySlugInputDto, type UpsertAgentToolInput, type UpsertEntityTypeBySlugInput, type UpsertTableBySlugInput, type UpsertWorkflowBySlugInput, type UpsertWorkflowBySlugInputDto, type UpsertWorkflowStepInput, type UpsertWorkflowTriggerInput, type Variable, VariablesResource, type WaitUntilFinishedOptions, type WatchProgressOptions, type Workflow, type WorkflowApp, WorkflowAppsResource, type WorkflowDefinition, type WorkflowStepDefinition, WorkflowsResource, assertApiKeyAllowedInEnvironment, type components, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineTrigger, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, type operations, parseSseEvents, parseSseStream, type paths, ref, resolveActionAppId, resolveActionId, resolveTriggerAppId, resolveTriggerId };
|
package/dist/index.d.ts
CHANGED
|
@@ -2299,13 +2299,18 @@ interface components {
|
|
|
2299
2299
|
requestedCount: number;
|
|
2300
2300
|
};
|
|
2301
2301
|
UpsertWorkflowStepDto: {
|
|
2302
|
+
/**
|
|
2303
|
+
* @description Name later steps use in ={{step:<key>,path}}. Keyed steps keep their node id across deploys. "trigger" is reserved.
|
|
2304
|
+
* @example loadCase
|
|
2305
|
+
*/
|
|
2306
|
+
key?: string;
|
|
2302
2307
|
/** @description Workflow app id (catalogue slug). */
|
|
2303
2308
|
appId: string;
|
|
2304
2309
|
/** @description Catalogue action id. */
|
|
2305
2310
|
actionId: string;
|
|
2306
2311
|
/** @description Connection instance UUID for this step. */
|
|
2307
2312
|
connectionId?: string;
|
|
2308
|
-
/** @description Action input / config fields. */
|
|
2313
|
+
/** @description Action input / config fields. String values may use ={{step:trigger,field}} or ={{step:<key>,path,to,value}}. */
|
|
2309
2314
|
input?: {
|
|
2310
2315
|
[key: string]: unknown;
|
|
2311
2316
|
};
|
|
@@ -3464,6 +3469,8 @@ interface components {
|
|
|
3464
3469
|
executionPath?: components["schemas"]["ExecutionPathStepDto"][];
|
|
3465
3470
|
};
|
|
3466
3471
|
RunStepDto: {
|
|
3472
|
+
/** @description Name later steps use in ={{step:<key>,path}}. Ad-hoc runs have no trigger. */
|
|
3473
|
+
key?: string;
|
|
3467
3474
|
/** @description Workflow app id (catalogue slug), e.g. `http`, `gmail`. */
|
|
3468
3475
|
appId: string;
|
|
3469
3476
|
/** @description Action id within the app, e.g. `http_action_send-request`. Discover via GET /workflow-apps. */
|
|
@@ -6716,9 +6723,14 @@ interface TriggerDefinition {
|
|
|
6716
6723
|
description?: string;
|
|
6717
6724
|
}
|
|
6718
6725
|
interface WorkflowStepDefinition {
|
|
6726
|
+
/**
|
|
6727
|
+
* Name later steps use with `ref.step(key, ...)`. Keyed steps keep their
|
|
6728
|
+
* node id across deploys. `trigger` is reserved.
|
|
6729
|
+
*/
|
|
6730
|
+
key?: string;
|
|
6719
6731
|
/** Action definition (or inline action-shaped object). */
|
|
6720
6732
|
use: ActionDefinition;
|
|
6721
|
-
/** Per-step input overrides. */
|
|
6733
|
+
/** Per-step input overrides. Values may contain `ref.trigger` / `ref.step`. */
|
|
6722
6734
|
input?: Record<string, unknown>;
|
|
6723
6735
|
name?: string;
|
|
6724
6736
|
}
|
|
@@ -6762,6 +6774,17 @@ declare function defineConnection(config?: Omit<ConnectionDefinition, 'kind'>):
|
|
|
6762
6774
|
declare function defineAiConnection(config?: Omit<AiConnectionDefinition, 'kind'>): AiConnectionDefinition;
|
|
6763
6775
|
declare function defineAction(config: Omit<ActionDefinition, 'kind'>): ActionDefinition;
|
|
6764
6776
|
declare function defineTrigger(config: Omit<TriggerDefinition, 'kind'>): TriggerDefinition;
|
|
6777
|
+
/**
|
|
6778
|
+
* References for step inputs. The server swaps them for the real node ids on
|
|
6779
|
+
* deploy, and the builder shows them as mapped fields from earlier nodes.
|
|
6780
|
+
* They are plain strings, so they also work inside text and nested objects.
|
|
6781
|
+
*/
|
|
6782
|
+
declare const ref: {
|
|
6783
|
+
/** A trigger output field, e.g. a Manually Run input id. */
|
|
6784
|
+
trigger: (field: string, ...path: Array<string | number>) => string;
|
|
6785
|
+
/** An earlier step's output, by its `key`. Array indexes are numbers. */
|
|
6786
|
+
step: (key: string, ...path: Array<string | number>) => string;
|
|
6787
|
+
};
|
|
6765
6788
|
declare function defineWorkflow(config: Omit<WorkflowDefinition, 'kind'>): WorkflowDefinition;
|
|
6766
6789
|
declare function defineAgent(config: Omit<AgentDefinition, 'kind'>): AgentDefinition;
|
|
6767
6790
|
interface EntityTypeDefinition {
|
|
@@ -7360,6 +7383,8 @@ declare class QueuesResource {
|
|
|
7360
7383
|
}
|
|
7361
7384
|
|
|
7362
7385
|
interface StartRunStep {
|
|
7386
|
+
/** Name later steps use with `ref.step(key, ...)`. */
|
|
7387
|
+
key?: string;
|
|
7363
7388
|
appId: string;
|
|
7364
7389
|
actionId: string;
|
|
7365
7390
|
connectionId?: string;
|
|
@@ -7512,6 +7537,8 @@ declare class VariablesResource {
|
|
|
7512
7537
|
}
|
|
7513
7538
|
|
|
7514
7539
|
interface UpsertWorkflowStepInput {
|
|
7540
|
+
/** Name later steps use in `={{step:<key>,path}}`. Keeps the node id stable. */
|
|
7541
|
+
key?: string;
|
|
7515
7542
|
appId: string;
|
|
7516
7543
|
actionId: string;
|
|
7517
7544
|
connectionId?: string;
|
|
@@ -7765,4 +7792,4 @@ interface CreateServerClientOptions {
|
|
|
7765
7792
|
*/
|
|
7766
7793
|
declare function createServerClient(options: CreateServerClientOptions): LunnoaClient;
|
|
7767
7794
|
|
|
7768
|
-
export { API_KEY_PREFIX, type ActionDefinition, ActionsResource, type AddQueueItemErrorInput, type Agent, AgentChatClient, AgentChatStream, type AgentDefinition, type AgentToolDefinition, AgentsResource, type AiConnection, type AiConnectionDefinition, type AiConnectionModel, AiConnectionsResource, type ApprovalInboxItem, ApprovalsResource, AuthResource, type AuthTokens, type BulkCreateQueueItemsInput, type BulkCreateQueueItemsResult, type ChangeEntityStateInput, type ChangeEntityStateResult, type ChatMode, type Connection, type ConnectionDefinition, ConnectionsResource, type CreateBrowserClientOptions, type CreateEntityInput, type CreateKnowledgeInput, type CreateQueueInput, type CreateQueueItemInput, type CreateServerClientOptions, type CreateTaskInput, type CreateVariableInput, type CurrentUser, DEFINE_KINDS, type DefineKind, type DeletedTask, DiscoveryResource, type EligibleApprover, type EnabledFeatures, EntitiesResource, type Entity, type EntityStateHistoryEntry, type EntityStateTransitions, type EntityType, type EntityTypeDefinition, type EntityTypeReadOptions, EntityTypesResource, type ExecuteWorkflowResult, type Execution, type ExecutionPathStep, type ExecutionProgress, type ExecutionProgressPayload, type ExecutionProgressStep, ExecutionProgressStream, type ExecutionStatus, type ExecutionStreamEvent, type ExecutionStreamEventType, ExecutionTimeoutError, ExecutionsResource, type ExportEntitiesInput, type FetchLike, HttpClient, type ImportEntitiesInput, type ImportEntitiesResult, type ImportTemplate, type Knowledge, type KnowledgeDocument, type KnowledgeDocumentGroup, KnowledgeResource, type ListEntitiesOptions, type ListQueryOptions, type ListQueueItemsByObjectOptions, type ListQueueItemsOptions, type LocalStorageTokenStoreOptions, type LoginRequires2FA, type LoginResult, type LoginSuccess, LunnoaApiError, LunnoaClient, type LunnoaClientOptions, type MessageTaskInput, type OffsetPagination, type PagePagination, type PaginatedEntities, type PendingInput, type PendingInputField, type QueryValue, type Queue, type QueueAllowedObjectType, type QueueItem, type QueueItemCreated, type QueueItemErrorEntry, type QueueItemFull, type QueueItemList, type QueueItemObjectSummary, type QueueItemStats, type QueueItemStatus, QueueItemsResource, type QueueStats, QueuesResource, type RecordMeasureValueInput, type RequestOptions, type RunActionInput, type RunActionOptions, type RunActionResult, RunsResource, type SaveUploadedTextInput, type Scorecard, type ScorecardMeasure, type ScorecardMeasureStatus, type ScorecardMeasureValue, type ScorecardObjective, type ScorecardSummary, ScorecardsResource, type SseEvent, SsoAuthResource, type SsoProviderSummary, type SsoProvidersResponse, type StartRunInput, type StartRunInputDto, type StartRunOptions, type StartRunStep, type StopStreamOptions, type StreamMessageOptions, type Table, TablesResource, type Task, type TaskListItem, TasksResource, type TokenStore, type TriggerDefinition, type TriggerInputFieldDefinition, type UpdateEntityInput, type UpdateKnowledgeInput, type UpdateQueueInput, type UpdateQueueItemInput, type UpdateTaskInput, type UpdateVariableInput, type UpsertAgentBySlugInput, type UpsertAgentBySlugInputDto, type UpsertAgentToolInput, type UpsertEntityTypeBySlugInput, type UpsertTableBySlugInput, type UpsertWorkflowBySlugInput, type UpsertWorkflowBySlugInputDto, type UpsertWorkflowStepInput, type UpsertWorkflowTriggerInput, type Variable, VariablesResource, type WaitUntilFinishedOptions, type WatchProgressOptions, type Workflow, type WorkflowApp, WorkflowAppsResource, type WorkflowDefinition, type WorkflowStepDefinition, WorkflowsResource, assertApiKeyAllowedInEnvironment, type components, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineTrigger, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, type operations, parseSseEvents, parseSseStream, type paths, resolveActionAppId, resolveActionId, resolveTriggerAppId, resolveTriggerId };
|
|
7795
|
+
export { API_KEY_PREFIX, type ActionDefinition, ActionsResource, type AddQueueItemErrorInput, type Agent, AgentChatClient, AgentChatStream, type AgentDefinition, type AgentToolDefinition, AgentsResource, type AiConnection, type AiConnectionDefinition, type AiConnectionModel, AiConnectionsResource, type ApprovalInboxItem, ApprovalsResource, AuthResource, type AuthTokens, type BulkCreateQueueItemsInput, type BulkCreateQueueItemsResult, type ChangeEntityStateInput, type ChangeEntityStateResult, type ChatMode, type Connection, type ConnectionDefinition, ConnectionsResource, type CreateBrowserClientOptions, type CreateEntityInput, type CreateKnowledgeInput, type CreateQueueInput, type CreateQueueItemInput, type CreateServerClientOptions, type CreateTaskInput, type CreateVariableInput, type CurrentUser, DEFINE_KINDS, type DefineKind, type DeletedTask, DiscoveryResource, type EligibleApprover, type EnabledFeatures, EntitiesResource, type Entity, type EntityStateHistoryEntry, type EntityStateTransitions, type EntityType, type EntityTypeDefinition, type EntityTypeReadOptions, EntityTypesResource, type ExecuteWorkflowResult, type Execution, type ExecutionPathStep, type ExecutionProgress, type ExecutionProgressPayload, type ExecutionProgressStep, ExecutionProgressStream, type ExecutionStatus, type ExecutionStreamEvent, type ExecutionStreamEventType, ExecutionTimeoutError, ExecutionsResource, type ExportEntitiesInput, type FetchLike, HttpClient, type ImportEntitiesInput, type ImportEntitiesResult, type ImportTemplate, type Knowledge, type KnowledgeDocument, type KnowledgeDocumentGroup, KnowledgeResource, type ListEntitiesOptions, type ListQueryOptions, type ListQueueItemsByObjectOptions, type ListQueueItemsOptions, type LocalStorageTokenStoreOptions, type LoginRequires2FA, type LoginResult, type LoginSuccess, LunnoaApiError, LunnoaClient, type LunnoaClientOptions, type MessageTaskInput, type OffsetPagination, type PagePagination, type PaginatedEntities, type PendingInput, type PendingInputField, type QueryValue, type Queue, type QueueAllowedObjectType, type QueueItem, type QueueItemCreated, type QueueItemErrorEntry, type QueueItemFull, type QueueItemList, type QueueItemObjectSummary, type QueueItemStats, type QueueItemStatus, QueueItemsResource, type QueueStats, QueuesResource, type RecordMeasureValueInput, type RequestOptions, type RunActionInput, type RunActionOptions, type RunActionResult, RunsResource, type SaveUploadedTextInput, type Scorecard, type ScorecardMeasure, type ScorecardMeasureStatus, type ScorecardMeasureValue, type ScorecardObjective, type ScorecardSummary, ScorecardsResource, type SseEvent, SsoAuthResource, type SsoProviderSummary, type SsoProvidersResponse, type StartRunInput, type StartRunInputDto, type StartRunOptions, type StartRunStep, type StopStreamOptions, type StreamMessageOptions, type Table, TablesResource, type Task, type TaskListItem, TasksResource, type TokenStore, type TriggerDefinition, type TriggerInputFieldDefinition, type UpdateEntityInput, type UpdateKnowledgeInput, type UpdateQueueInput, type UpdateQueueItemInput, type UpdateTaskInput, type UpdateVariableInput, type UpsertAgentBySlugInput, type UpsertAgentBySlugInputDto, type UpsertAgentToolInput, type UpsertEntityTypeBySlugInput, type UpsertTableBySlugInput, type UpsertWorkflowBySlugInput, type UpsertWorkflowBySlugInputDto, type UpsertWorkflowStepInput, type UpsertWorkflowTriggerInput, type Variable, VariablesResource, type WaitUntilFinishedOptions, type WatchProgressOptions, type Workflow, type WorkflowApp, WorkflowAppsResource, type WorkflowDefinition, type WorkflowStepDefinition, WorkflowsResource, assertApiKeyAllowedInEnvironment, type components, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineTrigger, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, type operations, parseSseEvents, parseSseStream, type paths, ref, resolveActionAppId, resolveActionId, resolveTriggerAppId, resolveTriggerId };
|
package/dist/index.js
CHANGED
|
@@ -561,7 +561,7 @@ function assertTriggerConfig(config) {
|
|
|
561
561
|
throw new Error("defineTrigger inputs require id");
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
|
-
if (config.inputs?.length && config.id.trim() !==
|
|
564
|
+
if (config.inputs?.length && config.id.trim() !== MANUAL_TRIGGER_ID) {
|
|
565
565
|
throw new Error(
|
|
566
566
|
"defineTrigger inputs are only valid on flow-control_trigger_manual"
|
|
567
567
|
);
|
|
@@ -571,6 +571,73 @@ function defineTrigger(config) {
|
|
|
571
571
|
assertTriggerConfig(config);
|
|
572
572
|
return { kind: DEFINE_KINDS.trigger, ...config };
|
|
573
573
|
}
|
|
574
|
+
var MANUAL_TRIGGER_ID = "flow-control_trigger_manual";
|
|
575
|
+
var TRIGGER_KEY = "trigger";
|
|
576
|
+
var STEP_KEY_PATTERN = /^[A-Za-z][A-Za-z0-9_-]*$/;
|
|
577
|
+
var STEP_REF_PATTERN = /={{step:([^}]*)}}/g;
|
|
578
|
+
function refString(key, path) {
|
|
579
|
+
const parts = [key, ...path.map(String)];
|
|
580
|
+
for (const part of parts) {
|
|
581
|
+
if (!part || /[,{}]/.test(part)) {
|
|
582
|
+
throw new Error(`ref path parts must be non-empty and contain no , { or }: "${part}"`);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
return `={{step:${parts.join(",")}}}`;
|
|
586
|
+
}
|
|
587
|
+
var ref = {
|
|
588
|
+
/** A trigger output field, e.g. a Manually Run input id. */
|
|
589
|
+
trigger: (field, ...path) => refString(TRIGGER_KEY, [field, ...path]),
|
|
590
|
+
/** An earlier step's output, by its `key`. Array indexes are numbers. */
|
|
591
|
+
step: (key, ...path) => refString(key, path)
|
|
592
|
+
};
|
|
593
|
+
function collectRefs(value, out) {
|
|
594
|
+
if (typeof value === "string") {
|
|
595
|
+
for (const match of value.matchAll(STEP_REF_PATTERN)) {
|
|
596
|
+
out.push(match[1].split(",").map((part) => part.trim()));
|
|
597
|
+
}
|
|
598
|
+
} else if (Array.isArray(value)) {
|
|
599
|
+
value.forEach((item) => collectRefs(item, out));
|
|
600
|
+
} else if (value && typeof value === "object") {
|
|
601
|
+
Object.values(value).forEach((item) => collectRefs(item, out));
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
function assertStepRefs(config) {
|
|
605
|
+
const triggerId = config.trigger?.id.trim() ?? MANUAL_TRIGGER_ID;
|
|
606
|
+
const triggerFields = triggerId === MANUAL_TRIGGER_ID ? new Set((config.trigger?.inputs ?? []).map((f) => f.id.trim())) : void 0;
|
|
607
|
+
const allKeys = /* @__PURE__ */ new Set();
|
|
608
|
+
for (const step of config.steps) {
|
|
609
|
+
if (step.key === void 0) continue;
|
|
610
|
+
if (!STEP_KEY_PATTERN.test(step.key) || step.key === TRIGGER_KEY) {
|
|
611
|
+
throw new Error(
|
|
612
|
+
`Step key "${step.key}" must start with a letter, use letters, digits, - or _, and not be "${TRIGGER_KEY}".`
|
|
613
|
+
);
|
|
614
|
+
}
|
|
615
|
+
if (allKeys.has(step.key)) {
|
|
616
|
+
throw new Error(`Step key "${step.key}" is used twice.`);
|
|
617
|
+
}
|
|
618
|
+
allKeys.add(step.key);
|
|
619
|
+
}
|
|
620
|
+
const earlier = /* @__PURE__ */ new Set([TRIGGER_KEY]);
|
|
621
|
+
config.steps.forEach((step, index) => {
|
|
622
|
+
const refs = [];
|
|
623
|
+
collectRefs([step.use?.input, step.input], refs);
|
|
624
|
+
const where = `Step "${step.key ?? step.name ?? index + 1}"`;
|
|
625
|
+
for (const [key = "", ...path] of refs) {
|
|
626
|
+
const shown = `={{step:${[key, ...path].join(",")}}}`;
|
|
627
|
+
if (!earlier.has(key)) {
|
|
628
|
+
throw new Error(
|
|
629
|
+
allKeys.has(key) ? `${where}: ${shown} refers to itself or a later step. Use the trigger or an earlier step.` : `${where}: ${shown} names unknown key "${key}". Use "trigger" or an earlier step's key.`
|
|
630
|
+
);
|
|
631
|
+
}
|
|
632
|
+
if (key === TRIGGER_KEY && triggerFields && !triggerFields.has(path[0] ?? "")) {
|
|
633
|
+
throw new Error(
|
|
634
|
+
`${where}: ${shown} uses trigger field "${path[0] ?? ""}", which is not declared in trigger inputs.`
|
|
635
|
+
);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
if (step.key) earlier.add(step.key);
|
|
639
|
+
});
|
|
640
|
+
}
|
|
574
641
|
function defineWorkflow(config) {
|
|
575
642
|
if (!config.slug?.trim()) {
|
|
576
643
|
throw new Error("defineWorkflow requires slug");
|
|
@@ -581,6 +648,7 @@ function defineWorkflow(config) {
|
|
|
581
648
|
if (config.trigger) {
|
|
582
649
|
assertTriggerConfig(config.trigger);
|
|
583
650
|
}
|
|
651
|
+
assertStepRefs(config);
|
|
584
652
|
return { kind: DEFINE_KINDS.workflow, ...config };
|
|
585
653
|
}
|
|
586
654
|
function defineAgent(config) {
|
|
@@ -1872,7 +1940,9 @@ function stepFromDefinition(step) {
|
|
|
1872
1940
|
...use.input ?? {},
|
|
1873
1941
|
...step.input ?? {}
|
|
1874
1942
|
};
|
|
1943
|
+
const key = step.key;
|
|
1875
1944
|
return {
|
|
1945
|
+
...key ? { key } : {},
|
|
1876
1946
|
appId: resolveActionAppId(use),
|
|
1877
1947
|
actionId: resolveActionId(use),
|
|
1878
1948
|
...use.connection?.id ? { connectionId: use.connection.id } : {},
|
|
@@ -2088,6 +2158,7 @@ function triggerToUpsertInput(trigger) {
|
|
|
2088
2158
|
function stepToUpsertInput(step) {
|
|
2089
2159
|
const use = step.use;
|
|
2090
2160
|
return {
|
|
2161
|
+
...step.key ? { key: step.key } : {},
|
|
2091
2162
|
appId: resolveActionAppId(use),
|
|
2092
2163
|
actionId: resolveActionId(use),
|
|
2093
2164
|
connectionId: use.connection?.id,
|
|
@@ -2304,6 +2375,6 @@ function createServerClient(options) {
|
|
|
2304
2375
|
});
|
|
2305
2376
|
}
|
|
2306
2377
|
|
|
2307
|
-
export { API_KEY_PREFIX, ActionsResource, AgentChatClient, AgentChatStream, AgentsResource, AiConnectionsResource, ApprovalsResource, AuthResource, ConnectionsResource, DEFINE_KINDS, DiscoveryResource, EntitiesResource, EntityTypesResource, ExecutionProgressStream, ExecutionTimeoutError, ExecutionsResource, HttpClient, KnowledgeResource, LunnoaApiError, LunnoaClient, QueueItemsResource, QueuesResource, RunsResource, ScorecardsResource, SsoAuthResource, TablesResource, TasksResource, VariablesResource, WorkflowAppsResource, WorkflowsResource, assertApiKeyAllowedInEnvironment, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineTrigger, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, parseSseEvents, parseSseStream, resolveActionAppId, resolveActionId, resolveTriggerAppId, resolveTriggerId };
|
|
2378
|
+
export { API_KEY_PREFIX, ActionsResource, AgentChatClient, AgentChatStream, AgentsResource, AiConnectionsResource, ApprovalsResource, AuthResource, ConnectionsResource, DEFINE_KINDS, DiscoveryResource, EntitiesResource, EntityTypesResource, ExecutionProgressStream, ExecutionTimeoutError, ExecutionsResource, HttpClient, KnowledgeResource, LunnoaApiError, LunnoaClient, QueueItemsResource, QueuesResource, RunsResource, ScorecardsResource, SsoAuthResource, TablesResource, TasksResource, VariablesResource, WorkflowAppsResource, WorkflowsResource, assertApiKeyAllowedInEnvironment, createBrowserClient, createLocalStorageTokenStore, createMemoryTokenStore, createServerClient, defineAction, defineAgent, defineAiConnection, defineConnection, defineEntityType, defineTrigger, defineWorkflow, entityTypeDefinitionToUpsert, isBrowserEnvironment, isLoginRequires2FA, iterateOffset, iteratePages, parseSseEvents, parseSseStream, ref, resolveActionAppId, resolveActionId, resolveTriggerAppId, resolveTriggerId };
|
|
2308
2379
|
//# sourceMappingURL=index.js.map
|
|
2309
2380
|
//# sourceMappingURL=index.js.map
|