@mastra/libsql 1.22.3-alpha.0 → 1.22.3-alpha.1
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/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/index.cjs +18 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/storage/domains/workflow-definitions/index.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/docs/SKILL.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -12762,6 +12762,9 @@ function parseJson(val, column, rowId) {
|
|
|
12762
12762
|
}
|
|
12763
12763
|
return val;
|
|
12764
12764
|
}
|
|
12765
|
+
function workflowDefinitionSelectColumns() {
|
|
12766
|
+
return buildSelectColumns(_mastra_core_storage.TABLE_WORKFLOW_DEFINITIONS).replace("json(\"schedule\") as \"schedule\"", "\"schedule\"");
|
|
12767
|
+
}
|
|
12765
12768
|
function rowToDefinition(row) {
|
|
12766
12769
|
const inputSchema = parseJson(row.inputSchema, "inputSchema", row.id);
|
|
12767
12770
|
const outputSchema = parseJson(row.outputSchema, "outputSchema", row.id);
|
|
@@ -12784,6 +12787,12 @@ function rowToDefinition(row) {
|
|
|
12784
12787
|
if (stateSchema !== void 0) def.stateSchema = stateSchema;
|
|
12785
12788
|
const requestContextSchema = parseJson(row.requestContextSchema, "requestContextSchema", row.id);
|
|
12786
12789
|
if (requestContextSchema !== void 0) def.requestContextSchema = requestContextSchema;
|
|
12790
|
+
try {
|
|
12791
|
+
const schedule = parseJson(row.schedule, "schedule", row.id);
|
|
12792
|
+
if (schedule != null) def.schedule = schedule;
|
|
12793
|
+
} catch {
|
|
12794
|
+
def.schedule = row.schedule;
|
|
12795
|
+
}
|
|
12787
12796
|
if (row.authorId != null) def.authorId = String(row.authorId);
|
|
12788
12797
|
return def;
|
|
12789
12798
|
}
|
|
@@ -12805,6 +12814,11 @@ var WorkflowDefinitionsLibSQL = class extends _mastra_core_storage.WorkflowDefin
|
|
|
12805
12814
|
tableName: _mastra_core_storage.TABLE_WORKFLOW_DEFINITIONS,
|
|
12806
12815
|
schema: _mastra_core_storage.TABLE_SCHEMAS[_mastra_core_storage.TABLE_WORKFLOW_DEFINITIONS]
|
|
12807
12816
|
});
|
|
12817
|
+
await this.#db.alterTable({
|
|
12818
|
+
tableName: _mastra_core_storage.TABLE_WORKFLOW_DEFINITIONS,
|
|
12819
|
+
schema: _mastra_core_storage.TABLE_SCHEMAS[_mastra_core_storage.TABLE_WORKFLOW_DEFINITIONS],
|
|
12820
|
+
ifNotExists: ["schedule"]
|
|
12821
|
+
});
|
|
12808
12822
|
await this.#client.execute({
|
|
12809
12823
|
sql: `CREATE INDEX IF NOT EXISTS idx_workflow_definitions_status ON "${_mastra_core_storage.TABLE_WORKFLOW_DEFINITIONS}" ("status")`,
|
|
12810
12824
|
args: []
|
|
@@ -12828,6 +12842,7 @@ var WorkflowDefinitionsLibSQL = class extends _mastra_core_storage.WorkflowDefin
|
|
|
12828
12842
|
stateSchema: input.stateSchema ?? null,
|
|
12829
12843
|
requestContextSchema: input.requestContextSchema ?? null,
|
|
12830
12844
|
graph: input.graph,
|
|
12845
|
+
schedule: "schedule" in input ? input.schedule ?? null : null,
|
|
12831
12846
|
status: "active",
|
|
12832
12847
|
source: "storage",
|
|
12833
12848
|
authorId: "authorId" in input ? input.authorId ?? null : null,
|
|
@@ -12858,6 +12873,7 @@ var WorkflowDefinitionsLibSQL = class extends _mastra_core_storage.WorkflowDefin
|
|
|
12858
12873
|
if ("stateSchema" in input && input.stateSchema !== void 0) data.stateSchema = input.stateSchema;
|
|
12859
12874
|
if ("requestContextSchema" in input && input.requestContextSchema !== void 0) data.requestContextSchema = input.requestContextSchema;
|
|
12860
12875
|
if ("graph" in input && input.graph !== void 0) data.graph = input.graph;
|
|
12876
|
+
if ("schedule" in input && input.schedule !== void 0) data.schedule = input.schedule;
|
|
12861
12877
|
if ("status" in input && input.status !== void 0) data.status = input.status;
|
|
12862
12878
|
if ("authorId" in input && input.authorId !== void 0) data.authorId = input.authorId;
|
|
12863
12879
|
await this.#db.update({
|
|
@@ -12871,7 +12887,7 @@ var WorkflowDefinitionsLibSQL = class extends _mastra_core_storage.WorkflowDefin
|
|
|
12871
12887
|
}
|
|
12872
12888
|
async get(id) {
|
|
12873
12889
|
const row = (await this.#client.execute({
|
|
12874
|
-
sql: `SELECT ${
|
|
12890
|
+
sql: `SELECT ${workflowDefinitionSelectColumns()} FROM "${_mastra_core_storage.TABLE_WORKFLOW_DEFINITIONS}" WHERE id = ?`,
|
|
12875
12891
|
args: [id]
|
|
12876
12892
|
})).rows[0];
|
|
12877
12893
|
return row ? rowToDefinition(row) : null;
|
|
@@ -12889,7 +12905,7 @@ var WorkflowDefinitionsLibSQL = class extends _mastra_core_storage.WorkflowDefin
|
|
|
12889
12905
|
}
|
|
12890
12906
|
const where = conditions.length > 0 ? `WHERE ${conditions.join(" AND ")}` : "";
|
|
12891
12907
|
const definitions = (await this.#client.execute({
|
|
12892
|
-
sql: `SELECT ${
|
|
12908
|
+
sql: `SELECT ${workflowDefinitionSelectColumns()} FROM "${_mastra_core_storage.TABLE_WORKFLOW_DEFINITIONS}" ${where} ORDER BY updatedAt DESC`,
|
|
12893
12909
|
args: params
|
|
12894
12910
|
})).rows.map((row) => rowToDefinition(row));
|
|
12895
12911
|
return {
|