open-agreements
Version:
Open-source legal template filling CLI and library
52 lines • 3.22 kB
TypeScript
export interface ContentEntry {
id: string;
dir: string;
baseDir: string;
}
/**
* The three logical kinds a slug can carry. Since the S3 source/rights
* restructure (#1249) every managed slug lives under a single
* `templates/<source>-<rights>/<slug>/` tree — the old `external/` and
* `field-selectors/` top-level dirs are gone. The kind is now DERIVED from each
* slug's `metadata.yaml` instead of from which directory it lived in:
*
* - `field-selector` — `artifact_type: field-selector` (linked, non-redistributable
* source; ships transformation instructions, no `template.docx`).
* - `external` — a redistributable-but-no-derivatives vendored form
* (`allow_derivatives: false`, e.g. the CC BY-ND YC SAFEs):
* the original DOCX is stored as-is and bracket-to-tag
* normalized at fill time.
* - `template` — a first-party / derivable template with pre-baked `{tag}`
* placeholders (the default).
*/
export type ContentKind = 'template' | 'external' | 'field-selector';
/** Root of the open-agreements package */
export declare function getPackageRoot(): string;
/** Optional additional content roots. Format is path-delimited, e.g. /a:/b on macOS/Linux. */
export declare function getContentRoots(): string[];
/** Top-level `templates/` directory in the package root. */
export declare function getTemplatesDir(): string;
/** All `templates/` roots in precedence order (env roots first, package root last). */
export declare function getAllTemplatesDirs(): string[];
/** Resolve a specific template directory by ID */
export declare function resolveTemplateDir(templateId: string): string;
/** Find a specific template directory by ID across all configured content roots. */
export declare function findTemplateDir(templateId: string): string | undefined;
/** List template IDs across all content roots (first match wins for duplicates). */
export declare function listTemplateEntries(): ContentEntry[];
export declare function listTemplateIds(): string[];
/** Resolve a specific external template directory by ID */
export declare function resolveExternalDir(externalId: string): string;
/** Find a specific external directory by ID across all configured content roots. */
export declare function findExternalDir(externalId: string): string | undefined;
/** List external template IDs across all content roots (first match wins for duplicates). */
export declare function listExternalEntries(): ContentEntry[];
export declare function listExternalIds(): string[];
/** Resolve a specific fieldSelector directory by ID */
export declare function resolveFieldSelectorDir(fieldSelectorId: string): string;
/** Find a specific fieldSelector directory by ID across all configured content roots. */
export declare function findFieldSelectorDir(fieldSelectorId: string): string | undefined;
/** List fieldSelector IDs across all content roots (first match wins for duplicates). */
export declare function listFieldSelectorEntries(): ContentEntry[];
export declare function listFieldSelectorIds(): string[];
//# sourceMappingURL=paths.d.ts.map