Skip to Content

Check a template project workspace

Check a template project workspace. Request: POST /v1/templates/{id}/workspace/check. Scope: templates:read.

POST
/v1/templates/{id}/workspace/check

Builds the template entry from the current effective workspace tree, including unsaved file patches, and returns what the template declares plus every compile and target-client finding. Nothing is written and no message is rendered.

Authorization

apiKey
headerx-api-key<token>

Path Parameters

id*string
Match^tmpl_[0-9a-hjkmnp-tv-z]{16,24}$

Request Body

application/json
  1. body
expectedRevision*string

Response Body

Success

application/json
  1. response
projectId*TemplateProjectId
Match^tproj_[0-9a-hjkmnp-tv-z]{16,24}$
revision*string
entryPath*|
declaration*|null
issue?
diagnostics*array<>
incompatibilities*array<>
Example Request
import { createClient } from "samva";

const samva = createClient({ apiKey: process.env.SAMVA_API_KEY! });

const result = await samva.templates.checkWorkspace({
  "id": "example",
  "expectedRevision": "example"
});
Example Response
{
  "projectId": "string",
  "revision": "string",
  "entryPath": "string",
  "declaration": {
    "codeDigest": "string",
    "templateId": "string",
    "input": {
      "schema": {
        "property1": "string",
        "property2": "string"
      },
      "schemaDigest": "string",
      "contractDigest": "string"
    },
    "fixtures": [
      "string"
    ]
  },
  "issue": {
    "path": "string",
    "frontmatter": {
      "title": "string",
      "date": "string",
      "slug": "string",
      "topic": "string",
      "preheader": "string",
      "seo": {
        "title": "string",
        "description": "string",
        "image": "string"
      },
      "gate": {
        "leadIn": 0
      }
    }
  },
  "diagnostics": [
    {
      "code": "string",
      "severity": "error",
      "message": "string",
      "origins": [
        {
          "fileName": "string",
          "lineNumber": 1,
          "columnNumber": 1
        }
      ],
      "clients": [
        "string"
      ],
      "notes": "string",
      "provenance": "string",
      "fixtures": [
        "string"
      ],
      "occurrences": [
        [
          {
            "fileName": "string",
            "lineNumber": 1,
            "columnNumber": 1
          }
        ]
      ],
      "compatibility": {
        "assessment": "risk",
        "title": "string"
      }
    }
  ],
  "incompatibilities": [
    {
      "code": "string",
      "severity": "error",
      "message": "string",
      "origins": [
        {
          "fileName": "string",
          "lineNumber": 1,
          "columnNumber": 1
        }
      ],
      "clients": [
        "string"
      ],
      "notes": "string",
      "provenance": "string",
      "fixtures": [
        "string"
      ],
      "occurrences": [
        [
          {
            "fileName": "string",
            "lineNumber": 1,
            "columnNumber": 1
          }
        ]
      ],
      "compatibility": {
        "assessment": "risk",
        "title": "string"
      }
    }
  ]
}

Related documentation