@pikku/addon-graph 0.0.1 → 0.0.3
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/.pikku/addon/pikku-addon-types.gen.d.ts +17 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.d.ts.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.js +21 -2
- package/dist/.pikku/addon/pikku-addon-types.gen.js.map +1 -1
- package/dist/.pikku/addon/pikku-addon-types.gen.ts +24 -2
- package/dist/.pikku/addon/pikku-package.gen.js +1 -1
- package/dist/.pikku/addon/pikku-package.gen.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-map.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts +6 -6
- package/dist/.pikku/agent/pikku-agent-types.gen.d.ts.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.js.map +1 -1
- package/dist/.pikku/agent/pikku-agent-types.gen.ts +13 -7
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.js +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.d.ts +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.js +1 -1
- package/dist/.pikku/agent/pikku-agent-wirings.gen.ts +1 -1
- package/{.pikku/console/pikku-nodes-meta.gen.json → dist/.pikku/console/pikku-addon-meta.gen.json} +12 -9
- package/dist/.pikku/console/pikku-node-types.gen.d.ts +2 -2
- package/dist/.pikku/console/pikku-node-types.gen.d.ts.map +1 -1
- package/dist/.pikku/console/pikku-node-types.gen.ts +2 -2
- package/dist/.pikku/function/pikku-function-types.gen.d.ts +41 -12
- package/dist/.pikku/function/pikku-function-types.gen.d.ts.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.js +17 -1
- package/dist/.pikku/function/pikku-function-types.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-function-types.gen.ts +53 -15
- package/dist/.pikku/function/pikku-functions-meta-verbose.gen.json +28 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.js +1 -1
- package/dist/.pikku/function/pikku-functions-meta.gen.json +16 -0
- package/dist/.pikku/function/pikku-functions-meta.gen.ts +1 -1
- package/dist/.pikku/function/pikku-functions.gen.js +3 -1
- package/dist/.pikku/function/pikku-functions.gen.js.map +1 -1
- package/dist/.pikku/function/pikku-functions.gen.ts +3 -1
- package/dist/.pikku/pikku-bootstrap.gen.js +1 -1
- package/dist/.pikku/pikku-bootstrap.gen.ts +1 -1
- package/dist/.pikku/pikku-services.gen.d.ts +3 -1
- package/dist/.pikku/pikku-services.gen.d.ts.map +1 -1
- package/dist/.pikku/pikku-services.gen.js +2 -0
- package/dist/.pikku/pikku-services.gen.js.map +1 -1
- package/dist/.pikku/pikku-services.gen.ts +3 -1
- package/dist/.pikku/pikku-types.gen.d.ts +1 -1
- package/dist/.pikku/pikku-types.gen.js +1 -1
- package/dist/.pikku/pikku-types.gen.ts +1 -1
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +50 -396
- package/dist/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +51 -396
- package/dist/.pikku/schema-cache.json +1 -0
- package/dist/.pikku/schemas/pikku.cache.json +1 -0
- package/dist/.pikku/schemas/register.gen.js +3 -1
- package/dist/.pikku/schemas/register.gen.js.map +1 -1
- package/dist/.pikku/schemas/register.gen.ts +5 -1
- package/dist/.pikku/schemas/schemas/SleepInput.schema.json +1 -0
- package/dist/.pikku/secrets/pikku-secret-types.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secret-types.gen.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.d.ts +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.js +1 -1
- package/dist/.pikku/secrets/pikku-secrets.gen.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.d.ts +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.js +1 -1
- package/dist/.pikku/trigger/pikku-trigger-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variable-types.gen.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.d.ts +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.js +1 -1
- package/dist/.pikku/variables/pikku-variables.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-map.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts +35 -5
- package/dist/.pikku/workflow/pikku-workflow-types.gen.d.ts.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js +5 -5
- package/dist/.pikku/workflow/pikku-workflow-types.gen.js.map +1 -1
- package/dist/.pikku/workflow/pikku-workflow-types.gen.ts +65 -9
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.d.ts +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.js +1 -1
- package/dist/.pikku/workflow/pikku-workflow-wirings.gen.ts +1 -1
- package/dist/src/functions/data/sleep.function.d.ts +16 -0
- package/dist/src/functions/data/sleep.function.d.ts.map +1 -0
- package/dist/src/functions/data/sleep.function.js +18 -0
- package/dist/src/functions/data/sleep.function.js.map +1 -0
- package/package.json +13 -10
- package/.pikku/addon/pikku-addon-types.gen.ts +0 -78
- package/.pikku/addon/pikku-package.gen.ts +0 -9
- package/.pikku/agent/pikku-agent-map.gen.d.ts +0 -16
- package/.pikku/agent/pikku-agent-types.gen.ts +0 -76
- package/.pikku/agent/pikku-agent-wirings-meta.gen.json +0 -3
- package/.pikku/agent/pikku-agent-wirings-meta.gen.ts +0 -7
- package/.pikku/agent/pikku-agent-wirings.gen.ts +0 -3
- package/.pikku/console/pikku-node-types.gen.ts +0 -8
- package/.pikku/function/pikku-function-types.gen.ts +0 -648
- package/.pikku/function/pikku-functions-meta-verbose.gen.json +0 -582
- package/.pikku/function/pikku-functions-meta.gen.json +0 -434
- package/.pikku/function/pikku-functions-meta.gen.ts +0 -7
- package/.pikku/function/pikku-functions.gen.ts +0 -54
- package/.pikku/pikku-bootstrap.gen.ts +0 -15
- package/.pikku/pikku-services.gen.ts +0 -32
- package/.pikku/pikku-types.gen.ts +0 -21
- package/.pikku/rpc/pikku-rpc-wirings-map.gen.d.ts +0 -470
- package/.pikku/rpc/pikku-rpc-wirings-map.internal.gen.d.ts +0 -494
- package/.pikku/schemas/register.gen.ts +0 -195
- package/.pikku/schemas/schemas/AggregateInput.schema.json +0 -1
- package/.pikku/schemas/schemas/AggregateOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/ChunkInput.schema.json +0 -1
- package/.pikku/schemas/schemas/ChunkOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/CoalesceInput.schema.json +0 -1
- package/.pikku/schemas/schemas/CoalesceOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/CryptoInput.schema.json +0 -1
- package/.pikku/schemas/schemas/CryptoOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/DateTimeInput.schema.json +0 -1
- package/.pikku/schemas/schemas/DateTimeOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/EditFieldsInput.schema.json +0 -1
- package/.pikku/schemas/schemas/EditFieldsOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/FindInput.schema.json +0 -1
- package/.pikku/schemas/schemas/FindOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/GroupByInput.schema.json +0 -1
- package/.pikku/schemas/schemas/GroupByOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/JwtDecodeInput.schema.json +0 -1
- package/.pikku/schemas/schemas/JwtDecodeOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/JwtSignInput.schema.json +0 -1
- package/.pikku/schemas/schemas/JwtSignOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/LimitInput.schema.json +0 -1
- package/.pikku/schemas/schemas/LimitOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/MathInput.schema.json +0 -1
- package/.pikku/schemas/schemas/MathOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/MergeInput.schema.json +0 -1
- package/.pikku/schemas/schemas/MergeOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/OmitInput.schema.json +0 -1
- package/.pikku/schemas/schemas/OmitOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/PickInput.schema.json +0 -1
- package/.pikku/schemas/schemas/PickOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/RemoveDuplicatesInput.schema.json +0 -1
- package/.pikku/schemas/schemas/RemoveDuplicatesOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/RenameKeysInput.schema.json +0 -1
- package/.pikku/schemas/schemas/RenameKeysOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/ReverseInput.schema.json +0 -1
- package/.pikku/schemas/schemas/ReverseOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/SortInput.schema.json +0 -1
- package/.pikku/schemas/schemas/SortOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/SplitOutInput.schema.json +0 -1
- package/.pikku/schemas/schemas/SplitOutOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/StringTransformInput.schema.json +0 -1
- package/.pikku/schemas/schemas/StringTransformOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/SummarizeInput.schema.json +0 -1
- package/.pikku/schemas/schemas/SummarizeOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/TypeConvertInput.schema.json +0 -1
- package/.pikku/schemas/schemas/TypeConvertOutput.schema.json +0 -1
- package/.pikku/schemas/schemas/UniqueInput.schema.json +0 -1
- package/.pikku/schemas/schemas/UniqueOutput.schema.json +0 -1
- package/.pikku/secrets/pikku-secret-types.gen.ts +0 -5
- package/.pikku/secrets/pikku-secrets-meta.gen.json +0 -1
- package/.pikku/secrets/pikku-secrets.gen.ts +0 -21
- package/.pikku/trigger/pikku-trigger-types.gen.ts +0 -160
- package/.pikku/variables/pikku-variable-types.gen.ts +0 -5
- package/.pikku/variables/pikku-variables-meta.gen.json +0 -1
- package/.pikku/variables/pikku-variables.gen.ts +0 -21
- package/.pikku/workflow/pikku-workflow-map.gen.d.ts +0 -34
- package/.pikku/workflow/pikku-workflow-types.gen.ts +0 -158
- package/.pikku/workflow/pikku-workflow-wirings-meta.gen.ts +0 -9
- package/.pikku/workflow/pikku-workflow-wirings.gen.ts +0 -3
- package/dist/.pikku/console/pikku-nodes-meta.gen.json +0 -278
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{},"description":"The array to split into chunks"},"size":{"type":"number","minimum":1,"description":"Size of each chunk"}},"required":["items","size"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"chunks":{"type":"array","items":{"type":"array","items":{}},"description":"Array of chunks"}},"required":["chunks"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"values":{"type":"array","items":{},"description":"Values to check in order"},"treatEmptyStringAsNull":{"description":"Treat empty strings as null","type":"boolean"},"treatZeroAsNull":{"description":"Treat zero as null","type":"boolean"}},"required":["values"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"value":{"description":"The first non-null value"},"index":{"type":"number","description":"Index of the returned value (-1 if all null)"}},"required":["value","index"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"string","enum":["hash","hmac","randomBytes","uuid","base64Encode","base64Decode","hexEncode","hexDecode"],"description":"The cryptographic operation to perform"},"data":{"description":"Input data for hash/hmac/encode/decode operations","type":"string"},"algorithm":{"description":"Hash algorithm for hash/hmac operations","type":"string","enum":["md5","sha1","sha256","sha384","sha512"]},"key":{"description":"Secret key for hmac operation","type":"string"},"length":{"description":"Number of bytes for randomBytes operation","type":"number"},"encoding":{"description":"Output encoding for hash/hmac operations","type":"string","enum":["hex","base64"]}},"required":["operation"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"result":{"type":"string","description":"The result of the cryptographic operation"}},"required":["result"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"value":{"description":"The input date/time value (ISO string, timestamp, or parseable date string)","anyOf":[{"type":"string"},{"type":"number"}]},"operation":{"type":"string","enum":["format","parse","add","subtract","startOf","endOf","diff","now"],"description":"The operation to perform"},"format":{"description":"Output format for format operation (e.g., YYYY-MM-DD)","type":"string"},"amount":{"description":"Amount for add/subtract operations","type":"number"},"unit":{"description":"Time unit for add/subtract/startOf/endOf/diff operations","type":"string","enum":["years","months","weeks","days","hours","minutes","seconds","milliseconds"]},"compareWith":{"description":"Second date for diff operation","anyOf":[{"type":"string"},{"type":"number"}]},"timezone":{"description":"Timezone for conversion (e.g., America/New_York)","type":"string"}},"required":["operation"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"result":{"anyOf":[{"type":"string"},{"type":"number"}],"description":"The result of the operation"},"iso":{"type":"string","description":"ISO 8601 formatted date string"},"timestamp":{"type":"number","description":"Unix timestamp in milliseconds"}},"required":["result","iso","timestamp"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The input object to transform"},"operations":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"The field path to operate on (supports dot notation)"},"operation":{"type":"string","enum":["set","remove","rename"],"description":"The operation to perform"},"value":{"description":"The value to set (for set operation)"},"newName":{"description":"The new field name (for rename operation)","type":"string"}},"required":["field","operation"],"additionalProperties":false},"description":"List of field operations to perform"}},"required":["item","operations"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The transformed object"}},"required":["item"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The array to search"},"field":{"type":"string","description":"The field to match against"},"value":{"description":"The value to find"},"returnIndex":{"description":"Return the index instead of the item","type":"boolean"}},"required":["items","field","value"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"anyOf":[{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},{"type":"null"}],"description":"The found item (null if not found)"},"index":{"type":"number","description":"The index of the found item (-1 if not found)"},"found":{"type":"boolean","description":"Whether the item was found"}},"required":["item","index","found"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The array of items to group"},"field":{"type":"string","description":"The field to group by (supports dot notation)"}},"required":["items","field"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"groups":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"description":"Object with group keys and their items"}},"required":["groups"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","description":"The JWT token to decode"}},"required":["token"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"payload":{"description":"The decoded payload"}},"required":["payload"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"payload":{"description":"The payload to encode into the JWT"},"expiresIn":{"type":"object","properties":{"value":{"type":"number","description":"Duration value"},"unit":{"type":"string","enum":["second","minute","hour","day","week","year"],"description":"Time unit"}},"required":["value","unit"],"additionalProperties":false,"description":"Token expiration time"}},"required":["payload","expiresIn"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"token":{"type":"string","description":"The signed JWT token"}},"required":["token"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{},"description":"The array of items to limit"},"limit":{"type":"number","minimum":0,"description":"Maximum number of items to return"},"offset":{"description":"Number of items to skip from the beginning","type":"number","minimum":0}},"required":["items","limit"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{},"description":"The limited array of items"},"totalCount":{"type":"number","description":"The original total count before limiting"}},"required":["items","totalCount"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"operation":{"type":"string","enum":["add","subtract","multiply","divide","modulo","power","sqrt","abs","round","floor","ceil","min","max","random"],"description":"The math operation to perform"},"a":{"description":"First operand","type":"number"},"b":{"description":"Second operand (for binary operations)","type":"number"},"decimals":{"description":"Decimal places for round operation","type":"number"}},"required":["operation"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"result":{"type":"number","description":"The result of the operation"}},"required":["result"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"Objects to merge (later objects override earlier ones)"},"deep":{"description":"Perform deep merge of nested objects","type":"boolean"}},"required":["items"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The merged object"}},"required":["item"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The input object"},"fields":{"type":"array","items":{"type":"string"},"description":"Fields to remove"}},"required":["item","fields"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Object without the specified fields"}},"required":["item"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The input object"},"fields":{"type":"array","items":{"type":"string"},"description":"Fields to keep (supports dot notation for nested fields)"}},"required":["item","fields"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"Object with only the specified fields"}},"required":["item"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The array of items to deduplicate"},"fields":{"type":"array","items":{"type":"string"},"description":"Fields to use for comparison (if empty, compares entire objects)"},"keepFirst":{"description":"Keep the first occurrence (true) or last (false)","type":"boolean"}},"required":["items","fields"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The deduplicated array of items"},"removedCount":{"type":"number","description":"Number of duplicates removed"}},"required":["items","removedCount"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The input object to transform"},"mappings":{"type":"array","items":{"type":"object","properties":{"oldKey":{"type":"string","description":"The original key name"},"newKey":{"type":"string","description":"The new key name"}},"required":["oldKey","newKey"],"additionalProperties":false},"description":"List of key rename mappings"},"keepUnmapped":{"description":"Whether to keep keys that are not in the mapping","type":"boolean"}},"required":["item","mappings"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The transformed object with renamed keys"}},"required":["item"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{},"description":"The array to reverse"}},"required":["items"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{},"description":"The reversed array"}},"required":["items"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The array of items to sort"},"sortBy":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"The field path to sort by (supports dot notation)"},"order":{"description":"Sort order","type":"string","enum":["asc","desc"]}},"required":["field"],"additionalProperties":false},"description":"Fields to sort by (in order of priority)"}},"required":["items","sortBy"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The sorted array of items"}},"required":["items"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"item":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{},"description":"The input object containing a nested array"},"field":{"type":"string","description":"The field path containing the array to split (supports dot notation)"},"includeParent":{"description":"Include parent object fields in each output item","type":"boolean"}},"required":["item","field"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The split array of items"}},"required":["items"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"value":{"type":"string","description":"The input string"},"operation":{"type":"string","enum":["uppercase","lowercase","capitalize","camelCase","snakeCase","kebabCase","trim","trimStart","trimEnd","split","replace","slice","padStart","padEnd"],"description":"The transformation to apply"},"separator":{"description":"Separator for split operation","type":"string"},"search":{"description":"Search string for replace operation","type":"string"},"replacement":{"description":"Replacement string for replace operation","type":"string"},"replaceAll":{"description":"Replace all occurrences","type":"boolean"},"start":{"description":"Start index for slice","type":"number"},"end":{"description":"End index for slice","type":"number"},"length":{"description":"Target length for pad operations","type":"number"},"padChar":{"description":"Character to pad with","type":"string"}},"required":["value","operation"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"result":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"The transformed result"}},"required":["result"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The array of items to summarize"},"aggregations":{"type":"array","items":{"type":"object","properties":{"field":{"type":"string","description":"The field path to aggregate"},"operation":{"type":"string","enum":["sum","avg","min","max","count","countDistinct","first","last"],"description":"The aggregation operation"},"outputField":{"type":"string","description":"The name of the output field"}},"required":["field","operation","outputField"],"additionalProperties":false},"description":"List of aggregation operations to perform"},"groupBy":{"description":"Fields to group by","type":"array","items":{"type":"string"}}},"required":["items","aggregations"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}},"description":"The summarized results"}},"required":["items"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"value":{"description":"The value to convert"},"to":{"type":"string","enum":["string","number","boolean","json","array"],"description":"Target type"},"radix":{"description":"Radix for number parsing (e.g., 10, 16)","type":"number"}},"required":["value","to"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"result":{"description":"The converted value"},"success":{"type":"boolean","description":"Whether the conversion succeeded"},"originalType":{"type":"string","description":"The original type of the value"}},"required":["result","success","originalType"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{},"description":"The array to get unique values from"},"field":{"description":"For arrays of objects, the field to check uniqueness by","type":"string"}},"required":["items"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"items":{"type":"array","items":{},"description":"Array with only unique values"}},"required":["items"],"additionalProperties":false}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
-
*/
|
|
4
|
-
import { TypedSecretService as CoreTypedSecretService, type CredentialMeta } from '@pikku/core/services'
|
|
5
|
-
import type { SecretService } from '@pikku/core/services'
|
|
6
|
-
|
|
7
|
-
export interface CredentialsMap {
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type SecretId = keyof CredentialsMap
|
|
12
|
-
|
|
13
|
-
const CREDENTIALS_META: Record<string, CredentialMeta> = {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export class TypedSecretService extends CoreTypedSecretService<CredentialsMap> {
|
|
18
|
-
constructor(secrets: SecretService) {
|
|
19
|
-
super(secrets, CREDENTIALS_META)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Trigger-specific type definitions for tree-shaking optimization
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
import { CorePikkuTriggerFunction, CorePikkuTriggerFunctionConfig, CoreTrigger, wireTrigger as wireTriggerCore, wireTriggerSource as wireTriggerSourceCore } from '@pikku/core/trigger'
|
|
9
|
-
import type { CoreNodeConfig } from '@pikku/core/node'
|
|
10
|
-
import type { SingletonServices } from '../../types/application-types.d.js'
|
|
11
|
-
import type { StandardSchemaV1 } from '@standard-schema/spec'
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* A trigger function that sets up a subscription and returns a teardown function.
|
|
17
|
-
* The trigger is fired via wire.trigger.invoke(data).
|
|
18
|
-
*
|
|
19
|
-
* @template TInput - Input type (configuration passed when wired)
|
|
20
|
-
* @template TOutput - Output type produced when trigger fires
|
|
21
|
-
*/
|
|
22
|
-
export type PikkuTriggerFunction<
|
|
23
|
-
TInput = unknown,
|
|
24
|
-
TOutput = unknown
|
|
25
|
-
> = CorePikkuTriggerFunction<TInput, TOutput, SingletonServices>
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Configuration object for creating a trigger function with metadata
|
|
29
|
-
*/
|
|
30
|
-
export type PikkuTriggerFunctionConfig<
|
|
31
|
-
TInput = unknown,
|
|
32
|
-
TOutput = unknown,
|
|
33
|
-
InputSchema extends StandardSchemaV1 | undefined = undefined,
|
|
34
|
-
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
35
|
-
> = CorePikkuTriggerFunctionConfig<TInput, TOutput, SingletonServices, InputSchema, OutputSchema>
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Helper type to infer the output type from a Standard Schema
|
|
39
|
-
*/
|
|
40
|
-
type InferSchemaOutput<T> = T extends StandardSchemaV1<any, infer Output> ? Output : never
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Configuration object for trigger functions with Zod schema validation.
|
|
44
|
-
* Use this when you want to define input/output schemas using Zod.
|
|
45
|
-
* Types are automatically inferred from the schemas.
|
|
46
|
-
*/
|
|
47
|
-
export type PikkuTriggerFunctionConfigWithSchema<
|
|
48
|
-
InputSchema extends StandardSchemaV1,
|
|
49
|
-
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
50
|
-
> = {
|
|
51
|
-
title?: string
|
|
52
|
-
description?: string
|
|
53
|
-
tags?: string[]
|
|
54
|
-
func: PikkuTriggerFunction<
|
|
55
|
-
InferSchemaOutput<InputSchema>,
|
|
56
|
-
OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown
|
|
57
|
-
>
|
|
58
|
-
input: InputSchema
|
|
59
|
-
output?: OutputSchema
|
|
60
|
-
node?: CoreNodeConfig
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Type definition for trigger wirings.
|
|
65
|
-
* Declares a trigger name and its target pikku function.
|
|
66
|
-
*/
|
|
67
|
-
export type TriggerWiring = CoreTrigger
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* A trigger source with the subscription function, using project-specific services.
|
|
71
|
-
*
|
|
72
|
-
* @template TInput - Input type passed to the trigger function
|
|
73
|
-
* @template TOutput - Output type produced when trigger fires
|
|
74
|
-
*/
|
|
75
|
-
export type TriggerSource<
|
|
76
|
-
TInput = unknown,
|
|
77
|
-
TOutput = unknown
|
|
78
|
-
> = {
|
|
79
|
-
name: string
|
|
80
|
-
func: PikkuTriggerFunctionConfig<TInput, TOutput>
|
|
81
|
-
} & (unknown extends TInput ? { input?: TInput } : { input: TInput })
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* Creates a trigger function configuration.
|
|
85
|
-
* Use this to define trigger functions that set up subscriptions.
|
|
86
|
-
*
|
|
87
|
-
* @param triggerOrConfig - Function definition or configuration object
|
|
88
|
-
* @returns The normalized configuration object
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```typescript
|
|
92
|
-
* export const redisSubscribeTrigger = pikkuTriggerFunc<
|
|
93
|
-
* { channel: string },
|
|
94
|
-
* { message: string }
|
|
95
|
-
* >(async ({ redis }, { channel }, { trigger }) => {
|
|
96
|
-
* const subscriber = redis.duplicate()
|
|
97
|
-
* await subscriber.subscribe(channel, (msg) => {
|
|
98
|
-
* trigger.invoke({ message: msg })
|
|
99
|
-
* })
|
|
100
|
-
* return () => subscriber.unsubscribe()
|
|
101
|
-
* })
|
|
102
|
-
*
|
|
103
|
-
* export const redisSubscribeTrigger = pikkuTriggerFunc({
|
|
104
|
-
* title: 'Redis Subscribe Trigger',
|
|
105
|
-
* description: 'Listens to Redis pub/sub channel',
|
|
106
|
-
* input: z.object({ channel: z.string() }),
|
|
107
|
-
* output: z.object({ message: z.string() }),
|
|
108
|
-
* func: async ({ redis }, { channel }, { trigger }) => {
|
|
109
|
-
* const subscriber = redis.duplicate()
|
|
110
|
-
* await subscriber.subscribe(channel, (msg) => {
|
|
111
|
-
* trigger.invoke({ message: msg })
|
|
112
|
-
* })
|
|
113
|
-
* return () => subscriber.unsubscribe()
|
|
114
|
-
* }
|
|
115
|
-
* })
|
|
116
|
-
* ```
|
|
117
|
-
*/
|
|
118
|
-
export function pikkuTriggerFunc<
|
|
119
|
-
InputSchema extends StandardSchemaV1,
|
|
120
|
-
OutputSchema extends StandardSchemaV1 | undefined = undefined
|
|
121
|
-
>(
|
|
122
|
-
config: PikkuTriggerFunctionConfigWithSchema<InputSchema, OutputSchema>
|
|
123
|
-
): PikkuTriggerFunctionConfig<InferSchemaOutput<InputSchema>, OutputSchema extends StandardSchemaV1 ? InferSchemaOutput<OutputSchema> : unknown, InputSchema, OutputSchema>
|
|
124
|
-
export function pikkuTriggerFunc<TInput, TOutput = unknown>(
|
|
125
|
-
triggerOrConfig:
|
|
126
|
-
| PikkuTriggerFunction<TInput, TOutput>
|
|
127
|
-
| PikkuTriggerFunctionConfig<TInput, TOutput>
|
|
128
|
-
): PikkuTriggerFunctionConfig<TInput, TOutput>
|
|
129
|
-
export function pikkuTriggerFunc(triggerOrConfig: any) {
|
|
130
|
-
if (typeof triggerOrConfig === 'function') {
|
|
131
|
-
return { func: triggerOrConfig }
|
|
132
|
-
}
|
|
133
|
-
return triggerOrConfig
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Registers a trigger with the Pikku framework.
|
|
138
|
-
* Declares a trigger name and its target pikku function.
|
|
139
|
-
* Runs everywhere — inspector extracts at build time.
|
|
140
|
-
*
|
|
141
|
-
* @param trigger - Trigger definition with name and function config
|
|
142
|
-
*/
|
|
143
|
-
export const wireTrigger = (
|
|
144
|
-
trigger: TriggerWiring
|
|
145
|
-
) => {
|
|
146
|
-
wireTriggerCore(trigger as any)
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Registers a trigger source with the Pikku framework.
|
|
151
|
-
* Provides the subscription function and input data.
|
|
152
|
-
* Only imported in the trigger worker process.
|
|
153
|
-
*
|
|
154
|
-
* @param source - Trigger source with name, func, and input
|
|
155
|
-
*/
|
|
156
|
-
export const wireTriggerSource = <TInput = unknown, TOutput = unknown>(
|
|
157
|
-
source: TriggerSource<TInput, TOutput>
|
|
158
|
-
) => {
|
|
159
|
-
wireTriggerSourceCore(source as any)
|
|
160
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
-
*/
|
|
4
|
-
import { TypedVariablesService as CoreTypedVariablesService, type VariableMeta } from '@pikku/core/services'
|
|
5
|
-
import type { VariablesService } from '@pikku/core/services'
|
|
6
|
-
|
|
7
|
-
export interface VariablesMap {
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export type VariableId = keyof VariablesMap
|
|
12
|
-
|
|
13
|
-
const VARIABLES_META: Record<string, VariableMeta> = {
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export class TypedVariablesService extends CoreTypedVariablesService<VariablesMap> {
|
|
18
|
-
constructor(variables: VariablesService) {
|
|
19
|
-
super(variables, VARIABLES_META)
|
|
20
|
-
}
|
|
21
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Workflow type map with input/output types for each workflow
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
interface WorkflowHandler<I, O> {
|
|
12
|
-
input: I;
|
|
13
|
-
output: O;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
interface GraphNodeHandler<I> {
|
|
17
|
-
input: I;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export type WorkflowMap = {
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type GraphsMap = {
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export type WorkflowClient<Name extends keyof WorkflowMap> = {
|
|
27
|
-
start: (input: WorkflowMap[Name]['input']) => Promise<{ runId: string }>;
|
|
28
|
-
getRun: <output extends keyof WorkflowMap[Name]>(runId: string) => Promise<WorkflowMap[Name][output]>;
|
|
29
|
-
cancelRun: (runId: string) => Promise<boolean>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export type TypedWorkflowClients = {
|
|
33
|
-
[Name in keyof WorkflowMap]: WorkflowClient<Name>;
|
|
34
|
-
}
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was generated by @pikku/cli@0.12.1
|
|
3
|
-
*/
|
|
4
|
-
import { WorkflowCancelledException } from '@pikku/core/workflow'
|
|
5
|
-
import {
|
|
6
|
-
workflow as coreWorkflow,
|
|
7
|
-
workflowStart as coreWorkflowStart,
|
|
8
|
-
workflowStatus as coreWorkflowStatus,
|
|
9
|
-
graphStart as coreGraphStart,
|
|
10
|
-
} from '@pikku/core/workflow'
|
|
11
|
-
import { template } from '@pikku/core/workflow'
|
|
12
|
-
import {
|
|
13
|
-
pikkuWorkflowGraph as corePikkuWorkflowGraph,
|
|
14
|
-
type PikkuWorkflowGraphConfig,
|
|
15
|
-
type PikkuWorkflowGraphResult,
|
|
16
|
-
} from '@pikku/core/workflow'
|
|
17
|
-
import type { PikkuWorkflowWire, WorkflowStepOptions } from '@pikku/core/workflow'
|
|
18
|
-
|
|
19
|
-
export { WorkflowCancelledException }
|
|
20
|
-
import type { PikkuFunctionSessionless, PikkuFunctionConfig } from '../function/pikku-function-types.gen.js'
|
|
21
|
-
import type { RPCMap, FlattenedRPCMap } from '../rpc/pikku-rpc-wirings-map.internal.gen.d.js'
|
|
22
|
-
import type { WorkflowMap, GraphsMap } from './pikku-workflow-map.gen.d.js'
|
|
23
|
-
|
|
24
|
-
export { template }
|
|
25
|
-
|
|
26
|
-
export interface TypedWorkflow extends PikkuWorkflowWire {
|
|
27
|
-
do<K extends keyof RPCMap>(
|
|
28
|
-
stepName: string,
|
|
29
|
-
rpcName: K,
|
|
30
|
-
data: RPCMap[K]['input'],
|
|
31
|
-
options?: WorkflowStepOptions
|
|
32
|
-
): Promise<RPCMap[K]['output']>
|
|
33
|
-
|
|
34
|
-
do<T>(
|
|
35
|
-
stepName: string,
|
|
36
|
-
fn: () => T | Promise<T>,
|
|
37
|
-
options?: WorkflowStepOptions
|
|
38
|
-
): Promise<T>
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type PikkuFunctionWorkflow<
|
|
42
|
-
In = unknown,
|
|
43
|
-
Out = never
|
|
44
|
-
> = PikkuFunctionSessionless<In, Out, 'workflow'>
|
|
45
|
-
|
|
46
|
-
export const pikkuWorkflowFunc = <In, Out = unknown>(
|
|
47
|
-
func:
|
|
48
|
-
| PikkuFunctionWorkflow<In, Out>
|
|
49
|
-
| PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
|
|
50
|
-
) => {
|
|
51
|
-
return typeof func === 'function' ? { func } : func
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export const pikkuWorkflowComplexFunc = <In, Out = unknown>(
|
|
55
|
-
func:
|
|
56
|
-
| PikkuFunctionWorkflow<In, Out>
|
|
57
|
-
| PikkuFunctionConfig<In, Out, 'workflow', PikkuFunctionWorkflow<In, Out>>
|
|
58
|
-
) => {
|
|
59
|
-
return typeof func === 'function' ? { func } : func
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
type TypedRef<T> = { $ref: string; path?: string } & { __phantomType?: T }
|
|
63
|
-
|
|
64
|
-
type TemplateString = {
|
|
65
|
-
$template: {
|
|
66
|
-
parts: string[]
|
|
67
|
-
expressions: Array<{ $ref: string; path?: string }>
|
|
68
|
-
}
|
|
69
|
-
} & { __brand: 'TemplateString' }
|
|
70
|
-
|
|
71
|
-
type InputWithRefs<T> = {
|
|
72
|
-
[K in keyof T]?: T[K] | TypedRef<T[K]> | TypedRef<unknown> | TemplateString
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
type NodeInputType<FuncMap extends Record<string, string>, K extends keyof FuncMap> =
|
|
76
|
-
FuncMap[K] extends keyof FlattenedRPCMap
|
|
77
|
-
? InputWithRefs<FlattenedRPCMap[FuncMap[K]]['input']>
|
|
78
|
-
: Record<string, unknown>
|
|
79
|
-
|
|
80
|
-
type NodeOutputKeys<FuncMap extends Record<string, string>, N extends string> =
|
|
81
|
-
N extends keyof FuncMap
|
|
82
|
-
? FuncMap[N] extends keyof FlattenedRPCMap
|
|
83
|
-
? keyof FlattenedRPCMap[FuncMap[N]]['output'] & string
|
|
84
|
-
: string
|
|
85
|
-
: string
|
|
86
|
-
|
|
87
|
-
type RefFunction<FuncMap extends Record<string, string>> = {
|
|
88
|
-
<N extends Extract<keyof FuncMap, string>>(
|
|
89
|
-
nodeId: N,
|
|
90
|
-
path: NodeOutputKeys<FuncMap, N>
|
|
91
|
-
): TypedRef<unknown>
|
|
92
|
-
(nodeId: 'trigger' | '$item', path?: string): TypedRef<unknown>
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
type TemplateFunction = (templateStr: string, refs: TypedRef<unknown>[]) => TemplateString
|
|
96
|
-
|
|
97
|
-
type GraphNodeConfigMap<FuncMap extends Record<string, string>> = {
|
|
98
|
-
[K in Extract<keyof FuncMap, string>]?: {
|
|
99
|
-
next?: NextConfig<Extract<keyof FuncMap, string>>
|
|
100
|
-
input?:
|
|
101
|
-
| NodeInputType<FuncMap, K>
|
|
102
|
-
| (() => NodeInputType<FuncMap, K>)
|
|
103
|
-
| ((ref: RefFunction<FuncMap>, template: TemplateFunction) => NodeInputType<FuncMap, K>)
|
|
104
|
-
onError?: Extract<keyof FuncMap, string> | Extract<keyof FuncMap, string>[]
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
type NextConfig<NodeIds extends string> = NodeIds | NodeIds[] | { if: string; then: NodeIds; else?: NodeIds }
|
|
109
|
-
|
|
110
|
-
export function pikkuWorkflowGraph<
|
|
111
|
-
const FuncMap extends Record<string, keyof FlattenedRPCMap & string>
|
|
112
|
-
>(
|
|
113
|
-
config: PikkuWorkflowGraphConfig<FuncMap, GraphNodeConfigMap<FuncMap>>
|
|
114
|
-
): PikkuWorkflowGraphResult {
|
|
115
|
-
return corePikkuWorkflowGraph(config as any)
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
export const workflow = <Name extends keyof WorkflowMap>(
|
|
119
|
-
workflowName: Name,
|
|
120
|
-
options?: { pollIntervalMs?: number }
|
|
121
|
-
) => {
|
|
122
|
-
return coreWorkflow<WorkflowMap>(workflowName as string & keyof WorkflowMap, options) as PikkuFunctionConfig<
|
|
123
|
-
WorkflowMap[Name]['input'],
|
|
124
|
-
WorkflowMap[Name]['output'],
|
|
125
|
-
'session' | 'rpc'
|
|
126
|
-
>
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
export const workflowStart = <Name extends keyof WorkflowMap>(
|
|
130
|
-
workflowName: Name
|
|
131
|
-
) => {
|
|
132
|
-
return coreWorkflowStart<WorkflowMap>(workflowName as string & keyof WorkflowMap) as PikkuFunctionConfig<
|
|
133
|
-
WorkflowMap[Name]['input'],
|
|
134
|
-
{ runId: string },
|
|
135
|
-
'session' | 'rpc'
|
|
136
|
-
>
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export const workflowStatus = <Name extends keyof WorkflowMap>(
|
|
140
|
-
_workflowName: Name
|
|
141
|
-
) => {
|
|
142
|
-
return coreWorkflowStatus<WorkflowMap>(_workflowName as string & keyof WorkflowMap) as PikkuFunctionConfig<
|
|
143
|
-
{ runId: string },
|
|
144
|
-
{ id: string; status: 'running' | 'completed' | 'failed' | 'cancelled'; output?: WorkflowMap[Name]['output']; error?: { message?: string } },
|
|
145
|
-
'session' | 'rpc'
|
|
146
|
-
>
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export const graphStart = <Name extends keyof GraphsMap, Node extends string & keyof GraphsMap[Name]>(
|
|
150
|
-
graphName: Name,
|
|
151
|
-
startNode: Node
|
|
152
|
-
) => {
|
|
153
|
-
return coreGraphStart<GraphsMap>(graphName as string & keyof GraphsMap, startNode as string) as PikkuFunctionConfig<
|
|
154
|
-
GraphsMap[Name][Node] extends { input: infer I } ? I : never,
|
|
155
|
-
{ runId: string },
|
|
156
|
-
'session' | 'rpc'
|
|
157
|
-
>
|
|
158
|
-
}
|