@guideshot/core 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +6 -1
- package/dist/index.js +14 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,7 @@ interface ScenarioResult {
|
|
|
73
73
|
interface ScenarioDefinition<TInput extends JsonObject = JsonObject> extends ExtensionInfo {
|
|
74
74
|
schema: object;
|
|
75
75
|
datasetRevision?: string;
|
|
76
|
+
concurrencyKey?: string;
|
|
76
77
|
prepare(context: ScenarioContext, input: TInput): ScenarioResult | Promise<ScenarioResult>;
|
|
77
78
|
}
|
|
78
79
|
interface TranslationContext {
|
|
@@ -91,11 +92,15 @@ interface ServerConfig {
|
|
|
91
92
|
interface SafetyConfig {
|
|
92
93
|
allowedOrigins?: readonly string[];
|
|
93
94
|
}
|
|
95
|
+
interface CaptureConfig {
|
|
96
|
+
concurrency?: number;
|
|
97
|
+
}
|
|
94
98
|
interface GuideShotConfig {
|
|
95
99
|
recipes: readonly string[];
|
|
96
100
|
outputDir: string;
|
|
97
101
|
cacheDir: string;
|
|
98
102
|
server: ServerConfig;
|
|
103
|
+
capture?: CaptureConfig;
|
|
99
104
|
safety?: SafetyConfig;
|
|
100
105
|
targetAttribute?: `data-${string}`;
|
|
101
106
|
profiles: Readonly<Record<string, CaptureProfile>>;
|
|
@@ -405,4 +410,4 @@ declare function validateConfig(config: GuideShotConfig): void;
|
|
|
405
410
|
declare function validateRecipeSemantics(source: RecipeSource, config: GuideShotConfig): void;
|
|
406
411
|
declare function defaultProfileName(config: GuideShotConfig): string;
|
|
407
412
|
|
|
408
|
-
export { type AnnotationRenderer, type BrowserCookie, type BrowserDriver, type BrowserEnvironment, type BrowserRun, type BrowserStatePatch, type CaptureIntent, type CaptureProfile, type CaptureRequest, type CaptureResult, type CapturedScene, type CompositionIntent, type CompositionOutput, type CompositionRequest, DIAGNOSTIC_CODES, type Diagnostic, type DiagnosticCode, type DiagnosticLocation, type DiagnosticSeverity, type DimensionDefinition, type DimensionResolveContext, type DriverRunOptions, type ExtensionInfo, type GuideShotConfig, GuideShotError, type GuideShotErrorOptions, type InterpolationContext, type LocalStorageState, type ManifestAssetInput, type MatrixDefinition, type ParseRecipeOptions, type Plan, type PlanOptions, type PlannedJob, type RecipeSource, type Rect, type RenderedAsset, type RendererRun, type ResolveJobOptions, type ResolveTextContext, type ResolvedAnnotation, type ResolvedCaptureJob, type ResolvedJob, type SafeProjectPaths, type SafetyConfig, type ScenarioContext, type ScenarioDefinition, type ScenarioResult, type SceneBackground, type SceneTarget, type SceneViewport, type ServerConfig, type TranslationContext, type TranslationProvider, type VariantRow, type Viewport, assertAllowedOrigin, assertUniqueRecipeIds, buildPublicManifest, canonicalSerialize, createAssetPath, createCaptureHash, createCompositionHash, createJobCompositionHash, createVariantKey, defaultProfileName, defineConfig, defineDimension, defineScenario, diagnosticFromUnknown, discoverRecipes, expandMatrix, hashCanonical, interpolate, interpolateString, isGuideShotError, matchesVariantFilter, mergeBrowserState, parseRecipe, planProject, planRecipes, resolveArtifactPath, resolveJob, resolveLocalizedText, resolvePageUrl, resolveRecipeText, resolveSafeProjectPaths, resolvedAlt, resolvedAnnotations, sanitizeFileSegment, sha256, validateConfig, validateManifest, validateRecipe, validateRecipeSemantics };
|
|
413
|
+
export { type AnnotationRenderer, type BrowserCookie, type BrowserDriver, type BrowserEnvironment, type BrowserRun, type BrowserStatePatch, type CaptureConfig, type CaptureIntent, type CaptureProfile, type CaptureRequest, type CaptureResult, type CapturedScene, type CompositionIntent, type CompositionOutput, type CompositionRequest, DIAGNOSTIC_CODES, type Diagnostic, type DiagnosticCode, type DiagnosticLocation, type DiagnosticSeverity, type DimensionDefinition, type DimensionResolveContext, type DriverRunOptions, type ExtensionInfo, type GuideShotConfig, GuideShotError, type GuideShotErrorOptions, type InterpolationContext, type LocalStorageState, type ManifestAssetInput, type MatrixDefinition, type ParseRecipeOptions, type Plan, type PlanOptions, type PlannedJob, type RecipeSource, type Rect, type RenderedAsset, type RendererRun, type ResolveJobOptions, type ResolveTextContext, type ResolvedAnnotation, type ResolvedCaptureJob, type ResolvedJob, type SafeProjectPaths, type SafetyConfig, type ScenarioContext, type ScenarioDefinition, type ScenarioResult, type SceneBackground, type SceneTarget, type SceneViewport, type ServerConfig, type TranslationContext, type TranslationProvider, type VariantRow, type Viewport, assertAllowedOrigin, assertUniqueRecipeIds, buildPublicManifest, canonicalSerialize, createAssetPath, createCaptureHash, createCompositionHash, createJobCompositionHash, createVariantKey, defaultProfileName, defineConfig, defineDimension, defineScenario, diagnosticFromUnknown, discoverRecipes, expandMatrix, hashCanonical, interpolate, interpolateString, isGuideShotError, matchesVariantFilter, mergeBrowserState, parseRecipe, planProject, planRecipes, resolveArtifactPath, resolveJob, resolveLocalizedText, resolvePageUrl, resolveRecipeText, resolveSafeProjectPaths, resolvedAlt, resolvedAnnotations, sanitizeFileSegment, sha256, validateConfig, validateManifest, validateRecipe, validateRecipeSemantics };
|
package/dist/index.js
CHANGED
|
@@ -246,6 +246,20 @@ function validateConfig(config) {
|
|
|
246
246
|
"Configuration must register at least one capture profile."
|
|
247
247
|
);
|
|
248
248
|
}
|
|
249
|
+
if (config.capture?.concurrency !== void 0 && (!Number.isInteger(config.capture.concurrency) || config.capture.concurrency < 1)) {
|
|
250
|
+
throw new GuideShotError(
|
|
251
|
+
"RECIPE_SCHEMA_INVALID",
|
|
252
|
+
"Capture concurrency must be a positive integer."
|
|
253
|
+
);
|
|
254
|
+
}
|
|
255
|
+
for (const scenario of Object.values(config.scenarios ?? {})) {
|
|
256
|
+
if (scenario.concurrencyKey !== void 0 && scenario.concurrencyKey.trim() === "") {
|
|
257
|
+
throw new GuideShotError(
|
|
258
|
+
"RECIPE_SCHEMA_INVALID",
|
|
259
|
+
"Scenario concurrency keys cannot be empty."
|
|
260
|
+
);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
249
263
|
for (const [name, profile] of Object.entries(config.profiles)) {
|
|
250
264
|
if (!Number.isInteger(profile.viewport.width) || profile.viewport.width <= 0 || !Number.isInteger(profile.viewport.height) || profile.viewport.height <= 0) {
|
|
251
265
|
throw new GuideShotError(
|