@vtex-email/core 0.0.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.
Files changed (56) hide show
  1. package/dist/compile/artifact.d.ts +36 -0
  2. package/dist/compile/artifact.d.ts.map +1 -0
  3. package/dist/compile/assemble.d.ts +15 -0
  4. package/dist/compile/assemble.d.ts.map +1 -0
  5. package/dist/compile/syntax.d.ts +3 -0
  6. package/dist/compile/syntax.d.ts.map +1 -0
  7. package/dist/compile/target.d.ts +4 -0
  8. package/dist/compile/target.d.ts.map +1 -0
  9. package/dist/define-email.d.ts +68 -0
  10. package/dist/define-email.d.ts.map +1 -0
  11. package/dist/diagnostics.d.ts +28 -0
  12. package/dist/diagnostics.d.ts.map +1 -0
  13. package/dist/expression/path.d.ts +23 -0
  14. package/dist/expression/path.d.ts.map +1 -0
  15. package/dist/fixture/check.d.ts +6 -0
  16. package/dist/fixture/check.d.ts.map +1 -0
  17. package/dist/fixture/locale-path.d.ts +9 -0
  18. package/dist/fixture/locale-path.d.ts.map +1 -0
  19. package/dist/hbs/engine.d.ts +16 -0
  20. package/dist/hbs/engine.d.ts.map +1 -0
  21. package/dist/hbs/source.d.ts +6 -0
  22. package/dist/hbs/source.d.ts.map +1 -0
  23. package/dist/i18n/catalog.d.ts +3 -0
  24. package/dist/i18n/catalog.d.ts.map +1 -0
  25. package/dist/i18n/merge.d.ts +14 -0
  26. package/dist/i18n/merge.d.ts.map +1 -0
  27. package/dist/i18n/message.d.ts +20 -0
  28. package/dist/i18n/message.d.ts.map +1 -0
  29. package/dist/index.d.ts +24 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +1369 -0
  32. package/dist/markers/bind.d.ts +13 -0
  33. package/dist/markers/bind.d.ts.map +1 -0
  34. package/dist/markers/html-anchors.d.ts +6 -0
  35. package/dist/markers/html-anchors.d.ts.map +1 -0
  36. package/dist/markers/restore.d.ts +8 -0
  37. package/dist/markers/restore.d.ts.map +1 -0
  38. package/dist/markers/sites.d.ts +21 -0
  39. package/dist/markers/sites.d.ts.map +1 -0
  40. package/dist/markers/tokens.d.ts +41 -0
  41. package/dist/markers/tokens.d.ts.map +1 -0
  42. package/dist/output/commit.d.ts +15 -0
  43. package/dist/output/commit.d.ts.map +1 -0
  44. package/dist/profile.d.ts +48 -0
  45. package/dist/profile.d.ts.map +1 -0
  46. package/dist/runtime/document.d.ts +2 -0
  47. package/dist/runtime/document.d.ts.map +1 -0
  48. package/dist/runtime/evaluate.d.ts +14 -0
  49. package/dist/runtime/evaluate.d.ts.map +1 -0
  50. package/dist/schema/zod-def.d.ts +23 -0
  51. package/dist/schema/zod-def.d.ts.map +1 -0
  52. package/dist/scope/analyze-paths.d.ts +6 -0
  53. package/dist/scope/analyze-paths.d.ts.map +1 -0
  54. package/dist/scope/structure.d.ts +32 -0
  55. package/dist/scope/structure.d.ts.map +1 -0
  56. package/package.json +21 -0
