Skip to content

Commit bf05d84

Browse files
committed
Migrate from app to workflow config and schema
Replaces all references to 'app' configuration files with 'workflow' equivalents in the VSCode ObjectQL extension. Removes app schema and template, adds workflow schema and template, updates commands, file patterns, and validation logic to support workflows instead of applications.
1 parent e37fcbf commit bf05d84

File tree

8 files changed

+95
-103
lines changed

8 files changed

+95
-103
lines changed

packages/tools/vscode-objectql/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"workspaceContains:**/*.object.yml",
3131
"workspaceContains:**/*.validation.yml",
3232
"workspaceContains:**/*.permission.yml",
33-
"workspaceContains:**/*.app.yml",
33+
"workspaceContains:**/*.workflow.yml",
3434
"workspaceContains:**/*.action.ts",
3535
"workspaceContains:**/*.hook.ts"
3636
],
@@ -77,12 +77,12 @@
7777
"configuration": "./language-configuration.json"
7878
},
7979
{
80-
"id": "objectql-app",
80+
"id": "objectql-workflow",
8181
"aliases": [
82-
"ObjectQL Application"
82+
"ObjectQL Workflow"
8383
],
8484
"extensions": [
85-
".app.yml"
85+
".workflow.yml"
8686
],
8787
"configuration": "./language-configuration.json"
8888
}
@@ -93,8 +93,8 @@
9393
"url": "./schemas/object.schema.json"
9494
},
9595
{
96-
"fileMatch": "*.app.yml",
97-
"url": "./schemas/app.schema.json"
96+
"fileMatch": "*.workflow.yml",
97+
"url": "./schemas/workflow.schema.json"
9898
}
9999
],
100100
"jsonValidation": [
@@ -103,8 +103,8 @@
103103
"url": "./schemas/object.schema.json"
104104
},
105105
{
106-
"fileMatch": "*.app.json",
107-
"url": "./schemas/app.schema.json"
106+
"fileMatch": "*.workflow.json",
107+
"url": "./schemas/workflow.schema.json"
108108
}
109109
],
110110
"snippets": [
@@ -134,8 +134,8 @@
134134
"category": "ObjectQL"
135135
},
136136
{
137-
"command": "objectql.newApp",
138-
"title": "ObjectQL: New Application Config",
137+
"command": "objectql.newWorkflow",
138+
"title": "ObjectQL: New Workflow Definition",
139139
"category": "ObjectQL"
140140
},
141141
{
@@ -165,7 +165,7 @@
165165
"group": "objectql@3"
166166
},
167167
{
168-
"command": "objectql.newApp",
168+
"command": "objectql.newWorkflow",
169169
"group": "objectql@4"
170170
}
171171
]

packages/tools/vscode-objectql/schemas/app.schema.json

Lines changed: 0 additions & 50 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema#",
3+
"type": "object",
4+
"properties": {
5+
"name": {
6+
"type": "string",
7+
"pattern": "^[a-z_][a-z0-9_]*$"
8+
},
9+
"label": {
10+
"type": "string"
11+
},
12+
"description": {
13+
"type": "string"
14+
},
15+
"type": {
16+
"type": "string",
17+
"enum": ["approval", "automation", "scheduled", "sequential", "parallel", "custom"]
18+
},
19+
"trigger": {
20+
"type": "object",
21+
"properties": {
22+
"event": {
23+
"type": "string",
24+
"enum": ["create", "update", "delete", "create_or_update", "field_change", "schedule", "manual", "webhook"]
25+
},
26+
"fields": {
27+
"type": "array",
28+
"items": { "type": "string" }
29+
},
30+
"conditions": {
31+
"type": "array"
32+
}
33+
},
34+
"required": ["event"]
35+
},
36+
"steps": {
37+
"type": "array",
38+
"items": {
39+
"type": "object",
40+
"properties": {
41+
"name": { "type": "string" },
42+
"type": {
43+
"type": "string",
44+
"enum": ["approval", "action", "notification", "field_update", "create_record", "condition", "wait", "loop", "webhook", "script"]
45+
}
46+
},
47+
"required": ["name", "type"]
48+
}
49+
}
50+
},
51+
"required": ["name", "label", "type", "trigger", "steps"]
52+
}

packages/tools/vscode-objectql/src/commands/createFile.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import * as fs from 'fs';
44

55
export async function createNewFile(
66
context: vscode.ExtensionContext,
7-
fileType: 'object' | 'validation' | 'permission' | 'app'
7+
fileType: 'object' | 'validation' | 'permission' | 'workflow'
88
) {
99
const workspaceFolder = vscode.workspace.workspaceFolders?.[0];
1010

@@ -36,8 +36,8 @@ export async function createNewFile(
3636
let folder = 'src';
3737
if (fileType === 'object') {
3838
folder = 'src/objects';
39-
} else if (fileType === 'app') {
40-
folder = 'src';
39+
} else if (fileType === 'workflow') {
40+
folder = 'src/workflows';
4141
}
4242

4343
const fullFileName = `${fileName}.${fileType}.yml`;

packages/tools/vscode-objectql/src/commands/validate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function validateCurrentFile() {
1212
const fileName = path.basename(document.fileName);
1313

1414
// Check if it's an ObjectQL file
15-
const objectqlFilePattern = /\.(object|validation|permission|app)\.(yml|yaml)$/;
15+
const objectqlFilePattern = /\.(object|validation|permission|workflow)\.(yml|yaml)$/;
1616
if (!objectqlFilePattern.test(fileName)) {
1717
vscode.window.showWarningMessage('This is not an ObjectQL metadata file');
1818
return;

packages/tools/vscode-objectql/src/extension.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function activate(context: vscode.ExtensionContext) {
2323
vscode.commands.registerCommand('objectql.newObject', () => createNewFile(context, 'object')),
2424
vscode.commands.registerCommand('objectql.newValidation', () => createNewFile(context, 'validation')),
2525
vscode.commands.registerCommand('objectql.newPermission', () => createNewFile(context, 'permission')),
26-
vscode.commands.registerCommand('objectql.newApp', () => createNewFile(context, 'app')),
26+
vscode.commands.registerCommand('objectql.newWorkflow', () => createNewFile(context, 'workflow')),
2727
vscode.commands.registerCommand('objectql.validateSchema', validateCurrentFile)
2828
);
2929

packages/tools/vscode-objectql/src/templates/app.template.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# {{label}} Workflow
2+
name: {{name}}
3+
label: {{label}}
4+
description: "Workflow description"
5+
type: automation # automation | approval | scheduled | field_change
6+
7+
trigger:
8+
event: create_or_update
9+
# fields: [status] # Only for field_change
10+
# conditions:
11+
# - field: status
12+
# operator: =
13+
# value: active
14+
15+
steps:
16+
- name: check_condition
17+
type: condition
18+
conditions:
19+
- field: amount
20+
operator: ">"
21+
value: 1000
22+
yes:
23+
- name: send_notification
24+
type: notification
25+
template: big_deal_alert
26+
users: [admin]
27+
no: []

0 commit comments

Comments
 (0)