@snowplow/snowtype-core
Version:
A code generator for faster and type-safe Snowplow tracking code
63 lines (62 loc) • 2.33 kB
TypeScript
import { LanguageIds, TrackerTemplates, languageIds, trackerTemplates } from './languages';
import { createEventSpecificationInstructionsIdentifier, joinIgluSchemaUrlParts, splitIgluSchemaUrlParts } from './utils';
import { EcomTemplateSchemaType } from './utils/ecom';
export { createEventSpecificationInstructionsIdentifier, languageIds, trackerTemplates, splitIgluSchemaUrlParts, joinIgluSchemaUrlParts, };
import { EventSpecificationsInputMetadata as MetaEs } from './schema';
import { PropertyRulesSchema } from './quicktype/helpers/merge-property-rules-schemas';
import { ValidationsSchemaObject } from './languages/types';
export type { PropertyRulesSchema, LanguageIds, TrackerTemplates, ValidationsSchemaObject, };
export type EventSpecificationIdentifiers = {
name: string;
id: string;
dataProductName: string;
dataProductId: string;
dataProductDomain?: string | undefined;
};
export interface InstructionsHeading {
instructionsTitle: string;
instructionsLink: string;
}
export type EntitiesSchemas = {
original: Schema;
propertyRule: PropertyRulesSchema | undefined;
};
export type EventSpecificationInput = {
eventSpecification: EventSpecificationIdentifiers;
version: number;
eventSchema: Schema;
entitiesSchemas?: EntitiesSchemas[];
instructions?: {
instructionsHeading: InstructionsHeading;
} | undefined;
propertyRules?: PropertyRulesSchema | undefined;
};
export type SchemaSelf = {
vendor: string;
name: string;
version: string;
format: string;
};
export type Schema = {
self: SchemaSelf;
description?: string;
isEcomTemplateSchema?: EcomTemplateSchemaType;
properties?: {
[k: string]: unknown;
};
additionalProperties?: boolean | undefined;
required?: string[];
type?: string;
$schema?: string;
};
export type GenerationInput = {
language: LanguageIds;
tracker: TrackerTemplates;
eventSpecifications: EventSpecificationInput[];
schemas: Schema[];
validations: boolean;
eventSpecificationsInputMetadata: EventSpecificationsInputMetadata;
namespace?: string | undefined;
};
export declare function generate(input: GenerationInput): Promise<import("./languages").GenerationResult> | undefined;
export type EventSpecificationsInputMetadata = MetaEs;