@vcp-dev/site-edit-engine 0.11.20 → 0.11.21
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 +173 -42
- package/dist/index.js +14 -14
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Generated by dts-bundle-generator v9.5.1
|
|
2
2
|
|
|
3
3
|
import { File as File$1 } from '@babel/types';
|
|
4
|
-
import { BlockDirectory, BlockRenderRef, GeneratedSiteCapabilities, PortableCollectionRecipeFacts, PortableCollectionViewReference, PortableInvocationBinding, PortableJsonValue, ResolvedField, SiteEditClassNameSourceStyleContext, SiteEditCommandSuccess, SiteEditCompositionContext, SiteEditCompositionSelector, SiteEditEvent, SiteEditGetClassNameSourceCommandResult, SiteEditGetClassNameSourceResult, SiteEditMaterialization, SiteEditMaterializationExport, SiteEditMutationContext, SiteEditObjectEditContext, SiteEditOperationCommandResult, SiteEditOperationRequest, SiteEditOperationSelectionRef, SiteEditPageBlockDescriptor, SiteEditPageBlockPosition, SiteEditPageBlockTarget, SiteEditPageCompositionErrorCode, SiteEditPatchPlan, SiteEditRenderDocument, SiteEditResolveSourceLocationInput, SiteEditSourceFileResponse, SiteEditSourceLocation, SiteEditSourceTreeResponse } from '@vcp-dev/contracts';
|
|
4
|
+
import { BlockDirectory, BlockRenderRef, GeneratedSiteCapabilities, PortableCollectionRecipeFacts, PortableCollectionViewReference, PortableInvocationBinding, PortableJsonValue, ResolvedField, SiteEditClassNameSourceStyleContext, SiteEditCommandSuccess, SiteEditCompositionContext, SiteEditCompositionSelector, SiteEditEvent, SiteEditGetClassNameSourceCommandResult, SiteEditGetClassNameSourceResult, SiteEditMaterialization, SiteEditMaterializationExport, SiteEditMutationContext, SiteEditObjectEditContext, SiteEditOperationCommandResult, SiteEditOperationRequest, SiteEditOperationSelectionRef, SiteEditPageBlockDescriptor, SiteEditPageBlockPosition, SiteEditPageBlockTarget, SiteEditPageCompositionErrorCode, SiteEditPatchPlan, SiteEditRenderDocument, SiteEditResolveSourceLocationInput, SiteEditSourceFileResponse, SiteEditSourceLocation, SiteEditSourceTreeResponse, SnapshotManifest } from '@vcp-dev/contracts';
|
|
5
5
|
|
|
6
6
|
type SiteEditSourceModuleResult = {
|
|
7
7
|
ok: true;
|
|
@@ -1763,6 +1763,178 @@ export interface PortableDependencyAuditResult {
|
|
|
1763
1763
|
readonly errors: readonly PortableDependencyAuditError[];
|
|
1764
1764
|
}
|
|
1765
1765
|
export declare function auditPortableDependencies(input: PortableDependencyAuditInput): PortableDependencyAuditResult;
|
|
1766
|
+
type Location$1 = {
|
|
1767
|
+
readonly line: number;
|
|
1768
|
+
readonly column: number;
|
|
1769
|
+
};
|
|
1770
|
+
interface PortableCmsSourceEvidence {
|
|
1771
|
+
readonly source_path: string;
|
|
1772
|
+
readonly operation: string;
|
|
1773
|
+
readonly binding: "trusted-cms";
|
|
1774
|
+
readonly call_site: Location$1;
|
|
1775
|
+
}
|
|
1776
|
+
interface PortableCmsSourceDependency {
|
|
1777
|
+
readonly requirement_key: string;
|
|
1778
|
+
readonly slug: string;
|
|
1779
|
+
readonly evidence: readonly PortableCmsSourceEvidence[];
|
|
1780
|
+
}
|
|
1781
|
+
interface PortableCmsSourceUnresolved {
|
|
1782
|
+
readonly code: string;
|
|
1783
|
+
readonly source_path: string;
|
|
1784
|
+
readonly message: string;
|
|
1785
|
+
readonly call_site?: Location$1;
|
|
1786
|
+
}
|
|
1787
|
+
interface PortableCmsSourcesResult {
|
|
1788
|
+
readonly complete: boolean;
|
|
1789
|
+
readonly dependencies: readonly PortableCmsSourceDependency[];
|
|
1790
|
+
readonly unresolved: readonly PortableCmsSourceUnresolved[];
|
|
1791
|
+
}
|
|
1792
|
+
export type PortableMediaReferenceKind = "src" | "srcset" | "poster" | "thumbnail" | "object" | "array-item" | "import" | "manifest";
|
|
1793
|
+
export type PortableMediaReferenceSource = "jsx-attribute" | "object-property" | "array-item" | "import" | "media-manifest";
|
|
1794
|
+
export interface PortableMediaSourceRange {
|
|
1795
|
+
readonly start_offset: number;
|
|
1796
|
+
readonly end_offset: number;
|
|
1797
|
+
readonly start_line: number;
|
|
1798
|
+
readonly start_column: number;
|
|
1799
|
+
readonly end_line: number;
|
|
1800
|
+
readonly end_column: number;
|
|
1801
|
+
}
|
|
1802
|
+
export interface PortableMediaReference {
|
|
1803
|
+
readonly file_path: string;
|
|
1804
|
+
readonly occurrence: number;
|
|
1805
|
+
readonly kind: PortableMediaReferenceKind;
|
|
1806
|
+
readonly source: PortableMediaReferenceSource;
|
|
1807
|
+
readonly value: string | null;
|
|
1808
|
+
readonly expression: string;
|
|
1809
|
+
readonly asset_key: string | null;
|
|
1810
|
+
readonly source_range: PortableMediaSourceRange;
|
|
1811
|
+
/** Digest of the original AST/source occurrence, not downloaded bytes. */
|
|
1812
|
+
readonly content_digest: string;
|
|
1813
|
+
readonly complete: boolean;
|
|
1814
|
+
}
|
|
1815
|
+
export type PortableMediaReferenceScanErrorCode = "MEDIA_SOURCE_PARSE_FAILED" | "MEDIA_VALUE_UNKNOWN" | "MEDIA_MANIFEST_KEY_UNKNOWN";
|
|
1816
|
+
export interface PortableMediaReferenceScanError {
|
|
1817
|
+
readonly code: PortableMediaReferenceScanErrorCode;
|
|
1818
|
+
readonly file_path: string;
|
|
1819
|
+
readonly message: string;
|
|
1820
|
+
readonly source_range?: PortableMediaSourceRange;
|
|
1821
|
+
}
|
|
1822
|
+
export interface PortableMediaReferenceScanInput {
|
|
1823
|
+
readonly file_path: string;
|
|
1824
|
+
readonly source: string;
|
|
1825
|
+
readonly media_manifest?: Readonly<Record<string, string>>;
|
|
1826
|
+
}
|
|
1827
|
+
export interface PortableMediaReferenceScanResult {
|
|
1828
|
+
readonly complete: boolean;
|
|
1829
|
+
readonly references: readonly PortableMediaReference[];
|
|
1830
|
+
readonly errors: readonly PortableMediaReferenceScanError[];
|
|
1831
|
+
}
|
|
1832
|
+
export declare function scanPortableMediaReferences(input: PortableMediaReferenceScanInput): PortableMediaReferenceScanResult;
|
|
1833
|
+
export interface PortableBlockExportInput {
|
|
1834
|
+
readonly site_id: string;
|
|
1835
|
+
readonly base_snapshot_id: string;
|
|
1836
|
+
readonly document_version: number;
|
|
1837
|
+
/** Trusted live Engine identity, read before and after the async analysis. */
|
|
1838
|
+
readonly read_current_identity: () => {
|
|
1839
|
+
readonly site_id: string;
|
|
1840
|
+
readonly snapshot_id: string;
|
|
1841
|
+
readonly document_version: number;
|
|
1842
|
+
};
|
|
1843
|
+
readonly target: SiteEditPageBlockTarget;
|
|
1844
|
+
readonly selection_ref: BlockRenderRef;
|
|
1845
|
+
readonly host_capabilities: GeneratedSiteCapabilities;
|
|
1846
|
+
/** Supplied by trusted host provenance, never by a browser or Snapshot file. */
|
|
1847
|
+
readonly trusted_host_file_hashes?: ReadonlyMap<string, string>;
|
|
1848
|
+
/** Must be obtained from an authoritative, site-scoped Snapshot reader. */
|
|
1849
|
+
readonly snapshot: {
|
|
1850
|
+
readonly site_id: string;
|
|
1851
|
+
readonly snapshot_id: string;
|
|
1852
|
+
readonly files: ReadonlyMap<string, PortableSourceFileContent>;
|
|
1853
|
+
/** Already authenticated against the authoritative Snapshot manifest hash. */
|
|
1854
|
+
readonly manifest: SnapshotManifest;
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
interface PortableBlockExportError {
|
|
1858
|
+
readonly code: string;
|
|
1859
|
+
readonly path: string;
|
|
1860
|
+
readonly message: string;
|
|
1861
|
+
readonly call_site?: {
|
|
1862
|
+
readonly line: number;
|
|
1863
|
+
readonly column: number;
|
|
1864
|
+
};
|
|
1865
|
+
}
|
|
1866
|
+
export type PortableBlockExportResult = {
|
|
1867
|
+
readonly complete: true;
|
|
1868
|
+
readonly site_id: string;
|
|
1869
|
+
readonly base_snapshot_id: string;
|
|
1870
|
+
readonly snapshot_digest: string;
|
|
1871
|
+
readonly document_version: number;
|
|
1872
|
+
readonly target: SiteEditPageBlockTarget;
|
|
1873
|
+
readonly selection_ref: BlockRenderRef;
|
|
1874
|
+
readonly entry: {
|
|
1875
|
+
readonly file: string;
|
|
1876
|
+
readonly export: {
|
|
1877
|
+
readonly kind: "default";
|
|
1878
|
+
} | {
|
|
1879
|
+
readonly kind: "named";
|
|
1880
|
+
readonly name: string;
|
|
1881
|
+
};
|
|
1882
|
+
};
|
|
1883
|
+
readonly files: readonly {
|
|
1884
|
+
readonly path: string;
|
|
1885
|
+
readonly content: string;
|
|
1886
|
+
}[];
|
|
1887
|
+
readonly source_closure: PortableSourceClosure;
|
|
1888
|
+
readonly dependency_audit: PortableDependencyAuditResult;
|
|
1889
|
+
readonly cms: PortableCmsSourcesResult;
|
|
1890
|
+
readonly media: readonly PortableMediaReference[];
|
|
1891
|
+
readonly invocation_bindings: readonly PortableInvocationBinding[];
|
|
1892
|
+
readonly host_contract_digest: string;
|
|
1893
|
+
} | {
|
|
1894
|
+
readonly complete: false;
|
|
1895
|
+
readonly unresolved: readonly PortableBlockExportError[];
|
|
1896
|
+
};
|
|
1897
|
+
type PortableBlockLocalAssetChunk = {
|
|
1898
|
+
readonly complete: true;
|
|
1899
|
+
readonly snapshot_digest: string;
|
|
1900
|
+
readonly file_path: string;
|
|
1901
|
+
readonly occurrence: number;
|
|
1902
|
+
readonly path: string;
|
|
1903
|
+
readonly mime_type: "image/png" | "image/jpeg" | "image/gif" | "image/webp";
|
|
1904
|
+
readonly byte_size: number;
|
|
1905
|
+
readonly digest_sha256: string;
|
|
1906
|
+
readonly offset: number;
|
|
1907
|
+
readonly data_base64: string;
|
|
1908
|
+
} | {
|
|
1909
|
+
readonly complete: false;
|
|
1910
|
+
readonly unresolved: readonly PortableBlockExportError[];
|
|
1911
|
+
};
|
|
1912
|
+
/** Only use with a just-verified Engine export and the same pinned Snapshot.
|
|
1913
|
+
* The caller must prove both, and enforce the live identity before returning. */
|
|
1914
|
+
export declare function readPortableBlockLocalAssetChunk(input: {
|
|
1915
|
+
readonly exported: {
|
|
1916
|
+
readonly complete: true;
|
|
1917
|
+
readonly snapshot_digest: string;
|
|
1918
|
+
readonly media: readonly {
|
|
1919
|
+
readonly file_path: string;
|
|
1920
|
+
readonly occurrence: number;
|
|
1921
|
+
readonly complete: boolean;
|
|
1922
|
+
readonly value: string | null;
|
|
1923
|
+
readonly kind: string;
|
|
1924
|
+
}[];
|
|
1925
|
+
};
|
|
1926
|
+
readonly snapshot_files: ReadonlyMap<string, PortableSourceFileContent>;
|
|
1927
|
+
readonly snapshot_digest: string;
|
|
1928
|
+
readonly file_path: string;
|
|
1929
|
+
readonly occurrence: number;
|
|
1930
|
+
readonly offset: number;
|
|
1931
|
+
}): PortableBlockLocalAssetChunk;
|
|
1932
|
+
/**
|
|
1933
|
+
* The caller is a trusted runtime boundary. Never accept a browser-supplied
|
|
1934
|
+
* file map or current document version here; this helper grants no filesystem
|
|
1935
|
+
* read authority and deliberately returns no partial source on failure.
|
|
1936
|
+
*/
|
|
1937
|
+
export declare function exportPortableBlockFromSnapshot(input: PortableBlockExportInput): Promise<PortableBlockExportResult>;
|
|
1766
1938
|
export type PortableRelatedEntryPurpose = "collection-detail-view" | "i18n-companion" | "client-importer";
|
|
1767
1939
|
export interface PortableRelatedEntry {
|
|
1768
1940
|
readonly key: string;
|
|
@@ -2897,47 +3069,6 @@ export type PageBlockSnapshotResolution = BlockResolution & {
|
|
|
2897
3069
|
export declare function resolvePageBlockFromSnapshot(input: BlockSnapshotInput): Promise<PageBlockSnapshotResolution>;
|
|
2898
3070
|
/** Exact JSX ranges proven to read the captured record.thumbnail array only. */
|
|
2899
3071
|
export declare function provenRecordThumbnailRanges(source: string): ReadonlySet<string>;
|
|
2900
|
-
export type PortableMediaReferenceKind = "src" | "srcset" | "poster" | "thumbnail" | "object" | "array-item" | "import" | "manifest";
|
|
2901
|
-
export type PortableMediaReferenceSource = "jsx-attribute" | "object-property" | "array-item" | "import" | "media-manifest";
|
|
2902
|
-
export interface PortableMediaSourceRange {
|
|
2903
|
-
readonly start_offset: number;
|
|
2904
|
-
readonly end_offset: number;
|
|
2905
|
-
readonly start_line: number;
|
|
2906
|
-
readonly start_column: number;
|
|
2907
|
-
readonly end_line: number;
|
|
2908
|
-
readonly end_column: number;
|
|
2909
|
-
}
|
|
2910
|
-
export interface PortableMediaReference {
|
|
2911
|
-
readonly file_path: string;
|
|
2912
|
-
readonly occurrence: number;
|
|
2913
|
-
readonly kind: PortableMediaReferenceKind;
|
|
2914
|
-
readonly source: PortableMediaReferenceSource;
|
|
2915
|
-
readonly value: string | null;
|
|
2916
|
-
readonly expression: string;
|
|
2917
|
-
readonly asset_key: string | null;
|
|
2918
|
-
readonly source_range: PortableMediaSourceRange;
|
|
2919
|
-
/** Digest of the original AST/source occurrence, not downloaded bytes. */
|
|
2920
|
-
readonly content_digest: string;
|
|
2921
|
-
readonly complete: boolean;
|
|
2922
|
-
}
|
|
2923
|
-
export type PortableMediaReferenceScanErrorCode = "MEDIA_SOURCE_PARSE_FAILED" | "MEDIA_VALUE_UNKNOWN" | "MEDIA_MANIFEST_KEY_UNKNOWN";
|
|
2924
|
-
export interface PortableMediaReferenceScanError {
|
|
2925
|
-
readonly code: PortableMediaReferenceScanErrorCode;
|
|
2926
|
-
readonly file_path: string;
|
|
2927
|
-
readonly message: string;
|
|
2928
|
-
readonly source_range?: PortableMediaSourceRange;
|
|
2929
|
-
}
|
|
2930
|
-
export interface PortableMediaReferenceScanInput {
|
|
2931
|
-
readonly file_path: string;
|
|
2932
|
-
readonly source: string;
|
|
2933
|
-
readonly media_manifest?: Readonly<Record<string, string>>;
|
|
2934
|
-
}
|
|
2935
|
-
export interface PortableMediaReferenceScanResult {
|
|
2936
|
-
readonly complete: boolean;
|
|
2937
|
-
readonly references: readonly PortableMediaReference[];
|
|
2938
|
-
readonly errors: readonly PortableMediaReferenceScanError[];
|
|
2939
|
-
}
|
|
2940
|
-
export declare function scanPortableMediaReferences(input: PortableMediaReferenceScanInput): PortableMediaReferenceScanResult;
|
|
2941
3072
|
|
|
2942
3073
|
export {
|
|
2943
3074
|
SiteEditEngineComposition$1 as SiteEditEngineComposition,
|