@@ -0,0 +1,36 @@
1
+ import type { Diagnostic } from '../diagnostics';
2
+ import type { ScopeNode } from '../scope/structure';
3
+ export interface BuildManifest {
4
+ formatVersion: 1;
5
+ templateId: string;
6
+ event: string;
7
+ profileId: string;
8
+ locales: string[];
9
+ defaultLocale: string;
10
+ sha256: string;
11
+ capabilities: Array<{
12
+ name: string;
13
+ evidence: string;
14
+ note: string;
15
+ }>;
16
+ homologation: 'experimental';
17
+ warnings: string[];
18
+ }
19
+ export interface CompiledArtifact {
20
+ name: string;
21
+ content: string;
22
+ sha256: string;
23
+ }
24
+ export type CompileEmailResult = {
25
+ ok: true;
26
+ artifacts: CompiledArtifact[];
27
+ manifest: BuildManifest;
28
+ diagnostics: Diagnostic[];
29
+ structure: ScopeNode[];
30
+ } | {
31
+ ok: false;
32
+ diagnostics: Diagnostic[];
33
+ };
34
+ export declare function sha256(content: string): string;
35
+ export declare function normalizeOutput(content: string): string;
36
+ //# sourceMappingURL=artifact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"artifact.d.ts","sourceRoot":"","sources":["../../src/compile/artifact.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAEnD,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,CAAC,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,SAAS,EAAE,MAAM,CAAA;IACjB,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACrE,YAAY,EAAE,cAAc,CAAA;IAC5B,QAAQ,EAAE,MAAM,EAAE,CAAA;CACnB;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,MAAM,CAAA;CACf;AAED,MAAM,MAAM,kBAAkB,GAC1B;IACE,EAAE,EAAE,IAAI,CAAA;IACR,SAAS,EAAE,gBAAgB,EAAE,CAAA;IAC7B,QAAQ,EAAE,aAAa,CAAA;IACvB,WAAW,EAAE,UAAU,EAAE,CAAA;IACzB,SAAS,EAAE,SAAS,EAAE,CAAA;CACvB,GACD;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAA;CAAE,CAAA;AAE5C,wBAAgB,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAIvD"}
@@ -0,0 +1,15 @@
1
+ import type { SiteRecord } from '../markers/sites';
2
+ import type { Marker } from '../markers/tokens';
3
+ import type { EmissionProfile } from '../profile';
4
+ import { type CompileEmailResult } from './artifact';
5
+ export interface AssembleDocumentInput {
6
+ html: string;
7
+ markers: ReadonlyMap<string, Marker>;
8
+ sites: ReadonlyMap<string, SiteRecord>;
9
+ profile: EmissionProfile;
10
+ templateId: string;
11
+ event: string;
12
+ locale: string;
13
+ }
14
+ export declare function assembleDocument(input: AssembleDocumentInput): CompileEmailResult;
15
+ //# sourceMappingURL=assemble.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assemble.d.ts","sourceRoot":"","sources":["../../src/compile/assemble.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,KAAK,EAAsB,eAAe,EAAE,MAAM,YAAY,CAAA;AAKrE,OAAO,EAA+C,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAIjG,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACpC,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IACtC,OAAO,EAAE,eAAe,CAAA;IACxB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,GAAG,kBAAkB,CAmCjF"}
@@ -0,0 +1,3 @@
1
+ import type { Diagnostic } from '../diagnostics';
2
+ export declare function validateHandlebarsSyntax(source: string, knownHelperNames: readonly string[]): Diagnostic | null;
3
+ //# sourceMappingURL=syntax.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syntax.d.ts","sourceRoot":"","sources":["../../src/compile/syntax.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAKhD,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE,SAAS,MAAM,EAAE,GAAG,UAAU,GAAG,IAAI,CAW/G"}
@@ -0,0 +1,4 @@
1
+ import type { EmissionCapability } from '../profile';
2
+ import { type Diagnostic } from '../diagnostics';
3
+ export declare function unverifiedCapabilityDiagnostic(capability: Pick<EmissionCapability, 'name' | 'evidence'>, templateId: string): Diagnostic | null;
4
+ //# sourceMappingURL=target.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../src/compile/target.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEpD,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAEnE,wBAAgB,8BAA8B,CAC5C,UAAU,EAAE,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,UAAU,CAAC,EACzD,UAAU,EAAE,MAAM,GACjB,UAAU,GAAG,IAAI,CAOnB"}
@@ -0,0 +1,68 @@
1
+ import type { z } from 'zod';
2
+ export interface EmailDocument<TTemplate> {
3
+ id: string;
4
+ event: string;
5
+ template: TTemplate;
6
+ }
7
+ export interface EmailI18n {
8
+ locales?: readonly string[];
9
+ defaultLocale?: string;
10
+ localePath: string;
11
+ output?: 'per-locale' | 'merged';
12
+ aliases?: Readonly<Record<string, string>>;
13
+ }
14
+ export interface EmailValidationOverride {
15
+ unknownPath?: 'error' | 'warning';
16
+ warningsAsErrors?: boolean;
17
+ }
18
+ /**
19
+ * Public authoring overrides for an email module.
20
+ * Omitted fields inherit from project config or file-key conventions.
21
+ * Use with `export const settings = { ... } satisfies EmailSettings`.
22
+ */
23
+ export interface EmailSettings {
24
+ /** Template id. Defaults to the file key (basename without `.email.tsx`). */
25
+ id?: string;
26
+ /**
27
+ * Local metadata label for the email. Defaults to the file key.
28
+ * Overriding this does not prove association with a real VTEX event.
29
+ */
30
+ event?: string;
31
+ /** Zod schema. Overrides `{schemasDir}/{fileKey}.ts` (default export) when set. */
32
+ schema?: z.ZodType;
33
+ /**
34
+ * Fixtures directory relative to the project config directory.
35
+ * Overrides `{fixturesDir}/{fileKey}/`. Does not follow from `id`/`event`.
36
+ */
37
+ fixtures?: string;
38
+ /** Partial i18n overrides. Nested fields omit independently; arrays replace. */
39
+ i18n?: EmailI18nSettings;
40
+ /** Partial validation overrides. */
41
+ validation?: EmailValidationOverride;
42
+ }
43
+ /**
44
+ * Optional i18n fields on `EmailSettings`.
45
+ * Each present field replaces the project/toolchain default; omitted fields inherit.
46
+ */
47
+ export interface EmailI18nSettings {
48
+ /** Locale list for this email. Replaces the project list when set. */
49
+ locales?: readonly string[];
50
+ /** Default locale for this email. */
51
+ defaultLocale?: string;
52
+ /** Payload path used to read the locale. Overrides project `i18n.localePath`. */
53
+ localePath?: string;
54
+ /** `per-locale` artifacts or a single `merged` document. Defaults to `merged`. */
55
+ output?: 'per-locale' | 'merged';
56
+ /** Alias map (`alias → locale`). Replaces entirely when set; no deep merge. */
57
+ aliases?: Readonly<Record<string, string>>;
58
+ }
59
+ /** Normalized email definition used after project resolution. Not the authoring API. */
60
+ export interface EmailDefinition<TTemplate> extends EmailDocument<TTemplate> {
61
+ schema: z.ZodType;
62
+ /** Resolved fixtures directory relative to the project config directory. */
63
+ fixtures: string;
64
+ i18n: EmailI18n;
65
+ validation?: EmailValidationOverride;
66
+ }
67
+ export declare function isSafeEmailId(id: string): boolean;
68
+ //# sourceMappingURL=define-email.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"define-email.d.ts","sourceRoot":"","sources":["../src/define-email.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAE5B,MAAM,WAAW,aAAa,CAAC,SAAS;IACtC,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb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aAAa,CAAC,SAAS,CAAC;IAC1E,MAAM,EAAE,CAAC,CAAC,OAAO,CAAA;IACjB,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,SAAS,CAAA;IACf,UAAU,CAAC,EAAE,uBAAuB,CAAA;CACrC;AAID,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAEjD"}
@@ -0,0 +1,28 @@
1
+ export interface DiagnosticSource {
2
+ file: string;
3
+ line?: number;
4
+ column?: number;
5
+ }
6
+ export interface Diagnostic {
7
+ code: string;
8
+ severity: 'error' | 'warning' | 'info';
9
+ message: string;
10
+ templateId?: string;
11
+ locale?: string;
12
+ fixtureId?: string;
13
+ origin?: string;
14
+ source?: DiagnosticSource;
15
+ path?: string;
16
+ suggestion?: string;
17
+ capability?: {
18
+ name: string;
19
+ evidence: string;
20
+ };
21
+ }
22
+ export type Failure = {
23
+ ok: false;
24
+ diagnostics: Diagnostic[];
25
+ };
26
+ export declare function errorDiagnostic(code: string, message: string, extra?: Omit<Diagnostic, 'code' | 'severity' | 'message'>): Diagnostic;
27
+ export declare function warningDiagnostic(code: string, message: string, extra?: Omit<Diagnostic, 'code' | 'severity' | 'message'>): Diagnostic;
28
+ //# sourceMappingURL=diagnostics.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;IACtC,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAChD;AAED,MAAM,MAAM,OAAO,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,WAAW,EAAE,UAAU,EAAE,CAAA;CAAE,CAAA;AAE9D,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAM,GAC5D,UAAU,CAEZ;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,KAAK,GAAE,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAM,GAC5D,UAAU,CAEZ"}
@@ -0,0 +1,23 @@
1
+ export type Expression = {
2
+ kind: 'path';
3
+ value: string;
4
+ } | {
5
+ kind: 'literal';
6
+ value: string | number | boolean | null;
7
+ } | {
8
+ kind: 'helper';
9
+ name: string;
10
+ args: Expression[];
11
+ };
12
+ export type PathResult = {
13
+ ok: true;
14
+ segments: string[];
15
+ emitted: string;
16
+ } | {
17
+ ok: false;
18
+ message: string;
19
+ };
20
+ export declare function parentHops(segments: readonly string[]): number;
21
+ export declare function parsePath(input: string, allowParent: boolean): PathResult;
22
+ export declare function emitPath(segments: readonly string[]): string;
23
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../src/expression/path.ts"],"names":[],"mappings":"AAIA,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;CAAE,GAC5D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,UAAU,EAAE,CAAA;CAAE,CAAA;AAExD,MAAM,MAAM,UAAU,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE3G,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAO9D;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,GAAG,UAAU,CAiCzE;AAED,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAc5D"}
@@ -0,0 +1,6 @@
1
+ import { z } from 'zod';
2
+ import { type Diagnostic } from '../diagnostics';
3
+ import { schemaMutates } from '../schema/zod-def';
4
+ export declare function checkFixture(schema: z.ZodType, data: unknown): Diagnostic | null;
5
+ export { schemaMutates };
6
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/fixture/check.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAA;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,wBAAgB,YAAY,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,GAAG,UAAU,GAAG,IAAI,CAehF;AAED,OAAO,EAAE,aAAa,EAAE,CAAA"}
@@ -0,0 +1,9 @@
1
+ export declare function readPathValue(data: unknown, pathExpression: string): unknown;
2
+ export declare function withForcedLocale(data: unknown, localePath: string, locale: string): {
3
+ ok: true;
4
+ data: unknown;
5
+ } | {
6
+ ok: false;
7
+ message: string;
8
+ };
9
+ //# sourceMappingURL=locale-path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"locale-path.d.ts","sourceRoot":"","sources":["../../src/fixture/locale-path.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAS5E;AAED,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,OAAO,EACb,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACb;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAsB9D"}
@@ -0,0 +1,16 @@
1
+ import type { Diagnostic } from '../diagnostics';
2
+ interface HandlebarsCompileOptions {
3
+ knownHelpersOnly: boolean;
4
+ knownHelpers: Record<string, boolean>;
5
+ noEscape: boolean;
6
+ }
7
+ interface HandlebarsInstance {
8
+ registerHelper(name: string, fn: (...args: never[]) => unknown): void;
9
+ compile(source: string, options: HandlebarsCompileOptions): (data: unknown) => string;
10
+ precompile(source: string, options: HandlebarsCompileOptions): string;
11
+ }
12
+ export declare function createHandlebars(): HandlebarsInstance;
13
+ export declare function compileOptions(knownHelperNames: readonly string[]): HandlebarsCompileOptions;
14
+ export declare function handlebarsDiagnostic(error: unknown): Diagnostic;
15
+ export {};
16
+ //# sourceMappingURL=engine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engine.d.ts","sourceRoot":"","sources":["../../src/hbs/engine.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAIhD,UAAU,wBAAwB;IAChC,gBAAgB,EAAE,OAAO,CAAA;IACzB,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,UAAU,kBAAkB;IAC1B,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,GAAG,IAAI,CAAA;IACrE,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,CAAA;IACrF,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,wBAAwB,GAAG,MAAM,CAAA;CACtE;AAQD,wBAAgB,gBAAgB,IAAI,kBAAkB,CAErD;AAED,wBAAgB,cAAc,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,GAAG,wBAAwB,CAI5F;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,UAAU,CAI/D"}
@@ -0,0 +1,6 @@
1
+ export declare function emitLiteral(value: string | number | boolean | null): string;
2
+ export declare function emitInterpolation(path: string): string;
3
+ export declare function emitHelperCall(name: string, args: readonly string[]): string;
4
+ export declare function emitBlockOpen(name: string, args: readonly string[]): string;
5
+ export declare function emitBlockClose(name: string): string;
6
+ //# sourceMappingURL=source.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/hbs/source.ts"],"names":[],"mappings":"AAAA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CAU3E;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEtD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAE5E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAE3E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD"}
@@ -0,0 +1,3 @@
1
+ import type { Diagnostic } from '../diagnostics';
2
+ export declare function checkCatalogs(locales: readonly string[], catalogs: Readonly<Record<string, Readonly<Record<string, string>>>>): Diagnostic[];
3
+ //# sourceMappingURL=catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/i18n/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAMhD,wBAAgB,aAAa,CAC3B,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,GACnE,UAAU,EAAE,CAuCd"}
@@ -0,0 +1,14 @@
1
+ export declare function mergeLocaleDocuments(input: {
2
+ localePath: string;
3
+ defaultLocale: string;
4
+ documents: ReadonlyArray<{
5
+ locale: string;
6
+ html: string;
7
+ }>;
8
+ aliases?: ReadonlyArray<{
9
+ alias: string;
10
+ locale: string;
11
+ }>;
12
+ equality?: string;
13
+ }): string;
14
+ //# sourceMappingURL=merge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../src/i18n/merge.ts"],"names":[],"mappings":"AAGA,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,aAAa,EAAE,MAAM,CAAA;IACrB,SAAS,EAAE,aAAa,CAAC;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC1D,OAAO,CAAC,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC1D,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,MAAM,CAgCT"}
@@ -0,0 +1,20 @@
1
+ export interface TextPart {
2
+ type: 'text';
3
+ value: string;
4
+ }
5
+ export interface PlaceholderPart {
6
+ type: 'placeholder';
7
+ name: string;
8
+ }
9
+ export type MessagePart = TextPart | PlaceholderPart;
10
+ export type ParsedMessage = {
11
+ ok: true;
12
+ parts: MessagePart[];
13
+ placeholders: string[];
14
+ } | {
15
+ ok: false;
16
+ message: string;
17
+ };
18
+ export declare function parseMessage(value: string): ParsedMessage;
19
+ export declare function placeholderSignature(value: string): string | null;
20
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/i18n/message.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,aAAa,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;CACb;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,eAAe,CAAA;AAEpD,MAAM,MAAM,aAAa,GAAG;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,WAAW,EAAE,CAAC;IAAC,YAAY,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAIvH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,CAyBzD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAIjE"}
@@ -0,0 +1,24 @@
1
+ export { normalizeOutput, sha256, type BuildManifest, type CompiledArtifact, type CompileEmailResult, } from './compile/artifact';
2
+ export { assembleDocument, type AssembleDocumentInput } from './compile/assemble';
3
+ export { validateHandlebarsSyntax } from './compile/syntax';
4
+ export { unverifiedCapabilityDiagnostic } from './compile/target';
5
+ export { isSafeEmailId, type EmailDefinition, type EmailDocument, type EmailI18n, type EmailI18nSettings, type EmailSettings, type EmailValidationOverride, } from './define-email';
6
+ export { errorDiagnostic, warningDiagnostic, type Diagnostic, type DiagnosticSource, type Failure } from './diagnostics';
7
+ export { emitPath, parentHops, parsePath, type Expression, type PathResult } from './expression/path';
8
+ export { checkFixture, schemaMutates } from './fixture/check';
9
+ export { readPathValue, withForcedLocale } from './fixture/locale-path';
10
+ export { emitBlockClose, emitBlockOpen, emitHelperCall, emitInterpolation, emitLiteral } from './hbs/source';
11
+ export { checkCatalogs } from './i18n/catalog';
12
+ export { mergeLocaleDocuments } from './i18n/merge';
13
+ export { parseMessage, placeholderSignature, type MessagePart, type ParsedMessage } from './i18n/message';
14
+ export { bindSites, type BindResult } from './markers/bind';
15
+ export { restoreHandlebars, type RestoreResult } from './markers/restore';
16
+ export type { BlockName, DynamicAttribute, ResolvedPath, SiteArgument, SiteRecord } from './markers/sites';
17
+ export { mintToken, opaqueTokenIssue, scanTokens, TOKEN_BODY_LENGTH, TOKEN_LENGTH, TOKEN_PREFIX, type AttrMarker, type ElseMarker, type Marker, type OpenMarker, type TextMarker, } from './markers/tokens';
18
+ export { commitArtifacts, releaseArtifacts } from './output/commit';
19
+ export { findCapability, syntaxHelperNames, type BlockHelper, type BlockOptions, type EmissionCapability, type EmissionProfile, type Evidence, type InlineHelper, type LocalSimulator, type Profile, type SimulatorHelper, } from './profile';
20
+ export { singleDocumentIssue } from './runtime/document';
21
+ export { evaluateArtifact, renderTemplate, TemplateFailure } from './runtime/evaluate';
22
+ export { analyzePaths, analyzeRootPath } from './scope/analyze-paths';
23
+ export { nestSites, type ScopeArg, type ScopeBlock, type ScopeNode, type ScopeRef } from './scope/structure';
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,MAAM,EACN,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,gBAAgB,EAAE,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAA;AACjF,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAA;AAC3D,OAAO,EAAE,8BAA8B,EAAE,MAAM,kBAAkB,CAAA;AACjE,OAAO,EACL,aAAa,EACb,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,uBAAuB,GAC7B,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,KAAK,UAAU,EAAE,KAAK,gBAAgB,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AACxH,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACrG,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC5G,OAAO,EAAE,aAAa,EAAE,MAAM,gBAA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