npm.io
13.9.0 • Published 1 week ago

@forge/manifest

Licence
SEE LICENSE IN LICENSE.txt
Version
13.9.0
Deps
9
Size
4.5 MB
Vulns
1
Weekly
83.0K

Forge manifest validation

Package used to parse and validate the manifest.yml file of Forge apps.

How to use the library

Use it as follows:

import { ProcessorBuilder, ValidationTypes } from '@forge/manifest';

const results = ProcessorBuilder.instance()
  .withValidation(ValidationTypes.FULL)
  .build()
  .process();

console.log(`Valid manifest ? ${results.success}`);

Simple Trigger Scopes Validation

For validating trigger event scopes, use the simple validation API that only requires the event name and scopes:

import { validateTriggerScopes } from '@forge/manifest';

// Simple: just pass event and scopes
const result = await validateTriggerScopes(
  'avi:jira:assigned:issue',
  ['read:jira-work']
);

if (!result.valid) {
  console.error(`Missing scopes: ${result.missingScopes.join(', ')}`);
}

This is useful for:

  • External tools that need to verify scope requirements
  • Any service that validates event-scope mappings

How to check the errors

In case of an invalid manifest.yml, the following information will be populated:

export interface ValidationError {
  message: string;
  reference: string;
  level: 'error' | 'warning';
  line?: number;
  column?: number;
}

export interface ManifestValidationResult {
  success: boolean;
  errors?: ValidationError[];
}

Updating Manifest schemas

The schemas in this package are automatically updated from Shipyard daily. Any manual changes to these files will be reverted. Please raise a PR in app-host-artifacts instead.