UNPKG

@maddonkeysoftware/orid-node

Version:

A utility page to help produce and consume Open Resource IDs

53 lines (52 loc) 1.34 kB
export interface V1Orid { /** * The provider for this ORID. */ provider: string; /** * Optional provider specific field 1. */ custom1?: string; /** * Optional provider specific field 2. */ custom2?: string; /** * Optional provider specific field 3. */ custom3?: string; /** * The service that the resource belongs to. */ service: string; /** * The resource identified by this ORID. */ resourceId: string; /** * Optional resource type associated with resource. */ resourceRider?: string; /** * True to use a slash (/) to separate the resourceId and resourceRider; False or omitted to use colon (:). */ useSlashSeparator?: boolean; } /** * Generate a properly formatted V1 ORID. * * @param data The metadata object for all ORID parts. */ export declare function generate(data: V1Orid): string; /** * * @param value The item to validate if it is a V1 ORID or not. * @returns True if a valid orid string was supplied, false otherwise. */ export declare function isValid(value: string): boolean; /** * Parses a properly formatted ORID into an object for easier consumption. * @param orid The ORID to parse. * @returns A ORID object. */ export declare function parse(orid: string): V1Orid;