From 19334d2b456fc966ea0b4e58954ba50fcacf5cc5 Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Sat, 02 Aug 2025 09:43:51 +0000 Subject: [PATCH] lexicons: restructure lexicons Signed-off-by: oppiliappan --- lexicons/addSecret.json | 37 ------------------------------------- lexicons/artifact.json | 52 ---------------------------------------------------- lexicons/defaultBranch.json | 29 ----------------------------- lexicons/listSecrets.json | 67 ------------------------------------------------------------------- lexicons/pipeline.json | 263 ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- lexicons/removeSecret.json | 31 ------------------------------- lexicons/repo.json | 54 ------------------------------------------------------ lexicons/spindle.json | 25 ------------------------- lexicons/pipeline/pipeline.json | 263 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lexicons/repo/addSecret.json | 37 +++++++++++++++++++++++++++++++++++++ lexicons/repo/artifact.json | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ lexicons/repo/defaultBranch.json | 29 +++++++++++++++++++++++++++++ lexicons/repo/listSecrets.json | 67 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ lexicons/repo/removeSecret.json | 31 +++++++++++++++++++++++++++++++ lexicons/repo/repo.json | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ lexicons/spindle/spindle.json | 25 +++++++++++++++++++++++++ 16 file(s) changed, 558 insertion(s)(+), 558 deletion(s)(-) diff --git a/lexicons/addSecret.json b/lexicons/addSecret.json deleted file mode 100644 --- a/lexicons/addSecret.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "lexicon": 1, - "id": "sh.tangled.repo.addSecret", - "defs": { - "main": { - "type": "procedure", - "description": "Add a CI secret", - "input": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": [ - "repo", - "key", - "value" - ], - "properties": { - "repo": { - "type": "string", - "format": "at-uri" - }, - "key": { - "type": "string", - "maxLength": 50, - "minLength": 1 - }, - "value": { - "type": "string", - "maxLength": 200, - "minLength": 1 - } - } - } - } - } - } -} diff --git a/lexicons/artifact.json b/lexicons/artifact.json deleted file mode 100644 --- a/lexicons/artifact.json +++ /dev/null @@ -1,52 +0,0 @@ -{ - "lexicon": 1, - "id": "sh.tangled.repo.artifact", - "needsCbor": true, - "needsType": true, - "defs": { - "main": { - "type": "record", - "key": "tid", - "record": { - "type": "object", - "required": [ - "name", - "repo", - "tag", - "createdAt", - "artifact" - ], - "properties": { - "name": { - "type": "string", - "description": "name of the artifact" - }, - "repo": { - "type": "string", - "format": "at-uri", - "description": "repo that this artifact is being uploaded to" - }, - "tag": { - "type": "bytes", - "description": "hash of the tag object that this artifact is attached to (only annotated tags are supported)", - "minLength": 20, - "maxLength": 20 - }, - "createdAt": { - "type": "string", - "format": "datetime", - "description": "time of creation of this artifact" - }, - "artifact": { - "type": "blob", - "description": "the artifact", - "accept": [ - "*/*" - ], - "maxSize": 52428800 - } - } - } - } - } -} diff --git a/lexicons/defaultBranch.json b/lexicons/defaultBranch.json deleted file mode 100644 --- a/lexicons/defaultBranch.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "lexicon": 1, - "id": "sh.tangled.repo.setDefaultBranch", - "defs": { - "main": { - "type": "procedure", - "description": "Set the default branch for a repository", - "input": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": [ - "repo", - "defaultBranch" - ], - "properties": { - "repo": { - "type": "string", - "format": "at-uri" - }, - "defaultBranch": { - "type": "string" - } - } - } - } - } - } -} diff --git a/lexicons/listSecrets.json b/lexicons/listSecrets.json deleted file mode 100644 --- a/lexicons/listSecrets.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "lexicon": 1, - "id": "sh.tangled.repo.listSecrets", - "defs": { - "main": { - "type": "query", - "parameters": { - "type": "params", - "required": [ - "repo" - ], - "properties": { - "repo": { - "type": "string", - "format": "at-uri" - } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": [ - "secrets" - ], - "properties": { - "secrets": { - "type": "array", - "items": { - "type": "ref", - "ref": "#secret" - } - } - } - } - } - }, - "secret": { - "type": "object", - "required": [ - "repo", - "key", - "createdAt", - "createdBy" - ], - "properties": { - "repo": { - "type": "string", - "format": "at-uri" - }, - "key": { - "type": "string", - "maxLength": 50, - "minLength": 1 - }, - "createdAt": { - "type": "string", - "format": "datetime" - }, - "createdBy": { - "type": "string", - "format": "did" - } - } - } - } -} diff --git a/lexicons/pipeline.json b/lexicons/pipeline.json deleted file mode 100644 --- a/lexicons/pipeline.json +++ /dev/null @@ -1,263 +0,0 @@ -{ - "lexicon": 1, - "id": "sh.tangled.pipeline", - "needsCbor": true, - "needsType": true, - "defs": { - "main": { - "type": "record", - "key": "tid", - "record": { - "type": "object", - "required": [ - "triggerMetadata", - "workflows" - ], - "properties": { - "triggerMetadata": { - "type": "ref", - "ref": "#triggerMetadata" - }, - "workflows": { - "type": "array", - "items": { - "type": "ref", - "ref": "#workflow" - } - } - } - } - }, - "triggerMetadata": { - "type": "object", - "required": [ - "kind", - "repo" - ], - "properties": { - "kind": { - "type": "string", - "enum": [ - "push", - "pull_request", - "manual" - ] - }, - "repo": { - "type": "ref", - "ref": "#triggerRepo" - }, - "push": { - "type": "ref", - "ref": "#pushTriggerData" - }, - "pullRequest": { - "type": "ref", - "ref": "#pullRequestTriggerData" - }, - "manual": { - "type": "ref", - "ref": "#manualTriggerData" - } - } - }, - "triggerRepo": { - "type": "object", - "required": [ - "knot", - "did", - "repo", - "defaultBranch" - ], - "properties": { - "knot": { - "type": "string" - }, - "did": { - "type": "string", - "format": "did" - }, - "repo": { - "type": "string" - }, - "defaultBranch": { - "type": "string" - } - } - }, - "pushTriggerData": { - "type": "object", - "required": [ - "ref", - "newSha", - "oldSha" - ], - "properties": { - "ref": { - "type": "string" - }, - "newSha": { - "type": "string", - "minLength": 40, - "maxLength": 40 - }, - "oldSha": { - "type": "string", - "minLength": 40, - "maxLength": 40 - } - } - }, - "pullRequestTriggerData": { - "type": "object", - "required": [ - "sourceBranch", - "targetBranch", - "sourceSha", - "action" - ], - "properties": { - "sourceBranch": { - "type": "string" - }, - "targetBranch": { - "type": "string" - }, - "sourceSha": { - "type": "string", - "minLength": 40, - "maxLength": 40 - }, - "action": { - "type": "string" - } - } - }, - "manualTriggerData": { - "type": "object", - "properties": { - "inputs": { - "type": "array", - "items": { - "type": "ref", - "ref": "#pair" - } - } - } - }, - "workflow": { - "type": "object", - "required": [ - "name", - "dependencies", - "steps", - "environment", - "clone" - ], - "properties": { - "name": { - "type": "string" - }, - "dependencies": { - "type": "array", - "items": { - "type": "ref", - "ref": "#dependency" - } - }, - "steps": { - "type": "array", - "items": { - "type": "ref", - "ref": "#step" - } - }, - "environment": { - "type": "array", - "items": { - "type": "ref", - "ref": "#pair" - } - }, - "clone": { - "type": "ref", - "ref": "#cloneOpts" - } - } - }, - "dependency": { - "type": "object", - "required": [ - "registry", - "packages" - ], - "properties": { - "registry": { - "type": "string" - }, - "packages": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "cloneOpts": { - "type": "object", - "required": [ - "skip", - "depth", - "submodules" - ], - "properties": { - "skip": { - "type": "boolean" - }, - "depth": { - "type": "integer" - }, - "submodules": { - "type": "boolean" - } - } - }, - "step": { - "type": "object", - "required": [ - "name", - "command" - ], - "properties": { - "name": { - "type": "string" - }, - "command": { - "type": "string" - }, - "environment": { - "type": "array", - "items": { - "type": "ref", - "ref": "#pair" - } - } - } - }, - "pair": { - "type": "object", - "required": [ - "key", - "value" - ], - "properties": { - "key": { - "type": "string" - }, - "value": { - "type": "string" - } - } - } - } -} diff --git a/lexicons/removeSecret.json b/lexicons/removeSecret.json deleted file mode 100644 --- a/lexicons/removeSecret.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "lexicon": 1, - "id": "sh.tangled.repo.removeSecret", - "defs": { - "main": { - "type": "procedure", - "description": "Remove a CI secret", - "input": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": [ - "repo", - "key" - ], - "properties": { - "repo": { - "type": "string", - "format": "at-uri" - }, - "key": { - "type": "string", - "maxLength": 50, - "minLength": 1 - } - } - } - } - } - } -} diff --git a/lexicons/repo.json b/lexicons/repo.json deleted file mode 100644 --- a/lexicons/repo.json +++ /dev/null @@ -1,54 +0,0 @@ -{ - "lexicon": 1, - "id": "sh.tangled.repo", - "needsCbor": true, - "needsType": true, - "defs": { - "main": { - "type": "record", - "key": "tid", - "record": { - "type": "object", - "required": [ - "name", - "knot", - "owner", - "createdAt" - ], - "properties": { - "name": { - "type": "string", - "description": "name of the repo" - }, - "owner": { - "type": "string", - "format": "did" - }, - "knot": { - "type": "string", - "description": "knot where the repo was created" - }, - "spindle": { - "type": "string", - "description": "CI runner to send jobs to and receive results from" - }, - "description": { - "type": "string", - "format": "datetime", - "minGraphemes": 1, - "maxGraphemes": 140 - }, - "source": { - "type": "string", - "format": "uri", - "description": "source of the repo" - }, - "createdAt": { - "type": "string", - "format": "datetime" - } - } - } - } - } -} diff --git a/lexicons/spindle.json b/lexicons/spindle.json deleted file mode 100644 --- a/lexicons/spindle.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "lexicon": 1, - "id": "sh.tangled.spindle", - "needsCbor": true, - "needsType": true, - "defs": { - "main": { - "type": "record", - "key": "any", - "record": { - "type": "object", - "required": [ - "createdAt" - ], - "properties": { - "createdAt": { - "type": "string", - "format": "datetime" - } - } - } - } - } -} - diff --git a/lexicons/pipeline/pipeline.json b/lexicons/pipeline/pipeline.json new file mode 100644 --- /dev/null +++ b/lexicons/pipeline/pipeline.json @@ -0,0 +1,263 @@ +{ + "lexicon": 1, + "id": "sh.tangled.pipeline", + "needsCbor": true, + "needsType": true, + "defs": { + "main": { + "type": "record", + "key": "tid", + "record": { + "type": "object", + "required": [ + "triggerMetadata", + "workflows" + ], + "properties": { + "triggerMetadata": { + "type": "ref", + "ref": "#triggerMetadata" + }, + "workflows": { + "type": "array", + "items": { + "type": "ref", + "ref": "#workflow" + } + } + } + } + }, + "triggerMetadata": { + "type": "object", + "required": [ + "kind", + "repo" + ], + "properties": { + "kind": { + "type": "string", + "enum": [ + "push", + "pull_request", + "manual" + ] + }, + "repo": { + "type": "ref", + "ref": "#triggerRepo" + }, + "push": { + "type": "ref", + "ref": "#pushTriggerData" + }, + "pullRequest": { + "type": "ref", + "ref": "#pullRequestTriggerData" + }, + "manual": { + "type": "ref", + "ref": "#manualTriggerData" + } + } + }, + "triggerRepo": { + "type": "object", + "required": [ + "knot", + "did", + "repo", + "defaultBranch" + ], + "properties": { + "knot": { + "type": "string" + }, + "did": { + "type": "string", + "format": "did" + }, + "repo": { + "type": "string" + }, + "defaultBranch": { + "type": "string" + } + } + }, + "pushTriggerData": { + "type": "object", + "required": [ + "ref", + "newSha", + "oldSha" + ], + "properties": { + "ref": { + "type": "string" + }, + "newSha": { + "type": "string", + "minLength": 40, + "maxLength": 40 + }, + "oldSha": { + "type": "string", + "minLength": 40, + "maxLength": 40 + } + } + }, + "pullRequestTriggerData": { + "type": "object", + "required": [ + "sourceBranch", + "targetBranch", + "sourceSha", + "action" + ], + "properties": { + "sourceBranch": { + "type": "string" + }, + "targetBranch": { + "type": "string" + }, + "sourceSha": { + "type": "string", + "minLength": 40, + "maxLength": 40 + }, + "action": { + "type": "string" + } + } + }, + "manualTriggerData": { + "type": "object", + "properties": { + "inputs": { + "type": "array", + "items": { + "type": "ref", + "ref": "#pair" + } + } + } + }, + "workflow": { + "type": "object", + "required": [ + "name", + "dependencies", + "steps", + "environment", + "clone" + ], + "properties": { + "name": { + "type": "string" + }, + "dependencies": { + "type": "array", + "items": { + "type": "ref", + "ref": "#dependency" + } + }, + "steps": { + "type": "array", + "items": { + "type": "ref", + "ref": "#step" + } + }, + "environment": { + "type": "array", + "items": { + "type": "ref", + "ref": "#pair" + } + }, + "clone": { + "type": "ref", + "ref": "#cloneOpts" + } + } + }, + "dependency": { + "type": "object", + "required": [ + "registry", + "packages" + ], + "properties": { + "registry": { + "type": "string" + }, + "packages": { + "type": "array", + "items": { + "type": "string" + } + } + } + }, + "cloneOpts": { + "type": "object", + "required": [ + "skip", + "depth", + "submodules" + ], + "properties": { + "skip": { + "type": "boolean" + }, + "depth": { + "type": "integer" + }, + "submodules": { + "type": "boolean" + } + } + }, + "step": { + "type": "object", + "required": [ + "name", + "command" + ], + "properties": { + "name": { + "type": "string" + }, + "command": { + "type": "string" + }, + "environment": { + "type": "array", + "items": { + "type": "ref", + "ref": "#pair" + } + } + } + }, + "pair": { + "type": "object", + "required": [ + "key", + "value" + ], + "properties": { + "key": { + "type": "string" + }, + "value": { + "type": "string" + } + } + } + } +} diff --git a/lexicons/repo/addSecret.json b/lexicons/repo/addSecret.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/addSecret.json @@ -0,0 +1,37 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.addSecret", + "defs": { + "main": { + "type": "procedure", + "description": "Add a CI secret", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repo", + "key", + "value" + ], + "properties": { + "repo": { + "type": "string", + "format": "at-uri" + }, + "key": { + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "value": { + "type": "string", + "maxLength": 200, + "minLength": 1 + } + } + } + } + } + } +} diff --git a/lexicons/repo/artifact.json b/lexicons/repo/artifact.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/artifact.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.artifact", + "needsCbor": true, + "needsType": true, + "defs": { + "main": { + "type": "record", + "key": "tid", + "record": { + "type": "object", + "required": [ + "name", + "repo", + "tag", + "createdAt", + "artifact" + ], + "properties": { + "name": { + "type": "string", + "description": "name of the artifact" + }, + "repo": { + "type": "string", + "format": "at-uri", + "description": "repo that this artifact is being uploaded to" + }, + "tag": { + "type": "bytes", + "description": "hash of the tag object that this artifact is attached to (only annotated tags are supported)", + "minLength": 20, + "maxLength": 20 + }, + "createdAt": { + "type": "string", + "format": "datetime", + "description": "time of creation of this artifact" + }, + "artifact": { + "type": "blob", + "description": "the artifact", + "accept": [ + "*/*" + ], + "maxSize": 52428800 + } + } + } + } + } +} diff --git a/lexicons/repo/defaultBranch.json b/lexicons/repo/defaultBranch.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/defaultBranch.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.setDefaultBranch", + "defs": { + "main": { + "type": "procedure", + "description": "Set the default branch for a repository", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repo", + "defaultBranch" + ], + "properties": { + "repo": { + "type": "string", + "format": "at-uri" + }, + "defaultBranch": { + "type": "string" + } + } + } + } + } + } +} diff --git a/lexicons/repo/listSecrets.json b/lexicons/repo/listSecrets.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/listSecrets.json @@ -0,0 +1,67 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.listSecrets", + "defs": { + "main": { + "type": "query", + "parameters": { + "type": "params", + "required": [ + "repo" + ], + "properties": { + "repo": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "secrets" + ], + "properties": { + "secrets": { + "type": "array", + "items": { + "type": "ref", + "ref": "#secret" + } + } + } + } + } + }, + "secret": { + "type": "object", + "required": [ + "repo", + "key", + "createdAt", + "createdBy" + ], + "properties": { + "repo": { + "type": "string", + "format": "at-uri" + }, + "key": { + "type": "string", + "maxLength": 50, + "minLength": 1 + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "createdBy": { + "type": "string", + "format": "did" + } + } + } + } +} diff --git a/lexicons/repo/removeSecret.json b/lexicons/repo/removeSecret.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/removeSecret.json @@ -0,0 +1,31 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo.removeSecret", + "defs": { + "main": { + "type": "procedure", + "description": "Remove a CI secret", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "repo", + "key" + ], + "properties": { + "repo": { + "type": "string", + "format": "at-uri" + }, + "key": { + "type": "string", + "maxLength": 50, + "minLength": 1 + } + } + } + } + } + } +} diff --git a/lexicons/repo/repo.json b/lexicons/repo/repo.json new file mode 100644 --- /dev/null +++ b/lexicons/repo/repo.json @@ -0,0 +1,54 @@ +{ + "lexicon": 1, + "id": "sh.tangled.repo", + "needsCbor": true, + "needsType": true, + "defs": { + "main": { + "type": "record", + "key": "tid", + "record": { + "type": "object", + "required": [ + "name", + "knot", + "owner", + "createdAt" + ], + "properties": { + "name": { + "type": "string", + "description": "name of the repo" + }, + "owner": { + "type": "string", + "format": "did" + }, + "knot": { + "type": "string", + "description": "knot where the repo was created" + }, + "spindle": { + "type": "string", + "description": "CI runner to send jobs to and receive results from" + }, + "description": { + "type": "string", + "format": "datetime", + "minGraphemes": 1, + "maxGraphemes": 140 + }, + "source": { + "type": "string", + "format": "uri", + "description": "source of the repo" + }, + "createdAt": { + "type": "string", + "format": "datetime" + } + } + } + } + } +} diff --git a/lexicons/spindle/spindle.json b/lexicons/spindle/spindle.json new file mode 100644 --- /dev/null +++ b/lexicons/spindle/spindle.json @@ -0,0 +1,25 @@ +{ + "lexicon": 1, + "id": "sh.tangled.spindle", + "needsCbor": true, + "needsType": true, + "defs": { + "main": { + "type": "record", + "key": "any", + "record": { + "type": "object", + "required": [ + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + } + } + } + } + } +} + -- tangled.sh