feat(templates): create schemas for users, labels, projects, sprints, issues, comments

This commit is contained in:
GitApp 2025-12-19 16:03:30 +00:00
parent 5426462640
commit 8759f93ab3
19 changed files with 374 additions and 0 deletions

0
.gitapp/.gitkeep Normal file
View File

56
.gitapp/manifest.json Normal file
View File

@ -0,0 +1,56 @@
{
"name": "pocketbase-lite",
"version": "0.1.0",
"paths": {
"data": "collections/",
"media": "media/",
"indexes": ".gitapp/indexes/"
},
"schemas": [
{
"id": "users",
"file": "schemas/users.json",
"glob": "collections/users/*.json"
},
{
"id": "labels",
"file": "schemas/labels.json",
"glob": "collections/labels/*.json"
},
{
"id": "projects",
"file": "schemas/projects.json",
"glob": "collections/projects/*.json"
},
{
"id": "sprints",
"file": "schemas/sprints.json",
"glob": "collections/sprints/*.json"
},
{
"id": "issues",
"file": "schemas/issues.json",
"glob": "collections/issues/*.json"
},
{
"id": "comments",
"file": "schemas/comments.json",
"glob": "collections/comments/*.json"
}
],
"operations": [
"create-record",
"update-record",
"delete-record"
],
"policies": {
"roles": [
"viewer",
"editor"
],
"acl": null
},
"lfs": {
"enabled": false
}
}

View File

View File

@ -0,0 +1,20 @@
name: create-record
version: 1
scope:
subtree: "collections/"
input:
$schema: zod
schema: |
z.object({
collection: z.string().min(1),
id: z.string().min(1),
data: z.record(z.unknown())
})
preconditions: []
mutations:
- type: create_file
path: "collections/${input.collection}/${input.id}.json"
content: "${JSON.stringify(input.data, null, 2)}"
commit:
message: "feat(data): create ${input.collection} record ${input.id}"
updateRef: "refs/heads/main"

View File

@ -0,0 +1,20 @@
name: delete-record
version: 1
scope:
subtree: "collections/"
input:
$schema: zod
schema: |
z.object({
collection: z.string().min(1),
id: z.string().min(1)
})
preconditions:
- type: path_exists
path: "collections/${input.collection}/${input.id}.json"
mutations:
- type: delete_file
path: "collections/${input.collection}/${input.id}.json"
commit:
message: "feat(data): delete ${input.collection} record ${input.id}"
updateRef: "refs/heads/main"

View File

@ -0,0 +1,22 @@
name: update-record
version: 1
scope:
subtree: "collections/"
input:
$schema: zod
schema: |
z.object({
collection: z.string().min(1),
id: z.string().min(1),
data: z.record(z.unknown())
})
preconditions:
- type: path_exists
path: "collections/${input.collection}/${input.id}.json"
mutations:
- type: create_file
path: "collections/${input.collection}/${input.id}.json"
content: "${JSON.stringify(input.data, null, 2)}"
commit:
message: "feat(data): update ${input.collection} record ${input.id}"
updateRef: "refs/heads/main"

0
.gitapp/schemas/.gitkeep Normal file
View File

View File

@ -0,0 +1,32 @@
{
"$id": "comments",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"content"
],
"properties": {
"content": {
"type": "string",
"minLength": 1
},
"date": {
"type": "string",
"format": "date-time"
},
"issue": {
"type": "string",
"x-relation": {
"collection": "issues",
"type": "single"
}
},
"author": {
"type": "string",
"x-relation": {
"collection": "users",
"type": "single"
}
}
}
}

View File

@ -0,0 +1,95 @@
{
"$id": "issues",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"title",
"type",
"status"
],
"properties": {
"title": {
"type": "string",
"minLength": 1
},
"description": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"bug",
"feature",
"task",
"story",
"epic"
]
},
"priority": {
"type": "string",
"enum": [
"low",
"medium",
"high",
"critical"
]
},
"status": {
"type": "string",
"enum": [
"backlog",
"todo",
"in_progress",
"review",
"done"
]
},
"estimate": {
"type": "integer",
"minimum": 0
},
"dueDate": {
"type": "string",
"format": "date"
},
"project": {
"type": "string",
"x-relation": {
"collection": "projects",
"type": "single"
}
},
"assignee": {
"type": "string",
"x-relation": {
"collection": "users",
"type": "single"
}
},
"reporter": {
"type": "string",
"x-relation": {
"collection": "users",
"type": "single"
}
},
"labels": {
"type": "array",
"items": {
"type": "string"
},
"x-relation": {
"collection": "labels",
"type": "multiple",
"maxItems": 5
}
},
"sprint": {
"type": "string",
"x-relation": {
"collection": "sprints",
"type": "single"
}
}
}
}

View File

@ -0,0 +1,21 @@
{
"$id": "labels",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"name",
"color"
],
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"color": {
"type": "string"
},
"description": {
"type": "string"
}
}
}

View File

@ -0,0 +1,42 @@
{
"$id": "projects",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"name",
"key"
],
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"key": {
"type": "string",
"minLength": 2,
"maxLength": 5
},
"description": {
"type": "string"
},
"color": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"active",
"on-hold",
"completed",
"archived"
]
},
"lead": {
"type": "string",
"x-relation": {
"collection": "users",
"type": "single"
}
}
}
}

View File

@ -0,0 +1,34 @@
{
"$id": "sprints",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"name",
"startDate",
"endDate"
],
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"startDate": {
"type": "string",
"format": "date"
},
"endDate": {
"type": "string",
"format": "date"
},
"goal": {
"type": "string"
},
"project": {
"type": "string",
"x-relation": {
"collection": "projects",
"type": "single"
}
}
}
}

View File

@ -0,0 +1,32 @@
{
"$id": "users",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"required": [
"name",
"email"
],
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"email": {
"type": "string",
"format": "email"
},
"avatar": {
"type": "string"
},
"role": {
"type": "string",
"enum": [
"admin",
"developer",
"designer",
"qa",
"pm"
]
}
}
}

View File

View File

View File

View File

View File

View File