Registry / devops / screwdriver-data-schema

screwdriver-data-schema

JSON →
library26.1.2jsnpmunverified

Internal data schema for Screwdriver CI/CD system, providing validation and structure for all models/resources: API input/output, screwdriver.yaml config, internal resources (pipeline, job, build, collection), plugins (datastore, executor), and SCM plugin output. Version 26.1.2, part of Screwdriver ecosystem. Released regularly alongside other Screwdriver packages. Key differentiator: opinionated eight-schema model design (base, allKeys, get, create, update, keys, tableName, indexes) enforcing consistency across resources.

npm install screwdriver-data-schema
INSTALL
IMPORT
SIG · SCREWDRIVER-DATA-S
S
screwdriver-data-schema
devopsjavascriptv26.1.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
const schema = require('screwdriver-data-schema');
import schema from 'screwdriver-data-schema';
Package is CommonJS only; ESM import not supported.
configParser
const configParser = require('screwdriver-data-schema').config.configParser;
import { configParser } from 'screwdriver-data-schema';
Access nested properties via require; no direct named exports.
model.job
const jobSchema = require('screwdriver-data-schema').models.job;
const jobSchema = require('screwdriver-data-schema/models/job');
Subpaths not available; only top-level require.

Demonstrates requiring the schema package, accessing model schemas (create, get, allKeys), validating a job payload with jsonschema, and parsing a screwdriver.yaml config string.

const schema = require('screwdriver-data-schema'); // Access job model schemas const jobCreateSchema = schema.models.job.create; const jobGetSchema = schema.models.job.get; const jobAllKeys = schema.models.job.allKeys; // Validate a job creation payload const { Validator } = require('jsonschema'); const v = new Validator(); const payload = { id: 'abc123', pipelineId: 'pipeline1', name: 'main', state: 'ENABLED' }; const result = v.validate(payload, jobCreateSchema); console.log(result.errors); // [] if valid // Access config parser for screwdriver.yaml const configParser = schema.config.configParser; const parsedConfig = configParser('jobs:\n main:\n image: node:18\n steps:\n - install: npm install'); console.log(parsedConfig);
Debug
Known issues
gotchaPackage is CommonJS only; attempting ESM import will fail.
fix
Use require() instead of import.
affects: >=0.0.0
gotchaNo direct subpath exports (e.g., require('screwdriver-data-schema/models/job')). Only top-level require works.
fix
Access nested objects via top-level require: require('screwdriver-data-schema').models.job.
affects: >=0.0.0
breakingModel schemas can change between major versions; always pin to a specific version in package.json to avoid unexpected validation failures.
fix
Pin version: "screwdriver-data-schema": "26.1.2".
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'screwdriver-data-schema'
Package not installed or incorrect path.
fix
npm install screwdriver-data-schema
TypeError: schema.models is undefined
Attempting to use ESM import style on CJS-only package.
fix
Replace import with const schema = require('screwdriver-data-schema');
Error: Cannot find module 'screwdriver-data-schema/models/job'
Trying to use subpath require which is not supported.
fix
Use require('screwdriver-data-schema').models.job instead.
Upgrade
Version history
26.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Resources
screwdriver-data-schema — npm install screwdriver-data-schema · libregistry